Flint Particle System Forum - flint vs pv3d (weapons, stars, collisions) Sat, 25 Dec 2010 19:38:43 +0000 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher flint vs pv3d (weapons, stars, collisions) http://flintparticles.org/forum/comments.php?DiscussionID=149&Focus=592#Comment_592 http://flintparticles.org/forum/comments.php?DiscussionID=149&Focus=592#Comment_592 Tue, 30 Dec 2008 11:45:09 +0000 kirbysayshi
I am creating a game in the vein of x-wing/freespace/wing commander, with a little BSG thrown in for good measure. The basic flight mechanics are done, and I'm now moving on to weapons. A couple performance-based questions have arisen that could be solved with flint, but I am unsure due to inexperience.

Question 1:

Right now, I'm using papervision 3d to generate the starfield dynamically, so that a good number of stars can be shown wizzing by your cockpit while in motion. Given that the playing area has to be large enough for a dogfight, I'm generating a particle field (pv3d particle field) 8000 x 8000 x 100depth, with 100 stars, 8000 units in front of your ship, for every 1000 units traveled. So every 1000 units, a new starfield "pops in" mostly unnoticed, and then stays in the scene until a certain limit whereupon old ones are deleted. You move at a top speed of around 100 units per frame. Right now, on my slightly-better-than-average desktop, I get about 55 fps. My work dell laptop gets about 30. You can also swivel your ship around while moving in a fixed direction ( moving forward while looking backward), so it's integral that the starts are not deleted the second they're off screen. This all works fine right now.

My first question: could Flint do this using less resources? If I disable my starfield system, I get about 60 fps. Since I'm trying to squeeze all the power I can out of flash, I'm looking to see if Flint can do this more efficiently.

Question 2:

Weapons. I want to have two styles of weapons, a blaster-type (star wars) and a machine-gun type (battlestar). These each require the rapid generation of projectiles; max of 20 per second. Using just papervision cylinders, having only 15 projectiles at any given time on the screen cuts my framerate down to 24 on my desktop (a little more than in half), which is unacceptable right now.

I know that Flint can generate the particles I want, but is it possible to detect collisions between a Flint particle and a PV3D object? Please forgive my ignorance, as wanted to see if it was even possible before I invested a lot of time into Flint.

I read a few threads detailing collisions between bitmaps and movie clips, but they seemed a little old. Thus, I figured I'd see what's up.

Thanks for any help anyone can give! ]]>
flint vs pv3d (weapons, stars, collisions) http://flintparticles.org/forum/comments.php?DiscussionID=149&Focus=601#Comment_601 http://flintparticles.org/forum/comments.php?DiscussionID=149&Focus=601#Comment_601 Wed, 07 Jan 2009 08:43:41 +0000 Richard
Re Q2: Currently Flint only detects collisions between particles. A future version will have actions to detect collisions with other objects, but not yet. However, Flint is designed to be easy to extend, so you may be able to add the specific functionality that you want without much effort. ]]>
flint vs pv3d (weapons, stars, collisions) http://flintparticles.org/forum/comments.php?DiscussionID=149&Focus=614#Comment_614 http://flintparticles.org/forum/comments.php?DiscussionID=149&Focus=614#Comment_614 Mon, 12 Jan 2009 02:09:52 +0000 kirbysayshi
Q1: I'm unfamiliar with the Pixels object, but after seeing the example here: http://www.iamseeker.com/?p=72, I'm excited. Can you "fly through" the pixels, is it a true 3d object, or is it just a flat bitmap in 3d space?

Q2: Would this be something like looping through an array of the particles to check if their xyz coords were within another pv3d object? That sounds very processor intensive... ]]>
flint vs pv3d (weapons, stars, collisions) http://flintparticles.org/forum/comments.php?DiscussionID=149&Focus=617#Comment_617 http://flintparticles.org/forum/comments.php?DiscussionID=149&Focus=617#Comment_617 Mon, 12 Jan 2009 13:57:27 +0000 Richard
Q2: Yes, although approximating the PV3D object to a simpler shape will make it a lot more efficient. ]]>