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.

Dark GDK / RTS Example (Real Time Strategy)

Author
Message
dweeb
15
Years of Service
User Offline
Joined: 22nd Jun 2009
Location:
Posted: 23rd Jun 2009 01:01
Can anyone point me int the right direction for a basic Real Time Strategy example using Dark GDK and C++. I've found a few threads but all of them have broken links so I can't get any info.

Basic features I'm interested in are
unit movement
collision detection
unit selection

Thanks in advance.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 23rd Jun 2009 03:33
The page :

http://zimnox.com/dbcc/?page=tutorials

contains some tutorials about DBPro by Phaelax.

There is one specificall about RTS games, the original thread is in these forums if u do a search for "RTS"..

The code is in DarkBasic Pro, but its a very simple matter to translate it to C++ ..

About the only thing that cant be translated by sticking "db" infront of it are the UDT's (User Defined Types), variables and loops...

for UDT's you can either declare your own type with "typedef" or you can just use a struct or class, the variables are usually just a case of checking the scope that its in and making sure that where it is declared , it will be in scope for wherever it is called.

If it ain't broke.... DONT FIX IT !!!
dweeb
15
Years of Service
User Offline
Joined: 22nd Jun 2009
Location:
Posted: 28th Jun 2009 19:12
I've taken your advice and started working, but I've already run into a problem. I've built the terrain ... I've got the code to get a 3d mouse position. I select a position on the map to spawn a model but for some reason when I use dbLoadObject the camera immediately moves back to position 0,0,0 why is that??
dweeb
15
Years of Service
User Offline
Joined: 22nd Jun 2009
Location:
Posted: 28th Jun 2009 21:17
I figured it out, I have to use dbInstanceObject since the objects are being created within in a class I need to load the objects at the beginning of the program and out of the game loop using dbLoadObject then once I click the terrain and the vehicle class in created I then use dbInstanceObject on the loaded object. Seems to work fine, but does it make sence??
dweeb
15
Years of Service
User Offline
Joined: 22nd Jun 2009
Location:
Posted: 20th Jul 2009 06:07
I think i'm in the right direction.

Login to post a reply

Server time is: 2024-11-25 08:52:33
Your offset time is: 2024-11-25 08:52:33