   A simple wargame
  Hi all! This is my first post, hopefully it's in the right place. Here's my situation--I've been tasked by my boss with writing a simple tactical-level modern-era wargame. Now, I've never written any wargames before... heck, I've barely even played any wargames. But no matter, he doesn't want anything complex. Just something that produces reasonable results from the player's actions. Almost a mini-game, really. No more than ~30 units total. But here's where it gets messy--The target audience is non-gamers, so I'm not allowed to use a hex grid. A square grid would be okay, but the boss isn't satisfied with the map placement resolution that provides. I can't significantly increase the grid resolution, because that would make the unit icons too small (project is running at a fixed, relatively low res).So this leaves me with one option-- non-constrained free placement of units. Ugh.At this early point in the project I "don't know what I don't know", but I have a feeling it's going to be painful and involve a lot of math. All movement will be completely player-controlled so at least I don't have to worry about pathfinding, but I am concerned how to sanely handle multiple units crowding into the same space. Or how to allow easy manipulation of overlapping icons.Any advice? Recommended reading? Sympathies?   
  You could implement rudimentary boundary box collision detection.  In which case, you could set the units a minimum distance apart from the point of the collision, but I can imagine this cascading into many other collisions.  I think it would be kinda neat to see them sort themselves out, but I don't know how resource intensive you're allowed to be with this.  It shouldn't be too bad with a simple AABB, though.   ;  This post is so far beyond funny to me :)I am currently working on a turn-based strategy game where the entire point of the design was to eliminate the nasty hex grid and take advantage of the additional gameplay it can create.I'm not far enough in it to give alot of implementation advice, but I've gone far enough to know that the math isn't nearly as bad as you think.  One of the biggest difficulties that you mentioned is the crowding, and I'm handling it by allowing units to intersect while moving but not be able to stop until they are a certain distance from other units.  That way, they will intersect a bit, but they can't just all stand on top of each other.  Also, since a unit can't move past a wall of units, it gives the strategy of marching down the field in a line or surrounding an enemy.I think the bigger difficulties are in making it appeal to non-gamers.  You'll have to consider your combat system to make sure that it isn't too complex, but has enough strategy to be fun.  Try the Sega Genesis series Shining Force for a great combat system (and one of the inspirations for my current game).Good luck, and if you want to talk more about it feel free to email me: jbourrie@gmail.com   ;  I suggest that you actually use hexes, but hide it from the audience. Instead of making it blatantly obvious that there are hexes(see: most hex-games), simply not show any hexes, but actually just 'round' any mouse clicks to the nearest hex. Provide any lighting in a circle, not based on the number of hexes away. Anything that would show that it is obviously a hex-based system, try to avoid.Best of both worlds, IMO.Many games do this for isometric tiles, too, but it should work with hexes.Good luck!   ;  Thanks JBourrie, that sounds like pretty elegant solution to the crowding problem. I was leaning toward applying a movement penalty to each unit depending on how many other units they're intersecting. So hey, if the player wants to cram five divisions through a narrow pass at the same time the game will let them, but it'll take five times longer than normal. :)How are you defining your terrain characteristics? A simple array?Ezbez, unfortunately I really can't use hexes. The scale is such that they don't provide sufficiently fine control over movement and positioning. I'm talking literally a 10x10 grid.   ;Quote:How are you defining your terrain characteristics? A simple array?My terrain is currently just a set of line segments that represent walls, though I plan later to allow certain areas to have movement penalties (most likely as polygon sections).  I didn't want a tile system, because I'm really trying to eliminate the grid feel altogether.  The character bounding objects are circles, and they just do a simple swept-collision with the line segments.One thing I like about doing turn-based is that super-fast code is not as much of an issue.  So instead of worrying about having an optimized collision system and complex structures to manage everything, I can instead focus on what's really important: making the game shine.  If you do need to optimize for speed, those line segments can be sectioned off into a grid, and each character will only need to collide with segments that are within the surrounding sectors of the grid.A tile array would work as well, though it's actually more memory intensive (important if the system you're working on is mobile or something) and IMO just doesn't feel as good.   ;  Target platform is Flash in a web browser, but resolution-fixed due to it being embedded in some distance-learning content.Agreed that a grid isn't ideal for this sort of thing, but vector intersections are way outside my experience zone (nevermind the overhead of creating an editor). Maybe next time. For now I'm toying with the idea of using a little interpolation to smooth things out and make the griddiness not so apparent.Sure, I could blow a megabyte on a high-res terrain data array and modern PCs wouldn't even flinch, but my inner child (who learned programming on a 48K Atari 800) would kill me on general principle.   ;Quote:Sure, I could blow a megabyte on a high-res terrain data array and modern PCs wouldn't even flinch, but my inner child (who learned programming on a 48K Atari 800) would kill me on general principle.I think the dial-up users would kill you first ;)   ;Quote:No more than ~30 units total.you could get away with just 3 units in a scissors/paper/rock relationship. These could be:Tank: Tanks are tough against infantry because of their speed and firepower, but as artillery has a far greater range and damage, thanks are not very effective against them.Artillery: These are slower than infantry to move and only have a slow rate of fire. Also they have a minimum distance that they can shoot at, which makes them ineffective against infantry as they can move within the artillery's min range adn the artillery can't escape. However becaue they can destroy a tank easily they are most effective against tanks.Infantry: Infantry can move faster than artillery, but are slower than a tank. Thy can move within artillery's minimum range and attack without the risk of being attacked back. However because they are lightly armoured, they are not effective against tanks.this simple system should be able to be oicked up quickly by non/casual gamers, but you can expand this quite easily to 9 units by having 3 unit types for each category. Each of the 3 unit in the category would specialise in killing one of the categories.For instance:InfantryMachine Gunenrs: Machine gunners are infantry units that are effective at killing other infantry units. The weak firepower of the machine gun against armoured targets means they are ineffective against tanks, and although still able to take out artillery, they are less effective than other infantry units.Rocket Launcher: These infantyr use a rockit launcher that is effective at destroying tanks. The longer range of the rock means that the unit can attack the tank from out side it's own attack range. However the missile launcher has a minimum range that is greater than a standard artillery's minimum range, this menas that these units are not effective against artillery and the slow rate of fire means that they are not effective against infantry.Grenade Launcher: Grenade launchers use a short range morter launcher to fire explosive shells. These can be used fairly close, and can do a lot of damage so are effective against artillery, the slow fire rate means that they are ineffective against infantry and the short range means that the are also not effective against tanks.This could also be applied to the artillery and the tanks so that you end up with 9 units total. This would be harder for a non/casual gamer to learn but have much larger strategic deapth.   ;  If you haven't played many wargames, and are targeting non-gamers, you'll probably want to pickup a copy of Advanced Wars (either of the ones for the GBA, or the one for the DS) for "research". It has pretty much defined how to make a turn based game "fun" for the masses, making Nintendo and Intelligent Systems a mint in the process.   