3d Platformer - rotating/moving shapes
by Andy S. · in Torque 3D Professional · 10/06/2013 (4:18 pm) · 10 replies
Hi,
my new project is creating a game like Super Mario 3D land, or it's newer Version Super Mario 3d world (WII U). I am doing this as a learning exercise for Torque.
So far i have implemented the 3D Action Adventure Kit into the stock MIT 3.0 engine. This gives me a nice character I can tweak plus a nice camera system. However, I have questions on how to proceed regarding moveable platforms, or rotating platforms the Player can walk on. In the old Torque Engines, as far as I remember, this was not possible because the collision mesh would not move. Is this still the same? If so, are there any Workarounds for this?
Also, does anybody have some Input on how to code killing the enemies. As in Mario, I'd like to have them killed if the Player jups on them, but kill the Player on any other contact.
my new project is creating a game like Super Mario 3D land, or it's newer Version Super Mario 3d world (WII U). I am doing this as a learning exercise for Torque.
So far i have implemented the 3D Action Adventure Kit into the stock MIT 3.0 engine. This gives me a nice character I can tweak plus a nice camera system. However, I have questions on how to proceed regarding moveable platforms, or rotating platforms the Player can walk on. In the old Torque Engines, as far as I remember, this was not possible because the collision mesh would not move. Is this still the same? If so, are there any Workarounds for this?
Also, does anybody have some Input on how to code killing the enemies. As in Mario, I'd like to have them killed if the Player jups on them, but kill the Player on any other contact.
#2
10/06/2013 (6:35 pm)
Since no one else replied yet, I thought of a way that might work for the stomp mechanic. Have a raycast aim below the player - If the raycast and the player's collider contact the enemy, it dies. If only the player touches the enemy, the player dies.
#3
As for moving platforms, Torque still has no standard solution.
10/06/2013 (8:24 pm)
You could easily do the stomping using the onCollision callback. Check the positions of the two objects; if the player is higher then they win.As for moving platforms, Torque still has no standard solution.
#4
10/07/2013 (4:28 am)
Thanks for the answers guys. A pity the moving platforms are not supported out of the box. There was once a resource for it, does anybody know if it works with 3.0?
#5
Couldn't he have a platform as an AI player and make it follow the path which would give him movement? The AI Player would still have collision so he should be able to jump ontop of it correct?
Also i'm not sure if the path nodes can be rotated or not but if so that might allow the rotation as well?
I'm at work so I can't test it but I would assume it would work?
10/07/2013 (5:20 pm)
I may be off the mark as I literally only just learned how to get paths working last night.Couldn't he have a platform as an AI player and make it follow the path which would give him movement? The AI Player would still have collision so he should be able to jump ontop of it correct?
Also i'm not sure if the path nodes can be rotated or not but if so that might allow the rotation as well?
I'm at work so I can't test it but I would assume it would work?
#6
EDIT: Not sure if the resource is working with MIT3D. I haven't tried it!
10/08/2013 (5:22 am)
Only one way to find out! (I'll give it a shot in t3d-bones tomorrow.)EDIT: Not sure if the resource is working with MIT3D. I haven't tried it!
#7
I even setup the collision mesh as a cube it's almost like only the sides have collision but the top doesn't at least from my quick test.
10/08/2013 (6:41 pm)
I just tried it with the rocks as the model and it's weird it goes right through the player (Although I think it's a height issue) but stops if it's blocked by a rock but i can stop a duplicate player.I even setup the collision mesh as a cube it's almost like only the sides have collision but the top doesn't at least from my quick test.
#8
The Col Mesh was taller than what i had set on the cube i'm unsure if it's cause of the settings for the col mesh in the playerdata settings
But i could jump onto the platform no problems the issue is it slides under me and doesn't pull the player along so as a platform it's not that handy.
10/10/2013 (4:26 am)
Ok i redid this test and it works kinda.The Col Mesh was taller than what i had set on the cube i'm unsure if it's cause of the settings for the col mesh in the playerdata settings
But i could jump onto the platform no problems the issue is it slides under me and doesn't pull the player along so as a platform it's not that handy.
#9
Also I get errors when running with my player into the platform:
Console output:
A collsion with a loopingshape has occurred
scripts/server/pathshape.cs (33): Unknown command getState.
I am no C++ programmer. Obviousely, somehow the function "getState" is unknown. Yet it compiled without errors.
Another user had a similar problem with this resource. See Nils Eikelenbaums comment here http://www.garagegames.com/community/resource/view/20385/2#comments
If I'd put my merged C++ files up as a resource, would maybe someone be able to help or guide me? As the compiler gives no errors, I am lost on how to proceed...
10/10/2013 (2:20 pm)
Meanwhile I have integrated the pathshape resource into my 3.0 build. It compiled without errors, however when I create a pathshape in the missioneditor, it gets converted automatically to a staticshape.Also I get errors when running with my player into the platform:
Console output:
A collsion with a loopingshape has occurred
scripts/server/pathshape.cs (33): Unknown command getState.
I am no C++ programmer. Obviousely, somehow the function "getState" is unknown. Yet it compiled without errors.
Another user had a similar problem with this resource. See Nils Eikelenbaums comment here http://www.garagegames.com/community/resource/view/20385/2#comments
If I'd put my merged C++ files up as a resource, would maybe someone be able to help or guide me? As the compiler gives no errors, I am lost on how to proceed...
#10
http://www.garagegames.com/community/forums/viewthread/135283/1#comment-850992
10/11/2013 (5:42 pm)
See this post for info about making a moving platform/shape:http://www.garagegames.com/community/forums/viewthread/135283/1#comment-850992
RoundedIcon
1- Rotate them in the script
2- Animate a collision mesh without deforming it (I read somewhere up to 8 meshes can be animated and work, so long as they are not deformed by the animation.