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.

Code Snippets / RTS bare bone demo for DBP

Author
Message
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 20th Aug 2003 08:54
It has a few comments, but not many.

Features:
---------
unit selection
group hotkeys (ctrl + 1-9 to assign group number)
basic unit movement and animation



As I said, this is a bare bone of an engine. If you want to make your own RTS, you still have to do much of the work. Such as pathfinding, building and unit construction.

http://angelfire.com/80s/phaelax/rts-dbpro.zip
Red general
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: United Kingdom
Posted: 21st Aug 2003 18:34
This has the most accurate 3D rts mouseclicking/unit positioning I have ever seen (and I thought mine was good) - this is incredable, but several features of it seem to slow it down, I going to see if I can clean the code up to increase speed. Also add a few functions to it so that it can be easily used.

Otherwise this is a pretty incredable coding, and is the best attempt at a 3D rts in DBPRO that I have seen so far.


RED GENEREAL

My computer melts regulary - perhaps it likes being fondue
Fallen
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Portugal
Posted: 22nd Aug 2003 21:12
Nice code Phaelax !!! The best rts code I seen so far



--Project Fantasy-- WebsitE SooN
lcfcfan
21
Years of Service
User Offline
Joined: 19th Feb 2003
Location: North East, UK
Posted: 23rd Aug 2003 16:18
very nice code and fast too.

3dZmaster
21
Years of Service
User Offline
Joined: 30th Jun 2003
Location: Finland
Posted: 23rd Aug 2003 19:40
Unbeliavable.... =)

Current project: RPG game. It's 'bout time traveling.
Fallen
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Portugal
Posted: 27th Aug 2003 05:20
I dont know why... but the second time I executed the code the models turned invisible..I didn't make any change #) I already downloaded the file again and still the same problem #) strange..



--Project Fantasy-- WebsitE SooN
Hotwire
21
Years of Service
User Offline
Joined: 25th Aug 2003
Location: California
Posted: 28th Aug 2003 22:42
rock on dude! We should keep adding to this and then get a RTS making competition going on.
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 28th Aug 2003 22:54 Edited at: 29th Aug 2003 13:28
Hey,

Very good. I especially like the little display of which units are selected at the bottom

Isn't it funny we came across the samew idea for keeping units in formation while moving?

You may want to have a look at my rts in the beta forum.

Theres no place like 127.0.0.1
There are 10 people in this world, those who understand binary and those who don't
Bus station = where bus stops. Train station = where train stops. Workstation = ?
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th Aug 2003 07:57
thx, and david89 I'll take a look at it.
Red general
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: United Kingdom
Posted: 1st Sep 2003 12:39
still working on it - make be some time, but i will put up the coding when I am finished with all the nessecary rems

RED GENERAL

My computer melts regulary - perhaps it likes being fondue
Metamophic
21
Years of Service
User Offline
Joined: 23rd Aug 2003
Location:
Posted: 21st Sep 2003 03:37
Dude, those icons are from AOE II, aren't they?

www.freewebs.com/metamorphicsoft
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 21st Sep 2003 15:20
Yeah, just noticed they are.

c:/dos
c:/dos run
run dos run
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 22nd Sep 2003 11:04
hehe, yup! I was using that game as a reference sort of. Age of Kings is probably my favorite rts.
Metamophic
21
Years of Service
User Offline
Joined: 23rd Aug 2003
Location:
Posted: 22nd Sep 2003 17:43
mine too

www.freewebs.com/metamorphicsoft
FieldDoc
21
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 24th Sep 2003 00:10
This is excellent Phaelax! It's doing a lot to teach me about 3d camera positioning (and reminding me a little too much of maths )

I need a way of calculating which matrix tile has been selected as opposed to the exact location on the map. Whats the best way to alter your _Click_Matrix_Position subroutine to achieve this coz I don't think there's any way I could work it out for myself

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Sep 2003 02:11
I answered this in your other post, but I'll tell ya here as well. You don't need to edit the subroutine at all, just the results it gives.

if matrix tiles are say, 50x50 units, then:
x = matrix coordinates
z = matrix coordinates

tilex = x/50
tilez = z/50

that's assuming your first tile starts with number zero and not 1.
FieldDoc
21
Years of Service
User Offline
Joined: 30th May 2003
Location: London, UK
Posted: 24th Sep 2003 16:11
Thanks Phaelax,

What software did you use to create the units and their animations? I only ask as I need to make some and have no idea where to begin.

Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 25th Sep 2003 11:23
I got the models from DarkMatter.
PePO
21
Years of Service
User Offline
Joined: 24th Jul 2003
Location: Argentina - Salta
Posted: 25th Sep 2003 23:32
Thanks. I'am working on a city building game and it's a great guide for the control of armies.

Don't use a spoon to dig a hole!!!
M00NSHiNE
21
Years of Service
User Offline
Joined: 4th Aug 2003
Location: England, UK
Posted: 29th Sep 2003 23:35
Only thing missing is pathfinding, and it would be a mini game in its own right!

"It's amazin' what you can do with a computer and access to t'internet"
genius
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: Utah, USA
Posted: 27th Oct 2003 05:46
hey Phaelax, can I use your code? I'll include you in the credits! PLEASE!!!!
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th Oct 2003 06:44
thats what its there for.
genius
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: Utah, USA
Posted: 31st Oct 2003 02:22 Edited at: 31st Oct 2003 22:29
thnx, also, could I use some of your media?
ZomBfied
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location:
Posted: 2nd Nov 2003 09:10
the file is gone. I wanna see!
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd Nov 2003 10:13
file is still there, zombfied. And the models are from darkmatter. The interface I drew, I dont care what you do with that.
genius
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: Utah, USA
Posted: 3rd Nov 2003 04:07
Even the trees?
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 3rd Nov 2003 09:47 Edited at: 3rd Nov 2003 09:53
trees? hang on, lemme look at what I have posted here, its been awhile.


Ok, the tree was from a set of tree textures I found online awhile ago. Should be free as far as I know.
feiting
21
Years of Service
User Offline
Joined: 19th Oct 2003
Location:
Posted: 3rd Nov 2003 17:51
targetOffsetX#=object position x(OBJECT)-selectionCenterX#
targetOffsetZ#=object position z(OBJECT)-selectionCenterZ#

Rem those and add collision code for non-formations.

He who does not take the assassin job, will get killed by one who does.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 3rd Nov 2003 23:51
I planned on adding another function to create other formations, like in AOE. Useless I always thought, but figured I add it just because. Without adding collision, a simple yet crude way to rid of formations would be to add a small random value to the offsets. So the character would stop close to, but not exactly at the destination.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 8th Nov 2003 14:06
Phaelax, that code is a champion effort, how long'd it take to make?

Thanks for letting us use it...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 9th Nov 2003 08:50
Not too long really. Just working on a little bit each night, tweaking this and that. So maybe a week or so. Not really sure. My current version uses code from Dmitry to select/position units on a random terrain. A nice snippet he made indeed.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 9th Nov 2003 13:44
A week huh?... Cool.


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Northern Fist
21
Years of Service
User Offline
Joined: 23rd Sep 2003
Location:
Posted: 12th Nov 2003 03:37 Edited at: 12th Nov 2003 03:37
Wish is worked for DBClassic .

Could you make an .exe? please?

"Power, precision, and don't forget about speed. If you practice everyday with these things in mind... you begin to develope A FIGHTING MODE." - Fist of Legend (Jet Li)
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 12th Nov 2003 09:58 Edited at: 12th Nov 2003 11:27
this originally started as DBC. It figures someone would want classic after I did further development of it in Pro. It should work in classic with the only changes being the Types.



Current version with source and EXE. Arrow keys move camera; A,Z change camera angle; <CTRL> + number assigns group; Its compiled in 800x600x32.
http://www.angelfire.com/80s/phaelax/rts_demo_v06.zip
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 25th Nov 2003 17:52
Ok, here's a screenshot.


Slayer
21
Years of Service
User Offline
Joined: 15th Nov 2003
Location: CA
Posted: 25th Nov 2003 22:14 Edited at: 25th Nov 2003 22:23
very nice! this years compo is going to be a good one!
if youd like i saw your code and i could give you some
code to make your game a little better?
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 26th Nov 2003 15:08
Hey - unless you own DarkMATTER you cant distribute the models. So genius unless you own the product DarkMATTER it would be illegal for you to use the models from the RTS in game... (pretty sure..)

