Changelog - picture heavy

Started by Andy ONeill, January 02, 2018, 02:08:07 PM

Previous topic - Next topic

0 Members and 5 Guests are viewing this topic.

Dr D Ezra Sidran

Wow! This was the worst case worst bug I've hunted down and killed in my 30+ years of coding. I noticed an error in a picture I posted in this article on our development blog: http://general-staff.com/battle-lines-commanders-computers/.

It's been driving me crazy for two weeks. But, it's fixed now.  I'll write a bit more about this in a blog post shortly.

Andy ONeill

Game

I've started prototyping the mechanism you will use to give move orders.
The idea is:

When in order mode, there will be a chevron appears when you mouse over one of your units.
You drag that to where you want your unit to go.
As you drag, the game will calculate whether you're ordering your men through invalid terrain like a swamp, river or whatever.
There will be an indication this would be an invalid move.
Which is why it's light green.
I'll probably use light green if OK, red if not.
Not sure about using colours matching your side whilst ordering.
You're not going to see enemy orders. ( Obviously ).

A line will be drawn to where you're moving and combined with the chevron this will of course look like an arrow.
When you mouse up you will see an arrow ( in order mode ) showing where you ordered them to go.
You can then issue another move and drag a new chevron.
Some limits to the number of arrows are likely but tbd.
As is exactly how road movement will apply.
Logically, this would be outside of threat from enemy since units would likely be deployed into line for combat and hence out of column and "off" any road by their CO.


Anyhow.
The chevron is somewhat tricky because it's point is where you're going to and it needs to drag smoothly.

I've therefore been experimenting in a scratch solution.



The blue rectangle is there so I can easily tell where a specific point is.
Both that and the chevron are positioned at 100, 100
So "usually" you'd expect the chevron's left point to be on the left edge of that rectangle.

Although that's tricky to show, the chevron also rotates around the point.  As you'd expect with something showing where you're going.



Dr D Ezra Sidran

Added Range of Influence calculations. These factor in 3D Line of Sight and Range of weapons. Below is a screen shot of the ROI mapped for the battle of Antietam at dawn.



Note: visual display of ROI is for AI debugging purposes and probably won't be available in the game (it's not really necessary). It shows what every unit can hit and the cumulative firepower of all units.

This is an ROI map from the American Kriegsspiel 1882 scenario:



Notice the range and accuracy of 19th century artillery; it's accuracy falls off quickly.

I will be writing a longer and more detailed blog post about ROI at our development site: http://general-staff.com/

Andy ONeill

Game

Prototyping move chevrons.
First step is to prove a chevron will position correctly and point in the correct direction.
This is very quick and dirty, adding a chevron for all units.
There will be a panel for orders eventually and you'll need to be in giving-orders mode before you see any.
The final version will only show your own side's orders of course.
I'll also need some mechanism to hold the data.
The chevrons are also fixed size and I need to work out whether to scale or recalculate the chevron shape.
One step at a time though.



The chevrons point in the direction of facing - some units are in column.
The very point of the chevron is positioned at the centre of the front of each unit.
Which is a sort of logical position for movement.
Some of movement will necessarily be somewhat abstracted in that it's that point which will count for what terrain a unit moves through rather than each point of it's face.

Andy ONeill

Army Editor

Increased range to 9000 m.
Note that this is not maximum theoretical weapon range - don't just look up the claimed range of an artillery piece and input that.

For example
Theoretically, a musket would maybe have 300m or so range.
There were a number of Napoleonic war engagements where battalions exchanged musket volleys at 100 yards.
To negligible effect.

Similarly with artillery.
Even if you could make out a unit at 9000m away, you'd probably not be able to work out where your shot landed with
Guns of this period were almost always direct fire.
The exceptions where indirect fire happened were rare and involved rather unusual circumstances.
Which of course contrasts completely with ww1 onwards where artillery fire would usually be indirect.

Andy ONeill

Map Editor

Bug Fix
If you checked the minimum zero box, the elevation values were set on the wrong collection which were then overwritten.
At the moment you can work round this with the current version by unchecking that box.

Since Google decided to force everyone to register a credit card in order to use the elevation api, they have been able to remove a number of the safeguards they used to have in order to stop abuse.
As a result of this I've been able to reduce the throttling on the service calls.
Which means a map worth of data is about twice as quick.
This, by the way, is fairly  connectivity sensitive.
It's making a service call every 40 milliseconds to get data.
The data returned is not massive by today's standards but non trivial.
A broadband connection will easily handle bandwidth.
Poor wifi connections might not.

