What language should I develop for a particle engine engine?

I was wondering what expressiveness corresponds to the language used to create particle effects. Suppose you want the engine as flexible as possible? (besides trivial ones such as color, position, speed, acceleration)

+4
source share
3 answers

Everyone who encourages you not to reinvent the wheel, and what a great idea, I have a soft spot for Python (which will allow your scripting users to also install and use many other useful math libraries and c), but LUA is no doubt even easier to integrate (and other scripting languages ​​such as Ruby would also be fine, no doubt). Not writing your own scripting language is great advice.

But reading your question tells me that your problem is more related to what attributes of the objects of my engine (and which objects are particles, of course, but what else), I should show ember to any scripting language (or, say, via MS COM or .NET, to any scripting language or without scripts that my users prefer)?

The specific properties of each particle, such as those listed by you, are undoubtedly worth it. Do you have anything else in your engine besides point particles such as, say, surfaces and other non-point objects that particles can bounce off of? What about the “forces” of attraction or repulsion? Can your particles have angular momentum / rotation?

A great idea is to make the properties of your particles “expando”, use the popular term (other object models express the same idea differently) - depending on the application using your engine, other programmers may decide to add the particles that they need .. .. perhaps the mass, let's say - maybe an electric charge - maybe the cost in euro cents, for everything that you know or care ;-). It makes life easier for your users compared to just offering a “particle identifier” (which of course you should;) so that they can use hash tables or the like to keep track of the specific attributes that they care about! Allowing them to add “methods” and “triggers” (methods that you call automatically if and when certain conditions are met, for example, two particles approach a certain distance), would be surprising, but perhaps a little more complicated.

Don't forget BTW to provide a good “snapshot” method of the current state of the particle system (INCLUDING the user’s expando properties added) to the named stream or file and restore from such a snapshot - this is absolutely crucial for many purposes.

Going beyond certain particles (and possibly other objects, such as surfaces, if any), you should probably have a “global environment” with its own properties (including expando) and ideally methods and triggers. For example, a force field acting on all particles depending on their position (and, possibly, their charge, mass, etc. ....) -) ...

I hope that some of these ideas amaze you as interesting - it’s hard for me to say without any idea of ​​your intended scope! -)

+5
source

Do not try to create a new language just for your application; instead, introduce another well-established language into it. Take a look at the mess he caused for other applications trying to implement their own scripting language (a good example is mIRC). This means that users will have to learn another language only for the script of your application. In addition, if you are developing your own language, it will probably not be as useful as other languages. Do not try to reinvent the wheel.

You might want to look at Lua , as it is lightweight, popular, well-established and designed for (users of this include EA, Blizzard, Garry Mod, etc.) and has a very minimal base library (it is designed for a modular language).

+5
source

Just insert Lua . This is a great language design, great performance, widely used by game developers and small enough for you to learn it in a few days.

Then you can continue your game design.

+2
source

All Articles