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

0 Members and 2 Guests are viewing this topic.

Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 254
Re: Changelog - picture heavy
« Reply #135 on: June 13, 2018, 12:10:50 PM »
Fonts

Overhauling the font preferences mechanism.
Changed some fonts and views to make them fit (better) with the different options.
Added font preferences to map editor.


Preferences
Persisting ( and read on run ) user preferences,
If you pick plain style then next time you run one of the apps, you get plain style.

The Army Editor also has a preferences menu item and will respect the settings.

Rationalised the shapers internals.

Added min and max to shapers panel.

Buttons

Replaced the button template.
The old one looks too much like a mirror frame and it was a nightmare getting it to look OK with different font formats in all the different views.
The new version's fancy bits are less distracting and now cannot impinge on the text.
Reducing the space necessary to left and right of the text also makes this version a lot more flexible.



Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 254
Re: Changelog - picture heavy
« Reply #136 on: June 15, 2018, 12:08:14 PM »

Terrain and elevations visualisation.

(First iteration)
This is a sort of vertical slice through the map showing both elevation and terrain type.
The terrain type is represented by colour - but you need to save a map before this is actually set.

Showing this is controlled via a checkbox on the layers menu.
When checked you get an overlay with two sights defining start and end points
You can drag these around


Another window appears showing the visualisation.
This is a regular window so it can disappear behind the main window if you let it.
As a result you're best dragging it to one side or your second monitor.


Black is the default colour, I've no terrain other than elevation on this map.

This is constructed from a number of rectangles.
Each rectangle is a cell between your two chosen points.
As you mouse over each of thes rectangles, there's a spot which moves to the appropriate position on the map.
You can see that on the top picture.

Although only used in the map editor at the moment this is designed for re-usability.
I can potentially show it whilst you're issuing move orders for the terrain you're moving over, when you're checking for sightings etc etc.

Currently stable, but still some more to add.


Shapers - evaluate min and max elevations on map load.

Bug Fix
One of the shapers layers was interfering with drawing anything.

All
Standardising storage of elevations and terrains across modules.


Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 254
Re: Changelog - picture heavy
« Reply #137 on: June 16, 2018, 10:00:17 AM »
Terrain Visualiser

Fixing bugs and improving the behaviour.
Close the menu as the terrainvisualiser is shown.
Usually you want a menu to be on top of anything and the fact that's how they work is great.
In this case something on top of our new window is a bad thing.
Persuading the new window to stay on top of the main one.
Retaining previous positions and data when you re-open.

The sights overlay now initially appears with it's "spot" off map.
Spot is also moved off the map when you drag a sight so it's not left hanging about in the middle of nowhere.

Added elevation and terrain type in text to visualiser.

In the below screen shot I've done a screen capture using windows problem steps recorder.
This captures the mouse so you can see where it is at the time of capture but has adds that rather interesting green border to the window.
I've added a hill and two cones plus some other terrain.
These are pretty steep hills.
The left one is a hill which is a relatively natural shape but slow.
The middle (cone) demonstrates why a cone is called a cone.
The right one  is a cone with a lot of blur applied.
Quick to generate but blurring reduces the effective overall height.
If you can live with that though, it's way quicker than a big hill.



Notice also the colouring showing terrain types.

I wasn't terribly careful with placement of my river and road so they're not in particularly logical places.

Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 254
Re: Changelog - picture heavy
« Reply #138 on: June 17, 2018, 08:09:03 AM »
Map Editor

Styled up the Elevation Shapers options so it's similar to the drawing options.


Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 254
Re: Changelog - picture heavy
« Reply #139 on: June 18, 2018, 11:52:40 AM »
Map Editor

Building options.

I've added a mechanism which allows me to define different buildings.
A Building row has a combobox in edit terrains which allows you to pick from the defined buildings.
I've added another building. 2 so far.
You click a building picture in the combo to pick it and the building on the map changes.



You can still only rotate a maximum of 30 degrees either way.
That is because of the shading, which could look weird otherwise with the shadow on the wrong side and different to everything else on the map.
These are not light sourced 3d objects, because they get very graphics expensive very quickly AND they are harder to build.
They're built from shapes which have a gradient on them.
Although the shadow outside the building can be rotated the shading on the roof panels is fixed like a picture.

This limitation isn't necessarilly going to apply to all building so I'm thinking of making each define how far it can be rotated.

Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 254
Re: Changelog - picture heavy
« Reply #140 on: June 19, 2018, 08:50:18 AM »
Map Editor

List of terrain in terrain edit:
Removed display of id ( this uniquely identifies the piece of terrain but is only internally meaningful ).
Standardised font used.

Buildings

Added another house and courtyard to building templates.
The templates now have a value for default height and width they set as they're chosen.
Hence the latest house can have a bigger height than width and the courtyard is much bigger.

