Fatigue!

It could be argued that the title refers to some coding fatigue on my part – hence the month long absence. However, what I’m actually referring to is the new fatigue modelling that has now been coded into the system.

Before I get into any details as to what has been added over the last week, I think I should probably show off that I have now hit the 120,000 lines of code barrier! 🙂

Just hit the 120K lines of code mark! 8-)

120K – oh yeah baby! 😎

So what got put into the system to make the lines of code jump up like this?

Here’s the new functionality:

  • Unit equipment weight now affects a unit’s movement performance.
  • Unit fatigue is now modelled.
  • As a bonus unit collision detection has now been implemented too!

All in all a fair bit of code, however it wasn’t the coding that required the most effort. Instead, it was the design of the fatigue and equipment bearing systems that ate up the most time.

To produce these systems I had to design up-front what the effects would be on both movement and fatigue and how the two interrelate. This kind of design can only be achieved by sitting down, conducting research and then documenting the effects.

Gameplay and simulation mechanisms actually need an up-front design..... Heaven forbid!

Gameplay and simulation mechanisms actually need an up-front design….. Heaven forbid!

To jump straight into coding without first documenting the actual effects of these two complex systems would have lead to disaster.

It took a lot of internet research and a few iterations before I arrived at the mechanisms that I currently have. You wouldn’t believe how difficult it was to find the information that I needed. Even such simple facts as to how far an armoured infantry man can run and at what speed took a fair bit of time!

The fatigue modelling in particular is very advanced and takes a huge number of factors into account, including activity, training, terrain and any equipment carried.

To show you all this at work I have created a video which can be viewed at the end of this post. For those that are challenged in the video department I have included some screenshots below…

First up, unit collision detection:

Here I order the red cavalry unit to charge in the general direction of the blue chariot unit....

Here I order the red cavalry unit to charge in the general direction of the blue chariot unit….

In the bad old days the red unit would have continued right through the blue unit, but not any more! Unit collision detection is now in place! 8-)

In the bad old days the red unit would have continued right through the blue unit, but not any more! Unit collision detection is now in place! 😎

In the event unit collision detection proved to be a pain. The reason being that I wanted pixel perfect accuracy, along with a high calculation efficiency and speed. It took a few attempts to get there, but the current system is now lightning fast and very accurate.

It is designed to prevent units from passing through each other, unless one of the units has routed, or both units are Roman Maniples performing their pass-through manoeuvres.

The penalties for routing through a well ordered unit are pretty severe and one that I recommend that you don’t try at home! 😛

Next up, I will demonstrate how fatigue and equipment modelling impacts movement:

Eight units all perfectly inline and all ready to charge up the hill. Who is going to finish first? Which units are going to tire out first? Tune in for the next exciting instalments!

Eight units all perfectly inline and all ready to charge up the hill. Who is going to finish first? Which units are going to tire out first? Tune in for the next exciting instalments!

The blue and red units are identical. On the far left is a Light Infantry unit with average training and no kit. The rest of the units are all sporting medium armour. With the exception of the leftmost of the medium units, they all sport medium shields too. The main variation is in training. The leftmost medium infantry has average training, whilst the centre one is a conscripted unit, with the one on the far right being well trained.

The blue and red units are identical. On the far left is a Light Infantry unit with average training and no kit. The rest of the units are all sporting medium armour. With the exception of the leftmost of the medium units, they all sport medium shields too. The main variation is in training. The leftmost medium infantry has average training, whilst the centre one is a conscripted unit, with the one on the far right being well trained.

After one move (30 seconds), the light infantry unit on the left is pulling away. The next unit along is also pulling away from his comrades because he doesn't have to carry a medium shield. The unit at the back is a conscripted unit and is already tiring from the effects of running in medium armour...

After one move (30 seconds), the light infantry unit on the left is pulling away. The next unit along is also pulling away from his comrades because he doesn’t have to carry a medium shield. The unit at the back is a conscripted unit and is already tiring from the effects of running in medium armour…

After two turns (60 seconds) the light infantry unit is still in the lead and the conscripted unit has fallen further behind. Of interest, is that the right most 'Well Trained' unit is starting to catch up with the shield-less unit directly to it's left. That is despite the rightmost unit having to carry a shield. This is because the shield-less unit is starting to tire, whereas the 'Well Trained' unit is still going strong.

After two turns (60 seconds) the light infantry unit is still in the lead and the conscripted unit has fallen further behind. Of interest, is that the right most ‘Well Trained’ unit is starting to catch up with the shield-less unit directly to it’s left. That is despite the rightmost unit having to carry a shield. This is because the shield-less unit is starting to tire, whereas the ‘Well Trained’ unit is still going strong.

After 4 turns (2 mins), the shield carrying medium unit on the right has overtaken the shield-less averagely trained unit on the left. It looks like its superior training is paying off. The light unit on the far left has reached its destination a while ago and is busy resting!

