Game Development Community

Enhanced Projectiles TGE and TGEA

by Ron Nelson · 01/22/2008 (7:24 am) · 73 comments

Download Code File

I have recieved a few emails about something I did based upon several bits of work I have seen or gotten from many others on the forum and a lot of my own work.

What you get with this is:
-----------------------------------------------------------------------
Material based projectile bullet decals and explosions
Armor piercing rounds
Optional decal wrapping (good for paintball stuff or blood spatters)
Separate explosions for player characters and vehicles
Rear blood splatters on interiors and terrains in close proximity behind a player
An Optional gore switch
Timed Projectiles
Enhanced water surface explosions
NEW!! Added datablock entry to cancel/allow water surface explosions
NEW!! Added datablock entry to allow water to stop projectiles
Random bullet holes per material type (6 per material)

NEW!! Fixed a bug that prevented consistent water explosions for high velocity projectiles. The only limitation right now is imposed upon how fast processTick is called. So there is a chance it might not always make it with high velocity rounds when very close to a water surface.


Their might be some left over code from my other stuff I have been doing, but I think I cleared it. You see I also used this code with my vehicle damage system so don't panic if you see something and you don't know why its there. Just let me know about it.

I am also including a sample script file that gives you an example of what is needed in the projectile and weapon datablocks. Ignore anything you might see about clips. Sorry but that is a whole other nightmare and there are plenty of other resources on that.

Make sure this stuff is in your defaults.cs in your cleint directory.

$pref::Player::GoreOn = true;
$pref::Decal::decalTimeout = "10000";
$pref::Decal::maxNumDecals = "256";
$pref::decalsOn = "1";

KNOWN ISSUES:
The main limitation of this is inherent to TGE, no materials on DTS objects. If you figure that one out, please add it here. So basically I removed decal rendering on pretty much any DTS shape that can move (RigidShapes, Vehicles, and Players) you just get different explosions for each of them.

Also, batched decal rendering doesn't work too well with this version of the decal manager, so it is the 1.5.0 version.

I have added code from the following resources to restore material mapping in TGEA. I have heard getting the code in was difficult, I can agree to that since I talk to the guy that wrote it regularly. So I just added the files in the TEGA folder. These are the links were the code came from.

Original forum link:
www.garagegames.com/mg/forums/result.thread.php?qt=64664

TDN Link:
tdn.garagegames.com/wiki/Material_Based_Effects_Projects

This code may be benificial to other for other projects as well so thats why I have included the links. He has some examples there on how he used it. Additionally I still have the ShapeBase code in this because it is my hope to get this to work on DTS objects as well and his code is a great step in that direction.

The splash data is currently disabled in the TGEA code, however once Ashley Leach releases her code to restore it in this post:
www.garagegames.com/mg/forums/result.thread.php?qt=20408

I'll add it back into the resource.

Let me know if you have any problems with it.
Page«First 1 2 3 4 Next»
#61
08/16/2009 (2:44 am)
Ok, I was worried that maybe this wouldnt be multiplay compatible.

I'm so happy to hear that it is a simple solution, I will look into the pack/unpack functions asap.

Thanks Again!

Edit: Ok, So I've reordered some of the pack/unpack strings and it looks like they are all placed correctly now, however the client's console is still displaying a "Projectile ((null))::explode: couldn't register explosion".

Could you possibly spare a multiplay compatible file or instructions on what needs to be fixed?

Any help would be greatly appreciated as im not that experienced in c++ yet. (TGE1.5.2)
#62
08/17/2009 (11:39 pm)
Has anyone else gotten this to work multiplayer?

My client is not seeing Bullet Decals or Bullet Explosions, the console is showing:
Projectile ((null))::explode: couldn't register explosion
and I've reordered the pack/unpack strings accordingly but I'm not sure why its not being transmitted over to the client.


Edit: Ok, doing some more testing the client IS recieving the Player, Water and Vehicle Explosions, I'm going to see what is differant from the terrain and interior explosions that is stopping the explosions...
Could still use some help in this area if possible though.

Edit 2: It seems everything in the const U32 Projectile::csmStaticCollisionMask is not showing Decals or Explosions on the Client Machine (Interior, Terrain and Static Items)
#63
08/19/2009 (3:13 pm)
hmm okay... nooby question no doubt, but where do i put my decal images... or where do i define them?

seems i can't really find the spot.

any help would be much appreciated :)
#64
08/19/2009 (4:05 pm)
I have a decals.cs that is loaded before any of the weapons scripts.
#65
08/19/2009 (5:21 pm)
okay, and in there you define your decals like:

datablock DecalData(medMetalDecal1){
   sizeX       = 0.1;   
   sizeY       = 0.1;   
   textureName = "~/data/fx/weaponFX/decals/9mmMetalDecal1";
};

and so on...?
#66
08/19/2009 (5:33 pm)
Correct.
#67
08/19/2009 (6:02 pm)
Okay, so far so good, and thanks for the help...
now my problem is that i don't really get any decals on anything?
I suppose i have to declare a material type in the materials.cs file of whatever im trying to hit right?

so last question so far... :)
how do i define the material type...?

thx, in advance :)
#68
08/19/2009 (6:07 pm)
No it doesn't use materials, you just have to specify what decals you are using in the projectile's datablock.
#69
08/19/2009 (6:16 pm)
But then how do you determine what type of surface is hit? or rather where?
or is it a whole other problem i have?
Firing my weapon just results in a console output saying;
"Hitbox: "
for each shot fired.
#70
08/19/2009 (6:59 pm)
Hey Ron, can you help me with post #62, I'm really having trouble getting this working multiplayer. :(

If possible could you post a pack/unpack code snippet?

@Sebastian, Thats actually a good question, I havnt really looked into that area yet myself.


Edit @Ron: Please Help, any other problem I won't bother you with, however I can not seem to figure this out for the life of me.

Edit2 @Sebastian:
addMaterialMapping( "patchy" , "sound: 0" , "color: 0.46 0.36 0.26 0.4 0.0", "matMap: 1" );
matMap 0-5 should indicate what type of surface each material is and the decal/explosion should change accordingly once you have set the propertyMaps.cs correctly... I believe, as I said before I havnt gotten this far yet.
#71
08/26/2009 (1:42 pm)
Well I am getting tired of knock offs of my work here and all of the questions because even I have to admit this version had a ton of bugs and its use could have been spelled out even more simply.

SO, I am going to do my best to release a new version with far more enhancements and bug fixes and a user manual sometime next week. In the new version I added and updated a lot of stuff from old resources as well as my own work which has expanded quite a bit. Also, the multiplayer problem is gone. I only have it in TGEA 1.81 right now, I will try to convert what can be over to a TGE version so you guys can use most of it, sorry but there are advantages to using a shader engine.

As for being any chance of a T3D release in the future, I wouldn't hold your breath. Right now I have enough stuff to deal with than to spend nearly $1000 on an engine upgrade that I don't currently need. Sure if someone was insane enough to buy me a copy, then yeah I would be pretty obligated to make a new version for T3D, but like I said, don't hold your breath.
#72
08/27/2009 (1:05 pm)
That's excellent news Ron.

And sorry if the question's posed annoyed you, but hey if ever there was a place to ask questions i thought it would be here...?

but f*it, anyways, looking forward to the 1.8.1 edition, and im glad to see not all the "hot shots" moved on to T3D yet.

Anyway, good luck and looking forward to see it...
#73
08/27/2009 (3:17 pm)
I think "annoyed" is a bit strong a word, but I think in this version since I am adding a very thorough manual on how to use every feature, it should keep the confused to a minumum.
Page«First 1 2 3 4 Next»