EverEnding DevBlog 102: Rewiring

EveHeader

Unsurprisingly, there have been complications. Foremost among these is a feature that I forgot I needed for particle effects to work properly, at full flexibility and power: The ability for a single particle to change type. I know I’m going to need this capability because I can already envision a case where I need it, rain-drops hitting water – first the rain-drop particle, with a behavior that makes it fall, then the ripple, with an effect that makes it spread out in concentric rings. This might conceivably be achievable with one type, but I think the ability to change types will prove itself indispensable sooner or later, and since the first chapter of EverEnding will feature rain quite heavily, I want to get all of these effects nailed down as early as possible.

So what, right? Sounds easy, right? Well, yes and no. The problem is, the way I’ve designed the particle system, each particle’s behavior is determined entirely by a set of floating point numbers. While it’s easy to give each particle type a name, it’s less easy to give a particle instance an instruction to change types, since there’s no place where it can store that name. I’ve solved this particular problem by making a simple algorithm to hash text strings into floating point numbers: Thus, a particle instance can take a floating point number that uniquely identifies with the name of a particle type, and when anything is found in that field the particle system will look up the type using the hash and use that to assign the particle.

I’ve gone through and implemented this new system, but there are a number of minor restructures to the particle system that I keep noticing need to be addressed as I go, so it’s a bit slow. nevertheless, it’s steady progress. Once this is all in place, I’ll go back to the detail editor, make it so the newly implemented detail name is displayed, and change the interface for behavioral type assignment to reflect the new method. And, once I’m done with that… well, I think the detail editor will be complete, give or take a couple of minor improvements, but that’s basically what I said last week as well. We’ll see.

Hey, at least this update is close to on time though.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: