FPS bullet detection and particles

So I understand the basic idea behind using ray sensors and empties etc. for making aim logic but I wanted to double check with you guys that I understood things properly.

Thanks to my 3D platformer I’m building, I now know how to make collectibles and the like with nice little particle effects accompanying them so that’s great, leaves lots of room for interaction and stuff. However I’m now looking at things a little more complicated and I was thinking that if I wanted to make smoke or muzzle flashes would it simply be a matter of parenting the object to camera and having it activate only when a mouse click is detected? Therefore only one particle effects would contain any aim logic and the rest would just be particle effects that happen to occur at the same time.

I’m asking this because I’m also curious about implementing things like rocket launchers or shotguns and I want to know how the game engine will react to this as these have particle effects will be vastly different to simply adding a cube for collision detection. Unless of course I’m over thinking things and the particles will simply use the cube for collision detection and will work fine.

I also have an extra question regarding multiplayer because I’ve noticed when dealing with HUD scenes and so on they show up on different cameras, is there a way to make sure that a scene only shows up on one camera rather than all of them at the same time?

Just a little bump in the night fuzz I’d also like to know the solution to this. :slight_smile:

:smiley: Looks like I’m getting into the slightly more complicated areas now I’ve worked out all the little annoyances in Blender :stuck_out_tongue:

Why you would parent anything to the camera? Is the camera burning?
Typically you have one object that emits the particles. You place this emitter at the location you want to appear as source of the particles.

This can be the exhaust of a rocket, or the barrel of a gun (one end of it), or a torch, or a fireplace.

Why would an particle effect aim at something? Are you looking for a flock effect?

I’m not sure I understand your situation.
One scene typically has a single active camera. The image is rendered from this camera.
If you have an overlay (or background) scene, it has it’s own active camera. This has nothing to do with the other scene.

Maybe you mean multiple viewports?

Particularly with sci-fi guns you have particle effects coming out of the muzzle rather than a solid object I’m talking about plasma and stuff like that the most obvious example I guess I can give is Halo seen here.

http://www.youtube.com/watch?v=KH3D-gQk39Q - note the particles acting as projectiles as they fly towards where they are aimed

In a way with the whole HUD thing I guess I am talking about multiple viewports but what I mean is if one player spawns in using a duplicate of the camera will they see the HUD that has been parented to the camera using the empty? I’m not sure I can explain it any other way but basically I noticed that on the scene I have the HUD I’ve created shows up and stays active even when I am on a different camera and I want that to stay only on the camera I parented the HUD to.

If you want to make a particle which is a 2d plane, always facing the camera just set the “halo” or “billboard” options in the material tab (the same place you set alpha and per material backface culling. You have to have blender set to game engine, bot internal render for this part of the tab to show up.

If you’re making a multiplayer game, you want the particles to be added on the client machine, not server side. That way they will always face the player’s camera, because they only exist on the player’s machine.

Ah, you are talking about slow flying projectiles.

Particles are typically just some visual effect e.g. for smoke, flames, sparks. As visual effect they have no influence on the game behavior.

Projectiles on the other hand are part of the game logic. E.g. grenades, rockets, stones, arrows etc. [they can visually “pimped” with particles]

A projectile is just a physics object (e.g. rigid body) that you add to the scene and give it some forces to fly around. e.g a granade gets an initial impulse, a rocket a steady force.

As the physics engine has some problems with small fast flying objects, it is a good idea to make the projectile, slow and “not small”. E.g. bullets are too fast and way to small. Arrows might be to fast but are not small due to their length. If you really need you can make the projectile invisible and parent a visible small representation.

Typically small and fast travelling projectiles are “simulated” by just showing the effects = immediately impact, straight curve. Because of that you do not need a projectile, just a measure that gives you all the necessary data (e.g. a ray provides the hit point).

This sounds like you add the HUD to you game scene. Usually you place the HUD into an overlay scene. This is much easier to manage, avoids influences from the game scene such as lighting and physics and does not need to change when switching the game scene.
As side effect, you can’t see it from any camera in the game scene … because it is not present in this scene.

Obviously when you use viewports the overlay scene can benefit from viewports too. But you do not need to do it that way, you can create a “multi-HUD” in front of a single camera (left player A HUD, right Player B HUD).

That’s fantastic, thanks for all that, yes projectiles is the proper word isn’t it? I’ll experiment with things again and see how it all goes, I’m currently building a simple flying vehicle so I’ll see if I can’t put some plasma weapons on that or something :smiley:

Part of the reason I was asking about cameras as well is because of things like putting in a 3D cockpit and so on for that I’ll have to look at overlay scenes and such like you say.

The FPS I’m working on will take quite some time to build depending on how things go and so on so I’m focused on the platformer I have in the works which is coming along nicely. Thanks for the help, I’ll poke around and do some experimentation, I don’t think I should need to do much programming because the logic bricks work so well most of the time but I’ll have a look at things and see, I’m probably going to do some reading up on Python at some point so I can understand things easier.

I already have a third person camera properly set up now that I can rotate with the mouselook script, I don’t know what it is about the blender engine but it’s like when I first found Maya, the more I messed around with things the more I got how it worked.

For an idea of what I have planned, think Planetside 2 with lower polygons and no stupid micro-transactions, same kind of sci-fi shooter but maybe with different capture mechanics and so on.

The only tricky part I see in making a game like this is the multiplayer networking and the animations, I WILL build a game like this even if it kills me lol.

That looks like an interesting game, though I’ve never played it.

For multiplayer you really would need a bit of python, and managers like the one I posted above would also be useful, keeping track of what’s going on at a global level instead of trying to get the client to calculate every thing and then feed back… Though in such a case you’d need a ray that was speed* lag to check for collision.

However, if you’re making a more simple platform game with logic bricks, it’d be best to go with simple physics and collision sensors. it doesn’t mater if the objects move a little slowly, it’s not a simulation.

Oh yeah, basic thing I’m doing is making a very simple platformer just to get used to how the game engine works, then I’ll build the multiplayer FPS I’ve always wanted, the evil that is EA and SOE have pushed me to it because I’m so sick of playing games that are either horribly imbalanced or get broken each time they’re patched.

Just recently Battlefield 4 decided that it was going to randomly kick me off games with punkbuster so I just went “Screw it, I’m building my own multiplayer FPS now”. Planetside 2 is a great idea, but it got ruined with micro-transactions, if you want to be able to play that game you have to pay a subscription or just buy the guns with money in order to compete evenly with everyone else.

very off topic but yeah I agree. Games are making more money than movies these days and the games companies are under pressure from their investors to make the kind of return on investment that youd usually see in Hollywood, think 300% profit as a minimum. It’s big business and pretty ugly for all that. It’s why i haven’t played a commercial game in nearly 5 years. They’re all just trash.

Yeah sorry about that :smiley: I tend to get into a rant easily when it comes to the games industry, usually what happens is you have a bunch of people actually rushing to the defence of these kind of business practices.

It’s not all hopeless though, there are games like Star Citizen and Elite: Dangerous out there if you’re into space sims :stuck_out_tongue: