Recent Posts

Pages: [1] 2 3 ... 10
1
General Staff Support Forum / Re: Changelog
« Last post by Andy ONeill on Yesterday at 12:59:09 PM »
Scenario Editor ( but will really only be used in the game ).

Replaced Pathing.
The original approach was a prototype but bugged, slow and could not be multi threaded.
It also only used very simplistic terrain efffects.

After trying several alternatives, Ezra gave me a bunch of links to investigate.
One of them eventually led to this library:
https://roy-t.nl/2017/08/01/A-Star-Pathfinding-nuget-package.html
There's a fair bit of code kicking around out there on the web that doesn't seem to work so well.
Roy's code does work and works with weightings.

It also works multi-threaded which will significantly improve user experience.

2
General Staff Support Forum / Re: Changelog
« Last post by Andy ONeill on February 23, 2018, 07:33:19 AM »
Scenario Editor

Refactor on place and points labels.
This improves the look, uses a more sophisticated approach for the objects.
Added mouseover effect on these which increases their z-index so they can be overlapped and still readable.
There's an anomaly in the way these were positioned, but this is cosmetic and can be resolved as part of the map designer work.

Now with rounded borders, a faded drop shadow and will respect the size of the text within.
With Victorian fonts:


With plain:
3
General Staff Support Forum / Re: Map editing ( opinion poll of sorts )
« Last post by Adraeth on February 23, 2018, 02:40:43 AM »
1. 3
2. 3
3. 1
4. 1
4
General Staff Support Forum / Re: Changelog
« Last post by Andy ONeill on February 22, 2018, 08:56:13 AM »
Scenario Editor

Investigating optimisation of pathing.
Pathing uses spatial A* and is a very expensive operation.
At the moment it's only used for couriers which will be an end of orders calculation.
Hence it doesn't really need to be super fast.
This is just as well because it can take a while.

I have this on a background thread and have experimented with multi threading the process.
The problem with that is it's no faster due to the expense of creating the necessary arrays per search.
I've neatened up the code but it's just on one thread.

5
General Staff Support Forum / Re: Map editing ( opinion poll of sorts )
« Last post by mirth on February 22, 2018, 04:32:49 AM »
Mine:

1. 1
2. 1
3. 3
4. 3
6
General Staff Support Forum / Re: Map editing ( opinion poll of sorts )
« Last post by bayonetbrant on February 22, 2018, 04:27:37 AM »
My answers, in order

1. 1
2. 2
3. 5
4. 1
7
General Staff Support Forum / Map editing ( opinion poll of sorts )
« Last post by Andy ONeill on February 22, 2018, 04:02:55 AM »
Hi guys,
What I'm interested in is what sort of a map editor user you are likely to be.

If you take a look at the changelog you'll notice I've done a bit of an experiment proving the practicality of including some extra functionality via an external application.
Essentially, you'd use InkScape to trace or draw stuff which could be incorporated in a map.
This is something which is fairly easy for me to enable and would get you functionality way beyond what will happen otherwise.

Here are my questions:

1) How enthusiastic a scenario designer are you likely to be?
On a scale of 0 to 5 where 0 is "Never - I will just use other people's or buy them" to 5 "Always - this is why I like General Staff".

2) How enthusiastic a map designer are you likely to be? ( Some people may want to re-use existing maps ).
On a scale of 0 to 5 where 0 is "Never - I will just use other people's or buy them" to 5 "Always - this is why I like General Staff".

3) How familiar with graphics design and such apps are you?
On a scale of 0 to 5 where 0 is "Not used one" to 5 "This is my job or hobby".

4) If it offers you flexibility, how likely are you to get down and dirty with xaml?
On a scale of 0 to 5 where 0 is "I'm never going to bother" to 5 "I already know it or I love learning stuff like that".
8
General Staff Support Forum / Re: Changelog
« Last post by Andy ONeill on February 22, 2018, 03:49:10 AM »
Map Editor

I've been looking into the work which needs doing on the Map Editor.
This is very much a prototype stages app.
Some work will see it stabilised, improved and sharing common code.
Short of dedicating my life, this is always going to be a relatively basic sort of a drawing tool.
I think also that drawing the map is by far the hardest part of scenario design.

Which got me thinking.

