Projectiles - Page 2

Projectiles

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Projectiles

Post by lurker »

None of that changes what I advise. You can automate watchweapon. You seem to want explosions, not projectiles. Use Explosion. For someone that actually wants projectiles, giving them beamlaser non-projectiles would be an exception.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Projectiles

Post by Argh »

Nonono!

I've been using Explosion for ages, man. That's part of the Ion Laser's nifty effect, and the LUPS stuff I'm doing nowadays.

What I'm wanting to do, eventually, when everything is available on the inside... is to leverage LUPS and build some all-glsl stuff, and quit displaying CEGs for particle trails, maybe even quit drawing most projectiles through Spring's current OpenGL, which is slow as hell.

It's insane, imo, that we have brilliant GLSL trail code that jK wrote, but MissileLaunchers still use dirt-slow code from the Dark Ages, for example.

Sorry, I guess I should explain where I want to go here. I want to see projectiles that can be animated and do dynamic stuff, basically, and start treating projectiles as more-generic objects that can be manipulated for gameplay effects- for example, have a true MIRV, that when it reaches the end of FlightTime, "splits" into multiple MissileLauncher projectiles.

There is nowhere to go with that within the engine that doesn't require major changes, so I'm hoping I get the minor ones necessary to do it in Lua, basically.

When I have weaponIDs, projectileIDs, orientation, velocity and position, I can do the first part.

For dynamic animated projectiles, it'll require a bit more than that- I'll need to be able to create / destroy projectiles, and I'd prefer some system whereby I can animate them, preferably using BOS for now.

The first step is just getting the basics done. What I've gotten done here, with your help, will allow me to try generating LUPS particle systems as missile trails, etc., which promises a big speedup (and probably low failure rate on anything modern GPU-wise, unlike the FBO / VBO distortion stuff).
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Projectiles

Post by lurker »

Sounds neat, but all of that works on projectiles with point positions, velocities, and other physical attributes; what do you want to do with a true laser?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Projectiles

Post by Argh »

Well, a "true laser" is pretty much the easiest weapon type to play with, if you want to do stuff that looks Totally Else.

Anyhow, my quibble's just with consistency of approach. It's not life or death, it's just about standardization. If it's a weapon, there should be a projectileID, even if it doesn't go anywhere, doesn't explode, and doesn't exist past one frame.

It should just pass the orientation of the Weapon, or from the Piece named to the target, its location when it spawns, and a velocity of zero. Pretty straightforward really. Then all of the code can share a common set of commands to get these things, execute from there on out according to the weapon's type.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Projectiles

Post by AF »

Agreed, consistency si important. Lack fo consistency suggests poor underlying design of code
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Projectiles

Post by lurker »

I'm going to need someone to explain the lack of consistency to me. If you want to do something when a weapon fires, ProjectileCreated is the wrong call. Making a fake projectile would be inconsistent with how they physics work, and trying to deal with these would need special cases even for those that want them. Firing effects should be triggered by the weapon firing, and projectile effects should be triggered on projectiles. If Argh wants ProjectileCreated to run so he can use the single call for both tasks, he's doing it wrong. If he has a different reason, he needs to explain it with a concrete example.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Projectiles

Post by Argh »

If Argh wants ProjectileCreated to run so he can use the single call for both tasks, he's doing it wrong.
Why? I mean... it's easier to document and show people use cases, if there aren't exceptions at the root level of the behavior, surely?
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Projectiles

Post by lurker »

There can be firing with no projectiles (lasers), and there can be projectiles that aren't fired (EXPLODE, etc.). Please explain how it's an exception to have it do exactly what the name says.
Post Reply

Return to “Engine”