Anyway, I also put particle systems in when you bounce off of walls, which adds a bit of (needed) polish, I think. Not sure if I'm going to keep the "Ow.", since that might make people think they're taking damage. Maybe I'll save those particles for when the player character actually gets damaged.
The particle system itself is one of my own design. I started it months ago, and operates a bit similarly to an old particle system I wrote that was known as the X-Emitter from when I was using the BGE. The new particle system is in component form, and is just known as Emitter and Particle in my BDXHelper package. Here's some example code that sets up the emitter to work:
partEmitter = new Emitter(g);
partEmitter.addTemplate("SmallParticleCross");
partEmitter.addTemplate("SmallParticleCross");
partEmitter.addTemplate("HitVoice");
partEmitter.spawnTime(0);
partEmitter.friction = 0.025f;
partEmitter.startingVelocity.z = 2;
partEmitter.randomVelocity.x = 2;
partEmitter.randomVelocity.y = 2;
partEmitter.colorStages.add(new Vector4f(1, 1, 1, 1));
partEmitter.colorStages.add(new Vector4f(1, 1, 1, 1));
partEmitter.colorStages.add(new Vector4f(1, 1, 1, 0));
g.components.add(partEmitter);
As you can see, the process is all rather simple, as I'm just creating a new Emitter and then customizing it to fit my needs. Pretty simple and easy to manage - even easier would be a GUI. Maybe I'll manage that later.
Anyway, in the above example, I add a template (the GameObject to spawn that represents the particle), I set up different properties like friction and velocity, and then add color stages. Color stages are basically "keyframes" of color; it starts off white, and then turns invisible.
The two "white color" vectors basically means that it stays opaque for half the particles' lives, and then fades out over the second half, rather than fading over an entire second (like it would if one of those 1,1,1,1 Vectors weren't there). Anyway, it's rather simple to use, which is fun. If you want to actually catch the code that makes the particles work, it should be up to date over here.
In any case, here's a devlog video to show the game as it stood a couple of weeks ago (gasp!).
So what else have I been really doing for the past couple of weeks? Mainly, replays.
I think I've finally gotten input-based replays working and finished for the game engine I'm working with. It's been a pain because we weren't sure the physics engine was entirely deterministic as the replays were playing out completely differently when we'd run them - sometimes it would run correctly, other times kinda close, and other times it would be horribly wrong. However, it seems like the physics are deterministic to a point (at least, the way we're running it). I think it's just a matter of where and in what state the game objects are that influences the replay's process. When I'd play the replays, the game objects weren't in the exact same positions, and I didn't start the replays on the same frames in game time as the recording started on, which means that it boils down to a different situation, even if it looks the exact same.
Anyway, I think I've sorted it out, and if so, then it'll be merged into trunk, which is cool. Attract Modes for everybody! The code's here, in case anybody wants to take a peek.
Anyway, that's about it. Thanks for reading!
No comments:
Post a Comment