Archive

Author Archive

Unit AI Finite State Machine

March 10th, 2012 admin No comments
Finite State Machine

Finite State Machine

This is the top level unit AI finite state machine. Square are states and diamonds are transients between states.

There initial state is IDLE. The combat unit will remain IDLE until an unexplored hex becomes detected, or an area needs to be patrolled.

The need to explore a hex could be determined by another combat unit already on another mission.

The need to patrol a hex is determined by lack of intelligence about a hex. Intel and Visible are different status for a hex.

The EXPLORE state is a higher priority than the PATROL state.

THE AI will ensure that only 1 combat unit is assigned to an EXPLORE or PATROL mission in a hex area. While in the EXPLORE state the combat unit will continue to explore unexplored hexs until either it comes into contavt with an enemy combat unit, ( <Enemy Unit Seen> transient to ATTACK UNIT) ,
or the combat unit discovers an Enemy Depot (<Enemy Depot Seen> transient to ATTACK ENEMY DEPOT>,
or the combat unit discovers a new Strategic Point (<Vacant Strategic Point Seen> transient to DEFEND STRATEGIC Point),
or unit is notified of a support request from another combat unit. <<Respond to Support Request> transient to SUPPORT ATTACK

 

 

 

 

Categories: AI Tags:

Order and Combat System Updated

January 31st, 2012 admin No comments


Minimap now shows limited detail. 3D clouds now implemented.

Shows order system.
Movement discs can be toggled to show movement cost to enter each hex or how many turns to reach hex.

Shows combat System
French Infantry unit has cut English supply.
English Cavalry is attacking French Infantry in rear (+1), and receives additional support from adjacent Infantry and ranged support from Artillery (indicated by yellow support discs)

Categories: Development Screenshots Tags:

Interlude

May 13th, 2011 admin No comments

My apologies for those that follow this blog, but I am currently busy with another aspect of 3D Visualisation at www.visualbuilding.co.uk. Hope to continue here in a month or 2.

Categories: Thinking aloud Tags:

XNA UK Usergroup

April 20th, 2011 admin No comments

A quick plug or the people at XNA UK Usergroup:  http://xna-uk.net/ . Great people, great information and examples.

Categories: Uncategorized, XNA 4 Tags:

D’Erlon’s Attack Climax

February 16th, 2011 admin No comments

Categories: Development Screenshots Tags:

D’Erlon’s Attack

February 7th, 2011 admin No comments

With a little optimisation I managed to improve the man / model ratio from 1:25 to 1/10, ie each model represents 1o men. Smoke and sound  from musket volleys added.

Napoleon Attacks Wellington’s Ridge

February 3rd, 2011 admin No comments

Progress Video

Unit scale is now 1 model = 25 men. Not sure I can handle the Prussians arriving en masse  unless a few French/British units die. Each unit is identified down to battalion level (500 – 1000 men).

Categories: Demo Video Tags:

The French Arrive

January 30th, 2011 admin 1 comment

British Infantry watch French Infantry approach.

In these screenshots, each model represents 25 troops, and the map. The troops are therefore not in scale to the terrain.

Categories: Development Screenshots Tags:

Aerial view of Waterloo Battlefield

January 27th, 2011 admin No comments

Waterloo   Minimap view showing troop positions, roads and trees at 1130.

Categories: Development Screenshots Tags:

3D Map Creation

January 25th, 2011 admin No comments

The various 3D battlefields were achieved as follows:

Create Heightmap

This can be achieved using several methods. For historic maps you have a choice of using old maps that could contain survey errors versus using modern maps that are accurate, but don’t account for any terrain changes. For example the Waterloo battle field was dramatically “sculptured” building the Lion Mound in 1826, and the more recent building of modern roads. When overlaid the old map contours are significantly different to modern map contours, but the essential shape is the same, and apart from the Lion Mound should not produce too many game map errors.  In the end I decided to use the contours from a modern map, making changes / allowances for obvious changes since 1812. I used old maps for details of woodland and roads. IAlthough this game will support multiple 18th / 19th century battlefields I will use the Waterloo map as an example. 

I traced out the contour detail and then assigned a greyscale value to each of the contour heights.

Although I started with a 2048 x 2048 pixel map, which covered an area   5Km x 5Km it was obvious that the resulting mesh would be to great (for the XBox). Also the mesh needed ony to cover the actual battlefield ans so I reduced this to 256 x 192. I used L3DT to smooth out my heightmap.

The terrain mesh  was to be created from the heightmap and so a Content Processor was required to create the mesh. I found an excellent example of such a mesh creator on XNA Creators and used that as the basis for my content processor. Heightmap data is saved allowing later lookup to allow other model placement on the map. 

I could have overcome the mesh size limit by creating several mesh objects (eg 4 or 6) and adding them together but I feared further later problems in the HLSL code required to handle several adjoining objects and so opted for a single mesh object. For larger battlefields I will revisit this option. The mesh creator allows me to change terrain characteristics such vertical and horizontal scales independently.

So my final map model represents an area 5.120 Km wide x 3.83 Km deep, which covers all the significant areas of the Waterloo battlefield. My game scale is 1 pixel = 1 m, and with the zero located in the centre of the battlefield my camera travels from -2560 to + 2560 in the width and -1915 to +1915 in the depth.

To be continued….

Create Tree Map

Create Road Map

The roadmap is a greyscale image (lowcost) that defines the road network. A gausian blur (radius 2) was applied to the roadmap.

Roads drawn on 4096 x 4096 panel with white background using pen size of 20 (main road) and 10 (minor road) , hardness: 9, step: 20.

Create Hex overlay

The hexgrid is simply a texture repeated over the terrain map and optionally merged in the terrain shader. The hex texture can also be smoothed using a gausian blur.

Create Unit Position Map

Categories: Map Tags: