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 / How do you create Risk and Dawn of War map.

Author
Message
Guardian
20
Years of Service
User Offline
Joined: 30th Sep 2003
Location:
Posted: 20th Mar 2008 16:51 Edited at: 20th Mar 2008 17:01
Hi, I was wondering how would someone go about creating a Risk or maybe dawn of war meta-map similar to Dark Crusader to be used in a game. I'm basically trying to create a world map, doesn't have to be round flat works to.
I thought of two ways of doing this. The first was using Sprites and sprite collision for detection. However, Since a sprite is a square and overlaps occur when you try to collide two with another sprite. Since you would be layering sprites over sprites, with the alpha's overlapping against none alpha's. Or using the point command to look for color, that works, however colors are not the best way of doing it. Lets face it, 100 colors for different land is mind boggling and doesn't look good.

The second idea was using 3d land, and using ray casting to deside which area you hit. However this meothod kills FPS especially on lower end machines.

My third choice was using co-ordinate system. But I don't know how to do irregular shapes, since box shapped doesn't look natural. I like the way risk maps are and Dawn of war, but I'm at a loss of how to do this. Can anyone help. Thx.
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 20th Mar 2008 23:56 Edited at: 21st Mar 2008 00:04
found THIS THREAD on the forums here, and THIS ARTICLE on GameDev.Net regarding Hex Maps.

Both should be quite helpfull (i think i'd start by looking at the GameDev article). I'd stick with arrays for tile detection; they'd work very similarly whether you choose 2D or 3D for your game. no need for "collision" or raycasting for the tile detection aspect.

good luck!

Virtual Nomad
AMD XP 1800+ (~1.6 Ghz) / 1.5 GB RAM
ATI Radeon 8700LE 128 MB / Windows XP
Guardian
20
Years of Service
User Offline
Joined: 30th Sep 2003
Location:
Posted: 24th Mar 2008 17:24
Thank you, however to use tiling like that, only works if the area your covering is a square and your using a keyboard for movement. The problem with irrelgar shapes and a mouse is that a mouse needs a set of defined area. I was thinking of using a invisiable color map, where each location would be a color. However the point command only returns the visiable color of that area, does any one have any idea of a work around for this concept.
Would show then hide before a sync work?.
Thx.
wildbill
18
Years of Service
User Offline
Joined: 14th Apr 2006
Location:
Posted: 24th Mar 2008 20:04
I use the extends plugin for this, specifically these commands.

MBC Make Memblock From Bitmap BitmapNumber
Pixel Color = MBC Get Pixel( Memblock Number, X, Y)

These work great. You could use your own memblock commands, but why when someone else hase done it for you.
Guardian
20
Years of Service
User Offline
Joined: 30th Sep 2003
Location:
Posted: 24th Mar 2008 21:40
thats true. Problem is extends cost $$$ and I'm using dbpro for protyping then moving the code to GDK. So I have to be able to do what I can to make sure I can port it over.
wildbill
18
Years of Service
User Offline
Joined: 14th Apr 2006
Location:
Posted: 24th Mar 2008 22:35 Edited at: 24th Mar 2008 22:35
Well I guess you have to decide what your time cost or what instant gratification is worth.

You are wrong about the point command only returning a visible color. You just have to write your routine for point checking to switch to the bitmap you need to check.

function CheckColor()
set current bitmap 1
check for the correct color
set current bitmap 0
endfunction

Login to post a reply

Server time is: 2024-09-27 12:22:07
Your offset time is: 2024-09-27 12:22:07