Archived

This topic is now archived and is closed to further replies.

3D RPG Engine Question...

This topic is 5946 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Hello, I started writing a game engine for a 3D RPG game, and have come across a couple of questions. MY 3D RPG will have a perspective similar to Brave Fencer Musashi for playstation, which is basically like a Zelda view, but 3D... (Not first person). I have designed the logic behind most of the game engine and how it will work, but I have run into one problem. And that is this... I want the character to be able to walk on multiple levels.. So along with width and depth while running around, there will be height. So you can run up some stairs, jump off a small cliff and fall until you hit the ground, things like that. The question is, what is the fastest way to determine if my character is standing on solid ground? (I''m doing this in OpenGL by the way)... The only method I was able to think of, was to search every single vertex and polygon on the screen, and find the polygon thats lines would enclose the player. Then I would test to see if that was directly below him, if not he would fall until it was directly below him. In that paticular case it would mean he stepped off a ledge, and there were no polygons that''s coordinates wrapped around the player, that was directly beneath him, so he would fall until he hit one. This method seems though like it would slow everything down quite a bit. Using this method, every time you moved the player just a little, it would do math on every vertex, on every polygon on the screen to find one under him to know if he was on ground, or in the air. Before I spend weeks implimenting this method only to find out it''s horribly slow, I would like to know if any of you have any better and quicker ideas, as I''m sure you do. I would appreciate any of your ideas. Thanks... Dennis...

Share on other sites
Well, when you don''t use overhangs, you can pre-render a heightmap to be loaded with your level, and find the height of the current x, y location on it

Share on other sites
Looks like you might want the OpenGL forum instead of Game Design.

--------------------
Just waiting for the mothership...

Share on other sites
This isn't an OpenGL specific question, in fact it has nothing to do with Open GL... It's about game design. By asking the question to a wider audience I will have more people who are able to help... That's why I didn't originally post this in OpenGl... But thanks for your concern.

Dennis...

Edited by - anachronism on October 2, 2001 4:18:20 PM

Share on other sites
Your question has to do with programming.. therefore, it goes in Game Programming or OpenGL.

"He who fights with monsters should look to it that he himself does not become a monster... when you gaze long into the abyss, the abyss also gazes into you..."~Friedrich Nietzsche

Share on other sites
Ronin_54 I appreciate your replay I see no reason why that wouldn''t work for my situation. I can''t believe how badly I was overcomplicating what I wanted to do... I''ll start implimenting that! Thanks.... I still welcome any suggestions anyone else might have...

Dennis...

Share on other sites
Collision Detection? there is a lot of tutorials about that here, also you can do some simple things like:

Search for the Lower Vertex of your character (usually on the foot, this should be done at loading time) and store the Pointer, Index or whatever, and in the game whatch for collision between that vertex and the terrrain Vertexes, that should make faster your algorithm.

Solutions are always so easy that we don''t see them pass.
W-Buffer

Share on other sites
quote:
Original post by Malloc
Collision Detection? there is a lot of tutorials about that here, also you can do some simple things like:

Search for the Lower Vertex of your character (usually on the foot, this should be done at loading time) and store the Pointer, Index or whatever, and in the game whatch for collision between that vertex and the terrrain Vertexes, that should make faster your algorithm.

Solutions are always so easy that we don''t see them pass.
W-Buffer

time , shouldnt this be done on every update of the
character (unless of coarse your characters dont
walk or run but shuffle instead!, and what if they go
arse over tit? they would fall throuch the solid floor).

If your using skeletal animation this could be done
by

Find lowest bone node
Find the lowest vertex associated with that bone node.

Hope it helps

Mark

Share on other sites
Or you could use the Zelda-approach. The world is really flat but looks like it has height, and at all points where you wants someone to be able to fall down, you make a "jump", so that is the character walks there it will jump over the part wich looks like a wall, making it looking like he jumped "down"

Maybe not possible if you have an otherwise 3d world though...

Share on other sites
quote:
Original post by joke_dst
Or you could use the Zelda-approach. The world is really flat but looks like it has height, and at all points where you wants someone to be able to fall down, you make a "jump", so that is the character walks there it will jump over the part wich looks like a wall, making it looking like he jumped "down"

Maybe not possible if you have an otherwise 3d world though...

Thanks for the reply. I need actual 3D for this project, because most of the puzzles in the game will be solved by rotating the camera around to see hidden objects and such. Thanks for the reply though...

Dennis...

Share on other sites
Well, I''d still advice the heightmap in your situation... Calculating the vertex height and the lowest vertex of the character sounds... well... over complicated to me.

Off course, it''s the best use when you''ve got overhangs and such, but wouldn''t a heightmap work a million times faster? (does require more memory though... hmmm...)

Share on other sites
Just an idea...

couldnt you associate a value to say your characters feet and calculate if their on a pixel every time you move?

If their are pixels under the characters feet he stays on top of the ground... if their isnt then he falls until he encounters pixels, or the character dies...

-Ian