   Hex-Based Strategy Game Movement Problem
  We're making a web-based hex-based multi-player strategy game, where players give orders to their armies, and then when the time has come, movement and combat are calculated. The problem is with movement.As the game is supposed to be played by many players, we seek fairness in every aspect of the game. Additionaly, as we want games (sessions) with more than 20 players in them, taking turns one after the other is out of question. Our players give orders and then at exactly given time they are processed at once. Now the problem is with movement. If movement itself were done taking turns, the first player in the player list (internal linked list) would have a decent advantage over the rest, because his/her units would always move and take positions they were ordered to. So we decided that even movement would be done simultaneously, which means that in one iteration of movement every unit of every player would move exactly one hex, rather than move through its whole path. While this greatly flattens the chances of movement, it is not entirely fair, because even when units move only one hex in an iteration, there still must be someone first to move in that iteration. We speculated about reversing the player list order every second turn, so that the player who was preferred in turn number 1 will not be in turn number 2, etc. But this is obviously totally untransparent to the player. So we decided that when a unit is about to move to a hex, it first checks if the move is possible. The move is possible when no other unit is about to move to that hex in that iteration. If an enemy unit wants to move to the same hex, both units move to that hex and a battle occurs. As players may only speculate where their enemies' armies will move (because we have simultaneous movement, not taking turns), we decided that whenever two opposing armies neighbour each other (occupy two neighbouring hexes) during movement iterations, their further movement is terminated and a battle occurs. This is to prevent runarounds where two players really want to fight, but their armies miss each other by one or two hexes. Now we're finally getting to the problem. This mechanics allows battles to take place on one hex and two hexes. Two armies may want to move to one specific hex, so they fight in that one hex. Or they may be stopped by each other when moving along each other, so they fight each from their respective currently occupied hex. This is what I want to avoid. I want battles to take place on one hex OR two hexes, not both. We have terrain system that gives bonus to certain units, so players may use this to their advantage.The problem is that if we don't allow one player to have movement advantage over the other, we're not able to avoid the two cases battle. If I'm not clear enough, ask me.The questions are:1. Do you think that one-hex movement system is fair enough to allow little advantages for players that are higher in the player list?2. Do you have any ideas how to avoid the two cases battle?In the pictures, there is a red and a green army moving at each other. In the first case, they meet in one hex. In the second, they neighbour each other.
  1. Implement an initiative system, units with a higher initiative move first. When there two units try to move into the same hex, the unit with the higher initiative reaches the hex first while other unit becomes an attacker, the first unit gets a defensive bonus (if there is such an advantage). 2. I hope I get it right. After every unit has finishes their one hex movement, each unit will check for neighboring units (which starts a battle), before moving the next step. So if two units are next to each other, the battle will start before they can move onto the same hex which causes the two cases battle.   ;  If two players want to fight, then let them. Allow an 'attack X' order in addition to the move order. If armies collide, they fight on that hex. If given an 'attack X' order, the unit moves towards the target until it runs out of moves or collides. No runaround, no ambiguous combat scenarios.   ;  Zones of Control.Every unit applies to those hexs around them the value of their 'power level', and every unit moving first flags their desired move. Each time a unit moves, it checks if there is someone else attempting to move into that hex, and that the 'Control Level' of the hex it attemps to move into is higher than any other player's.If there is a draw, neither can move into that hex that turn, and they get a minor bonus to stats for the next turn (as if they spend movement time prepping equipment and making sure things are better organized than they otherwise would have.)   ;Quote:Original post by Si Hao1. Implement an initiative system, units with a higher initiative move first. When there two units try to move into the same hex, the unit with the higher initiative reaches the hex first while other unit becomes an attacker, the first unit gets a defensive bonus (if there is such an advantage). 2. I hope I get it right. After every unit has finishes their one hex movement, each unit will check for neighboring units (which starts a battle), before moving the next step. So if two units are next to each other, the battle will start before they can move onto the same hex which causes the two cases battle.1. Initiative system fails if there are two oposing units with same initiative2. If I get you right, you still have problem that is illustrated on images. Quote:Original post by TelastynIf two players want to fight, then let them. Allow an 'attack X' order in addition to the move order. If armies collide, they fight on that hex. If given an 'attack X' order, the unit moves towards the target until it runs out of moves or collides. No runaround, no ambiguous combat scenarios.That's really interesting idea :) but there is still problem when 2 units collide and they want to just move. It could be solved by forgetting about fight in middle of movement and allow fight only if they end on same hex. We will think about this.Quote:Original post by TalrothZones of Control.Every unit applies to those hexs around them the value of their 'power level', and every unit moving first flags their desired move. Each time a unit moves, it checks if there is someone else attempting to move into that hex, and that the 'Control Level' of the hex it attemps to move into is higher than any other player's.If there is a draw, neither can move into that hex that turn, and they get a minor bonus to stats for the next turn (as if they spend movement time prepping equipment and making sure things are better organized than they otherwise would have.)This approach can be more complicated for player to grasp that we want. Idea what happen when there is a draw already crossed our minds, but we dropped it, because we don't like it. P.S.: I am in same team as ZZajoman, so I can answer all questions regarding this project in his name :)   ;  Guys, thank you very much for your ideas. The thing is that we've already gone through similar ones ourselves, and none was to our liking. Just as Lopenka said. We're really struggling with this.   ;Quote:Original post by lopenkaQuote:Original post by TelastynIf two players want to fight, then let them. Allow an 'attack X' order in addition to the move order. If armies collide, they fight on that hex. If given an 'attack X' order, the unit moves towards the target until it runs out of moves or collides. No runaround, no ambiguous combat scenarios.That's really interesting idea :) but there is still problem when 2 units collide and they want to just move. It could be solved by forgetting about fight in middle of movement and allow fight only if they end on same hex. We will think about this.I just realised that there is same problem if two units attack each other, so this is not solution to our problem either...   ;  could you give both players armies the bonuses? for example in the first picture, Red would work out its damage with it being on the tile1 and green being on tile2, and vice versa.   ;  Ok, this is not a new problem.  All developers of a tile based movement systems have run into the same delimma at the beginning of development.  There are a few options you have available.First, a turn based system.  I know you are very opposed to this idea because you believe having turns sets the first player at an advantage.  But lets review a few other games that have used turns successfully.  First, chess... the ultimate of all strategy games.  Does white always have a clear upper hand because he moves first?  The answer is no.  Also, we have civilization and virtually every board game ever made (such as risk, monopoly, etc).  Please don't discount the turn based system just because you believe it isn't 100% fair.  At a minimum, run multiple simulations on paper showing a turn system before you decide just how unfair it is.Second, instead of setting a path, you could tell your army to 'chase' after an opponent.  If you really must avoid turns, this would be my second suggestion.  Once you tell your army to 'chase' an opponent, the computer could have a set of built in AI that would re-evaluate where the army goes at each iteration of the movement.  IE, if your army was moving 5 squares 'per turn', it could intelligently change paths to combat the nearby enemy army as you moved.A few other suggestions: I'm actually excited to see someone making a game like this in lieu of the unattainable 3D MMO game that so many programmers in here seem to be working on.  If I were you, I'd let players be able to customize their military by choosing ranged units, fast moving units, heavy hitters, heavy defenders, etc.  The more variables you have like that, the more interesting and challenging the game becomes.Also, if you have a website, please post the link.;Quote:Original post by lopenkaQuote:Original post by lopenkaQuote:Original post by TelastynIf two players want to fight, then let them. Allow an 'attack X' order in addition to the move order. If armies collide, they fight on that hex. If given an 'attack X' order, the unit moves towards the target until it runs out of moves or collides. No runaround, no ambiguous combat scenarios.That's really interesting idea :) but there is still problem when 2 units collide and they want to just move. It could be solved by forgetting about fight in middle of movement and allow fight only if they end on same hex. We will think about this.I just realised that there is same problem if two units attack each other, so this is not solution to our problem either...Where's the problem again? Oh. Add all units to container, shuffle container. No more preferential treatment to one player. And if units collide, they get put into a container to resolve the fight and removed from the container to process their moves...   