Game Development Community

Moving around INSIDE vehicles?

by John Vanderbeck · in Torque Game Engine · 01/13/2004 (3:54 pm) · 67 replies

Ok bear with me as this might be hard to explain. Heck the topic doesn't even probably make sense so thanks for taking a look :p

I've never to my knowledge seen this done. It would be extremely difficult even in my own engine, so doing it in Torque is beyond me as i'm still learning the ins and outs.

What we need to do is have very large vehicles which allow players to move around inside them. As an example, take a submarine. The submarine is a vehicle which moves around the map under the control of one or more players. In the normal sense for torque these players would be mounted into the vehicle. This is traditional for vehicles. Heres where it gets tricky. Instead of mounting players into the vehicle, I need them to be able to move around inside the vehicle (or on top of EG an aircraft carrier) just as if they were moving around on the map. Imagine for example standing on the deck of an aircraft carrier. You are on the vehicle, and the vehicle is moving ikn relation to the map. You are also free to move around on the vehicle though. Fights will take place inside and on these larger vehicles.

Does that make sense? If so this is probably the point where i'm told i'm crazy and its impossible. Unfortunately that word isn't what I want to hear :) I'm not asking anyone to write this for me, but point me in the right direction. The lack of documentation for Torque makes it very difficult to do anything that is outside the scope of "hacking tribes 2".
Page «Previous 1 2 3 4 Last »
#1
01/13/2004 (4:07 pm)
John,

You could create an illusion of the shape moving whilst players are inside via having the static non-moving interior placed in a remote part of the map, whilst the sub is a large .dts with, say, a portal of some sorts(which you would likely have to code in yourself) attatched to it so that players effectively see inside the sub, though when they go in, they are not really *IN* the actual submarine.

However it should be possible to do what your thinking (even via the previous method). You need to somehow make the player *stick* to the .dts....

If you want to use an interior instead, you could use the Pathed interior stuff(never tried myself), though lighting on interiors doesn't really take into account movement, and of course, the actual ship will be static (unless you add .dts's of moving parts) :)
#2
01/13/2004 (4:12 pm)
Yeah I thought about the illusion aspect, but that won't work for things like the aircraft carrier where the players would be on the deck. I don't see how to maintain the illusion in that type of situation. Players on the ship would have to be able to see the map around them (Render-to-texture Skybox maybe?) and players on the mapitself would have to be able to see the players on the aircraft carrier deck moving past them. That last part is the kicker. I can't find a way to make that work as an illusion. I'm all for doing it as an illusion if I can find a way to make it look right. I'll agree the illusion is the best way performance wise to do it.

In theory all I have to do is make sure the players movement is in relation to the vehicles movement. Theory breaks down when you add in network issues. I still remember the days of old EverQuest ships and players warping all over the place and falling off. They never made those things work and I don't envy having to try it myself.
#3
01/13/2004 (5:11 pm)
Just a thought here. I was importing large vehicle models into Torque and hopping on top of them no problem. Now if the vehicle started moving would I move with it, or would I slide right off?? Has anyone even tried making and using models in which you can move around in Torque, or is everyone just assuming that you have to do some coding, or is the assumption based in facts from digging around in the code or experiminting in-engine? When I hopped on the above mentioned vehicle I was under the impression that I would either 1). Slide off it or 2). Not be able to get onto it.
#4
01/13/2004 (5:57 pm)
Okay, I haven't looked at the vehicle code in a long, long time or much of the Torque code in a while (unfortunately). But here's a few ideas that I can throw out at you. Don't know if anything I say here will work, but hey. I'm here to toss a couple of ideas out.

The collision boxes as written will probably cause some problems in large vehicles so they would have to be completely redone. Perhaps using polygon detection instead would help, though cause a higher overhead. So binding interiors and models would be a better solution.

Instead, think of a way to bind interiors to a model for movement and control. That way you could create the base interir for the carrier and bind it to a control room for movement control.

That way you can have a player controlling where the ship is going by binding them to the seat in the control room and mapping the entire interior for movement across the map.

This could allow for boardable trains and airships and all kinds of strange flying/diving/driving interiors. It may cause all kinds of strange problems with lighting and the like, though. I don't know.

Considering the problems people have been having getting doors to work, I'm probably WAY off base thinking about how this will work.

I really shouldn't watch sci-fi while writing.
#5
01/13/2004 (6:42 pm)
I would suggest doing it with a hacked version of the interior code. MarbleBlast demonstrated that you can have very stable physics in Torque on moving platforms.

You're probably going to have to break away from Torque's existing vehicle paradigms to get this to work properly.
#6
01/14/2004 (4:38 am)
So let me just paraphrase all this so I can be sure I understand whats being suggested.

