3D Collision Detection in 2D Isometric game

Started by
2 comments, last by BlackDice 3 years, 4 months ago

Hi!

I have a question about implementation of 3D-like collision detection in 2D Isometric game. It is needed mainly for shooting projectiles and hitbox collision detection to understand, where projectile hit - arm, head, etc.

It would be smth like in old XCOM TFTD game (https://youtu.be/-HPV185KPns?t=3954)

Currently i have only one approach in mind:

  1. For each sprite create approximate 3D bounding volumes
  2. Create 2D “scene” for graphics and invisible 3D “scene” for physics
  3. Sync this scenes, and calculate this collision detection in 3D scene.

While this approach seems valid, it would require a lot of hand-authored work.

Can you give me some advice about how it can be done alternatively, or validate my thoughts?

Advertisement

IIRC the old X-Com games use voxels, and it's much easier to pull off something like that than a real-time physics simulation.
Projectiles travel in a line (or as appears with some weapons, in an arc), and you can step through the volume, sampling after passing each boundary, whether the projectile hits something or not.

So you were very close with your approach - the 3D bounding volumes, and dealing/syncing with the two abstractions!

I personally don't think it can become much easier than that. Some extra information is required along the added dimension,
but you can of course deal with different granularities. I don't know what X-com does here, but they do have some sort of sub-cell granularity, given as shots can be taken through windows, or hit crates on the ground.

In short; I'm validating your thoughts, but haven't given alternatives much thought (besides dismissing the possibility of viable alternatives)

@SuperVGA Big thank you for the reply!

Great point on using voxels, it seems that it can be good enough for this type of physics approximation!

This topic is closed to new replies.

Advertisement