Recent Posts

Pages: [1] 2 3 ... 10
General Staff Support Forum / Re: Changelog
« Last post by Andy ONeill on Yesterday at 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.

General Staff Support Forum / Re: Map editing ( opinion poll of sorts )
« Last post by mirth on Yesterday at 04:32:49 AM »

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

1. 1
2. 2
3. 5
4. 1
General Staff Support Forum / Map editing ( opinion poll of sorts )
« Last post by Andy ONeill on Yesterday at 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".
General Staff Support Forum / Re: Changelog
« Last post by Andy ONeill on Yesterday at 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.


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.

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
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:
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.

The experiment shows excellent performance.
I'd expect even an old i3 and maybe atom would be fine with this.
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.
General Staff Support Forum / Re: Changelog
« Last post by Andy ONeill on February 20, 2018, 12:10:02 PM »
Map Editor

Marching ants prototype.
This is a proof of concept animating dashes around a polygon.
General Staff Support Forum / Re: Changelog
« Last post by Andy ONeill on February 20, 2018, 09:23:47 AM »
Scenario Editor

Added Scaling of Pieces and Retreat Points.
There's a new slider in the preferences menu which you can drag. It goes from 20px to 80px, the default size is 35px. A px is a "device independent unit" and in theory 1/96 of an inch. Windows user settings alter that though.

The combination of Window resizing and Piece scaling should mean the game is usable on most sensible set ups.
At the risk of stating the obvious, there is only so much you can do on this.
Scaling units can make them bigger and they could then in theory overlap each other.
Bad things are likely to happen if you played a game like that.
In the below picture, I first reduced the size of the window down so it's pretty small.
That scales everything on the board down, which makes pieces tiny.
I then maxxed out the piece scaling.
The screen shot is just to kind of give you the idea, it's resized to 60% of size in case anyone cares about bandwidth.

General Staff Support Forum / Re: On screen resolution
« Last post by Andy ONeill on February 20, 2018, 09:09:55 AM »
I appreciate a lot of it will be very difficult to follow since it's about code you can't see on an app you can't really see. Yet.
But it's quicker for me to write that way.
At least Ezra ought to be able to follow it.
Pages: [1] 2 3 ... 10