Walking on Walls?
by Mike Kowalski · in Technical Issues · 08/13/2008 (1:51 pm) · 17 replies
Greetings, I fairly new to Torque Game Engine, and was wondering if it's possible and how exactly would you go about getting the player to walk up walls and ceiling? Basically, I want the player racing down a tube and be able to go 360 along the wall. Kinda like the F-zero game for the N64 if anyone recalls. Thanks for any help in advance.
About the author
#2
08/13/2008 (3:00 pm)
Thanks, I'll give this a go.
#3
08/13/2008 (5:35 pm)
If you plan on using vehicles for this, vehicles have no problem due to the way their collisions are handled and their rotation. It's alot different for players and will cause camera and collision problems. It's actually vey simple to get vehicles to become parallel what they are being pushed in to. Changing the ShapeBase gravity functions to use a gravity vector, instead of straight -Z, I was able to have vehicles driving around planetary objects. It takes ALOT more work with player objects however.
#4
08/13/2008 (7:49 pm)
Yea, I was looking at the coding involved for getting players to do what I want, and it look quite taxing for a newb like me. Though can vehicles "fake" being characters? For example in my game, the players are people with hover skate like things, who fight like hockey players while careening down the track. If I used vehicles, would could I use a rigged player model instead of a car?
#5
Oh, and saw and answered your question for the conform player to terrain resource. That is a very good resource, but only works well when the terrain angle is <75 or so degrees, as the player rotations cannot handle anything more than that effectively.
08/14/2008 (4:11 pm)
That would work, if you look at the starter.racing (if you're using TGE) you can see how the player is set up to be a vehicle for that game.Oh, and saw and answered your question for the conform player to terrain resource. That is a very good resource, but only works well when the terrain angle is <75 or so degrees, as the player rotations cannot handle anything more than that effectively.
#6
Using a basic standard vehicle like the jetbike, you'de still be able to dismount and act like a normal player in all other regards.
08/14/2008 (4:38 pm)
Check out the BraveTree Jetbike. Rework the mesh, and it would make an awesome hoverboard. And like Morrock says, getting vehicles to follow surfaces is relatively easy.Using a basic standard vehicle like the jetbike, you'de still be able to dismount and act like a normal player in all other regards.
#7
08/14/2008 (6:48 pm)
Thanks Morrock for the help on Conform Player, and everyone else as well. Gonna tackle this, hopefully this weekend, and post up my results. Crossing my fingers!
#8
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3148
about getting the player to conform to terrain and static meshes, but I hit a snag when I went to compile Torque again. I went and downloaded VS C++ 2008 Express and the latest Microsoft SDK, and followed all the steps here in the forums, and even tried using the set set-up process provided for Torque Game Builder for 2008, hoping it'd help.
www.garagegames.com/mg/forums/result.thread.php?qt=76495
Unfortunately every time I go to compile I get errors someplace. I'm not proficient with C++ or VS enough to even begin to try and sort it out. Curious if there is a step for getting TGE and VS 2008 to work together?
08/21/2008 (3:25 pm)
Well I went forward and tried implementing the code from www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3148
about getting the player to conform to terrain and static meshes, but I hit a snag when I went to compile Torque again. I went and downloaded VS C++ 2008 Express and the latest Microsoft SDK, and followed all the steps here in the forums, and even tried using the set set-up process provided for Torque Game Builder for 2008, hoping it'd help.
www.garagegames.com/mg/forums/result.thread.php?qt=76495
Unfortunately every time I go to compile I get errors someplace. I'm not proficient with C++ or VS enough to even begin to try and sort it out. Curious if there is a step for getting TGE and VS 2008 to work together?
#9
Can you show us what any of the errors are? Usually it's something simple in Torque, like a f left out after a float value that can be fixed very simply, but the error messages make it seem much worse. Oh, and to make sure the compiler is set up correctly, can you compile a clean build of TGE and have it run fine? This is TGE, and not TGB right? :p
08/21/2008 (4:02 pm)
Not sure if there are any problems with VS2008, I use 2005 but I don't think it would cause problems with the latest versions of Torque.Can you show us what any of the errors are? Usually it's something simple in Torque, like a f left out after a float value that can be fixed very simply, but the error messages make it seem much worse. Oh, and to make sure the compiler is set up correctly, can you compile a clean build of TGE and have it run fine? This is TGE, and not TGB right? :p
#10
08/23/2008 (8:37 am)
Yea I went thru the code again and sure enough, missing a bracket... now it compiled just fine, zero errors everything good to go, but when I edit the player data script to turn on ConformToTerrain, it doesnt do anything. I am still using blue block man. I'll keep working at it though. Thanks for the help again!
#11
08/23/2008 (11:05 am)
First, the variable name in the resource is actually conformToGround :p If that's what you have been using in the player.cs and it still takes no effect, did you add the:bool conformToGround; F32 smoothCamera;To the PlayerData struct, or did you accidently add it to the Player class? Also try deleting all .dso's (there's a batch file which will do it in the example folder) and load again.
#12
static void initPersistFields();
virtual void packData(BitStream* stream);
virtual void unpackData(BitStream* stream);
Though I had a feeling right away that was the wrong spot, lol.
08/24/2008 (10:39 am)
Yea I added bool conformtoground and f32 smoothcamera to Player Data struct in player.h, but I wasn't sure exactly where in it to put it. I ultimately inserted it around line 231, right after:static void initPersistFields();
virtual void packData(BitStream* stream);
virtual void unpackData(BitStream* stream);
Though I had a feeling right away that was the wrong spot, lol.
#13
A quick review of what I am doing exactly~
Implemented all the changes to both player.cc and player.h (not sure if player.h is done right see above post)
Jumped into VS 2008 with Microsoft SDK all installed and working, and rebuilt Torque Demo and thru the debugger I see that Torque Game Engine Interface loads up properly, and I can load the generic built in flat-world mission.
So I jump back to my game folder located in MyGames, add conformtoground=1; and smoothcamera=0.95; to player.cs, save and run the editor.
Jump into the world editor and attempt to run up both hills of terrian and my big pipe static mesh and nothing changes, my player is still sticking straight up like a lamp post, lol.
No errors on compiling or script, and thru playerbody.dump(); it lists conformtoground and smoothcamera as "tagged items" whatever that means.
So am I missing something? lol. I am starting to realize that this might be a little out of my league at the moment, but I don't want to give up when I feel like I am so close to getting this to work.
08/24/2008 (6:01 pm)
Alight I have tossed in all the "working code" from all the post in the Conform To Ground Resource up till F.W.Hardijzer's changes to z.normalize(); and still nothing happens to my player in the world editor.A quick review of what I am doing exactly~
Implemented all the changes to both player.cc and player.h (not sure if player.h is done right see above post)
Jumped into VS 2008 with Microsoft SDK all installed and working, and rebuilt Torque Demo and thru the debugger I see that Torque Game Engine Interface loads up properly, and I can load the generic built in flat-world mission.
So I jump back to my game folder located in MyGames, add conformtoground=1; and smoothcamera=0.95; to player.cs, save and run the editor.
Jump into the world editor and attempt to run up both hills of terrian and my big pipe static mesh and nothing changes, my player is still sticking straight up like a lamp post, lol.
No errors on compiling or script, and thru playerbody.dump(); it lists conformtoground and smoothcamera as "tagged items" whatever that means.
So am I missing something? lol. I am starting to realize that this might be a little out of my league at the moment, but I don't want to give up when I feel like I am so close to getting this to work.
#14
recompiling, and removing taking the values out of player.cs this changes the defaults to turned on. If it still doesn't work...
08/24/2008 (6:40 pm)
Try changing the first block of code mentioned in the resource fromconformToGround = false; smoothCamera = 0.0f;to
conformToGround = true; smoothCamera = 0.95f;
recompiling, and removing taking the values out of player.cs this changes the defaults to turned on. If it still doesn't work...
#15
On the bright side all this has at least doubled my understanding of Torque, so it wasn't a complete loss. :)
08/24/2008 (6:58 pm)
Yep nothing. I thought maybe I had my Debug and Release directories messed up, but their pointed to my project folder all right. Thanks for all the help Morrock, but I might have to put this solution on ice for a bit...onwards to vehicles? lol.On the bright side all this has at least doubled my understanding of Torque, so it wasn't a complete loss. :)
#16
08/25/2008 (1:09 pm)
Hehe, wish we could solve this. I would definately suggest vehicles for a task like this however, as you won't only have to change the players rotation and render transform (as this does), but revamp the camera system to work in cooperation with any angled eyeVector, add quaternion based rotation to players and their collision boxes...It's a much bigger task than it seems because of all the optimizations Torque has for player physics and collisions.
#17
08/25/2008 (8:54 pm)
Yea, had a long talk with my instructor about this too, and I'm defiantly gonna pursue vehicles as either strange player stand-ins or just toss the bloody players in car thingys, I know not. Thanks again for all the help again.
Torque Owner J.P. Berry
Punch in "Conform Player" in the search box to get you started.