Advertisement

Providing equal opportunity for each player

Started by May 23, 2018 06:40 PM
2 comments, last by LorenzoGatti 6 years, 6 months ago

I am building a 8 * 8 tile based grid. 2 players will start the game from opposite side.some tiles will have resources like gold etc.. players that conquer the tile will gain that resource. I am trying to setup those resource tiles uniformly through code ( not manually drawing tiles in a tile editor) so that each player face same difficulties to gain resources.otherwise one player will find it easier and he will have greater chance to win.. any algorithm to calculate uniform distribution?? Or I should divide whole map into 2 or 4 areas and randomly setup resource tiles?? 

If you have a map which is  8 * 8 (w * h - Full Map), I would generate the 4 * 8  (w * h), then mirror the array data for the other half if you're looking at an equal map. Just feed the 1st array into the 2nd but mirrored, and now you have a symmetrical map when you print both arrays out. You'll have to offset the positions for the other half unless you're feeding both arrays into one for the actual drawing part.

In my own RTS projects I always programmed a level designer which did this for me, and I couldn't imagine hard-coding RTS maps as a long term option.

Programmer and 3D Artist

Advertisement
11 hours ago, Rutin said:

mirror the array data for the other half if you're looking at an equal map

Given a randomly generated rectangular half-map, you can obtain a full symmetrical map for two players in 8 different ways, attaching a vertically mirrored copy at the top or at the bottom, a horizontally mirrored copy left or right, or a rotated copy (180°) to any side.

You can even make a symmetrical map for 4 players by copying a random querter of the map both horizontally and vertically.

On a hex grid, you can attach six 60° slices or three 120° slices for a symmetrical map suitable for 2, 3 or 6 players.

In any case, random resource placement without perfect symmetry is automatically unfair. Don't do it, unless you recover fairness by having matches consisting of two games with swapped starting positions.

Omae Wa Mou Shindeiru

This topic is closed to new replies.

Advertisement