Andy ONeill

Scenario Editor

Scenario Editor

Bug fixes:

Set victory conditions had both values bound to the red side's text box.
Set turn time wasn't notifying value changed when you re-read a scenario so you didn't see the value change to that in the file.

Considering the range of values led me to a realisation.

You could set scenario minutes per turn to between 1 and 60 minutes.
Higher minutes per turn would be very frustrating for players and allow way too much to happen with units out of control.
I've reduced the maximum to 20 but I think maybe anything over 5 or so is a bad idea and could see weird things like units just walking past each other without players being able to give more appropriate orders.

Andy ONeill

Scenario Editor

There were still issues around setting turn time.

I refactored this.
The viewmodel is now dynamically created and the view templated out from it.
This seems to have stabilised behaviour.

I still think we may have to either reduce the possible range of turn times or fix it at 1 minute.
We'll need one of those actual working game things to prove that theory and that is still quite some time distant.

Adraeth

"You could set scenario minutes per turn to between 1 and 60 minutes.
Higher minutes per turn would be very frustrating for players and allow way too much to happen with units out of control.
I've reduced the maximum to 20 but I think maybe anything over 5 or so is a bad idea and could see weird things like units just walking past each other without players being able to give more appropriate orders."

Maybe a 15 minutes might be an interesting choice for fast games but without those problems, an hour would be 4 turns so a whole battle might around 32 to an average of 40 turns i believe.

Andy ONeill

Model

Reviewing and changing a number of classes related to orders.
This is a pretty complicated part of the game.
Although I sketched out some classes a while ago, it turns out these were way off what I need.
Not 100% "correct" yet but I think near enough so I can start using it.











Dr D Ezra Sidran

I'm doing the same thing with the AI.

Andy ONeill

Game


Only the "current" side - ie you own side - will now show the move chevrons.
Make chevrons match scenario piece scale.

Setting the scale particularly high or small has potential downsides.



Andy ONeill

Game
Refactor Move Chevron into a control.
This is a step towards the drag drop process necessary for move orders.

Scenario editor
Confirmation message when scenario saved OK.
Could have sworn I added that a while ago... but it's in there now anyhow.


Andy ONeill

Game

Reduce size of move chevrons by a quarter
Added last order location to piece.
Set that initially to the piece location on load and deserialisation.
Bind move chevron location to that rather than the piece location.
The net result being no noticeable difference in the UI.
I'm now closer to being able to record where the order is to go to.

Prototype dragging
Calculate facing so chevron points in direction unit will face as you drag.
That looks a bit weird with the cross over the point.
Fix that.
Hide cursor so it's more obvious the chevron point is where the unit is going.

Andy ONeill

Game

Prototype order dragging and terrain checking.

Working out whether all of a move would be across valid terrain or not.
As you drag the chevron a calculation is performed which works out which cells the centre of the unit would cross.
The terrain in each cell is compared to terrain types the unit may cross.
If all the cells are valid terrain you get a green line.
If any cell is not valid terrain then you get a red line from that cell to the end.
These are on top of the chevron, because of course you might have an invalid point underneath where it is




The above unit is artillery which may not cross woods terrain.
That dashed line on the map is the outline of a woods and hence the red line starts at the woods.
Between the far side of the woods and the chevron point would otherwise be valid terrain, but it can't get that far.
The red line starts at any invalid terrain onwards, partly because there could just be one or two invalid cells and a player could well find it difficult to spot where the invalid terrain was if the red line was only 2 pixels long.

Notice the chevron indicates facing of the unit which is in the direction it moves.

Of course, this is rather simplifying things.
For example.
If a 200 metre long unit in line is ordered to go 100 metres in the direction 90 degrees to it's right then in reality things are much more complicated than just a 200 metre move.
It would wheel 90 degrees around the right corner before advancing.
This is trickier than you might think because it would likely become disordered on a real world battlefield.
The wheel would be followed by a pause to dress ranks before it advanced.
The whole process could take quite some time for poorly trained troops.
A unit such of French revolutionary volunteers would probably struggle to pull the whole thing off.

I'll have to give some consideration to how movement should be constrained.