Jump to content

Collisions with houses, first person shooter


timetocode
 Share

Recommended Posts

I've got collisions versus a heightmap via BABYLON.GroundMesh.

I've got collisions between my players and a few random walls and other primitives that can be spawned in the game via moveWithCollisions.

I'm using NullEngine and everything is multiplayer, so the scaling is important. Anything that gets added to the world needs to be able to be part of collisions against a couple hundred entities each frame. The heightmap is super high performance intrinsically and has no problem. moveWithCollisions is okay too so far, but I only have a few objects in the game total... but I'm imagining that if this ever becomes too expensive I can use the octree in babylon or roll my own spatial structure.

Now I'd like to begin putting structures into this world that the player can walk through. These houses are going to have doorways, windows, and staircases. I'd like the player to be able to move through the doorways and larger windows, as well as *up* the staircases. So now I have a million questions, for those who have made things like this before, or just generally know about 3D collisions.

I have a fair amount of programming experience as a gamedev+network programmer, but I'm very new to 3D. So my questions are really from the perspective of "how do I do a thing in 3d?" and "how do I do this thing via babylon.js?" I've been doing blender tutorials for two weeks in preparation.

Whats the general idea behind making a low-poly house (interior and exterior)... do I just model the whole thing inside and out in blender and import it?

Should the house be one mesh or multiple?

Is the mesh that I create in blender the same as the mesh I should use for collisions? Is this going to magically work via moveWithCollisions?

What about staircases? Should they be a ramp instead of steps?

What about the doors/windows/openings? Do these just work?

How do I place the house down into the terrain? I've got a bunch of ideas for this, from flattening the terrain, to connecting the foundation mesh to the ground, to just giving the houses a big fat block of a foundation and sinking it into the heightmap.. but would love to hear some options.

 

Link to comment
Share on other sites

1. Whats the general idea behind making a low-poly house: Yes blender is fine. Set a vertex budget and stick with it

2. Should the house be one mesh or multiple? The minimum amount is the best. ALso regarding collisions: do not use the rendered model but use simple invisible boxes as impostors

3. See #2

4. Staircase: you can use staircase but the collision impostor will be a plane (see this demo: http://www.babylonjs.com/demos/glowingespilit/)

5. Regarding collisions, you will recreated the holes with surrounding boxes. Other than that and regarding rendering, it just works ;)

6. Flattening is the key (like in real world)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...