Sign in to follow this  
  • entries
    235
  • comments
    509
  • views
    172053

Design & Reworked Collision

Sign in to follow this  

138 views

Design & Reworked Collision

I spent 4.5 hours on the phone with my partner, and we accomplished quite a bit in terms of prioritizing & tightening up the design. This game is going to rock.

It's very important to us that the RPG elements of the game are very clearly identified to the player, with enough information to make intelligent tradeoffs. For instance, when you are evaluating a weapon, it will tell you not just how much damage the weapon could do, but how much damage YOU could do with the weapon, based on your attributes and skills.

On the technical side, I finished integrating the capsule code, which fixed several collision problems that been lingering, due to having a mix of collision shapes. For instance, since ellipsoid->ellipsoid collision is so hard, I treated entity->entity collisions as sphere->sphere. This didn't work so well - causing your player to rebound off of enemies in a jerky manner due to the radius mismatches of the two shapes.

Now I use capsules for both entity->world and entity->entity collisions, so that sorted out nicely.

Here is a shot of the capsules in game :



Last night I reworked the collision code, taking out the old Physics::Particle class that assumed things were a sphere, and changed it to use the new Collidable interface, with concrete members for Sphere, Capsule and Triangle. Soon to come are Lozenges, thanks to my coding partner, and also OOBBs down the line.

Today I will finally add the feature that I have been dying to do for weeks. One of the main reasons to re-visit the collision system was to support physical entities like throwing knives, arrows, etc. in a reasonable way. Right now we have laser blasts, which are done through the particle system, where physics is handled via raycasts. With more substantial objects, I wanted to be able to support rotation. Also only physical entites can cast a shadow.

My goal is to have the ability to throw a spinning knife at a wall, and have it either stick, or give off sparks and tumble away if it collides hilt-first. That will be sooo cool!

The main things needed to handle this are to add the angular momentum code into the collidable system for capsules and spheres, and to extend the entity properties so that each entity can be assigned a certain collidable shape at design time.

Update

I just added the ability to set the collision shape via the csv entity data file. Here is a shot of two entities using capsules, and a skull object using a sphere.

Sign in to follow this  


4 Comments


Recommended Comments

Quote:
This game is going to rock.

I dismiss these sorts of comments most of the time, but having read (pretty much) every entry on your game so far, I'll be inclined to agree/hope that it does rock [grin]

Quote:
it will tell you not just how much damage the weapon could do, but how much damage YOU could do with the weapon

I like the sound of that. I'm not the biggest RPG player, but I have enjoyed a few. Knowing the potential of something would be very useful information. When I go back and play Deus Ex (my favourite game ever) I know it so well that I can pick the right weapons/devices only due to my knowledge of what you can do with them later on...

Quote:
My goal is to have the ability to throw a spinning knife at a wall, and have it either stick, or give off sparks and tumble away if it collides hilt-first. That will be sooo cool!

That would be pretty cool. Would you have that feed into the experience/RPG system? presumably someone who has little/no knife skills would mis-throw them more often - and having an obvious graphical/physical feedback would be awesome!

Also, if a knife is flying through the air, would it be slow enough such that you'd get to see a shadow dancing off the various parts of the world?

Not much use for the AI I suppose, but it could be cool if a player got a "heads up" on an impending confrontation because they spotted the shadow of an incoming knife [grin]

Keep up the good work!
Jack

Share this comment


Link to comment
Quote:

Also, if a knife is flying through the air, would it be slow enough such that you'd get to see a shadow dancing off the various parts of the world?


Absolutely. We are completely ready to tweak the speeds of things to make them a bit more visible. The combat is supposed to be tactical ( although real-time ), so that the projectiles should be slow enough that you can use your shield in time.

We might artificially turn down gravity on thrown weapons to make it so

1) they don't have to be arced as much ( arcing is automatic )
2) they don't have to fly so fast before they fall

Share this comment


Link to comment
Quote:
This game is going to rock.
I'm with Jack on this one. [smile]

I'll soon be adding collision detection to a system I'm working on. Do you know of a good online resource for using capsules?

Share this comment


Link to comment
There arn't many good online resources on capsules but what you can find some good information on is closest point to line segment, when you have the closest point on a line segment you can do almost any capsule test you can imagine.

Since a capsule is treated as a line segment with a radius, its just important to find that closest point and place a sphere on that point for a sphere to whatever intersection test.

Dave Eberly's geometric tools website has some code on capsule intersection tests, but I'll warn you that his capsule to triangle doesn't handle the case of capsule completly intersecting the triangle. If you have some extra money I'd recommend Real Time Collision Detection.

- Dave

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now