Ancient Warfare 2 Devblog 21

Posted on 12 November 2017 by Jannik

Heavy performance optimizations, procedural castles and small new features


A bit shorter devblog today, because I worked on another small project, too.

The experimental version won't get an update, because the AI isn't working at the moment.

I'm looking forward to update the experimental version next week.


Procedural castles


There is a new button in the toolbar of the custom battle editor.

It will open a new panel to create procedural castles.

Complex: Should the castle be simple or are complex layouts allowed?

Size: This will set the max size of the castle.

Complexity: This will influence the amount of edges, towers and the size, too.

Then you click the generate button, you will get a finished castle as a preview, which you can rotate and place like castle parts and units.

If you don't like the castle, you can click the generate button again, to get a new castle.

This feature is for those, who wanted back the finished castle, which I removed a long time ago, because they didn't wanted to build a castle from scratch.

Performance optimizations


I did some really good progress with the performance.

I reduced the physics time by 75%, which will give a small performance boost.

To improve the AI, I implemented the new movement system, which I created last week, but I haven't finished it yet. There is one big problem left, which I will hopefully fix next week. Just to have a few values: The old movement system needed about 6 milliseconds each frame with 100 units and the new movement system will need 0,07 milliseconds each frame and it will reduce the physics time by 20%.

In addition, I optimized the AI calculations, by rewriting all math functions in a faster way with managed code. This will give about another millisecond each frame, which is a really good result!

And now in frames per seconds (100 melee units):

Current version: ~35fps

Development version: 60fps+

Once I finished the new movementsystem, I will update the experimental version, so that you can test it!

In addition to all of this, I removed lag spikes by removing gc allocations.

 

I played a few random battles and the gameplay is much smoother now. It feels actually really good.

Small new features


  • You can now randomize the selected units for conquest/king of the hill battles
    • Full random
    • Equal teams
  • If you hover a unit with the mouse in spectate mode, you will now see a small health progressbar

Other changes


  • Siege weapons will now do damage instead of destroy buildings with one hit
  • Ballista arrows will now stick to buildings

Surprise on monday


We are both working on something cool new. It will be a surprise for next monday.

Until then, happy playing!