Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Two wargame hex map questions...

Author
Message
Valliant
20
Years of Service
User Offline
Joined: 12th Mar 2004
Location: Redmond, Washington
Posted: 12th Mar 2004 11:29
Hello folks,

Total newbie here to DBC, though I've had some exposure to programming (mostly object oriented) and game development via my occupation.

The game I'd like to create is essensially a 2d hexgrid style war game and I think I've got a solid design; most of the problems I'm running against are when designing the architecture of the systems. Among the problems I've been thinking about are how to create the hexs and assign particular properties to the hex.

Initially I figured I'd just display the background with a hex-grid overlay. Then I decided to add a few more tactical choices by making the geography more complex. For example adding "high ground" and other terrain bonuses which allows a deeper variety of units as each unit could then have special abilities based on terrain.

For example: Hex Type = Forest 2, height = 3 would be a dense very high mountain forest area (obscuring the unit and providing bonuses when attacking down to lower elevation ajacent hexes that are charging, etc.).

So the first question is:
How the heck do I create a hex map? Is there where I need a tile editor? I'm not terrible original or learned when it comes to math but I can apply and modify examples if necessary.

The second question is more design related. Is it your opinion that it would be easier or "better" to create a suite of Hexs covering all the elevations and geographic features then use those as my "tiles" or is there away to make the Hex overlay take into account what is in the background image and change values as a result?

Is there a better/easier/faster way that someone has found to do that?

Thirdly:
Is the ability to create core, unique instanced objects easy in DBC? I've read some of the tutorials so I know that it can be done in a way with some core objects (boxes and squares and the like), but it's difficult to tell how easy that is with non-packaged objects.

Or in other words: create a single core "hex" object, then instantiate that object as needed and apply properties. I can see the same code being usable for units as well. For example: create a "horseman" object from the unit library, give it a unique game name like "Knight" with different attack and defensive values or traits above and beyond those of a typical horseman.

I hope I made sense there. Thanks in advance for any help!
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 12th Mar 2004 19:29
I'm a DBP guy, so I doubt that I can provide exact code. In DBP, the answer is to create arrays of user defined types. You can use this to maintain lists of hexes and units. No need to defined every hex and altitude since there is only one terrain/height value per hex. Altitude and terrain are just properties of that hex. If you do not have types, then you should go with multi-dimensional arrays and lists.
--
TAZ

PowerFang
20
Years of Service
User Offline
Joined: 6th Feb 2004
Location: Australia (But currently in the USA)
Posted: 12th Mar 2004 20:07
I'm about to start working on this type of game aswell. Pretty much i plan on making a map editor first that will:

1) place the tiles
2) make it easy to add variables to hex's suchs as height, movement rate and such like that

The variables will all be stored in arrays and will most probable be the size of the map:

Height(x,y)
Movement(x,y)
Terrain(x,y)
Units(x,y)

something along those lines. They will all be read in from files created by the map editor.

I rekon you need to either make tiles that cover every combination of height/terrain or you can have this setup

* Base terrain tiles that take up the whole hex (Grass,desert etc...)
* Object Terrain - they are objects with a transparent background so that you can place the house and it will still keep the terrain underneath it but change the propeties of the hex

This method i believe is better.
*
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 12th Mar 2004 20:35
Layers like that are also commonly used in 2D games to break up the map so it is not as boring. In some games, it is a feature as you tear up roads, bridges, and buildings with artillery fire.
--
TAZ

Login to post a reply

Server time is: 2024-09-22 00:31:40
Your offset time is: 2024-09-22 00:31:40