Sparkles Ahoy!

So, this is probably redundant, as I seem to remember AnaΓ«l mentioning that he’s got some code for a particle system already written, but I thought it would be a good test of the plugin system to try and have a particle system and editor plugin.

I’ve written a small particle system before. It wasn’t overly impressive but it was functional. I didn’t think I could very easily write a flexible one though, so why not do what I’ve been doing recently for a few other things, piggyback off an existing library. Unfortunately there aren’t an awful lot of particle system libraries which are freely available (everyone rolls their own?) but I did come across Particle Systems API which seems to do a lot of what I want. The rendering ended up being incredibly simple and implemented in the example program, rather than the library itself, which is nice.

I have begun work on attempting to integrate it with Maratis/MGui as a “behavior” in a dll. Unfortunately, at this point, it doesn’t seem to work. Ok, more than that, it crashes. Still, I’m happy that it actually compiles with the minimal work I’ve done. I will look into why it crashes and fix that. If anyone wants to take a look at the code, it’s up on github for all to see.

So, what are the goal of this particle system. A quick list to see what we’re wanting to do:

  • Be able to place multiple particle emitters around the level. Probably as a behaviour is easiest.
  • Be able to tweak emitter variables from within Maratis Editor and see things update within the editor without running the game.
  • Potentially use MPhysicsContext (Bullet) for particle behaviour.
  • Potentially move particle behaviour onto GPU.

Now, it’s unlikely that we can do both using physics for the behaviour and moving it onto the GPU (although Bullet now can do calculations on the GPU). It just depends how things look, how it will evolve I think.

The thing I would really love is to be able to create a particle system which emulates a cloud of smoke and reacts to the player moving through it, swirling around them. I’ve looked into fluid dynamics and I think, in order to model this on the scale of a particle system, it really should be on the GPU, but using a physics system might be able to approximate it well enough.

What do people think? Any experiences at all with this?

