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

0 Members and 1 Guest are viewing this topic.

Offline Andy ONeill

  • Equites
  • ***
  • Posts: 157
Re: Changelog
« Reply #30 on: March 07, 2018, 06:21:28 AM »
Map Editing

Experimenting with drawing smoother lines in a separate solution just intended for this purpose.
To some success.
This would just be for "line" drawing such as rivers and roads.

If you take a look at some of the roads in images above you will notice there's a lot of jaggies going on.
This experimental method uses "ink". This is intended for purposes like drawing your signature for the postman. To smooth out drawings this tech uses some very tricky smoothing stuff with Bezier splines.




The above 2 pictures are crops of part of the window and the road/river is 5 px wide, so on my monitor they're magnified in the forum preview compared to the app running.
They're drawn as two lines on top of one another.
The dark wider one is "below" the lighter top one so it looks like an outlined shape.
We could allow selection of colours and width of both.

In an ideal world I'd write a more flexible algorithm, but that looks like it'd take way too long.




Offline Andy ONeill

  • Equites
  • ***
  • Posts: 157
Re: Changelog
« Reply #31 on: March 08, 2018, 03:24:04 AM »
Map Editor

More work on "line" structures.
The graphics you see on the screen are only part of the map story.
The game "knows" what terrain a unit is in based on a matrix ( a two dimensional array ).
That means once you draw something I have to work out what cells the shape covers so I can mark them as road or river ( forest / fields etc for other tools ).
Once you draw something it's shape is defined by a sort of series of points like join the dots.
With that fancy spline stuff, smoothed out shapes aren't just plain straight lines though.

My first attempt uses a sort of brute force hit testing around each of the points in the line.
Hit testing is quite an expensive action and there are thousands of such points.
The result is a bit slow really and I'm going to try plan B.


Offline Andy ONeill

  • Equites
  • ***
  • Posts: 157
Re: Changelog
« Reply #32 on: March 08, 2018, 09:42:51 AM »
Map Editor

New shiny improved way to find all the points inside a line.
This uses a different technique which is faster and can also be multi threaded.
Also worked out a couple of bugs in my code.
Still experimental but can be ported into the real app.
With a bit of neatening.



Offline Andy ONeill

  • Equites
  • ***
  • Posts: 157
Re: Changelog
« Reply #33 on: March 09, 2018, 10:00:13 AM »
Map Editor

Refactoring prototype drawing process towards production ready code.


Offline Andy ONeill

  • Equites
  • ***
  • Posts: 157
Re: Changelog
« Reply #34 on: March 10, 2018, 05:33:47 AM »
Map Editor Prototype

Many rivers aren't the same width along their length.
Today, I did a quick experiment with making a river widen from start to finish.
This seems pretty effective so I think I'll be adding this as an option.




Offline Andy ONeill

  • Equites
  • ***
  • Posts: 157
Re: Changelog
« Reply #35 on: March 19, 2018, 03:01:55 PM »
Scenario Editor

Fixed a minor bug with the place names display.
Changed pathing to take into account elevation changes. Climbing is harder except on a road. It's assumed a road takes best path going up and down hills.

Map Editor

I've done a fair bit of experimentation with stylus support for ink - this is definitely a good option and I'll be adding support for a stylus and "pressure".
I've also been iterating towards allowing the user to select terrain already drawn.
Using the prototype, you draw something and commit it. That's it.
My version will allow you to select objects you have drawn and delete or edit them.
There's only a load of code to show for this at the moment.

I've also done some investigation into storage options for the various pieces of map data.
This needs to be made secure for PBEM games in order to stop an opponent cheating.
It'd also be a good idea to drive down the size of files.
I'm thinking of zipping up and encrypting all the files into one.

Offline Andy ONeill

  • Equites
  • ***
  • Posts: 157
Re: Changelog
« Reply #36 on: March 20, 2018, 02:19:34 PM »
Map Editor

More work towards allowing you to switch between drawing modes.
You can now actually draw a forest and get it to appear.
Terrain objects are now numbered with an Id so the app knows which are what.
"Children" of these eg the trees which appear to go inside a forest are allocated this id so you can tell which trees are associated with a particular forest.

