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 / 3d space game like homeworld

Author
Message
Lord Einstein
18
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 29th Jul 2006 15:39
I've been trying to program a 3d space game like homeworld and I have a few questions.

I have a movement system simular to the homeworlds one but I can't get the ships to move very realisticly at the moment. I have them just pointing at the target and moving as you do in most RTS's but it doesn't seam to cope to well in 3D space. When you move a ship diagonaly it rolls over to it's side and slides across space which looks very strange.

I'm also unsure how to get the ships to rotate slowly instead of jumpingto the angles needed.

I would also like to have it so there are trails left by the ships but thats not really very important at the moment.

By the way I'm using DBC.
Opposing force
19
Years of Service
User Offline
Joined: 10th Aug 2005
Location: England
Posted: 29th Jul 2006 16:49
Quote: "I'm also unsure how to get the ships to rotate slowly instead of jumpingto the angles needed."



Use the wrapvalue command...

(store the object's angle in the variable objecty#)
objecty# = Object angle Y(your object number)


(to rotate the object round its y axis clockwise)

Yrotate object your object number,Wrapvalue(objecty#+5)

(anti-clockwise)

Yrotate object your object number,Wrapvalue(objecty#-5)



the 5 is like the speed of the rotation of the object. The higher the value the faster the rotation. Hope this helps.

visit http://teammegabasic.proboards59.com. Register and expand our community. Registration is free and only takes a minute.
Lord Einstein
18
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 30th Jul 2006 10:46
that only seams to help the y angle for the ship still turns strangely to go up of down
geecee3
20
Years of Service
User Offline
Joined: 25th Feb 2004
Location: edinburgh.scotland.
Posted: 30th Jul 2006 15:59
try using the pitch, roll and turn commands to orient your objects in 3d space. you can always get the angle of the object easily if you need that info for some other calculation, you can also do the same for the objects position in 3d space, If you use the point object command you will end up with some odd rotations especially if you point at an object thats directly below the point you are looking from, this can cause the camera to rotate, someone obviously thought that the X and Z axis would represent the ground plain in every scenario. Basically point object will always try to keep the camera view the correct way up, which sucks a bit for certain 'free movement' based systems.

there is a plugin called EZ rotate that might help you in this scenario.

cheers, Grant.

Ohd Chinese Ploverb say : Wise Eskimo, not eat yerrow snow.
Lord Einstein
18
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 2nd Aug 2006 00:36
where can I find this plugin and how do I use it?
Im still here
18
Years of Service
User Offline
Joined: 11th May 2006
Location: :noitacoL
Posted: 2nd Aug 2006 01:01
Quote: "I'm also unsure how to get the ships to rotate slowly instead of jumpingto the angles needed."


Another way to slowly change the value is to use curvevalue



The higher the third value is, the slower the curve is. The only thing is that it slows down towards the end.
Lord Einstein
18
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 2nd Aug 2006 19:42
that works really well. Ty. My ships get the desired angle by pointing them at the destination and saving that angle before rotatign back to normal. I don't see how I can do this with pitch because doing it with x-z controls makes it turn out strange.
Lord Einstein
18
Years of Service
User Offline
Joined: 22nd Oct 2005
Location: Well here, of course...
Posted: 5th Aug 2006 23:13
Ok. After ages of tryign new things I eventurly came to a very realistic ship movement system:

point object t,units#(t,3),units#(t,4),units#(t,5)
units#(t,9)=object angle y(t)
units#(t,10)=curveangle(units#(t,10),units#(t,9),1.02)
oldx#=object position x(t)
position object t,units#(t,3),object position y(t),object position z(t)
point object t,units#(t,3),units#(t,4),units#(t,5)
units#(t,7)=object angle x(t)+1
position object t,oldx#,object position y(t),object position z(t)
rotate object t,0,0,0
units#(t,8)=curveangle(units#(t,8),units#(t,7),1.02)
turn object right t,units#(t,10)
pitch object down t,units#(t,8)
move object t,+1

What do you think?

Login to post a reply

Server time is: 2024-09-25 05:31:03
Your offset time is: 2024-09-25 05:31:03