Previous Blog Next Blog
Prev/Next Blog
by date

Moving Objects that players can ride on!

Moving Objects that players can ride on!
Name:Ramen-sama
Date Posted:Jul 03, 2006
Rating:4.9 out of 5
Public:YES
Comments:YES
RSS Feed:GarageGames Blog feedor Subscribe with .
Profile Page:View profile page for Ramen-sama

Blog post
I've spent a good week or more trying to come up with a feasible method for a player to "ride" on a platform, elevator, spaceship.. whatever.

And i've finally got something that seems to work. Currently the players are able to dynamically attach to pathshape objects. which can then wisk them around the world. But this is going to be expanding so players can ride in/on ships, flying castles, whatever. it's not gonna matter :) It's a little different then "mounting" As the player still retains his movement and collision abilities, so they can jump off whenever they want. Also they'll be able to jump from one moving object to another.

Soon i'll be expanding this resource to do more attachment to player objects as well. that's already been implemented, but isn't in this code release. Currently that's not too incredibly useful... or is it? if you say attach a crate to a player object...... the player can then push the crate or something, or maybe other things to that effect.

How is this different from this "Pathed Interior" resource? well you don't have to use DIF for one.
You can attach yourself to a animated, flying bird for example... you can be inside an animated DTS that's flying thru space. Really it's up to your imagination.


Here's a little path around the lake for our "hero" to traverse on his flying square


Riding the wind!



Ditto!




SO to prove it. here's a video :P

ramensama.dyndns.org:8000/temp/stronghold.avi
It's 2.09 megs. enjoy and please post some comments.


OK, please go to this thread to download the code::

www.garagegames.com/mg/forums/result.thread.php?qt=47074

Recent Blog Posts
List:02/22/08 - Dynamic Attachment Update - Animated Environments
01/06/08 - Dynamic Attachment to objects
01/03/08 - 3D Painting with Modo
12/25/07 - A* Pathfinding stuffs
02/14/07 - More Platforms, works in 1.5
01/28/07 - Platforms Players can Ride Version 1.1
09/20/06 - Kork's Journey into Lightwave 3D
08/09/06 - More Lightwave stuff.

Submit ResourceSubmit your own resources!

Stefan Lundmark   (Jul 03, 2006 at 09:51 GMT)   Resource Rating: 5
Just wanted to say I'm very impressed and that I know many will appreciate your efforts.

Phil Carlisle   (Jul 03, 2006 at 10:03 GMT)
Is it networked Ramen?

Nice work anyway.. should give some fun ideas a chance.

Ramen-sama   (Jul 03, 2006 at 10:05 GMT)
I'm not sure if it's networked. It's updating both client side and server side... i think :p

I'm not really sure about networking and all but it seems to work... i'll pass out my code later for you vultures to test over a networked environment.

Stefan Beffy Moises   (Jul 03, 2006 at 10:10 GMT)
Glad you've improved my PathShape resource... that's something I've always wanted to do and never found the time for - great work! :)

Robert Russell   (Jul 03, 2006 at 10:37 GMT)   Resource Rating: 4
Thanks for doing work on this and hopefully releasing it to the community, I hardly get any time to work on my demo anymore apart from the artwork so this will come in handy - thanks again.
This will go perfect with my single person dropships.


-Wob

Canon   (Jul 03, 2006 at 12:26 GMT)   Resource Rating: 5
Let's go for plateform games!!!
Thank you Ramen!

Christophe
www.frogames.net

Johnny Hill   (Jul 03, 2006 at 17:58 GMT)
Great, resource!. Thinking of creating a tranportation system in-game. Like a mono-rail or train system. that runs on regular intervals. The one example that comes to mind is the Deeprun train in warcraft. A large moving platform that moves back and forth between stops.

But a nice one would be like the flying ships in FF-online, you can build the ships as complex DTS shape. I got a roughed-out one sitting on my HD. Once again great resource Ramen!

Aaron Ellis   (Jul 03, 2006 at 18:43 GMT)
@Ramen

Let me say how cool this is. You deserve a big thank you!

@Phil

About your networking question. I just tested it out on a less than optimal connection and it works great. Everything was smooth as silk with one player on the platform. It even worked with two players on the same platform . . . however, with two players riding the same shape, I did notice a small player rotation hiccup (in the 'Z').

Of course, that could have been caused by my testing setup. Since I'm at home instead of the office, I had to do this using two instances of the same app on my laptop (one host/one guest) -- all over a 56k modem connection (to the GG testing master server). I'm truly surprised how well everything worked together.

The fact that the code slid comfortably into my heavily modified engine is just icing on the cake.

Alan Hembra   (Jul 03, 2006 at 19:01 GMT)
This is cool. It would be great for a subway car or train cars.