Prototyped a tabcontrol which allows you to arrow through it's tabs ( less intrusive than clicking tabs ) for the left panel.
Added the templates etc for this into the map editor.
Moved the existing drawing list into this.
Second tab which will allow you to pick a terrain object already on the map is as yet just a stub.

In the picture below, Drawing Options is the current tab.
Click the chevron to the right and it switches out to Edit Terrain


Offline Andy ONeill

  • Equites
  • ***
  • Posts: 157
Re: Changelog
« Reply #37 on: March 21, 2018, 05:55:03 AM »
Map Editor

First cut of the Edit Terrain tab.
In the screen shot you can see I've drawn a bunch of woods and the list to the left refers to these. The number is their ID and incremented as you add each terrain object.
Selecting one of these on the left gives the corresponding terrain on the map a "marching ants" animation. The dashes in the screen shot are moving in the real thing.


Online bayonetbrant

  • Chief Arrogance Mitigator
  • Administrator
  • Musketeer
  • *
  • Posts: 36600
  • Loitering With Intent
Re: Changelog
« Reply #38 on: March 21, 2018, 05:57:32 AM »
The marching ants effect is a nice suble way to suit what's selected
The key to surviving this site is to not say something which ends up as someone's tag line - Steelgrave

"their citizens (all of them counted as such) glorified their mythology of 'rights'...and lost track of their duties. No nation, so constituted, can endure." Robert Heinlein, Starship Troopers

Offline Andy ONeill

  • Equites
  • ***
  • Posts: 157
Re: Changelog
« Reply #39 on: March 21, 2018, 09:58:01 AM »
Thanks.
The marching ants idea was Ezra's. 
He thought it couldn't be done though  :D  ::)

It's obvious which one you're working with, but you can see the content and it doesn't cover other stuff impact image quality like eg a dropshadow would.

I was going to make the animation work in all "modes" but it's quite processor intensive and I want to keep the hardware threshold low. ( Within reason, functionality and time expended developing are also important ).

If the animation is running whilst you're drawing there's a noticeable gap between the pen and the ink appearing following it.
Ink offers smoothing which is huge for anyone isn't some sort of graphics ninja.
Presumably that smoothing is also quite processor intensive.

Rather than spend weeks optimising things nobody cares about, the simple fix is to just do the animation whilst in edit mode.
If you just drew a lake or woods then you know which one you just drew.
The effect is also a bit distracting so I think this is a plus all round.



Offline Andy ONeill

  • Equites
  • ***
  • Posts: 157
Re: Changelog
« Reply #40 on: March 21, 2018, 02:15:28 PM »
Map Editor

clipping canvas so you don't get weird stuff happening when you draw outside it's bounds.
I found it kind of funny the first time I drew a forest over half the options in the left tab but...

Choose a terrain in edit mode and hit the delete button. The terrain and any children (trees if it's a forest) are removed.

Stop user drawing unless they're in drawing mode

The outline of woods isn't as definite as I'd like.
Added very fine dotted line round them, which seems to work.

Reclassifying some of the drawing types and removing pluralisation

First iteration of drawing Lakes.

Offline Andy ONeill

  • Equites
  • ***
  • Posts: 157
Re: Changelog
« Reply #41 on: March 23, 2018, 01:19:00 PM »
Map Editing

Shook out some bugs and added waves to Lakes.


Offline Andy ONeill

  • Equites
  • ***
  • Posts: 157
Re: Changelog
« Reply #42 on: March 24, 2018, 10:50:48 AM »
Map Editor

Setting the colour of the ink you draw with depending on what terrain you've selected to draw.
Water is blue, for example.

Offline Andy ONeill

  • Equites
  • ***
  • Posts: 157
Re: Changelog
« Reply #43 on: March 25, 2018, 01:35:28 PM »
Map Editor

Added swamp.


Offline Andy ONeill

  • Equites
  • ***
  • Posts: 157
Re: Changelog
« Reply #44 on: March 26, 2018, 04:23:53 AM »
Map Editor

Added Fields.


The fill on these is randomised using the same mechanism as the woods background. I could potentially allow a user to customise the colours and frequency used for both.