Emitter designer

First a little background: If you aren’t familiar with what an emitter is, it’s something that spits out a bunch of semi-transparent images (individually called particles).  You set a bunch of rules about how the particles behave, maybe set up some basic physics, give them some randomization, then start spitting them out, and you can get some pretty nice looking stuff which is actually fairly simple in terms of code.  So there are a whole lot of examples up on youtube.  This is approximately the complexity level I’m aiming for. (that link has music.)
The game really needs some engine trails, if for nothing else than to let you tell which corner of the ship is the front at low levels of zoom, so it’s emitter time, and I decided not to go down the dead-end street of typing in hard-coded values, or tuning them via a file like I do with most of the data in the game.  No mere mortal can just type values in and know what it will look like, so you’ve really got to have some realtime feedback.  So I’m working on a full-on emitter generating program.
Right now, I have the UI stuff down, and a big empty space ready for the actual emitter to go into.  Now I just (just…) need to write the actual emitter code that will take all this data and turn it into what it’s supposed to be.
So, a totally new program is included.
Most of the names will be self-explanatory, except “val” and “var”, which are respectively “value” and “variance”.
q to quit like always
d toggles between display of the raw data and displaying the emitter (which doesn’t do anything yet)
pick the thing you want to edit on the left by clicking on it
Type in a number and hit enter, and you’ll give a new value to whatever number is highlighted in red.  Decimal points allowed.  Note that if you enter something above a few decimal places, it will start giving scientific notation with an exponent and the number won’t fit in the column any more, but numbers that big aren’t really useful in emitters, so I’m not worried about it.  Also, it will take full float precision, but only display the first three decimal places.
Where it gets interesting is if you pick one of the values in the middle, where it makes sense to change the value over the lifetime of every object emitted, and you get this box at the bottom where you can draw a line to represent a multiplier value to be applied over time.  That part I think is actually pretty neat.
And finally, hit e and it will export the entire dataset into emitters.txt, where it can (eventually) be read in by the main game.

emitterUI

This entry was posted in Tool development. Bookmark the permalink.

Comments are closed.