Game Development Community

Fast projectiles dont draw..

by Jacob Dankovchik · in Torque Game Engine · 02/28/2004 (5:19 am) · 11 replies

I just did the laser beam tutorial, and appearently it uses a really fast projectile, instead of some sort of line trace as i expected. This is no big deal though, expect for the fact that since the projectile is moving so fast, when it hits something fairly near it wont draw. Also, the light of the projectile is extremely dodgey, only showing occasionaly. I noticed this before too while expirimenting. Anyone know how to fix this issue?

#1
02/28/2004 (8:02 am)
I'd suggest rewriting the laser projectile. ;)
#2
02/28/2004 (8:25 am)
Well i dont think that will help because ANY projectile does this and i'd like to fix this while im at it.. However i prolly will end up making it just instantly trace a line, but still i'd like to know how to fix this problem..
#3
02/28/2004 (8:30 am)
Just take a look at that game called "Legends".
I think they got a beam weapon sniper rifle
http://hosted.tribalwar.com/legends/
#4
02/28/2004 (9:28 am)
Jacob - that's my point. The flaw is systemic to using a ballistic projectile to approximate the action of a beam. You need to rewrite it to use a raycast so you can avoid the problem entirely.

As for the light issue, you'll have to tell me what type of light exactly it is before I can really help you there - there are many codepaths in the engine regarding lights, and some of them had this error and were later fixed. Are you running the latest HEAD?
#5
02/28/2004 (11:18 am)
I believe so. The light is done in the script projectile code.. Looks like this:hasLight = true;
lightRadius = 14.0;
lightColor = "0 0.5 0.5";

I noticed this with the crossbow too, the light. And this raycast you mention, whats that do exactly? Sorry for the noob-ness, but im totally new to here. Only other engine i've worked with was quake 1. They had somethin called traceline which, well, traced a line from one specifed vector to another. Very handy cause then u could draw a model beam off the lines coordinates.
#6
02/28/2004 (4:07 pm)
Make sure you're running the latest HEAD - I thought I fixed this problem. :)

Container::castRay() is the method you want to work with. It lets you cast a ray from one point to another, specifying masks of objects to check against, this sort of thing. A very powerful tool.
#7
02/28/2004 (5:50 pm)
Ohh.. so its like, exactly wot im lookin for, a traceline tool? cool! thanks, i'll go try somethin with it! =D
#8
02/28/2004 (6:14 pm)
Have fun with it. May all your lasers be straight and deadly.

You're on your own figuring out how to make the whole laser glow tho ;)
#9
02/29/2004 (6:27 am)
Oh, i got an idea for it.. :D I did this for quake 1. It will probably have to be engine side tho, which i never like too much, but what i have to do is somewhere around model drawing check for a specific model name that makes up the beam, and create light on that model. Also used for particles too. Might take soem time tho..
#10
02/29/2004 (6:32 am)
Oh ya, sorry, one thing i forgot to mention. If i dont have the latest head would i be able to update without losing my changes or anything?
#11
02/29/2004 (9:15 am)
Yes. CVS will try not to change anything you changed. If you change something that changed in HEAD, your CVS client should give you the opportunity to resolve the conflict.