Some of you may of course be graphics designers so it'd be nice if you could use specialised software.
Others may want more sophisticated functionality but don't want to pay a couple of grand and spend 2 years learning how to use it.
Maybe some are like me - a developer but not so much of a designer.
Some others will be OK learning a little and doing some manual editing for something to work
Maybe some are even wpf designer/developers and already know XAML.

My plan is to try and include all these groups and offer more.
More is always good.

There's a free piece of software called InkScape.
This allows you to produce "vector" graphics by drawing or tracing.
I use it a fair bit for tracing stuff.
You can also convert graphics files to InkScape friendly format.
Once finished you can save the result as a .XAML file.

That can itself be edited and previewed in xamlpad or visual studio.
Xamplpad is a very lightweight self contained exe you just copy onto your machine, it's free.
You text edit in one pane and see the results in another.
Visual studio community is a pretty big install but also free.
I develop using visual studio.

As an experiment I modified the map designer so you can optionally load such a file.
I then fired up my copy of InkScape.
Because someone already expended some years working on InkScape there are a huge number of options available.
I picked a "pen", width and fill colour.
I then drew a wiggly blue line in inkscape.
When I drew this freehand it gives me totally smooth curves.
There's huge flexibility.
I could move, rotate or manipulate that little drawing in almost infinite ways.

I didn't bother with any of that because I'm just experimenting now.
I just saved my wiggly line as xaml.

This gives a bunch of stuff in a text file which I had to eyeball.
From that I picked the "Path" out of my saved file and put it in a canvas tag of a new .xaml file.
I did this in NotePad as a .txt file and then renamed to .xaml.

Ran my modified map editor and clicked the button.
The result was as expected and I get a line on top of my picture.
Because it's a control of sorts I can add some functionality to the map editor to work with it.

You might be thinking "If it's just about editing a picture then can't I just use a scan and be done with it?".
That'd be fine except the map isn't just a picture
Each pixel is a type of terrain - a field / road / woods etc.
Each pixel has an elevation.
With such a path I can write code works out which bits of the map it covers.
Allowing the user to say this area here is water.

Conclusion

This looks to be a good way to offer optional functionality for the power user.
Not everyone will want to bother but those that do will get a very powerful tool with huge flexibility.

9
General Staff Support Forum / Re: Changelog
« Last post by Andy ONeill on February 21, 2018, 05:10:32 AM »
ModelLib & Scenario Editor

There are several libraries ( dll ) which are intended to be used in the various exe.
One of these is ModelLib, the "model" in programming terms is the data being represented and this contains a class called Map. Which is (surprise) all about the map. This is where what terrain is where is stored and has methods to read that data.

In order to give orders to units we want the user to choose a unit and drag to a waypoint.
With a "rubber band" showing the line it would take. Just a line from start point to where you're dragging or moving the cursor.

This is gaming stuff ( I'm a business app developer ) so Ezra designs this sort of thing and knows about game specific things like working out what terrain a line crosses.

Maybe this is interesting to someone reading.
There's this thing called a Bresenham line algorithm https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm.
Which Ezra "just knows" about and explained is very fast.

I've been prototyping something to see whether this'll work or not.
I grabbed this guy's code:
http://ericw.ca/notes/bresenhams-line-algorithm-in-csharp.html
Which is nice and efficient, I particularly like the use of yield.

We don't have a game solution yet so I've temporarily bolted this onto scenario editor.
I needed 2 points. Somewhere to go from and to, so I used a retreat point as starting point.
Turns out that algorithm is very fast and takes less than a millisecond.
My machine has a fairly recent i5 processor so it's reasonably fast but I'm testing this in debug mode so which is slower than optimised code.




I'm using faked terrain checking with woods, water and swamp as invalid for anything.
On the top image you can see the line crosses woods and is an invalid move.
On the bottom image the line crosses nothing invalid and is OK.

You can also see some debug info I've put in top right.
I'm using a stopwatch to check performance and you can see the milliseconds and "ticks" elapsed. ms 0 means less than one ms which is fast.

Conclusion
The experiment shows excellent performance.
I'd expect even an old i3 and maybe atom would be fine with this.
10
General Staff Support Forum / Re: Changelog
« Last post by Andy ONeill on February 21, 2018, 03:09:56 AM »
Scenario Editor

Minor adjustments on menu items formatting
Changed piece size slider to use brass pointer template
Removed all allowdrop settings out the UI - dragging things round is now all using non standard approaches ( for performance) rather than "proper" drag drop.
Pages: [1] 2 3 ... 10