Ropeway, Ladder and the Player
by Thomas Bang · in Torque Game Engine · 05/15/2009 (1:11 am) · 8 replies
What are the preferred methods to implement the interaction between ropeways, ladders and the player (also AIPlayer) ?
Do you have any suggestions? Currently i have no idea.
Known issues:
- moving the player with the ropeway (including rotation)
- correct collision detection when the player is moving in one direction (inside the ropeway) but the ropeway is moving in the opposite direction
- movement of the ropeway itself
- ladder detection
- move the player up and down
- stop moving the player and looking around while he is in the middle of the ladder
- ...
- ...
Do you have any suggestions? Currently i have no idea.
Known issues:
- moving the player with the ropeway (including rotation)
- correct collision detection when the player is moving in one direction (inside the ropeway) but the ropeway is moving in the opposite direction
- movement of the ropeway itself
- ladder detection
- move the player up and down
- stop moving the player and looking around while he is in the middle of the ladder
- ...
- ...
#2
There's an old resource for ladders which I managed to get working a while ago, but decided I didn't like so I'm going to get around to making my own :P.
Another 'hack' idea is to make some very steep steps. If each step is shorter than your Player's maxStepHeight, you'll be able to 'climb' them with no problem. You might make the 'steps' invisible in front of a visible ladder object.
05/26/2009 (8:49 am)
What do you mean by 'ropeway'?There's an old resource for ladders which I managed to get working a while ago, but decided I didn't like so I'm going to get around to making my own :P.
Another 'hack' idea is to make some very steep steps. If each step is shorter than your Player's maxStepHeight, you'll be able to 'climb' them with no problem. You might make the 'steps' invisible in front of a visible ladder object.
#3
But there is a problem with the position of the player.
The player is moving up and down but player.getPosition(); gives always the same values. Very strange.
This is a ropeway:
05/26/2009 (11:25 am)
I tried to move up and down a ladder with a animation (player is mounted to a animated mount point). It works. But there is a problem with the position of the player.
The player is moving up and down but player.getPosition(); gives always the same values. Very strange.
This is a ropeway:
#4
player.getPosition();
player.getTransform();
player.getEyePoint();
ladderMountObject.getSlotTransform(0);
Each of these methods returns always the same z-value;
05/26/2009 (11:42 am)
i tried it with... player.getPosition();
player.getTransform();
player.getEyePoint();
ladderMountObject.getSlotTransform(0);
Each of these methods returns always the same z-value;
#5
That's an odd problem. I'm thinking that if you hooked up a console method to the engine 'getRenderTransform' functions, you'd get correct values. However, you shouldn't *need* to do this, ideally. When you go into the editor, does the player's bounding box move correctly? I should think that'd give you an indicator of the result of getPosition.
05/26/2009 (12:25 pm)
Ah, we call it a dable car where I'm from ;P. Is that you game? If so, it's looking hot!That's an odd problem. I'm thinking that if you hooked up a console method to the engine 'getRenderTransform' functions, you'd get correct values. However, you shouldn't *need* to do this, ideally. When you go into the editor, does the player's bounding box move correctly? I should think that'd give you an indicator of the result of getPosition.
#6
05/26/2009 (12:52 pm)
No... it's not my game... it's "Return to Castle Wolfenstein".
#7
I tried also getWorldBox and getWorldBoxCenter. Same result.
I guess it has something to do with the mountObject-Method.
05/26/2009 (2:14 pm)
I created a ConsoleMethod getRenderTransform in the class SceneObject but i get the same "static" results. I tried also getWorldBox and getWorldBoxCenter. Same result.
I guess it has something to do with the mountObject-Method.
#8
Oh... unless you're always calling render transform on the server, where nothing is rendered. SO render transform on the client should give you correct values, but you really don't want to have to do things on the client.
But if you can actually see your player moving up the ladder, then the render transform is being changed *somewhere*, probably on the client.
I might look into this if I get some time - it might become an issue in my game as well.
05/27/2009 (1:19 am)
Yes, I'd assume it does. But it's odd that even the render transform is static.Oh... unless you're always calling render transform on the server, where nothing is rendered. SO render transform on the client should give you correct values, but you really don't want to have to do things on the client.
Quote:ladderMountObject.getSlotTransform(0);And it's especially odd that this doesn't work. I thought mount slots were animated. This might necessitate you explicitly animate the shape before getting the mount transform. If this is indeed the problem, and you fix it, then all he other problems should disappear as well - I think the core issue is that the player sets its transform to be equal to the mount transform, and if that's not changing, then neither does the player transform.
But if you can actually see your player moving up the ladder, then the render transform is being changed *somewhere*, probably on the client.
I might look into this if I get some time - it might become an issue in my game as well.
Torque Owner Infinitum3D
Like I said, its a hack, but its a start...
Tony