9 thoughts on “Sparkles Ahoy!”

  1. Hi there,

    I’ve thought about using maratis for sometime now, but I really need particles, but also networking is very important as well. I think maratis is a very nice offering for the community, so its nice to see you helping out to make maratis more, especially the whole particles thing, which in part is why Im not using Maratis. I honestly worry ( since I can’t program very well, yet…) particles might never get done, and that if I had to do them myself, it REALLY might never get done, given my programming skills are very limited.

    Thanks for trying to make maratis better…I’ll be looking at it more seriously now that particles is ‘possible’.

    I see that a ‘flame’ , or what looks like a flame is shown on maratis website, and I wonder how they did that if particle aren’t working ? Animated texture ?


  2. Thanks for your reply.
    I haven’t even begun to look at networking because it’s not something I will need for my game at all. It shouldn’t be too hard to do though, especially once the plugin system goes back in properly. There have been suggestings to use things like sdl_net for networking. Regardless, once the plugin system is out and about, someone will plug in some networking, I’m sure.
    Now, back to particles. I haven’t got anywhere at all with the particle system yet really. It actually makes the engine crash, which is, if anything, going backwards, and there’s so little code from Particle API that I probably should have written it myself. It will definitely get done though as I definitely need particles.
    Anael, I believe, mentioned that he had some code for particles too. I’ve got no idea how far along he got, this plugin is more of a proof of concept of the plugin system as I will have to probably write an editor plugin too.
    With regards to the flame on the website. I will check when I’m next at my PC, but I believe you’re right, an animated texture with a lightsource.

    It’s great to get your feedback, if you have any specific wishes for the particle system, throw them down and, when I have time, I will try and accomodate them.

  3. Ok sounds good,

    I will start using Martis now that I get the feeling that the features I think I’ll need over time will be coming along, and given the plugin architecture feature, the sky would be the limit. I would look fwd to, as my skills increase, helping as well. I was also looking at openwonderland, but I think I’ll start here instead as I had a few interesting games ideas already. Good luck with all that you’re trying to do. If you need help , not that I know how I could assist just yet, let me know.


  4. Thanks again for your comment.

    The thing I would say that any project, and especially an open source project, could do with in terms of help, is feedback. You’ve already given me good feedback that I’m heading in the right direction so again, I thank you. It would be good, in future when something more substantial exists, if you could also provide feedback on how you are using things and how you would like to use those features. Much as, primarily, these things are usually originally made with one project and solution in mind, I tend to find that it creates a more stable and flexible design if you consider other posibilities. Of course, as teams are usually small, in this case only me, quite often features might have to be put on hold indefinitely if they don’t directly affect my own outcome. However, once they have been mentioned, the thought will be there, so usually things will be developed with extension into that area in mind.

    I’m not saying you, or anyone else, isn’t welcome to get their hands dirty and help with the programming. Anything I write, apart from my game itself (for now) will be under some form of Open Source license and be uploaded to github, people can quite easily fork my code and merge back. Of course, right now there’s not much point.

    I tend to find, with these things, people either have their own ideas about how to do things, and attempt to make their own solutions, as I’m doing, or they latch onto someone else’s existing solution. Both are perfectly valid ways of doing things, they both will improve the quality of the free and open source software available. However, as such, I’m in no position right now to even begin to request help, I have no software at this stage to back it. Once I have, I’m sure I’ll be asking people if they have any experience in UI design for the editor, or any host of things. If at any stage people wish to contribute without me asking, all they’d have to do is send me a message.

    With regards to you mentioning your lack of skill twice now, that is definitely not something to worry about. The absolute best thing you can do is throw yourself at a project, ideally one that’s already rolling, and try to wrestle it into your control. People always say that programming is difficult, but it’s really not. The syntax can be a little confusing and the the vocabulary daunting, but the underlying rules are, for the most part, incredibly simple. All you need is to understand simple constructs like if/else, for, while, and a basic understanding of classes/structs and you’re good to start digging into other people’s code. The syntax familiarity comes pretty quickly, most languages have precious little “in the language” and most is in libraries. The vocabulary itself (ie libraries) you can basically forget about while you’re learning. There’s absolutely no reason to try hard to remember what every single stl container does and what parameters map::erase takes etc. It’s not like a spoken language where you can’t realistically look in a dictionary for every word. Don’t worry about those things and look them up at every stage if you need to. An interesting metric is that, over the course of a project, the average programmer writes about 20 lines of code per day. Of course that’s a lot to do with refactoring and rewriting, but on the other hand, if you try hard and make sure you write 30 lines of code, but they’re mostly right, you might only rewrite 10 of them later, you’ve done well.

    Finally, before I run off for lunch, I would love to read more about your game ideas and see how you’ve been doing

  5. Quick reply ,

    Didn’t mean to give false impression of current skill set,,I do know how to program overall, but not enough to not be very frustrated as a end goal to creating something that runs LOL ;). I started with basic on Vic20 ( dont ask ), then C-64, amiga and now pc of course. I know the most about, but also some java/c++, but not enough to create a project from scratch per se. One language under ones belt is usually enough for any other typically. I was going to use panda3d at one time to create my ideas, but opted not to for several reasons one being no ‘editor’ unlike the wonderfully conceived maratis.

    That in large part is the reason I latched onto maratis, in conjunction of course, with all the other fascinating features, and as we both know now, much more to come in part thanks to plugins πŸ˜‰

    I’ll address your other points later, but I wanted to be more transparent in saying I do know how to program for the most part. It’s going to take some time, as once sung by prob. , my favorite singing group, The Carpenters πŸ˜‰


  6. There’s nothing wrong with starting with BASIC. I started making text adventures in BASIC when I was in primary school. Although I have heard that it’s the best way to destroy a potential programmer πŸ˜›

    If you want to follow through with how to start a project from scratch, and already have a reasonable idea of how to program, I’ve got a collection of tutorials slowly growing which might be able to help you there. I’d also love feedback on them, anything you don’t understand, I will expand upon.

    I totally agree with you that the fact Maratis has an editor is great. To be honest, though, it’s not an ideal solution for all games. For internal levels a sort of “god view” can be very frustrating. To be honest, one plugin I’d REALLY love to see developed is an in game editor plugin. If you take a look at Sauerbraten as an example, you can see it’s quite nice to go around and just move things around. Of course you mostly create geometry in the Sauerbraten engine, but the concept is there. But the Maratis editor is infinitely better than no editor at all.

    I’m sorry that I may have misunderstood about your level of skill, but hopefully my comments may be of help to other people at some point anyway.

  7. Are you referring to a collection of tutorials as in Maratis ?

    If so prob. not a bad idea, just wanted to make sure there weren’t tutorials somewhere for programming in general that you might be reffering to, give our conversation.


  8. No, so far the tutorials just set up a framework for a game but I intend to make a very simple fps style interface for the tutorial. They are over at if you want to take a look.

    I’ve noticed from your website that you probably won’t approve of the fps concept, but the reason I’m using it as an example is that it demonstrates a lot of the features which can be used in practically any game genre.

    If the tutorials are of any help, I would love to hear from you on that count :)

  9. OK thanks for verification. Heartseed notwithstanding, I don’t mind the fps references, as the main goal is to enlighten reader on programming aspects.

    I’ll take a peek and let you know.


Leave a Reply

Your email address will not be published. Required fields are marked *