Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Particle / Screen Effects.....How?

Author
Message
Squall alias Leon
21
Years of Service
User Offline
Joined: 31st Jul 2003
Location: United Kingdom
Posted: 1st Aug 2003 22:12
ok, your probably fed up of me asking all these quesions but these are important.

Problem 1
How comes something everso simple on screen is hard as hell to do?
Problem is I want to make a particle effect like the one used on the Final Fantasy game series, but I get confused like hell with the coding. I have little knowledge of particle stuff so aint a clue how to make about 10 particles rotate around a character whilst moving upwards, then fall to the ground and dissappear. Come to think of it, I don't even know how to make a small group of particles. Any ideas?

Problem 2
Also, If you have ever played Final Fantasy 7 or 8, Im trying to make an effect like the following;

Final Fantasy 7: the green mist on the floor when casting magic,
or Final Fantasy 8: like the blue effect when Esuna is cast.

...but again, dunno where to begin with the movement. I've got a 'O' shape (not a cylinder so the top and not bottom aint textured) ready to be texture and properties set to it, just not a clue how to make the moveents and scaling. Anyone know how to do one of these, or both of them if possible?

Thanks for your time
Furiousuk
22
Years of Service
User Offline
Joined: 10th Jan 2003
Location: United Kingdom
Posted: 1st Aug 2003 22:43
Most particle engines use some form of vector math to do their calculations. This is because particle engines rely on knowing where a particle is going to and how fast it is going to get there. The engine then applies any physics (e.g gravity, friction etc) and updates the display with the new positions.

A simple particle engine in pseudo-code might look like this:
Create your objects and initialise their positions, directions and speed. (use a FOR loop).
Apply physics to each particle (again use a FOR loop).
Update the screen with the new particle positions.
You then enter a loop where you apply physics and show the particles until a certain event happens.
When the event happens you destroy the particle, thus finishing the effect.

I'm not sure how good you are at coding so I hope this isn't patronising at all.
In your example you want 10 particles to rotate, as well as move up and then down, so,
You create the 10 particles and place them around the player, they will each have a direction that takes them around the player. (Sometimes in DB it is easiest to have the particles begin the loop at the player position but facing different directions in one plane, then MOVE OBJECT them out say 10 units so they will be in a circle)
The physics to apply is an upwards motion. I will assume the effect is uniform for all the particles so you only need one variable to control all particles. Simply apply an 'Upwards' direction to each particle (you can do this using MOVE OBJECT again) using a variable and then slightly decrease that variable so that on the next pass the UP speed will be slightly less.
Now enter your drawing routine to update the screen with the particles' new positions (this can be as simple as SYNC'ing the screen).
You then enter a loop where you apply the physics and update the screen. The UP speed is decreased each loop until it reaches zero and then moves into negative figures, meaning it will be a DOWN speed.
You can perform a check that registers when the particles have hit the ground (as they will all have a uniform height you only need to check one particle) and then destroy the particles.

Hope this helps.
Oh, and remember, start by just making any sort of particle engine, then make one that simulates a specific effect.
Squall alias Leon
21
Years of Service
User Offline
Joined: 31st Jul 2003
Location: United Kingdom
Posted: 2nd Aug 2003 16:30
Thanks alot thats alot easier to read than the explanations on the actuall program examples . Alot easier to understand thanx

Still problem 2 though...

Anyone gimme a hand with that?

I gotta enlarge X and Z, but shink Y...as well as fade it away...

Help!

Login to post a reply

Server time is: 2025-05-19 16:14:43
Your offset time is: 2025-05-19 16:14:43