Thursday, 25 October 2012

Continuous Space (Continued)

To represent the game in continuous space, I've got a few choices, all of which would probably want OpenGL:
  • Maintain orthogonal top-down perspective, as in the libtcod version. Indicate heightmap by terrain colour and shadows. Sprites for characters, possibly even just circular symbols indicating weapon/shield/armour/skill combination
  • First-person 3D perspective. Would easily justify the restriction on player's field of view. Will probably not be able to getaway with sprites for characters in this case. Would rather not waste time on 3D models.
  • Isometric or variable perspective with 3D models. see above.
  • Isometric perspective with sprites. Cossacks style. This could work very very well. I'm leaning towards this. 2 minutes after publishing this it turns out Cossacks used 3D models pre-rendered in a set number of orientations. Whatever.

Continuous Space

Still too busy to be doing any coding on the strategy RL, but that should change soon when my work stops involving any coding for a few months. I did take the time to make a decision about the project's direction, though, which will probably lead to a rewrite. Long story short, the game was originally intended to take place in discrete grid space, and now it's going to take place in continuous space.

Reasons

Initially at the very least, the game is supposed to offer a scenario in which undisciplined untrained hordes are able to defeat professional, but badly outnumbered, armies, with the forces gradually equalising as the members of the player's group die, gain experience, and retrieve intact equipment from their fallen enemies.

The game is not intended to be ultra-realistic in terms of modelling exact arcs of weapon swings and interactions between colliding materials, but it is supposed to simulate that kind of asymmetric combat in a reasonably plausible way. That is, something less abstract than attack and defence values and hit points; in a microcosm of the game where 2 or 3 unskilled fighters  attack a professional warrior (with DEF 10) and win/lose, I don't want the result, or the probability of the result, to be an obvious consequence of the unskilled fighters having 4 ATK and the other having 10 DEF, and them losing or winning because 2 times 4 is less than 10 and 3 times 4 is greater than 10. I'd prefer to have more realistic interactions along the lines of one of them being blocked by the shield, one of them either parrying or harmlessly hitting armour, and the third being free to concentrate on making a good hit without retaliation.

When scaling up this kind of situation to a smallish army and a large horde, the problems with simulating such a system on a square grid become apparent. A regular formation must either have a soldier in every tile, or every other tile. There are no alternatives in between. If dense formations are made standard, then the horde is unable to gain advantage by using a larger number of fighters per unit area. That is, unless they do strange things such as organising the battlefront into groups of three who each target the same enemy, they are unable to force the situation in the previous paragraph to play out. In contrast, a continuous space system with continuous facing angles would allow finer distinctions between formation densities and make situations like the above occur naturally. A penalty to freedom of movement when surrounded too closely would discourage use of excessively tight formations (at least, for the kinds of warriors that need space to swing).

Continuous space will also make mounted troops a lot more natural, since they won't have a one-tile-per-actor rule to break - they'll just have a differently sized collision box. I had trouble imagining how to implement polearms in gridworld, since they would extend for more than one tile. In continuous space, the simulation of how they restrict movement and the ways in which a charge might, with losses, get through a pike wall, will be a lot more natural.

For troops organised enough to sit in box formations, a continuous world allows them to maintain a consistent frontier while marching in non-cardinal directions. Depending on how the maps are constructed, it could also make for much simpler field of vision calculations.

Summary

Rewrite.

Monday, 1 October 2012

Encircled has health regeneration and is much more likely to be winnable


Tiny update to the code, big difference to gameplay:
  • Gave all actors small level-dependent chance of health regeneration when standing still. This means that the player doesn't have to die on the first level where an enemy has a ranged weapon. I was able to get to level 9 of normal mode before encountering a crash which I think was also fixed in this update (number-flashing routine). Before now, this problem meant I died on level 5 or before.
  • Alter AI to take advantage of regeneration, and to make bosses move more freely when the player is far away (so they don't get stuck in corners permanently)
  • Update colour display information on entering a new level
  • Improve number-flashing routine

Same download link. http://dl.dropbox.com/u/6433222/encircled.zip
 
More likely to be winnable, but still very easy to die.