I now managed to have a compiling code, which is much shorter than this morning, and does less things only as far as combat() method is concerned. Trimming Unit down was really a good idea, thanks Gary.
A few points arise as we switch from Unit-based combat to Element-based.
One is the fact that you cannot keep Units in reserve, only elements. I don't think it is a pity, but I would mention it.
More important, morale checks: They worked based on the damage suffered by the unit, in terms of dead elements. I have to change that since elements will want to flee by themselves to keep the coding simple. One thing that was missing was an appraisal of opposition: You wanted to flee when you were hurt, but not when you were outnumbered.
I suggest the odds to keep ground are: (morale + mobility/2 + training)*5%, multiplied by the ratio of offensive powers: If you are twice less powerful, you want to flee twice more. Note this is checked after one round of fight, so armies at that stage are able to appraise the opposing firepower. I also discount damage because I am not sure whether you are more affected by one dead in your century or by the fact that the century next to you was annihilated to the last man...
Also, about dealing damage. Krenske's model used a number of hits, each of which dealt some (1) damage. The number of hits being an int is a problem. I thus suggest it be changed. We can have damage set to (0.1* old number of attacks). Note chance to hit is quite low unless troops are experienced/trained.
Another point, is experience. I don't like it much the more I think of it. Although it makes sens in real life, on the time scale we consider, experience seems ridiculous. A same phalanx will probably fight 20 or 30 years away, and it would retain the experience of its members? I think experience was in civ because it was a way to force people to build barracks. I think training is more interesting than experience to model, and it has almost the same role in the model, so I'd rather use only training, not experience. It is interesting in the sense that a less-than-appropriate payment for a unit would reduce its training first, thus reducing its efficiency in an easily modelled way.
Now, on deployment of elements.
Each army when they meet have their front, support and reserve (non fighting) lines. If outnumbered, front lines will flank and attack support first, then remaining front lines. I suggest reserves be attacked last. The only elements which will typically be in reserve (unless we provide tactical control to the player, but that is too much micromanagement from my point of view) will be engineers and other not-so-fit-for-fighting elements. They can probably be left alone until the attackers are done with the fighters.
As a last note: Although Krenske's model manages fights at various ranges, this still won't get coded until we get past medieval era in clash.
I'll start coding the new combat soon (1 or 2 days) and hopefully see what the results look like by the end of the week.
A few points arise as we switch from Unit-based combat to Element-based.
One is the fact that you cannot keep Units in reserve, only elements. I don't think it is a pity, but I would mention it.
More important, morale checks: They worked based on the damage suffered by the unit, in terms of dead elements. I have to change that since elements will want to flee by themselves to keep the coding simple. One thing that was missing was an appraisal of opposition: You wanted to flee when you were hurt, but not when you were outnumbered.
I suggest the odds to keep ground are: (morale + mobility/2 + training)*5%, multiplied by the ratio of offensive powers: If you are twice less powerful, you want to flee twice more. Note this is checked after one round of fight, so armies at that stage are able to appraise the opposing firepower. I also discount damage because I am not sure whether you are more affected by one dead in your century or by the fact that the century next to you was annihilated to the last man...
Also, about dealing damage. Krenske's model used a number of hits, each of which dealt some (1) damage. The number of hits being an int is a problem. I thus suggest it be changed. We can have damage set to (0.1* old number of attacks). Note chance to hit is quite low unless troops are experienced/trained.
Another point, is experience. I don't like it much the more I think of it. Although it makes sens in real life, on the time scale we consider, experience seems ridiculous. A same phalanx will probably fight 20 or 30 years away, and it would retain the experience of its members? I think experience was in civ because it was a way to force people to build barracks. I think training is more interesting than experience to model, and it has almost the same role in the model, so I'd rather use only training, not experience. It is interesting in the sense that a less-than-appropriate payment for a unit would reduce its training first, thus reducing its efficiency in an easily modelled way.
Now, on deployment of elements.
Each army when they meet have their front, support and reserve (non fighting) lines. If outnumbered, front lines will flank and attack support first, then remaining front lines. I suggest reserves be attacked last. The only elements which will typically be in reserve (unless we provide tactical control to the player, but that is too much micromanagement from my point of view) will be engineers and other not-so-fit-for-fighting elements. They can probably be left alone until the attackers are done with the fighters.
As a last note: Although Krenske's model manages fights at various ranges, this still won't get coded until we get past medieval era in clash.
I'll start coding the new combat soon (1 or 2 days) and hopefully see what the results look like by the end of the week.
Comment