You can now use the mousewheel in combination with a modifier key to alter the size of a building.
You need to have edit terrain selected ( like with rotating a building ).
Mousewheel scroll + Ctrl alters width
Mousewheel scroll + Shift alters height
Once you alter the size, the building will remain that size even if you change to a different template.
( This is necessary so when a saved design for a map is reloaded any altered sizes will be respected ).

Offline Dr D Ezra Sidran

  • Moderator
  • Hoplite
  • *****
  • Posts: 27
    • General Staff
Re: Changelog - picture heavy
« Reply #141 on: June 19, 2018, 10:21:26 AM »
I would just like to point out that that is an accurate Order of Battle Table for the Continental Army at Trenton and, yes, there really was a Colonel Sargent.

Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 254
Re: Changelog - picture heavy
« Reply #142 on: June 20, 2018, 02:40:20 AM »
Trees

There are now several different tree shapes.
Each tree randomly picks which shape it will be as it's created.

Change drop shadow to sepia ( was saddlebrown ).


Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 254
Re: Changelog - picture heavy
« Reply #143 on: June 20, 2018, 09:02:51 AM »
Buildings

Added 3 more building types.
You can use these separately of course but I built a church with these as an example of combining buildings.




Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 254
Re: Changelog - picture heavy
« Reply #144 on: June 21, 2018, 07:16:18 AM »
Terrain Visualiser

Added minimum and maximum elevation to the left of the terrain graph.
This is min and max for the whole maps for context - so you get an idea how whatever slice you're looking at fits in.

You now get a pink line above the part your mouse is over.
I considered adding some sort of a scale but that'd be very complicated because the user can pick whatever elevations they like.
I'm also not so sure about how useful that would be without a load of horizontal lines across the whole thing.
I may come back to that later but.... shelved until and unless I can think of a good way to do it.



The window tries to size itself to fit what you pick. If you pick a very long slice then the window could be quite wide.

My experimental map which has some terrain on it only has those three hill/cones on it.
This is with a map of the northern lake district.


And Isandlwana


A friend of mine has South African links and has visited the battefield on several occasions.
It's well looked after and pretty much as it was back in 1879.
Other than the things like the memorial, cairns, fence round the site and the car park.
I was surprised when he mentioned the car park.
There are now a couple of zulu villages nearby.

https://www.google.co.uk/maps/place/Isandlwana/@-28.3513158,30.6442408,14.93z/data=!4m5!3m4!1s0x1ef1bbc774f6dc39:0xf740fe2436bd3a34!8m2!3d-28.3586111!4d30.6513889!5m1!1e4



Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 254
Re: Changelog - picture heavy
« Reply #145 on: June 22, 2018, 02:36:08 AM »
Map Editor


Alter line width.
As the heading suggests, this is only applies to line types.  Even then it's probably then only really useful for rivers.

You alter the size using the scroll wheel when over a particular drawing option.
There is also a tooltip appears with a representation of the width.
The upper rectangle is what you'll get when drawing with a mouse ( this becomes 0.5 pressure ).
The lower rectangle is  the maximum width which you'll get at the widest if you click one of the widening buttons for a river ( 1 pressure).
In this picture you can see the tooltip and a few rather random bits of river I've scribbled just to prove you can do the different widths.
It works this way because you can set it prior to drawing and it's relatively quick to set rather than adding extra post processing via a context menu.
The tooltip only appears for line type drawing options.



Terrain Visualiser
When you drag the start "sight" you'll see the (X,Y) location appears as a user message.
This is intended for advanced user customisation scenarios and debugging.
As a sort of side effect, if you somehow got the two sights mixed up then moving the "end" one gives no message.

Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 254
Re: Changelog - picture heavy
« Reply #146 on: June 22, 2018, 06:46:35 AM »
Map Editor

Added support for custom resources.
This is a first cut at the moment.
This is a thing called a resource dictionary which is in plain text. You can edit it in notepad and it's then read at run time.
It's located in your user appdata / generalstaff/maps/CustomResources.xaml

Always find you want more?
Then this might be for you.
You can override many of the resources used within the map editor using this functionality.
What do resources do?
They define pictures, shapes, and colours used through the app.
Want a different background to woods?
You could do that.
The various building colours and shapes are all resources.

There is a teeny tiny catch in that you will probably need some help from me to know what to change.
I'll put guides together on how to do some stuff - eventually.

CustomCanvas
There is also a new layer - "CustomCanvas" which you can add anything you can define to.

Basic stuff is pretty simple once you get past the fact you're doing mark-up.

Say you want a star fort kind of a thing and of course there are no star fort buildings in the editor.
You could potentially "just" incorporate a picture in your background image in one way or another and go with that.
Maybe that doesn't suit though.

You find a suitable picture in a book or online and start with a picture.
You can then convert that to xaml using Inkscape. This is a little fiddly but not far from rocket science.
As a flavour:

You paste your picture into inkscape.
Choose trace bitmap.
Click the button and it generates vectors for you.
It just looks like another layer.
In this case I clicked the "simplify" button which loses a load of fiddly bits. Some of which you might have kind of wanted.
Drag that aside. delete the original layer and save as xaml.
Go grab the data from the path (or paths) in there and you can use that as a Geometry in the custom resource dictionary.
A geometry is a long string of co--ordinates which looks kind of weird but you're just cutting and pasting it.
The longest part of this process is likely to be finding a suitable image.
In my case I pasted in, surrounded that in a geometry tag and I could then use it




To get the above, I filled in some of the walls and erased some twiddly bits from an online picture.
I just used Paint for that step.
I wasn't terribly careful but the import process smooths bits out a little anyhow.
It will also probably lose some detail but maybe that doe

The custom dictionary has angle brackets in it, so I can't post the content.
It looks like:



The string in the geometry tags defines the shape of the fort. It is way bigger than that, I've substituted ... for most of it for clarity here.
The Canvas.Left and Canvas.Top define where the fort goes on the canvas - which fills the board.
If you want precision, you can use the measurements from the start terrain visualiser as described in the last post.

I intend processing paths using their "Tag" in order to apply terrain types to them.
Assuming I get that working, this would be a significant advantage to the approach.
Still probably not everyone's cup of tea but if you really really wanted a specific shaped fortification then you can do it.

Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 254
Re: Changelog - picture heavy
« Reply #147 on: June 24, 2018, 09:37:49 AM »
Map Editor

Custom Path tags
If you add a Tag which matches a terrain type to a path in your custom layer, this will be recognised as that terrain type.
Fortifications are "Fort" so if I add Tag="Fort" to the path I described above, this is then recognised as a fortification when the map is saved.



Note that this result is probably not ideal with that particular path because there are parts which are not fortification.
More work on the original picture would probably have been better.
You could alternatively use the path without a tag and trace over those specific bits you want in the map editor.
Or, you can split the thing into several vectors withing inkscape and use a number of paths rather than just the one.
Tag those parts which are defensive walls.

Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 254
Re: Changelog - picture heavy
« Reply #148 on: June 25, 2018, 05:24:21 AM »
Map Editor

Testing and neatening up the custom paths code.

Context menu on terrains.
You need to have the Edit Terrain tab selected.
A context menu opens when you right click something and hence with this you right click the background of a piece of terrain.
It must be the background - not one of the trees in a forest for example. A tree is a separate thing  - a child of that woods terrain.

There are three options.
Transparent - makes the "fill" of the terrain transparent so you just see the trees in a woods and a fine dashed line for the outline.
Remove Children - all the trees of a woods will disappear, similarly waves in a lake and swamp grass in a swamp.
Redo children - removes the ones you have and re-adds them. The process is random so it will be different every time you click redo.



Scenario Editor

Use the "new" open map window.

All Apps

Command line argument for full screen.
If you add -full after the run command on a shortcut to any of our apps, it will open full screen.

This is intended for low resolution monitors, where the app would open bigger than the monitor otherwise.

Began speed testing.
At this stage this is just a sort of reality-check to make sure things run and do so with acceptable performance on a low powered machine.
I'll put more detail in a separate thread.

Offline Andy ONeill

  • Moderator
  • Viking
  • *****
  • Posts: 254
Re: Changelog - picture heavy
« Reply #149 on: June 28, 2018, 02:28:37 AM »
All

Replaced the paper background. The new one is a "cleaner" looking picture.
The old one had blotches on it which tended to look like marks on my monitor.
This still new version has "texture", but less noticeable blotches.

Army Editor

Added "Walden" typography window.
Walden is the the supplier of the "Victorian" style fonts if you were wondering.


Started Accuracies

This is a multiplier which will be applied to effect for range.
Each unit has a 100 values, one per percentage range.
Hence range up to 1% would be the first value and that would be high and maybe 1.000.
The last entry is for very long range shots and almost always going to be very low - maybe 0.001.
There's a maximum 3 decimal places used.

You'll pick from a set of curves for this and or edit each value.
Obviously, editing a 100 values is a bit tedious and many weapon systems are pretty similar in effect.

For example, study after study shows the vast majority of regular riflemen perform extremely badly in battle.
Whether this is down to reluctance to kill, battle stress or whatever is still discussed amongst experts.
Differences between one rifle and another are far less significant than those between the people pulling the trigger.
But I digress.

It will be up to you, the users to interpret reality as you see fit.
We'll be giving you a set of curves but you can changed them.
You can set what values you want for your defaults and what values each unit has.

These curves are loaded from txt files.
Any located in the local appdata /GeneralStaff/Armies/Accuracies will be loaded to the combo box.
I'm going to write editors for these but you could just edit in notepad or paste in from excel.
The reverse is also true, so you could paste the data into an excel spreadsheet and graph it if you say wanted a giant print out of each.

At the moment, this is just preliminary test data and the curves are a bit wobbly.