Essentially I need to modify the interior code so that it can be moved around per user control (either directly or indirectly..most likely indirectly). I'll need to get a much better understanding of the way interiors are handled in Torque to do this, as I must admit it sounds a little weird. What do the interios use for PVS/collision? BSP? Portals? Moving them around is going to require recomputing all of that I guess. Is that something that can be done realtime?

How does this concept of moving INTERIORS deal with the problem of someone standing on TOP of a vehicle in the open? Such as a player moving around on the deck of an aircraft carrier?

Quote:
This could allow for boardable trains and airships and all kinds of strange flying/diving/driving interiors.

Pretty much what our design calls for. Except both interiors and exteriors :)
#7
01/14/2004 (4:57 am)
I would make a new shape type (based off of vehicle, like wheeled vehicle), then you could modify Player to do a raycast down each tick and see if theyre on a vehicle, if they are then maybe add them to a linked list in the vehicle class, then when the vehicle moves, it can move all the Players associated with it (and give them its velocity)... Of course, its a bit more compilcated than that... theres networking stuff to worry about and also dts collision meshes cant be too complex (from what I know). Actually, it would be a LOT of work.
Its a start though.
#8
01/15/2004 (4:04 am)
Actually I think I might know a way around the network ramifications. Check me on this.

Let's say we have a modified vehicle, or shapebase depending on where I end up needing to go. While we still allow players to move about freely inside the vehicle, we force them to "ent6er/exit" the vehicle in an established way. In other words they can't just "jump" onto the vehicle and crawl around on it. There is a controlled method of entering and exitting the vehicle. Essentially they would go to a spot on the vehicle that lets then ebter or exit and then they would mount the vehicle. In this case the mounting simply gets them inside the vehicle, where then can then move around. the mounting notifies the vehicle that the player is either entering or leaving it, allowing the vehicle to track "occupants" without having to raycast each player in its area.

Now given this system, unless i'm missing something, the only thing we really need to send down thwe wire extra is the mounting and unmounting. We need to notify clients that a player has entered or exited a vehicle. Once we've done that, the client can then do the rest of the work locally. It already will receive the player movements and the vehicle movements.
#9
01/15/2004 (10:12 am)
@John - I wouldn't include the visbility stuff that interiors use. Just reuse their collision code (because it perfectly matches the geometry) and rendering code (because... well... then you can see them). Stuff that in a Vehicle derivative. Get your physics tweaked so that players stand still on a moving interior/vehicle derivative.

At least, that's one way to do it.

If you're doing the interior as un-connected to the outside world, you might try modifying Torque to have multiple subspaces at a time.
#10
01/15/2004 (9:21 pm)
Actually, upon looking through my intent, I was just reversing the idea of attaching models to interiors. Instead I was thinking of attaching interiors to models and updating them through scripts or on the fly. That way all of the large scale movements for a carrier or the like would be manipulated in the traditional way, but the attached interiors would also be updated as long as the bounding boxes for collision matched up.

That's why I was thinking that the base of the carrier (the scope of the interior base) would be the main model used for collision.

But I have no idea if it would work. But it's a simple rethinking of the "model as decoration" to "interior as decoration".
#11
01/15/2004 (11:32 pm)
That's a neat approach. I did some code to generically mount one SceneObject to another a while back; something like that would pretty much solve your problem. :)
#12
01/16/2004 (12:18 am)
I too am very interested in making it possible for players to walk around inside of a vehicle except mine would be underwater as a submarine. ;)
#13
01/16/2004 (4:16 am)
I was planning on doing something like this for interiors
Here is how I will do it

First, create a new Class which uses interiorInstance as its parent.
Add interpolate on client side so the shape moves smoothly.
Modify the collision code to getVelocity of interior and player.getVelocity and add interiors velocity and player.setVelocity only when the player is in contact with the shape, so that you can jump and not move with it.

I don't know if the get/set velocity is the best way of doing it tho, haven't coded this yet :)
#14
01/16/2004 (4:31 am)
Melv said something about releasing some cod ehe made for strategem that allows you to mount anything ingame onto anything else. Seeing as everything ingame (rendered at least) is a sceneobject I would assume he made the changes to sceneobject. As Ben said, this would probably be your best bet for mounting interiors onto vehicles, but you have to wait for Melv to release it...
#15
01/16/2004 (8:25 am)
It's a pretty minor hack, compared to some. I'll have to check with Phil, maybe I can post my code as a resource. Probably won't be as nice as Melv's, but at least it would be out there. ;)
#16
01/16/2004 (2:14 pm)
Post it Ben :)
#17
01/17/2004 (12:15 pm)
I would be very interested in taking a look at that.
#18
01/17/2004 (12:28 pm)
I am interested in this too.
#19
01/19/2004 (10:31 am)
Yes, I'm also interested. Please post, Ben.
#20
01/19/2004 (12:01 pm)
Ok... I'll try to do that sometime in the next few days. :)
Page «Previous 1 2 3 4 Last »