stuarthoye / Observer_Effect

Ludum Dare Gamejam Project
0 stars 0 forks source link

Urgent: Particle Behaviours #24

Closed Boombostak closed 9 years ago

Boombostak commented 9 years ago

We really need to lock down the particle behaviours and collisions. The current build (Sunday at 9;29am) has the particle behaviour scripts unlinked from the prefabs. If you're working on new scripts, let me know. This thing needs to be functional and tested by this afternoon.

stuarthoye commented 9 years ago

I'm putting as much time into this as I can. It's nowhere near as much effort as you're making, but it's what I can do.

Here's an idea for how we can go about this: To structure the instantiation of a new particle, we need every particle in a scene to be the child of a parent, co-ordinating object. That co-ordinator holds references to each existing particle, and tracks all newly instantiated particles. When two particles collide in-scene, they send a message to their parent containing all the information needed to create a new particle (color, motion, etc.). The parent generates the visual effects, destroys the existing particles, and spawns the new one.

If a particle decays, it also sends a message to the parent, which performs these same operations, but creates two particles and destroys one.

stuarthoye commented 9 years ago

What are your thoughts? And what time do you want to have this tested by?

Boombostak commented 9 years ago

My current solution to this is to spawn the Chemical Reaction at the point of collision, and then cull the colliding objects. The Chemical Reaction has a slight delay before spawning a new particle, so this should work alright.

I don't understand the parent-messaging solution. We should just assign this to somebody and try to crack it out.

stuarthoye commented 9 years ago

We talked about disabling the colliders of the particles on collision, then spawning the new particle. I think this ought to work.

We also spoke about enabling/disabling fundamental particles when they collide (rather than destroying & instantiating every time). This could cut down on the overhead incurred by repeatedly allocating and freeing memory for the objects.