Game Development Community

Running uphill .... but on the flat

by Harvey Greensall · in Torque Game Engine · 05/07/2007 (5:12 am) · 7 replies

Hi all, anybody know how I can get the same effect as running up and down a gradient, but while you're on flat ground?

I'm trying to get some levels to have the effect of a big magnet, or a strong wind accross the entire level, so a force is constantly applied horizontally accross the level. It would have the exact same effect of the entire level being on a slope, but I'm not sure if it's possible to do this easily.

Anyone got any ideas? It would really help me out.

#1
05/07/2007 (5:17 am)
Two quick ideas:

1) Use a physical zone (available from the mission editor).

2) Apply a greater mass to the player when you want the effect to kick in.
#2
05/07/2007 (5:20 am)
Hi Harvey - hows your game coming along?

Have you looked into dragCoefficient, windCoefficient and gravityCoefficient? Used for particles, but could be the direction you are looking for the effect and maybe vectorDistance(player.getPosition(), magnet.getPosition());


Julian
Something2Play
#3
05/08/2007 (5:29 am)
Cheers guys,

@ Tim, So, do you think it's okay for me to have a physical zone accross an entire level? Do you think this will be an expensive process? I wouldn't need it to kick in, I'd want it the entire time. We've got a pirate ship game, and we want it to be harder to sail against the wind than with it is all. We don't want true wind as we want to keep the arcade style we've got, but an advantage to be sailing in the direction of the wind would be a nice addition to gameplay.

@ Julian, VERY Slowly but surely, man the first 95% was real fun, but this last 5% has taken over a year so far... 8)... The studios running on fumes. We're getting there though........"almost there...stay on target.....almost there".....That also sounds like it could be the way we need to go too, although something that just drops straight in with no programmer support at all is what we really need. It's why this last 5% is so hard.

Cheers Guys, I'll look into it

H
#4
05/08/2007 (5:34 am)
Add a variable containing the wind vector and strength for each mission/level, then as the player velocity vector approach the same as the wind vector you could add the wind strength to the player, and vice versa (subtract) when the vector is approaching opposite? Shouldn't be too hard.? And could be changed on the fly as well... Nasty winds, changing direction all the time ;)
#5
05/10/2007 (10:31 am)
It seems like the easiest way to do what you want would be to go to Player::updateMove, and just add your wind vector after everything else is done. Wouldn't have to deal with physical zones or anything if you just want it to affect the entire level.
#6
05/10/2007 (1:56 pm)
And as I said, adding that vector value to a variable you can keep in the mission file for each level... easy.
#7
05/11/2007 (1:02 am)
Well, sounds good in theory, I'll have to get it on the list when we get our next chunk of code freelance work sorted ( as I'm an artist, so although I have a basic understanding adding variables to mission files etc is a bit above my expertise ). Unless it's crazily easy and you guys can give me a bit more of a hint of how this is done. Cheers though, I'll cetainly make sure we look into getting this in, it'll really help our gameplay. Actually I could look around the forums this weekend and try to get my head around wind vectors etc. see if I can come up with something...

Thanks again all. H.