Author Topic: Changelog - picture heavy  (Read 53788 times)

0 Members and 1 Guest are viewing this topic.

Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 491
Re: Changelog - picture heavy
« Reply #420 on: January 02, 2021, 09:31:43 AM »
Game

Direct move arrows are now red or blue depending on side of piece.
Fixed a bug which left a "rubber band" possible move line visible after you pressed Esc to stop inputting moves.


Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 491
Re: Changelog - picture heavy
« Reply #421 on: January 03, 2021, 10:17:08 AM »
Game

Added places in.
These need more work though - the current style is far too big and clunky.
They get in the way and you can't really tell what point they refer to.

Moved show places into appsettings.
Appsettings is persisted and this setting is now used for both scenario editor and game.
Not the map editor.
Since you're likely to want to see the places in that by default whilst building a map.

Improved averaging of bearing for least cost path arrow.
This is used for the final facing of the piece and to rotate the end triangle around.
This being the arrow head.
Because a least cost path is necessarilly kind of wiggly, the arrow can still sometimes look like it's pointing in a strange direction.
That's unavoidable without smoothing out the path.

Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 491
Re: Changelog - picture heavy
« Reply #422 on: January 04, 2021, 12:15:30 PM »
Game

refactor least cost path arrow building into a separate class.

Ignore last 4 points in least cost path for purposes of calculating averaged end facing.
This is because the angle is calculated from one point to the last.
The angle between points very close together is prone to anomalies.

Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 491
Re: Changelog - picture heavy
« Reply #423 on: January 16, 2021, 09:35:28 AM »
Pieces
Kriegsspiel pieces in line now all have the same frontage.
Simulation pieces have different frontage depending on their unit type and previously game pieces also did.

Scenario editor in Game mode:

Simulation mode:


To highlight differences, here's a chunk of each. Notice how the Infantry unit is wider than the artillery whilst in simulation mode.
Game

Simulation


The game now respects game/simulation setting in a similar manner to scenario editor.
One difference being, no HeadQuarters pieces in game  mode.
Here's the game in game mode.


If you're thinking "Why does he keep on calling units pieces?"
We developers are forced to be pedantic and specific about names of things.
Code doesn't do kinda-right.
It's either precisely right or it doesn't compile at all.
When I mention a "Unit" this is an abstract thing in the army editor.
The clerk's notes on a Battalion whilst in it's barracks.
A "Piece" represents that battalion on the battlefield (or game board).
It is a different thing entirely because it has a load of other properties - eg location, facing, current stats, orders

Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 491
Re: Changelog - picture heavy
« Reply #424 on: January 24, 2021, 06:23:15 AM »
Game

Added the option to choose a direct move for pieces which would usually use best path.
In the unlikely event you need a piece that would usually move using a least cost move, you may now do so by holding the ctrl key down.
I would imagine this will be very rarely used but it's there if you need it.


In the picture above, an infantry column would by default choose best path. Here it's using a direct (straight line) move.
The blue HQ has two move orders - the first to move least cost and then another direct.
« Last Edit: January 24, 2021, 06:25:38 AM by Andy ONeill »

Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 491
Re: Changelog - picture heavy
« Reply #425 on: January 28, 2021, 01:01:50 PM »
Pathing

Fixed an oddity.
One of the changes I made to avoid wiggly lines had an unintended side effect.
A piece would be a bit too keen to keep on going in a straight line.
Hence sometimes ignore a road it should turn onto and end up choosing a bit of an odd route.
I removed the couple of lines of code reduced cost straight ahead and that problem seems to have gone.

Probably find pieces wiggle down some roads now or something but I'll worry about that when I see it.

Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 491
Re: Changelog - picture heavy
« Reply #426 on: February 14, 2021, 09:45:27 AM »
New Pathing mechanism

I've replaced the pathing I was using for best path completely with a different implementation of spatial A*.
Like the previous version, this now relies on pre-calculated slopes within a map.
This is now done when you save a map - with the current version of the map editor.
This is a breaking change but easily "fixed".
You just open a map you created with a previous version of the map editor and save it again.
The calculations are done on save.

There is now another check in the scenario editor.
In the current version when you mouse over a HQ on the map it will try and calculate courier routes.
This uses the best path method and will error.
That courier route functionality might not be there in the final version, this is still TBD.



I have done some work on this to reduce memory overhead but this is a prototype version of pathing.
One of the things I've done is use a reduced set of nodes for a route.
This works out the centre point between start and end and uses a square around that which is sized to the largest difference in X or Y plus a third.
That means short "moves" are now much lighter weight since they're handed say a 200 x 200 array rather than 1155 x 805.
It's possible this could have introduced some oddity for some situations so I might have to reconsider.
But as it stands, if you have a piece on one side of a river and want to get to somewhere just on the other side then it's advisable to give orders in multiple steps. Choose the piece, click on a bridge or crossing and tell the piece to use that rather than try and swim.