Slipping Away…

A unit side slipping to the right...

A unit side slipping to the right…

A five minute job it said…

Only five minutes!

Why not add side slip whilst fixing the other issues?

Come on it won’t take long….

What’s 5 minutes between you and me?

That ‘five minute’ job took around a day to code.Β That’s the last time I listen to my brain! πŸ˜›

But we now have the ability for units to side slip.

What is side slipping?

It’s the ability for a unit to move or charge forward whilst slipping the whole formation either left or right.

Ancient units used side slipping where it could replace wheeling as it didn’t take as long and didn’t affect cohesion as much. But unlike wheeling, side slips are limited by unit type, training, formation density and unit speed.

So not all units will be able to side slip very well.

Why did side slipping take so long to implement?

In the end, even the trivial case of simply side slipping forward dropped me in deeper than I thought! The green line is the route the unit would take if it followed the order arrow. However, following this line would result in the unit overshooting its endpoint. Instead, the red line is the route the unit must take to arrive at the shadow marked unit. This is because the arrow the player sees marks the front of the unit, but all unit's positions are calculated from their centres and not their fronts. Hence the additional, and rather unexpected calculations.... (Click for full sized image)

Even the trivial case of simply side slipping forward dropped me in deeper than I thought! The green line is the route the unit would take if it followed the order arrow. However, following this line would result in the unit overshooting its endpoint! Instead, the red line is the route the unit must take to arrive at the shadow marked unit. This is because the arrow the player sees marks the front of the unit, but all units’ positions are calculated from their centres and not their fronts. Hence the additional, and rather unexpected calculations…. (Click for full sized image)

The image above shows one reason why there were a few technical hiccups. Who would have thought that a side-slipping unit’s actual course is actually slightly different from the order arrow? Not me! πŸ™„

Of course (pardon the pun), that’s just a simple ‘trivial’ case.

Once you start adding lots of other orders, such as wheeling, the calculations get exceedingly hairy indeed!

Lots of testing was required!

Lots of testing was required!

But after a day of solid work it all seems to work across multiple orders and formation shapes. 😎

Although side slipping has accidentally stolen the limelight this week, the real bulk of the work was fixing the issues introduced from the formation changes that were added last week.

Still behind the curve. You can see where the new formations change functionality got introduced on the 19th.

Still behind the curve. You can see where the new formations change functionality got introduced on the 19th.

I have a policy of not starting any new functionality (side slipping excused), until I get the outstanding issues under control. As can be seen from the graph, I still have a little ways to go before I have a clean system ready for adding road travel functionality.

So what were the ‘outstanding’ issues that I had to fix?

Many of them came about from required functionality that I had simply not thought about for formation changes….

Units that change formation now block line of sight properly across their more complex shapes.

Such as the ability for units that are changing formation to block line of sight properly across their more complex shapes….

Units that are changing formation can now be selected over their whole complex shape. The system now also detects the unit when the mouse cursor is waved over any part of the complex shape.

Or maybe the ability to select and detect units that are changing formation over their whole complex shape.

There were other issues too. Such as removing the ability for a player to delete a change formation order if a unit is already in the middle of carrying it out.

All these smallish issues were issues that were not necessarily thought about up front, but are needed to make the change formation functionality usable.

In addition, as a bonus, I fixed the graphical anomalies on unformed units!

Regular readers will be thinking, ‘But you already fixed that?’ Well I thought I had, mainly because I couldn’t see the issue on my development machine.

Further investigation revealed that the corruption was down to the way I was dynamically calculating index buffers for the units. On AMD hardware (my dev machine) it worked perfectly, but on my games machine which has nVidia hardware it caused the occasional graphical issue.

I have since re-coded how the index buffers are calculated using a much safer algorithm and now, finally, everything is back and working again! Woot! πŸ˜€

I even managed to spend a little time on cleaning up the wheeling orders graphic…

On the left is the old wheeling symbology, on the right is the new. Can you spot the difference?

On the left is the old wheeling symbology, on the right is the new. Can you spot the difference?

The older symbology used to have a solid line that was drawn perpendicular to the unit that connected the pivot point to the endpoint of the unit. However, these days, the order graphic shows a shadow of the unit, so there is no need for this line to be displayed anymore!

That’s it for this week. For the next week I will carry on stabilising the system, and once it is ready I will start on the new road travel functionality.

Some people might be thinking that this is a slow way of going about software development, but in my view if you don’t stay on top of an application’s quality it will soon get on top of you!

Anyways, I will leave you with a short video demonstrating what unit side slipping is. Best viewed in HD.

Laters

RobP

 

Advertisements

6 thoughts on “Slipping Away…

  1. Hi Rob, I just came across this project and i find it very interesting. I’ve been dreaming a true ancient battle simulator since i played the first Rome total war (I was never satisfied about battle realism in total war games), so i really wish you good luck.
    I have one question: will roman units have the ability to move backwards from the front line and be replaced by other units? That would be amazing, allowing the player to use a proper “triplex acies”.
    Greetings from Italy

  2. Hi, Rob.
    Any news in two months?
    There is a small community awaiting for reports in my country… Yes, your have international fans πŸ˜‰

    Greetings from Spain.

    • Thanks Alejandro πŸ™‚

      Apologies for the delay, but alas, my main development machine has gone down :/ Luckily the source code is safe as that is located on a NAS drive. However, I’m going to need to replace the machine and somehow get the development apps (JIRA, Confluence and Fisheye) off of the broken machine and transferred to the new one – though I am considering putting these in the cloud for future safety.

      The earliest I can get a new dev machine will be after Christmas – so the updates will continue after then. Again, sorry for the delays.
      RobP

      • Thanks for the reply, Rob.
        Bad luck right now, but you’ll have good news the next year, sure.

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