ZFGC

Projects => Discussion => Topic started by: King Tetiro on February 20, 2011, 09:39:20 pm

Title: Explosions
Post by: King Tetiro on February 20, 2011, 09:39:20 pm
Howdy folks, Tetiro's got a little problem. Explosions

Not the triggering though. This time it's down to the graphics. Now I know you're thinking why isn't this in the graphics. Im more working on the theory of it. Little bit of explanation.

The player will chuck a gunpowder bomb and once it hits the floor, BOOM! So it's a grenade of sorts.
Can someone explain in theory how the gunpowder bomb would look like and work in a game?

I did think about multiple fireballs of different sizes to create a random explosion. I dunno though
Title: Re: Explosions
Post by: Zaeranos on February 21, 2011, 05:43:59 am
It all depends on what language you are programming in. GML, C++, C# or Java. Because it makes a lot of difference.
Title: Re: Explosions
Post by: King Tetiro on February 21, 2011, 07:51:59 am
Its still the good old GM for me. Im good with C++ now, just not that good (Few hurdles here and there to jump over)
Title: Re: Explosions
Post by: Mamoruanime on February 21, 2011, 08:02:14 am
It all depends on what language you are programming in. GML, C++, C# or Java. Because it makes a lot of difference.

I don't know how it would make a difference, since this sounds more like a graphical hurdle.

I say just go the Zelda route and have a shadow representing the object's true x/y coordinates. Have an additional "z" variable that will change the position of the grenade on the Y axis. When it's thrown, throw in some simple physics for Z and trigger the explosion when Z reaches 0.
Title: Re: Explosions
Post by: King Tetiro on February 21, 2011, 09:40:06 am
Im more focusing on the explosion part of it. Like FOR EXAMPLE in Windwaker that rather than it being a proper explosion is a ton of those swirl like graphics.
Title: Re: Explosions
Post by: Mamoruanime on February 21, 2011, 09:45:54 am
>_o just make a particle emitter... aka spawn a bunch of objects who's only purpose is to "draw something and disappear"...
Title: Re: Explosions
Post by: King Tetiro on February 21, 2011, 11:31:07 am
Ok then better question. What does an explosion consist of?
Title: Re: Explosions
Post by: Mamoruanime on February 21, 2011, 12:55:45 pm
Ok then better question. What does an explosion consist of?

Not really a better question :s Explosion consists of particles... Your bomb/grenade/whatever goes off, it creates a bunch of particles...
Title: Re: Explosions
Post by: King Tetiro on February 21, 2011, 01:53:45 pm
Ok then better question. What does an explosion consist of?

Not really a better question :s Explosion consists of particles... Your bomb/grenade/whatever goes off, it creates a bunch of particles...

Yup i know that. How would the particles move? Remain still or move in a random direction
Title: Re: Explosions
Post by: Mamoruanime on February 21, 2011, 01:56:46 pm
Neither... They would push out and gradually slow down... Just study Minish Cap and tWW explosions
Title: Re: Explosions
Post by: Zaeranos on February 21, 2011, 06:59:29 pm
It all depends on what language you are programming in. GML, C++, C# or Java. Because it makes a lot of difference.
I don't know how it would make a difference, since this sounds more like a graphical hurdle.
Actually it does matter. For C++, C# and Java, I would also say create a particle emitter. However in this case for GML I have to differ. GameMaker Pro has some particle system effects that you can use, but these are Pro only. For Lite I suggest you just make a big sprite containing the explosion and have a single object draw it.

If you are going to make an object for every little particle, you can get a dozen objects at once, which Game Maker treats as regular objects, like the player, MC, NPC and obstacles. And when you get a barrage of explosions that the number of objects can increase rapidly, even if their life time is limited. This increase in objects can seriously lag your game. Okay any particle emitter already puts a strain on the game anyway, but creating objects is even worse.

But then again you could create only one object and then draw the various particles at their right places for each frame. This requires some serious calculations or a very big switch statement.
Title: Re: Explosions
Post by: Mamoruanime on February 21, 2011, 11:29:31 pm
It all depends on what language you are programming in. GML, C++, C# or Java. Because it makes a lot of difference.
I don't know how it would make a difference, since this sounds more like a graphical hurdle.
Actually it does matter. For C++, C# and Java, I would also say create a particle emitter. However in this case for GML I have to differ. GameMaker Pro has some particle system effects that you can use, but these are Pro only. For Lite I suggest you just make a big sprite containing the explosion and have a single object draw it.

If you are going to make an object for every little particle, you can get a dozen objects at once, which Game Maker treats as regular objects, like the player, MC, NPC and obstacles. And when you get a barrage of explosions that the number of objects can increase rapidly, even if their life time is limited. This increase in objects can seriously lag your game. Okay any particle emitter already puts a strain on the game anyway, but creating objects is even worse.

But then again you could create only one object and then draw the various particles at their right places for each frame. This requires some serious calculations or a very big switch statement.

Why do you have to create a lot of objects???... Really it's not that tough to simulate the explosion in one single object :\... It's a workaround; but people don't really think centrally when it comes to GM. You make 1 object with a few arrays for particle simulation (position/life/etc). In the step event, you modify those values and lower the life for each. In the draw event, you draw each part to the emitter with a for loop. The thing is particles don't really serve any purpose outside of  being "visual flare". They don't need to have their own unique entity because they're just so simple in structure. Just a controller object (read: emitter). *shrugs* I mean I've made a damn near full engine using only 2 objects in GM. I don't know why people are so quick to add a new one for everything.
Title: Re: Explosions
Post by: DJvenom on February 22, 2011, 03:50:06 am
(http://www.yoroshii.org/boomin.gif) <<
Title: Re: Explosions
Post by: Theforeshadower on February 22, 2011, 03:52:29 am
(http://www.yoroshii.org/boomin.gif) <<

Go away, Jordan.  You ruin everything D:
Why you always got to /thread like this?

Title: Re: Explosions
Post by: DJvenom on February 22, 2011, 03:58:10 am
He asked what explosions should look like.

Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved