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 / is there a tutorial on how to learn to make a RTS / TBS strategy game

Author
Message
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 19th Jul 2008 23:04
ive read several tutorials inclduing phalanx' and they dont seem to work with version 6.9 =/
i dont care how long it takes to learn.
does anyone know where i can find some tutorials on this?

Creators of Outscape

http://forum.thegamecreators.com/?m=forum_view&t=132472&b=8
Destrugter 1
17
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 20th Jul 2008 22:36
Well well...it's been a while since I've been here, I've had quite a great amount of work on my hands. Glad to see you are still programming and didn't quit Outscape.

Let's just assume left mouse is select and right mouse is destination:

So, I'm not going to point you to a few tutorials, I will just offer the best knowledge I have of an RTS. Ok, so I'm pretty sure you've been coding this long, that you know how to load sprites and put them on the screen.

Ok, maybe make a variable for each sprite (make an array) and make it 1 if selected and 0 if not I guess, when let mouse button is clicked. Then grab the mousex() and mousey() coordinates when a right mouseclick is enforced, then just have your sprites move...let's say 5 px at a time until they get to the destination.

That's a very basic RTS, and a battle system shouldn't be too hard, just make the array hold Attack and Defense and when someone is attacking someone perform an algorithm (just make one up that you would think is fair to both players) and have the ending number be the amount of damage caused to the defender.

If you need more help, just post...I'm not guarenteeing I'll be on, so feel free to email me (you'll ensure a response considering I check my emails everytime I get on the computer). That's all I have for now, someone please correct me if I was wrong about anything I have mentioned, I do not want him/her learning from false information.
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 20th Jul 2008 23:03
i know bout sprites etc
ive been told 2d is harder than 3d tho

Creators of Outscape

http://forum.thegamecreators.com/?m=forum_view&t=132472&b=8
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 21st Jul 2008 00:03
Quote: "ive been told 2d is harder than 3d tho"


Maybe they meant a 2D isometric RTS. Those are hard

Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 21st Jul 2008 00:26
oh ok , had to wiki that =D
but the type you told me is realy TBS (which i dont mind for now)
so basicly i move the sprites around on a block map nd if an ally and enemy sprite collide then maths takes affect

Creators of Outscape

http://forum.thegamecreators.com/?m=forum_view&t=132472&b=8
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 21st Jul 2008 00:30
tbh if i get this collision thing working then i can prolly do it myself, thinking about it

Creators of Outscape

http://forum.thegamecreators.com/?m=forum_view&t=132472&b=8
Destrugter 1
17
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 21st Jul 2008 00:31
Well you don't want to do it like that. Most RTS's make it to where you actually have to select the option to perform on the target. For example, you would have to click on the target for an attack to take place. If you just based it on collision then you wouldn't be able to use the deeper, more better attacks and effects (depending on how big you want your RTS) like magic, ranged, and all of the other good stuff.

Now it's a little harder and requires a lot more media to enable the camera rotation, because then you need to be able to rotate around the sprites and stuff. Rotate sprite won't work because that just rotates the sprite, it doesn't give you a 3d effect...so I think you would have to draw every angle possible to see your sprite in to achieve this...again though it depends on how big you want your RTS.
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 21st Jul 2008 00:39
no i need them to stand on a matrix or somthing
and i cant use matrix' cos i dont know how
and i cant make an object cos it wont workses

Creators of Outscape

http://forum.thegamecreators.com/?m=forum_view&t=132472&b=8
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 21st Jul 2008 00:45
cos i could do like
archer#=0
and if they click on the archers
mabby
(not correct)
if sprite collision 1 and 2 (unit card)
then archer#=1
endif
then if it sint selected archer#=0

and if the collision with the enemy and archer#=1 then they attack

but i need them to stand on something before i start

Creators of Outscape

http://forum.thegamecreators.com/?m=forum_view&t=132472&b=8
Destrugter 1
17
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 21st Jul 2008 00:49
Here you go try this code out and see if it works.



That isn't my code, it's the code from (sry I can't remember your name right now) the rpg for beginners tutorial and I just slightly edited it (I was practicing 3d stuff).
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 21st Jul 2008 01:01
is there a command if the person clicks something?
i know there is if the mouse is a sprite

Creators of Outscape

http://forum.thegamecreators.com/?m=forum_view&t=132472&b=8
Destrugter 1
17
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 21st Jul 2008 01:05
Yes, mouseclick()=1 is left mouseclick, mouseclick()=2 is right mouseclick.
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 21st Jul 2008 01:13 Edited at: 21st Jul 2008 01:16
umm

it works so far =D

Creators of Outscape

http://forum.thegamecreators.com/?m=forum_view&t=132472&b=8
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 21st Jul 2008 01:17 Edited at: 21st Jul 2008 01:20
but i mean like
if the person clicks on that certain area, on that certain object
i have a problem it doesnt get the co-ords of the mouse correctly =/

Creators of Outscape

http://forum.thegamecreators.com/?m=forum_view&t=132472&b=8
Destrugter 1
17
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 21st Jul 2008 02:10
From what I've read so far in the forums, it has to do with your camera position that is affecting the x,y,z values. Here is a link to something someone made that sounds like what you are looking for...beware don't just copy and paste! Just use this code as a referrence and study it, change some values and see what makes it work, how it works, and why it works.
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 21st Jul 2008 02:34
link?

Creators of Outscape

http://forum.thegamecreators.com/?m=forum_view&t=132472&b=8
Destrugter 1
17
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 21st Jul 2008 03:33 Edited at: 21st Jul 2008 03:33
sry...that was stupid of me I did that post and checked out the program =P

http://forum.thegamecreators.com/?m=forum_view&t=11044&b=6
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 21st Jul 2008 17:19
i cant figure out how to add more stuff
like more spheres etc

Creators of Outscape

http://forum.thegamecreators.com/?m=forum_view&t=132472&b=8
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 21st Jul 2008 17:22
i think its better if i code it all myself
i just need to find out how to make the map and be able to use mouse co-ords corectly when adding blocks

Creators of Outscape

http://forum.thegamecreators.com/?m=forum_view&t=132472&b=8
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 21st Jul 2008 17:38
also what parts are the XYZ i get confused
cos i want to know which ones the floor (i think its the Z that controlls height) so i can keep it on the ground

Creators of Outscape

http://forum.thegamecreators.com/?m=forum_view&t=132472&b=8
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 21st Jul 2008 17:44
or add like sections where if they click it appears there

Creators of Outscape

http://forum.thegamecreators.com/?m=forum_view&t=132472&b=8
Moe
18
Years of Service
User Offline
Joined: 1st Apr 2006
Location: Sunny California
Posted: 22nd Jul 2008 07:16
You don't know the XYZ coordinate system?
Think about this.
Stand straight, staring straight ahead. Your left and right hands-that's the X axis - width

Now, up and down, this is the y axis - height

stare straight infront of you, this is the z axis - depth

Mind you Unlike your left and right hands, x,y, and z, are definite, not relative to your rotation



As for the script to get 3d coordinates?

null = make vector3(1)
null = make vector3(2)
null = make vector3(3)
null = make vector3(4)
set vector3 1, 0, -1, 0
pick screen mousex(), mousey(), 1
x# = get pick vector x()
y# = get pick vector y()
z# = get pick vector z()
set vector3 2, x#, y#, z#
angle# = acos(dot product vector3(2, 1))
cos_angle# = cos(angle#)
hypo_length# = camera_y / cos_angle#
normalize vector3 2, 2
scale vector3 2, 2, hypo_length#
set vector3 1, camera_x, camera_y, camera_z
add vector3 4, 1, 2
null = delete vector(1)
null = delete vector(2)
null = delete vector(3)


First, what happens is, the program makes four vectors to use, a vector is a 3d coordinate <x,y,z>

It sets vector 1 as a normalized vector pointing straight down.

Then it takes the 3d coordinates of the mouse. Technically it's not quite accurate, it takes the 3d position of the mouse, projected one unit into the screen.

Then it gets the three coordinates (x#,y#,z#)

then, it sets the second vector as those 3d coordinates <x#,y#,z#>

Then, It finds the angle of a line - if there were to be a line projected from vector 1 to vector 2 - by finding the arcossine of the dot product of the two vectors, read the tutorial "Vectors don't bite!" for a better explanation

Then, it takes that angle, and finds the cosine of it.
With this, you can find the length of the hypotenuse, from the camera, to a 2d plane at <0,0,0>

Now, it takes the normalized version of the second vector, and scales it by the length of the hypotenuse. After whitch it reuses vector 1, setting it to the x position of the camera, the y position of the camera, and the z position of the camera, and adds that to the scaled vector...

AAAAnd there you go, you have the 3d projection of the line onto a 2d plane. I dunno what to do if you want a 3d terrain though.... good luck

parrot
Outscape
16
Years of Service
User Offline
Joined: 23rd May 2008
Location:
Posted: 22nd Jul 2008 13:54
ill try that out thanks

Creators of Outscape

http://forum.thegamecreators.com/?m=forum_view&t=132472&b=8

Login to post a reply

Server time is: 2024-09-27 18:20:40
Your offset time is: 2024-09-27 18:20:40