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! 🙂
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.
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:
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:
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:
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!