Ramen-sama   (Jul 03, 2006 at 21:45 GMT)
Glad everyone likes this. My next step it to do some more fixes, specifically where the players render position is updated. Currently it's just updating the position, and not rotation. now that i know this is posible, i'll rewrite that section so the player rotates along with the object.

NewYork Virtual   (Jul 04, 2006 at 03:35 GMT)
Just saw the video, cool ! will try this code soon.

Surge   (Jul 04, 2006 at 11:53 GMT)
Yes Ramen,

Im soooo happy you did this, thanks for finding the thread way back when and doing something about it.
I cant wait to try out your code.

Now I can stop filling the forums with crazy ideas for an elevator and use this one that works.

-Surge
Edited on Jul 04, 2006 12:11 GMT

Ramen-sama   (Jul 04, 2006 at 21:22 GMT)
Everyone, my zip was updated to support platform rotation affecting players! nice addition. Check out the updated zip file.

Surge   (Jul 05, 2006 at 01:25 GMT)
This works really well, great job!!!!
Compiled and tested - works like a charm.

Tom Bentz   (Jul 05, 2006 at 18:08 GMT)
This is very cool!

Tim Muenstermann   (Jul 16, 2006 at 21:02 GMT)
Great Stuff!!! Hmmmm...... Capital Space Ships.... ;)

Pisal Setthawong   (Sep 18, 2006 at 16:11 GMT)
I was working on a similar project when I just noticed this code. Great work and thanks for the ideas :)

Juha Eerola   (Oct 11, 2006 at 07:21 GMT)
Does this work with both filetypes? (dif & dts)

Ramen-sama   (Oct 12, 2006 at 04:28 GMT)
No. This is only for supported filetypes of the pathshape class. Which currently is DTS only.

Saska   (Oct 14, 2006 at 16:36 GMT)   Resource Rating: 5
@Ramen somehow when i copied your code to the correct places and everything, i spawn in the dock "correct"

then i see the path in mission editor "correct" but i dont see the platform "WRONG" and when i try put it there through the mission editor it looks like a tiny shape tinier then the player :S "WRONG???" and it doesnt move anywhere

answers?

Ramen-sama   (Oct 14, 2006 at 20:11 GMT)
Hmmm well i'm not sure. the zip i made was designed to just simply be extracted from the archive replacing existing files on a stock 1.4 torque codebase. Is this what you have done?

Saska   (Oct 15, 2006 at 07:01 GMT)   Resource Rating: 5
yes i extracted the files to C:\Torque\sdk

Saska   (Oct 15, 2006 at 07:02 GMT)   Resource Rating: 5
i saw that someone named casey had the same problem but i deleted the dsos and nothing. i even reinstalled the whole thing

Roshan Kuriyan   (Dec 14, 2006 at 08:46 GMT)
i am a tse owner . i can not access the code link. so pls let me know this.
how to create a pathed object ,is your pathed object a static shape item class.or a pathedcamera class or a pathshape class.

Balu   (Jan 20, 2007 at 09:44 GMT)
Anyone also has the problem that the platform starts jumping after one round and on the third round even drops the player?

Ramen-sama   (Jan 27, 2007 at 03:12 GMT)
@ Saska

you did recompile the torque engine right?

Balu   (Jan 27, 2007 at 04:58 GMT)
Well, I recompiled it with out error, yes. Is not a big deal, is it? Just throw in the changed files, add the two additional files to the project and compile it! To be sure, I cleaned all up and compiled everything new and I also deleted all dso files. I was doing it on a freshly installed Torque 1.4, not 1.4.2 though.

Ramen-sama   (Jan 27, 2007 at 05:00 GMT)
Do you have an instant messaging program? perhaps you can contact me on AIM or Yahoo!, perhaps i can help figure out the issue then.

Balu   (Jan 27, 2007 at 06:36 GMT)
no, sorry, all I use sometimes is IRC...
Maybe I can send you a recording? Will that be useful?

Ramen-sama   (Jan 27, 2007 at 06:41 GMT)
Yes. a video would help me to understand. Perhaps you can e-mail it to me?

Ramen-sama   (Jan 27, 2007 at 07:42 GMT)
Ok, i've determined the issue.

if you look at pathshape.cs

function LoopingShape::onCollision(%this,%obj,%col){

%obj.followpath(Path);

}



for that line. i added in an error...



error("A collsion with a loopingshape has occurred");






i noticed that when the glitch occurs, it's cause there was a collision detected. the "collision" with the pathshape is what is triggering the pathshape to follow a path. So when the pathshape restarts it's loop, it's position/rotation is changing slightly, and a collision is being detected. an easy fix would be some sanity checking. Add a variable or something to the player or the pathshape to let it know it's moving, and doesn't need to be restarted.



I'll work on adding some callbacks or something to query the status of the pathshape.....

You must be a member and be logged in to either append comments or rate this resource.