It has been a while since the last update as I had decided to take a break from home development to free up some time for my many other hobbies. However, I’m now back!
My intention is not to add any new functionality, at least not just yet. Instead I want to concentrate on fixing all known issues and putting what I have through the wringer to make sure that everything is working as designed.
The first thing through the wringer is the Line Of Sight system. This system had many speed optimizations made to it, so it had to be thoroughly tested. It was during this testing that I found many subtle bugs.
Some of these had been introduced as the result of the optimizations, whilst others were down to the quantized nature of the terrain and the units (the old system could only handle elevations and unit heights in whole numbers only).
This limitation inevitably lead to heights and elevations that got rounded up. For example, a 1.8 metre high infantry unit would have its height rounded up to two metres.
There was code in place to try and mitigate this limitation, but it kept failing with many corner cases. So I kept adding more and more code, only to find other corner cases creeping out of the woodwork.
In the end I decided that instead of fighting the system, I would change it. As a result, terrain elevations and unit heights can now be specified up to 5 decimal places – assuming that you really want to do that sort of thing…. 😯
However, the more practical upshot of this modification is that units with a height of 1.8 metres are treated as units with that height, with no kind of mathematical workarounds having to be implemented! As a result, many of the subtle bugs that were in the system have simply disappeared! 🙂
Line of Sight is massively important to this game as I want to simulate the confusion of battle. The only way I can do this is by showing the player exactly what they would see on the battlefield if they were there. Hence the need for the high fidelity Line of Sight routines.
The Ancient Armies Line of Sight system has so many unique features that I have put together a new video that can be viewed at the end of this blog post.
For those that are challenged in the video department, here are some screenshots showing off some of these features:
The fidelity of the Line of Sight system is now so high, that the eye level for the Line of Sight tool has to be set. This is because different units can see differing things due to their varying eye levels. This screenshot shows the tool in its default mode which is simulating the view from an Infantry unit.
Here we are showing the Line of Sight tool being used on a 2 metre wall using its default settings. The Line of Sight in this example is blocked as the wall is too high for an infantryman to peer over (Green is visible, Red is blocked).
However, by right clicking on the Line of Sight tool’s tool-button, one is now presented with the opportunity to configure it! We are now going to select the simulated view point for a Cavalry unit…
Our Line of Sight tool is now configured to simulate the view from a Cavalry unit. Lets see what happens with the 2 metre wall now…
Bingo! In this case our simulated viewpoint can see right over the wall! Cool eh? 😎
Over the next three pictures I’ll show the practical effects of simulating eye level. Here the Blue Infantry unit to the South on the hill can see all three Infantry units (1 Blue and 2 Red), plus the Red Cavalry unit at the back. This is thanks to its vantage point on the hill. But what would happen if the Infantry unit decided to climb down to the bottom of the hill?
The Blue Infantry unit to the South has now moved Northwards off the hill and onto ground level. From here it cannot see either of the Red Infantry units because its own Blue Infantry unit to the North is blocking the view. Note that the Red Cavalry unit is taller than the intervening infantry units, so it can still be seen.
However, the Blue unit in the middle has been rotated enough so that the Blue unit to the South of it can once again view the Red Infantry unit to the North. Note, that it cannot see the 2nd Red Infantry unit because it is blocked by the first Red unit. However, the Red Cavalry unit is taller than the intervening infantry units, hence why it is still visible. Had our Blue Infantry unit been a Cavalry unit it would have been able to view all the units shown above due to its height advantage.
Now for a discussion about another unique Ancient Armies feature – Terrain Clutter. Terrain Clutter can be set on a per map basis within the map editor as shown above. In this example, the map has a clutter distance of 1000 metres and a max visibility of 8000 metres when on a hill. This means that a unit at ground level can only see up to 1000 metres away unless the target unit is on a hill. Terrain Clutter represents micro ground undulations and foliage that are too small to show on a map, yet large enough to affect Line of Sight.
Ground clutter in action! Here we have set the ground clutter for this map to 1000 metres and set the viewer down at the bottom left corner of the map at ground level. We can see for a 1000 metres along the ground (the green), then our Line of Sight is blocked by the ground clutter (in red). Only the front of the hill to the North is high enough to rise above the clutter and to allow observation to carry on again.
In this follow up screen shot, our observer has moved further back onto the hill to the South (the observer is bottom left). From the new vantage point, the observer can see right through all of the intervening ground clutter. As a result, the observer’s view is now unimpeded at ground level and only becomes blocked when it reaches the crest of the hill.
These screenshots only show a small percentage of the Ancient Armies Line of Sight system’s features. If you want a full in-depth overview, take a look at the new video below (best viewed in HD):
That’s it for this week. Next, I will take a look at a few minor Line of Sight issues and after that I will take a closer look at irregular units – as I’m sure that something isn’t quite right with those 🙂