Phaelex: Pro snippet man! Looks great! Keep up the magnificent work! Best of luck with your competition entry

RPGamer


Dont forget to Join the Forums!
genius
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: Utah, USA
Posted: 27th Nov 2003 04:07 Edited at: 27th Nov 2003 04:10
I own Dark Matter and Dark Matter 2. I was just wondering if I could use the trees. Phealax: Too cool! I'm working on an RTS and I am at the point where I need pathfinding. It is a lot like AOE with the object creation but it takes place in this century.

Be happy, tomorrow is another day
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 27th Nov 2003 09:59
AOE is a great game. I play age of kings all the time. I prefer the Teutons myself. Those elite knights kick! Oh, and you guys killed the bandwidth on my angelfire server!
udoh
20
Years of Service
User Offline
Joined: 3rd Dec 2003
Location:
Posted: 3rd Dec 2003 21:54 Edited at: 3rd Dec 2003 21:56
Hi,

The screenshot looks great, wonderful work, can't wait to try it out...

Nice work Phaelax
Ian T
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Around
Posted: 4th Dec 2003 02:00
I'm a Korean guy-- free tower upgrades !

RTS looks great!

--Mouse: Famous (Avatarless) Fighting Furball

A very nice %it, indeed.
genius
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: Utah, USA
Posted: 4th Dec 2003 05:04
Hey Phaelax, can I use some bits and pieces of your new interface?

Be happy, tomorrow is another day
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 5th Dec 2003 05:10
Well, I guess so. But what's going to make your RTS look any different than mine?
genius
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: Utah, USA
Posted: 5th Dec 2003 06:29
Well, I just like those blue cubes and I really am not a good texturer. My interface design is AOE style, and I won't use the exact one.

Be happy, tomorrow is another day
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 6th Dec 2003 14:34
Here's one I drew awhile ago. It has a more AOE style to it. You can use this one if you want.

genius
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: Utah, USA
Posted: 9th Dec 2003 05:54
Well, my game is more in the present day (modern age - future)

Be happy, tomorrow is another day
genius
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: Utah, USA
Posted: 23rd Dec 2003 00:35
Hello? Hello? HELLO!!!! this forum has been quite for almost 2 weeks!!

Be happy, tomorrow is another day
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 23rd Dec 2003 05:34 Edited at: 23rd Dec 2003 05:36
The game is still moving. But no new visuals worthy of a screenshot yet. Pathfinding has been added. I guess once I tweak it a little bit more to make it smoother, I can post the new code.


Any ideas what I might add to a martian landscape so it doesn't look so plain?
genius
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: Utah, USA
Posted: 23rd Dec 2003 08:05 Edited at: 23rd Dec 2003 08:07
Make big hills and cliffs, not just a big open plain. Also, I just barely got pathfinding working!!!!!! It took me forever! My RTS is about 4300 lines so far!!!!!! I wrote a little pathfinding program using IanM's codebase. Instead of just having different little boxes, I made it with cubes on a matrix and implemented those into my game.

Here is my little 3D hyped up version of IanM's codeBase(I know everyone wants this):


By the way Phaelax, how did you work your pathfinding into yours? Also, to hype up your martian landscape, make buildings and build units from those buildings. By the way, is it okay for me to use your ghosted plain for selecting lots of units in my RTS? I think that is cool!

Be happy, tomorrow is another day
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 23rd Dec 2003 08:53
The way my game was already set up, it wasn't hard to add the pathfinding. I think I added maybe 10 lines of new code. When you click a destination spot, the units keep their formation. So most units aren't going to go exactly where you clicked. So an offset target position is assigned to each unit when you click to move them. When the target position was usually assigned, thats when I did the map search. Then when the units move, it moves to the next tile in the path. Once you reach the new tile, research the map, then move again to the next tile. Because you research the map all the time (cause its a dynamic map), you always move to the first tile in the returned path. Only one path was needed to be used for all the units.

Login to post a reply

Server time is: 2024-11-24 03:41:26
Your offset time is: 2024-11-24 03:41:26