Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 13:17 18 Aug 2026 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2 Particle Engine

Author Message
joker

Regular Member

Joined: 06/02/2024
Location: Germany
Posts: 49
Posted: 01:34pm 17 Aug 2026
Copy link to clipboard 
Print this post

Hello,
I was always facinated by particle engines and their posibilities. I used one in my game Panzerduell for the fireworks on the victory screen. This engine used pixels as particles but you can't do much just with pixels.

So I tried another aproach using BOBs (Blitter OBjects)

The code and all the artwork is too big to be posted here. You can find it on Github:CMM2 Game Programming Gems. In the Wiki you can find more information including animations and the API.

I created an animated GIF to show a smoke effect but was no able to link it here. Please look at the BOBEmitter Wiki Page and scroll to the very end. I'm sorry for the inconvinience.

Because it was not clear from the beginning which design would be the best, I created three versions to compare them:

         Method            Engine                             Example Program
      1. Direct BLIT     bobemitter.inc                  SmokeEffect.bas
      2. Buffered BLIT bobemitter_buffered.inc   SmokeEffect_buffered.bas
      3. Sprites            bobemitter_sprites.inc     SmokeEfectSprites.bas

The first engine can handle unlimited particles with unlimited different shapes (at least in theory). The other two can handle unlimited particles as well, but only with 64 different shapes, due to the limited number of buffers.

The Benchmark of just the particle engine:


The Buffered BLIT and the Sprites reach the same performance because they are in principle the same. BLIT read/write are the same as SPRITE read/write. Due to this relationship you can use SPRITE transparency on a BLIT read buffer.

The drop in performance with real transparency happens because the transparency level have be calculated and set in basic. But this only concerns 12-bit color modes.

I thought SPRITES would be the fastest because they take care of restoring the background and don't need CLS in each frame. But I was not able to handle the massive overlap of the BOBs. All my attempts lead to ugly artifacts or other limitations. Maybe I haven't understood the SPRITE API and one of you have a solution for this problem.

I'm an terrible artist and I'm really curious what much better artists can do with this particle engine. Try to model fire, water, mist, dust, fumes. The possibilities are endless.

By the way: The code is under thje GPL3. If you want to use it in your projects, go ahead.

Cheers
Matthias
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 622
Posted: 02:22pm 17 Aug 2026
Copy link to clipboard 
Print this post

Hi Matthias

Your link to the wiki page is not valid. Could you repost it?
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026