What happens when the heroes do not show up for war? Well, then the generals have to throw the die.
Heroes & Generals is a game where a series of action games are triggered by a strategy meta-game. In some cases there is not enough human players to play out a battle or the battle is simply too imbalanced for the action game to be any fun. In that case the result of the battle will be decided by the server.
Our current algorithm is very simple and we are in the process of designing it’s replacement. I will tell a bit about some of the thoughts behind the next iteration and I have uploaded a small sandbox created in flash for trying out some ideas. The demo focuses on the actual solving of battles and not how they got into battle (the engagement rules).
All battles are fought between a number of assault teams from the two factions. The commanders move the assault team to a battle field and when contact is made between the assault teams a battle begins. The assault teams are very different in their composition and function and some combinations might not yield any results (like attacking a recon unit with fighter planes).
The battle is split into a 5 phases. The first 2, deployment and initiative happens only once for each assault team (assault teams joining an ongoing battle still have to be deployed). The next 2, battle turn and battle assessment, is where the actual battle goes on, and the last is for gathering of results (if a battlefield is lost it have to change side etc.).
The most interesting part is of course the battle turn. This is where the fun happens. There is a few rules that we must follow when designing this. First and foremost, we are creating an action game and we would prefer real players (the heroes) to play the game and not our server so we need to encourage the commanders to incentivise players to join the battle. This bit is actually beside the point of this blog so I’ll just say that we need a system where at any time action players can break the auto-resolve and create an action game. The current system is base around ‘one-resource-must-die-each-turn’ which gives some obvious problems with the time of the battles. Bring more men to the battle and the battle takes more time, when in reality more men shouldn’t add more time. It should rather be; ‘the greater the imbalance the shorter the battle’. In order to achieve this, the assault teams are broken down into individual resources (soldiers and vehicles) and in essence ‘lined up’. For each turn all resources gets one attack (or as you can see preparing for an attack by either loading its gun or finding a target). In the demo I have added a time delay between each attack but on the server a battle turn is always carried through. All the different parameters for both the attacker and the target adds up to a ‘kill probability’, which basically is ‘how likely is the target to die in this round’. Most numbers are between 0 and 1 and should be seen as a probability. For instance the ‘attack value infantry’ is the probability of the unit to get a successful kill on infantry unit, 0 is never and 1 is always.
You can add assault teams to the battle by clicking on the ‘add’ buttons. Mouse over will tell you the unit type (and if you can’t tell them apart you should’nt be playing with the demo).
When you are ready for battle press the ‘resolve battle’ button (yes, the red one :-).
You can assign a commander to the assault team. This is a little test of mine to see the effect of the commander. The commanders (or generals) in the game comes from the soldiers played in the action game. Once a soldier reaches rank 12 (lieutenant), the player can choose to ‘convert’ him to a commander. This removes the soldier from the battlefield and the player can now assign him to command an assault team (or later a command (a command being the logistic superior to several assault teams)). Converting a soldier to a commander will enable him to rise above level 14 (captain) and gain rank of field marshal The player can also just get a ‘west point’ commander (buy a commander instead of converting a soldier) but a real ‘battlefield’ commander will have considerable bonuses.
I have also added an entrenchment option to simulate the fact that an army defending a town will require a lot to defeat.
During battle you can reinforce assault teams running out of resources.
In this section of the demo you can play around with my initial parameters and see the effect on the battle.
NB:Internally an assault team is called a ‘commandnode’ due to some initial programmer confusion about the term ‘group’. The ‘commandnode template’ is a data structure that binds ‘army resources’ (men and tanks) to the ‘commandnodes’ (the assault teams). The ‘Army Resource Template’ is a data structure that holds values for the different resources like soldiers, tanks and so.
Last I need to stress that this demo is just a sandbox and none of the values are final (and probably subject to change a few times before implementation).