✔️ FIXED BUG: Particles

Eggheads talking about bytes and stuff.
Post Reply
User avatar
Krishty
Site Admin
Posts: 1270
Joined: 2022-Jan-09, 00:59

✔️ FIXED BUG: Particles

Post by Krishty »

The last release had particles when bullets hit the ground or other units. They have been broken since the TFX wrappers were separated from TFXplorer.
User avatar
Krishty
Site Admin
Posts: 1270
Joined: 2022-Jan-09, 00:59

Re: 🔴 OPEN BUG: Particles

Post by Krishty »

This is almost fixed and I wanted to take a few notes on why it turned out much harder than initially anticipated.

Separation of Extensions

As seen with this bug, the TAW extension can only rely on TAW particle effects, and the EF2000 extension can only rely on EF2000 particle effects.

So what particle do we spawn if a plane shoots at a building?

We ask the extension that provides the building for a particle effect on building damage, and the extension that provides the bullet for a particle effect on disintegrating bullets (which doesn’t exist unless you use HE rounds). As a result, crashing the TAW F-22 into the ground in an EF2000 level spawns the EF2000 crater and particle effect for holes in the ground, and also TAW’s particle effect for an exploding plane. That’s at least coherent.

Individual bullets and buildings did not yet keep track of which extension they belong to (because we never needed that before). That had to be retrofitted.

Correct Physics

I generalized the ground impact functions. As a result, craters do not only spawn for planes hitting the ground, but also for every single bullet/debris. Which is pretty impressive.

This, however, depends on correct physical values for these events. A bullet is muuuuch smaller than a plane, but it still makes a small crater due to its high momentum.

Momentum & Co. were a bit off for impacts (because we never used them for anything but particles of pre-defined sizes). In order to not have bullet impacts spawn one-mile-high particle effects, these values had to be computed correctly.

Coordinate Spaces

I strictly separate world coordinates from vehicles. Basically, your vehicle never gets a global coordinate, but exclusively ones relative to its own position and axes. This frees us from many problems (floating-point accuracy, reliance on specific kind of world coordinate system used, etc.).

If a plane is hit by a bullet, we ask the plane to model its damage and maybe spawn a particle. (I hope you can see it makes sense to ask the plane how its damage looks.) But all the required data is only available in global coordinates so far (because we didn’t have any use for this data before).

So, a few more coordinate space transformations here and there for vehicles to show their hits in the right places.

Building API is Crap

My API for handling destructible buildings is shit. It’s probably the last API I haven’t fully adjusted to the new API model yet and it needs a full rewrite. That’s also why we have no exploding AC3 targets yet; I designed that so bad that I can barely make it work myself.


Overall, this is finally coming to an end. It feels great. This is also the last major gameplay feature that holds back a new public release (not counting one blocking GUI feature).
User avatar
Krishty
Site Admin
Posts: 1270
Joined: 2022-Jan-09, 00:59

✔️ FIXED BUG: Particles

Post by Krishty »

Particles with new craters are now committed; closing as fixed.

Some code de-duplication could be done between EF2000 and F22, but honestly this is on the verge of escalating and I’m just happy that it’s over 😁

I must also say that I got back to enjoying shooting the ground/planes!
Post Reply