Archive

Archive for the ‘Map’ Category

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:

Layering a Hex grid on the World

September 9th, 2010 admin No comments

Here I will consider different methods of laying a hexgrid on a sphere. There are several reasons that you may want to do this:

a) To play a game on an existing system such as Google Earth
b) Regulate movement within your own game
c) To use as a system to import real maps into your own games.

Our planet is not a true sphere but for our puposes we will assume it and all other planets we encounter are regular spheres.

Using an Icosahedron
An Icosahedron is a 20 sided regular polygon, each face being an equilateral triangle. This shape will be familiar to wargamers that like to use 20 sided die.
This is not a perfect solution as the hexagons will not fit unless a pentagon is used at each apex of the Icosahedron.
The real advantage of this system is that you may use any scale that you choose, ie each of the 12 triangular sides within the Icosahedron may include as many hexagons as you wish, noting that the apex of each triangle will be a pentagon and not a hexagon.  For more detail search for Icosahedron Snyder or Geodesic.

This is not a solution if you want to zoom out to see an entire planet, as you will then see a flat sided planet. 

To Be Continued… 

 

Categories: Map, Mathmatical Theory Tags:

HexWorld AI started

May 27th, 2010 admin No comments

AI started, using Finite State Machine to control exploration and economic growth.
Multiple player AI added (currently 4).
Early transport animation added.
First 3D model added.
The AI is far more time consuming than i expected, but it was important to get the base AI engine working correctly before building on it.

Categories: AI, Demo Video, Map Tags:

3D Map with Border and Transport tiles

May 19th, 2010 admin No comments

The transport tile and borders tile positions are hard coded for test view.
A 3D building is added. Need to sort out the lighting / textures for the building.
Cursor added to indicate current selected hex.

Categories: Demo Video, Map Tags:

More 2D Tiles

May 18th, 2010 admin No comments

Alll these 2D tile sheets are quick and dirty to prove the concept. It will be easy to update each tile sheet later if required – and maybe by a better artist than me. :) (Hint to Amelia)

I want to create transport routes that allow the players to collect resources:

These tiles are also drawn on the hextiles, where a transport route exists.

We will also need to show borders and so will need a tile sheet to draw these.

Categories: Map Tags:

The first 2D Map

May 17th, 2010 admin No comments

The resulting map looks so:

Note that each tile is a 3D hexagonal object, onto which is placed a 2D texture from various tile sheets. Note that Im only using one of the hill terrain tiles and not the full set.

Looks OK in 2D, now to work on the 3D….

To Do: Animate the sea texture.

Categories: Development Screenshots, Map Tags:

The Map

May 16th, 2010 admin No comments

The map will be a hexagonal tiled map. There will be several layers for each tile.

Base tile layer:

 

I have created my hex tiles before any code.  As I want to zoom into a tile so that it fills the screen I will first try that each tile is 512 x 512. The tile sheets consist 32 tiles prroviding every combination allow the tiles to fit together to form a map.

Here are the tiles to be used for hills, which will drawn on top of base tile:

Here are the resource tiles:

I first tried creating a 3ds hexagon object and adding the base tile textures to the 3ds object. That worked, but I quickly realised that constructing my own object was easier.

Map size will initially be 100 x100 and tiles will be alligned on the horizontal.

Each tile is with a 512×512 pixel square, allowing a reasonable zoom in quality. Note that each tile is arranged on a 4×4 grid and so fits on a 2048 x 2048 pixel sheet. Its easy to reduce this tile resolution if moving a large number of large textures becomes too much of an overhead, but initial tests allow  a reasonable number(100 x100)  number of hexagons to be moved and textured. This may reduce when i start to need to draw multiple textures onto each hexagon.

 

Categories: Map Tags: