View unanswered posts | View active topics It is currently Tue Apr 23, 2024 11:42 pm



Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
 Faster particles? 
Author Message

Joined: Fri Dec 30, 2011 3:33 am
Posts: 276
Reply with quote
Post Faster particles?
If a MOSPixel has the following variables set:

Mass = 0
HitsMOs = 0
GetsHitByMOs = 0

Why is it so slow? A thousand of them drag the sim rate down.

Is there any variable or a function that will disable terrain interaction entirely, for particles that are just there for looks?

Would explicitly turning deepcheck off help any, or a specific material setting improve performance?


Wed Jul 04, 2012 7:54 pm
Profile
User avatar

Joined: Fri Feb 16, 2007 8:43 pm
Posts: 1695
Location: AH SHIT FUCK AUGH
Reply with quote
Post Re: Faster particles?
Not that i know of. It's just slow because... Well, 1000 particles at once. Best thing to do is to try and lower the amount of particles somehow (MOSParticles perhaps). I don't think MOPixels have deep check at all, so turning it off probably wouldn't do anything. Don't hold me up on this, but MAYBE the sim doesn't like 0 mass objects, so you could try setting it to something very close to 0 instead. No guarantees though.


Wed Jul 04, 2012 9:58 pm
Profile WWW
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post Re: Faster particles?
Are we talking MOSParticle or MOPixel? You should test the difference in physics between the two and the possible slowdowns of each.


Wed Jul 04, 2012 10:06 pm
Profile

Joined: Fri Dec 30, 2011 3:33 am
Posts: 276
Reply with quote
Post Re: Faster particles?
We're talking MOPixel.

Quote:
1000 particles at once
That's not that many; a lot of FPS games are throwing around 3-4 times that many. It's just that most particles in most games aren't required to interact with things, clip through stuff, etc. I'd like that for stuff that's short-lived but I want a lot of them. Where do we make feature requests?


Wed Jul 04, 2012 10:24 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post Re: Faster particles?
We don't. That's been a fact for many many years. Unless you can phrase it as a bug, no dice.


Wed Jul 04, 2012 11:14 pm
Profile
User avatar

Joined: Wed Feb 14, 2007 5:37 am
Posts: 350
Reply with quote
Post Re: Faster particles?
Exactly why do you need a thousand particles flying around not interacting with anything?


Thu Jul 05, 2012 3:44 am
Profile WWW

Joined: Fri Dec 30, 2011 3:33 am
Posts: 276
Reply with quote
Post Re: Faster particles?
Well, let's see... decent-looking laser beams, because there isn't a straightforward beam code in the engine that stretches a single quad.

Flamethrowers that you can give to 20 guys and they can all be shooting them at once without dragging the sim down much.

Really nice jetpack flight effects doing some fancy things under the hood and using a lot of different particles.

Guys making dust trails behind themselves if moving rapidly over terrain (like, low-level flight).

Smoke and general FX situations where we want to throw around lots of particles but don't want to have much impact on sim rates.

Basically, a lot of stuff, and all we need is a new class that's basically just a stripped-down MOPixel with terrain detection and physics turned off.

If we want any physics on these things other than the very basics (InheritsVel, GlobalAccScalar, AirResistance) we'd have to Lua it, ideally.


Thu Jul 05, 2012 4:39 pm
Profile

Joined: Wed Feb 11, 2009 11:01 pm
Posts: 28
Reply with quote
Post Re: Faster particles?
A lot of that stuff can be achieved without using 100s of particles. You can get really nice smoke trails with less than 10 particles, and laserbeams can be achieved by using the same code as bullets using really long trails, really tight aim and no gravity interaction (there are also alternatives but I'm not going to go into depth here). I'm not a modder but even I know the stuff your describing can be achieved using very few particles.

Also yes 1000 particles isn't much if they've got no physics interactions, but you must also remember that pretty much everything in this game is a physics object, even the walkcycles are heavily influenced by physics, which isn't something that happens in other games, so sacrifices have to be made in the name of performance.


Thu Jul 05, 2012 7:54 pm
Profile
User avatar

Joined: Sun Jan 28, 2007 10:32 pm
Posts: 1609
Location: UK
Reply with quote
Post Re: Faster particles?
Zuriki wrote:
...and laserbeams can be achieved by using the same code as bullets using really long trails, really tight aim and no gravity interaction (there are also alternatives but I'm not going to go into depth here).


You will not get good-looking instant beams using ultra-long-trail bullets, in part due to speed limitations, period. Particles beyond a certain velocity start to get more and more glitchy (hit detection starts to go wonky, for instance), and a certain point simply cease to exist. Yes, if they go too fast, they just... stop existing. Completely.

There's also the matter of the beam appearance itself. You have a beam, but it's not going to be a particularly pretty beam.

-----------------------------------

xenoargh wrote:
That's not that many; a lot of FPS games are throwing around 3-4 times that many. It's just that most particles in most games aren't required to interact with things, clip through stuff, etc. I'd like that for stuff that's short-lived but I want a lot of them. Where do we make feature requests?


Those same FPS games are running on high-end engines that have been worked on by an entire team of professionals who do this sort of thing for an actual living, not just one man and a handful of his internet buddies. It's not really a fair comparison.


Thu Jul 05, 2012 8:25 pm
Profile YIM

Joined: Fri Dec 30, 2011 3:33 am
Posts: 276
Reply with quote
Post Re: Faster particles?
Quote:
Those same FPS games are running on high-end engines that have been worked on by an entire team of professionals who do this sort of thing for an actual living, not just one man and a handful of his internet buddies. It's not really a fair comparison.
Well, it's hard to judge the problem from here, certainly, but I've done enough coding to know that usually, taking features out (i.e., skipping physics) is usually one heck of a lot easier than putting stuff in.

Particle systems are pretty simple code, imo, but I've written a couple of them, so my perspective is maybe a little different than most people's :-)


Thu Jul 05, 2012 8:46 pm
Profile
User avatar

Joined: Fri May 11, 2007 4:30 pm
Posts: 1040
Location: England
Reply with quote
Post Re: Faster particles?
To give some perspective I made a small engine using SDL that ran fine with 5000 small objects that had random movement (a few different variations for different types as well) and collided with (well avoided really) the map seam and terrain but had no physics or rotation. I made this in less than a day and I wasn't a very good programmer at the time (couple of years ago now). I just ran it with 8000 objects and I was getting 45fps... Granted there wasn't much else going on other than the player stuff http://i.cubeupload.com/Lv4ZRE.png (I'm not particularly proud of this so you're lucky I'm posting it to back up my claim). Even Arne can do 1000 AI without too much lag http://androidarts.com/smb/1000surprises.png.

Basically a class with only bare-bones physics that does not collide would be blazingly fast compared to even MOPixels. I think it would be worth it, it would make the game run explosions and many other visual effects faster and open up a load of Lua possibilities. Even with all the current stuff taking up a lot of fps I think this would let you could add at least 1000 of this new class without severely limiting fps, probably can't say the same for MOPixels and for MOSRotatings there's not a chance in hell. (I tested a lot of this stuff a while ago, there's also issues with settling to terrain)


Sun Jul 08, 2012 3:51 pm
Profile

Joined: Fri Dec 30, 2011 3:33 am
Posts: 276
Reply with quote
Post Re: Faster particles?
Simple particles can be really cheap, yup.

Heck, once particles are built, you can just hand them over to a shader and let the GPU do all the work, so that the main costs are on creation, using vertex attributes :-)

Collision detection is very not-cheap, comparatively. I'll be the first to say that I don't have the foggiest clue how it works on this engine, other than it must use a great deal of brute-force when it's detecting the ground, probably a search of the nearest pixels every sim frame.

Anyhow, doing a shader-based method is probably out of scope, but just having a flag that causes the particles to not display an Atom and do collision stuff would really speed things up a lot :-)


Sun Jul 08, 2012 4:08 pm
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post Re: Faster particles?
You're forgetting that each and every one of those particles is checking against terrain every frame, too, using a per-pixel raycasting system. It's a little more complicated than a simple particle system.


Tue Jul 10, 2012 2:10 am
Profile WWW

Joined: Fri Dec 30, 2011 3:33 am
Posts: 276
Reply with quote
Post Re: Faster particles?
That's what I'd like turned off, yes.

If it's just a visual effect, we don't need to do any raycasting and it's allowed to drift freely through terrain, which sounds bad but for the kinds of things it'd get used for (fast explosion FX with a lot of sprites, jetpack effects, flamethrower master particles spitting out a bunch of sprites every few frames, anything where sheer particle count is about the only way to get it done or add randomness) the speed tradeoff is worth it imo :-)


Tue Jul 10, 2012 6:36 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post Re: Faster particles?
Scrap the MO, just give us the Pixel!


Tue Jul 10, 2012 4:59 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 16 posts ]  Go to page 1, 2  Next

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.060s | 17 Queries | GZIP : Off ]