Time and Space!

Finally, Ancient Armies has hit a major milestone – we can now issue orders to units and have them act on those orders! For the first time ever, units can now move in reaction to orders placed in their orders queue.

Why is this a major milestone?

A lot of game code framework had to be put in place to realise the dream of moving units. This code effectivelly marks the transition from what was a data-modelling exercise to one of writing the actual game engine itself!

This Milestone has also taken me up to 100,203 lines of code!

This Milestone has also taken me up to 100,203 lines of code!

To enable unit movement the following subsystems had to be added:

  • Map Symbology Overlays
  • Unit Order Queues and processing
  • Artificial Intelligence
  • Hardware agnostic game loop
  • Game time flow management
  • Unit selection processing

That’s a lot of new subsystems. Between them all, they define what is essentially the ‘meat-and-potatoes’ of the game.

The decision to leave the Army and Scenario sub-systems partially completed (as reported here) was vindicated by this software development phase. Both of these sub-systems got modified to support the needs of the parent game. This has saved a lot of re-work and a lot of pre-planning!

The new game system now supports the following:

  • You Plan, I Plan, We Go turns (with a twist 😉 )
  • 15 Second game turns of simultaneous movement
  • 60 hz refresh rate
  • Game time compression from 1:1 up to x50
  • Guaranteed and realistic animation speeds – regardless of platform
  • Designed and built to support artificial intelligence from the ground up
  • Unit multiple selection

With the above framework in place, it should be relatively easy to add the other orders that the system requires. All that I need do is follow the rules of that framework and let it take the main burden!

Issuing orders to a unit is simple:

Orders are issued from a right clicked context menu. (Click for full-sized image)

Orders are issued from a right clicked context menu. (Click for full-sized image)

The eagle eyed amongst you will have noticed the yellow coloration of the unit shown above, this is due to the unit selection mechanism:

This is the composite picture of a unit being selected. Selected units are highlighted in yellow as shown on the right (click for full-sized image)

This is the composite picture of a unit being selected. Selected units are highlighted in yellow as shown on the right (click for full-sized image)

Internally the mechanism supports the multiple selection of units, though only single unit selection has so far been surfaced to the user interface.

All issued orders will be accompanied by their own unique map overlay graphics as shown below:

This unit has been issued with a singular movement order. (Click for full-sized image)

This unit has been issued with a singular movement order. (Click for full-sized image)

The system also supports the queuing and prioritisation of orders from both a human and the 2 layer artificial intelligence source.

The system supports queued orders. Here the cavalry unit has been issued with three separate movement orders. (Click for full-sized image)

The system supports queued orders. Here the cavalry unit has been issued with three separate movement orders. (Click for full-sized image)

The game handles many simultaneous orders with ease:

Stressing the system out! Here we have issued movement orders to all units! (Click for full-sized image)

Stressing the system out! Here we have issued movement orders to all units! (Click for full-sized image)

The same stress test 5 turns later.... (Click for full-sized image)

The same stress test 5 turns later…. (Click for full-sized image)

As a unit manoeuvres the system determines whether it has passed the success criteria for the current order. If so, that order is removed from the queue. The system then uses a prioritisation mechanism to pick the next order it needs to execute.

The perceptive amongst you probably spotted the time compression controls on the main toolbar:

Time Compression!

Time Compression!

Adding a time compression system was remarkably trivial thanks to the coding of time flow management within the game!

Anyways, whilst a picture paints a 1000 words, a video paints even more! So here is a 10 minute video showing the Ancient Armies orders and movement system in operation:

Time for a well earned rest!

Laters

RobP

Advertisements

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