Jump to content

  • Log In with Google      Sign In   
  • Create Account


Creating a room


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 aanthonyz1   Members   -  Reputation: 131

Like
0Likes
Like

Posted 10 January 2013 - 08:25 PM

What would be the easiest method of creating a cylinder and turning it into a room for a video game? Its going to be a dungeon and all the rooms are going to be circular like a cylinder. I have no idea how to approach this though...any help?



Sponsor:

#2 iedoc   Members   -  Reputation: 637

Like
3Likes
Like

Posted 11 January 2013 - 12:14 AM

you could make the rooms (sounds like caverns) in a 3d modeling program, then import them into your game


Braynzar Soft - DirectX Lessons & Game Programming Resources!

#3 aanthonyz1   Members   -  Reputation: 131

Like
0Likes
Like

Posted 11 January 2013 - 05:23 PM

How would I set up collision for the room?



#4 Medo3337   Members   -  Reputation: 663

Like
0Likes
Like

Posted 11 January 2013 - 07:17 PM

@aanthonyz1: You need to use a physics engine.

 

Here are list of physics engines you can choose from:

http://www.gamedev.net/topic/475753-list-of-physics-engines-and-reference-material-updated-7-march-2011/



#5 iedoc   Members   -  Reputation: 637

Like
0Likes
Like

Posted 13 January 2013 - 03:00 AM

if your just doing a simple project, you can just do collision on your own without a 3rd party physics engine.

 

There are many ways to do collision detection. If your rooms happen to be perfectly round like the cylinder you mentioned in your first post, you could get the radius of your cylinder, and just make sure that nothing gets further from the center of the room than the radius, that way you won't be able to walk through the cylinders walls. That's not a very flexible design though, as it would only work well for perfectly round rooms, and if you wanted the rooms to connect, you'd have to find a way to let the player walk to the next room by letting him go further from the center of one room than the radius of that room, if that makes any sense.

 

Otherwise, you can do bounding volume collision tests. There are a lot of different volumes you can use, but common ones include bounding spheres and bounding box's (AABB for an Axis-Aligned Bounding Box or OBB for Oriented Bounding Box). Put your main character or whatever in one of these bounding volumes, and check for a collision between the room and the bounding volume. You could also do triangle to triangle collision tests, Which is the most accurate collision test, however it also takes the biggest performance hit, especially if you have a lot of triangles in your scene to test against, which is why there is bounding volumes. Start with a bounding volume, and if you need to get more accurate, do triangle to triangle collision tests. if you have a lot of things to check for collision with, you might want to do some sort of spacial partitioning, such as a quad tree or octree, so that only an object in a section will check for collision with other collidables in that section and the surrounding sections.

 

Bounding volumes can also include a "collision mesh", which is a representation of the object you want to check for collision with, but many less triangles, and usually convex, so you can use collision test techniques that perform better than collision test techniques using concave objects.

 

if your room is complicated, you'll probably want to create a collision mesh for the room, but if its simply a cylinder, or a box, or some simple shape, you can use it by itself as a collision object with whatever is in the room.

 

Since collision detection is such a common thing in games, you can easily find many many sites that will teach you about collision detection. just use google and you'll find them


Edited by iedoc, 13 January 2013 - 03:06 AM.

Braynzar Soft - DirectX Lessons & Game Programming Resources!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS