Shooting games and bullets

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
Bobo7581
Gnoblar
Posts: 22
Joined: Wed Mar 09, 2005 8:15 pm
Location: Bristol, UK

Shooting games and bullets

Post by Bobo7581 »

Hi, I'm making a shooting game, specifically from a lightgun but its very similar to a 1st person shoot-em-up, so others may have done the same. In my scenes I have a basic backdrop, the walls the ground etc, which are not moveable, many small objects e.g. crates, which may or may not be moveable and many moving and animated characters, which I plan to shoot and be shot by. The main part i'm enquiring about is the shooting and bullets...

At first I modelled a bullet with a low poly mesh and simply moved this through the scene at a constant rate. I wrapped all the objects in an OgreOpcode CollisionEntity and detected collisions that way, however had major problems with the animated characters as the geometry changes and also the collision wasn't absolutly spot on but that wasn't too much of a problem...

I decided to try OgreOde, with the possiblity of physics on some moveable objects being kicked around (not really necessary though). Main problems i found for this were i couldn't effectivley detect collsionson my animated models. I tried putting a box around them but it took away my options to move them freely as you need to move everything by adding forces etc. Not really what i needed...

I was hoping to just get a few ideas here on what other people have done in similar games. Do people normally models the bullets (these are being fired from pistols) or is it better have a rayquery or shoot a particle system? My main idea for model the bullet were that if I can get it working with those then I might be able to port this over to having knives and the like thrown at me (with the ability to dodge) by the enemy later. I have read many posts with many possible ideas but nothing firm. My requirements aren't for detection aren't that fine, just something that seems realistic in a fast moving game, the possibilty of implementing a ragdoll on impact seems good aswell...
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

Did you see the Zombie demo from OgreODE? It does it. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
lodi
Greenskin
Posts: 103
Joined: Sat Jul 24, 2004 7:06 pm

Post by lodi »

You shouldn't do mesh/mesh collision with a bullet -- it's too small! Not only can it skip targets entirely between frames, but noone will notice a difference between that and a rayquery anyway.

If your 'bullet' is more like a cannonball, you'll need to look into swept collision detection. (extrude the sphere into a capsule, to capture all the positions the bullet travelled inbetween frames).
Post Reply