Matija
Morkin Member
The Turtle Moves!
Posts: 1,696
|
Post by Matija on Jul 15, 2004 8:19:32 GMT
If you wanted an even distribution, then ri and di would be randomly picked only once, and those values used for all players, but then you would know from your own starting position exactly where the other players started.
|
|
Perun
Public Area Guest
Issa (Vis) [1:76:24]
Posts: 2,506
|
Post by Perun on Jul 15, 2004 18:50:20 GMT
I don't know if anyone has suggested this (or any of mentioned methods is similar), so I will. Why not something like this: Exceptable area is yellow. B area (green) should be about 20% of it's pie. This way players won't be too near to each other. It could be bigger for smaller number of players. C area (red) should be also 20% of it's pie. This way players won't be too near to the edges of the map where interesting places are more sparse then nearer the center. A area (orange) should be somewhat greater than C, say 40%. This way players won't start too near to each other and not too near to the center of the map. Usual anti/clockwise rotation applies, of course. Sounds reasonable? It would be a piece of cake to implement this for Matija, obviously. I appologise if I'm reinventing the wheel.
|
|
Matija
Morkin Member
The Turtle Moves!
Posts: 1,696
|
Post by Matija on Jul 15, 2004 19:47:53 GMT
I believe it would go like this:
let n be the number of players, X and Y the dimensions of the map x0 := X / 2 ; x coordinate of the centre y0 := Y / 2 ; y coordinate of the centre xc := Ic * x0 ; Igor's C adjustments (0,2) yc := Ic * y0 R0 := random(2pi) ; starting rotation Rn := 2pi / n ; each player's 'slice' Rb := Ib * Rn ; Igor's B adjustment (0,2) c := sqrt(sqr(x0) + sqr(y0)) ; we will use this to determine maximum possible distance from the centre ca := Ia * c ; Igor's A adjustment (0,4)
for i = 1 to n do
r := random(Rn - 2 * Rb) ri := R0 + (i-1) * Rn + Rb + r ; the angle of the starting position - we now need the distance
if c * abs(cos(ri)) > x0 then dmax := (x0 - xc) / abs(cos(ri)) else dmax := (y0 - yc) / abs(sin(ri)) end if
dmax := dmax - ca di := random(dmax) Sxi := trunc(x0 + (di + ca) * cos(ri)) ; this are now coordinates of the i-th starting position Syi := trunc(y0 + (di + ca) * sin(ri))
|
|
Matija
Morkin Member
The Turtle Moves!
Posts: 1,696
|
Post by Matija on Jul 15, 2004 19:59:17 GMT
Note: since this is a rectangle, I've made C adjustment porportional to the rectangle's sides, effectively reducing the rectangle.
|
|
Matija
Morkin Member
The Turtle Moves!
Posts: 1,696
|
Post by Matija on Jul 16, 2004 7:30:47 GMT
Personally, I would leave out the C adjustement, reduce A adjustement to 20% at most, and B adjustment to 10% at most.
After all, some close starts DID lead to very fun games.
And secondly, alliances should be the means to balance close starts: the two players who start close are ideal candidates for an alliance.
So a completely random placement might actually prove to be a lot of fun if alliances are enabled.
|
|