Author Topic: BASIC Particles  (Read 2963 times)

0 Members and 1 Guest are viewing this topic.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
BASIC Particles
« on: October 04, 2011, 05:00:34 pm »
Recently, I got a request to add particle effects to Grammer and I was originally going to just avoid this, thinking it would be too complex. However, the idea started bugging me and so I thought back to a post by Builderboy. So during class, naturally, I started trying to code a water-like particle effect... and it works! The only issue is that it can only do a few cycles a second once it has to handle 100 particles, so this is where I am:

I am going to work on an assembly particle engine that BASIC users can use. I plan to add this to Grammer, too, but for now, I want to make it for BASIC users. For the first version, I plan to use non-user RAM (saveSScreen in this case) to store particle data and it will handle up to a few hundred particles. There will be a command to add or remove particles as well as a command to run a cycle (or multiple cycles?) I also want to add the ability to save particle states, eventually, too.

So what do y'all think? I will try to come up with some working code before I have to go to work (so in the next 45 minutes 3:-) )

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: BASIC Particles
« Reply #1 on: October 04, 2011, 05:12:12 pm »
Cool! Sounds awesome.
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BASIC Particles
« Reply #2 on: October 04, 2011, 05:44:35 pm »
Blegh, so I am not going to finish in time, but I have these commands finished:

Clearing all particles
The water particle engine

What I need to add:
A command to add particles
A command to delete particles

These should be doable in under 10 minutes, so these will be attended to after I get out of work in about 4 hours :D

Offline LincolnB

  • Check It Out Now
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1115
  • Rating: +125/-4
  • By Hackers For Hackers
    • View Profile
Re: BASIC Particles
« Reply #3 on: October 04, 2011, 06:22:11 pm »
Hey, are you using cellular automata for your water engine, like in my water simulation? (thanks to BuilderBoy)
Completed Projects:
   >> Spacky Emprise   >> Spacky 2 - Beta   >> Fantastic Sam
   >> An Exercise In Futility   >> GeoCore

My Current Projects:

Projects in Development:
In Medias Res - Contest Entry

Talk to me if you need help with Axe coding.


Spoiler For Bragging Rights:
Not much yet, hopefully this section will grow soon with time (and more contests)



Offline boot2490

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 607
  • Rating: +54/-36
    • View Profile
    • Boot2490's Stuff
Re: BASIC Particles
« Reply #4 on: October 04, 2011, 07:23:46 pm »
Hey sorry my idea "bugged you", I actually thought it was a stupidly hard suggestion *after* I posted it. But it is awesome to see you actually doing it! I wouldn't (after I thought about it) have thought it would be plausible to make a usable dynamic particle system for the Z80.
I'm not worried about SOPA creating censorship, that will not stand for long. I'm worried that they'll succeed in stopping piracy!

Spoiler For Signature, updated march 23, 11:28 PM EST:















An useful tool!

PM me if you need some help. I am glad to be of assistance and part of the TI Communnity.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BASIC Particles
« Reply #5 on: October 05, 2011, 01:17:44 am »
Okay, that took a bit longer than expected, but here is version 1 :)
It has a few commands:
0 or {0 will "freeze" existing particles and no longer interact with them
1 or {1 will execute a cycle (computes the location of all the particles
{2,Y,X will add a new particle at pixel position (Y,X)
99 or {99 will display the graph buffer

So an example of how to use this is:
Code: [Select]
0:Asm(prgmPARTICLE     ;Clears all particles
{2,1,3:Asm(prgmPARTICLE  ;Adds a particle at (1,3)
For(A,0,99
{1,99:Asm(prgmPARTICLE    ;Cycles through the particles, then display the graph buffer
End

For those familiar with my libraries, you can chain commands together in a list :)
Another note is that this will handle up to 383 particles (And it handles this without a problem).

So here is an example and a screeny as well as the program :)

EDIT: I can't wait 'till I add this to Grammer :devil:

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: BASIC Particles
« Reply #6 on: October 05, 2011, 07:04:05 am »
O.O
So there's a chance that grammer will only go to math/science programming D:
Sig wipe!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BASIC Particles
« Reply #7 on: October 05, 2011, 07:23:51 am »
O.O
So there's a chance that grammer will only go to math/science programming D:
No, but this is a neat graphics effect :D You could add this, say, to the tip of a volcano or something :)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: BASIC Particles
« Reply #8 on: October 05, 2011, 02:57:38 pm »
Wow that looks cool Xeda!