After 4 turns (2 mins), the shield carrying medium unit on the right has overtaken the shield-less averagely trained unit on the left. It looks like its superior training is paying off. The light unit on the far left has reached its destination a while ago and is busy resting!

A zoomed out view after 2 minutes of game time. The units in the forest have fallen behind blues as they had a slower speed and their fatigue took a bigger battering through trying to run through a forest.

A zoomed out view after 2 minutes of game time. The units in the forest have fallen behind blues as they had a slower speed and their fatigue took a bigger battering through trying to run through a forest.

What is interesting in the above screenshot is the relative distances between the medium units in the forest and those outside. The gaps imply that the forest based units all got tired out within a relatively short period of time, whereas those outside of the forest became fatigued at much greater time intervals.

Onto menus and orders:

When a unit is fatigued certain orders can no longer be issued as denoted by the grey orders in the menu above. The eagle eyed amongst you will also have noticed that Ancient Armies is running very well on Windows 10 :D

When a unit is fatigued certain orders can no longer be issued as denoted by the grey orders in the menu above. The eagle eyed amongst you will also have noticed that Ancient Armies is running very well on Windows 10 😀

This blog post only scratches the surface of what is actually being modelled, but hopefully it will provide an insight into how fatigue and equipment will affect your units.

For those that can watch video, here is the You-Tube video (best viewed in HD):

Also, whilst I had the recording software out, I took the opportunity to update the Mapping System Overview video which can be viewed below. Again, best watched in HD:

The next thing I will be working on are the effects that movement, formations, terrain and fatigue will have on cohesion. The plan is to nail the movement basics before embarking on column road movement.

That’s it for this week!

Laters

RobP

Advertisements

7 thoughts on “Fatigue!

  1. Looks great so far! Keep up the good work. May I suggest Archer Jones’ “Art of War in the Western World” as an essential read for anyone wanting to understand this period of warfare – especially someone looking to develop a wargame. I would also encourage you to take a look at the wargame series “Great Battles of History”, which (rightly, I think) places special emphasis on Leadership and Troop Quality as the 2 biggest determinants of victory in this era.

    To this, I would just add “Training”, as this last aspect is what allowed the well-articulated legions of Rome and the phalangists of Macedon to score victories over larger, more powerful (and even better-led) forces.

    • Thanks Erich! I have read many books on this period but seem to have missed Archer Jone’s book, will have to hunt through Amazon to see if I can get hold of it.

      As for the Great Battles in history games, I’m actually playing the Deluxe Edition Alexander board game right now! 😀 I own 6 boardgames from that series as well as the 3 computer games. I think that Richard Berg’s games are master pieces – with the board games being a lot better than the computer versions. His focus on cohesion and quality as opposed to raw casualties was a revolutionary design (and still is) – plus I like Richard’s sense of humour in his rules writing 🙂

      Training, discipline and cohesion do make up a significant part of the results of Ancient Armies, though Ancient Armies differentiates between morale and cohesion – for example many skirmishers had formations that had a very low cohesion, but then again it doesn’t matter for them as they do not usually participate in shock combat.

      The Signals system combined with the assigned manoeuvres system will benefit well trained armies in Ancient Armies and provide a lot more battlefield flexibility to those armies. So commanding these armies vs armies with less training will be very different.

      I’ll be using Richard Berg’s games as my reference tool. If my results are in the ball park of those games, then I will be quite happy 🙂

  2. Rob, interesting stuff for sure… I wonder though.. would a unit that partially intersects another unit actually come to a stop or more likely, would it still move forward but become disorganized? Or at least part of it would continue forward (the part that does not intersect with the other unit).. but I suspect there is no way for you to represent that.. so perhaps having them stop is the correct answer here.. but I would have them become disorganized (both of them) and basically become a milling mass of confusion until they can sort themselves out.. which should take some time.

    Good stuff, I am very impressed with what you are creating here.

    • Thanks Bil. This system as well as many others will continually evolve as I get feedback like this and during play testing. In fact, fatigue received it’s first big tweak yesterday 🙂

      I had envisioned that most units of men would not deliberately march into or through their own comrades, not unless battle field pressures forced them to.

      That said after reading your post I think there are certainly scenarios involving lose formations like skirmishers.

      My aim for the moment is get all the systems in place, then tune it up during play testing. 🙂

      • The ideal solution would be for a formation that looks like it is going to march into part of another friendly formation to simply make a small adjustment to avoid the collision(a half turn or something)… but of course these sorts of things did (and still do) happen so having some fuzziness built in would be nice, would add some friction and unpredictability…

  3. That will be part of the plan. Once the movement orders are fully in the system, I will be working on unit path finding for use by the AI. For player orders it will help prevent silly orders, like marching into a solid wall, by route finding around it.

    I like the idea of using fuzzy logic though. It could even be influenced by a units’ training and discipline. The less well trained and ill disciplined would be more likely to end up not taking avoiding action.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s