Product Chat / Particle Emitters

Author
Message
OldFlak
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 27th Jan 2015
Location: Tasmania Australia
Posted: 21st Dec 2018 10:17
Hi all

I have two maps, one which is a test map for models, and the other one is a test level for a game I have been working on, on and off.

On both maps - if I have particle emitters - it causes issues that cripple the game play to some extent.

The level for my game - this has 524 entities. 2 of which are smoke emitters.
There is one point about half way through the map where there are several lava decals, at this point the game play has a slow-motion effect happening, once you get past the decals everything goes back to normal.

The test map for models - this has 924 entities. 3 of which are smoke and fire emitters.
This map plays fine, but there is a pair of animated gates, which when activated, go into slow-motion - taking about 30 seconds to open or close.

In both cases just deleting the emitters fixes the issue.

While optimizing the levels would obviously play a part here, I am just wondering if the particle system is causing a slow-down in the engine.

Has anyone else seen this?

Reliquia....
aka OldFlak
Intel(R) Core(TM) i3-4160 @ 3,60GHz. 8GB Ram. NVidia GeForce GTX 750. Acer 24" Monitors x 2 @ 1920 x 1080. Windows 10 Pro 64-bit.
PM
GraPhiX
Forum Support
19
Years of Service
User Offline
Joined: 15th Feb 2005
Playing:
Posted: 21st Dec 2018 10:31 Edited at: 21st Dec 2018 10:31
Hi reliquia, I have seen this happen if you attach the emitters to triggerzones, what are you attaching them too and what settings do you have in the FPE of the host?
Welcome to the real world!
Main PC - Windows 10 Pro x64 - Core i7-7700K @4.2GHz - 32GB DDR4 RAM - GeForce GTX 1060-6G 6GB - 1TB NVe SSD
Test PC - Windows 10 Pro x64 - G4400 @3.3GHz - 16GB DDR3 RAM - GeForce GTX 950 2GB - 500GB SSD
Laptop - Helios 300 Predator - i7 7700HQ - 32GB - Nvidia GTX1060 6GB - 525GB M2 - 500 SSD - 17.3" IPS LED Panel - Windows 10 Pro x64
Various Tutorials by me
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 21st Dec 2018 10:31
Can you post the scripts you are using for the particle emitters?
Been there, done that, got all the T-Shirts!
PM
OldFlak
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 27th Jan 2015
Location: Tasmania Australia
Posted: 21st Dec 2018 11:01 Edited at: 21st Dec 2018 11:08
@GraPhix - I modeled a simple low poly disc for now. I was thinking of attaching them to more specific things like logs for fire, ash heaps for smoke etc.



@AmenMoses
Yeah, not too flash at scripting, but here ya go

Reliquia....
aka OldFlak
Intel(R) Core(TM) i3-4160 @ 3,60GHz. 8GB Ram. NVidia GeForce GTX 750. Acer 24" Monitors x 2 @ 1920 x 1080. Windows 10 Pro 64-bit.

Attachments

Login to view attachments
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 21st Dec 2018 11:29 Edited at: 21st Dec 2018 11:31
Do you have vsynch off?

One of the emitters is set to spawn at 1 ms rate, which seeing as the minimum life of the particles is 500ms is a wee bit excessive.

Try changing the spawn rate to something more sensible like 20 ms and make sure vsynch is on to see if that improves matters.

Also the emitters are going to be merrily spawning away even if the player is on the other side of the map, I would have the emitters created when needed, for example when the player enters a certain trigger zone or comes with a certain range, then have them deleted when no longer needed.

Added an example script showing how the number of particles an emitter can create is controlled.

Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
OldFlak
GameGuru TGC Backer
9
Years of Service
User Offline
Joined: 27th Jan 2015
Location: Tasmania Australia
Posted: 21st Dec 2018 11:49
Thanks AmenMoses, will take a look tomorrow, heading for shuteye now...

Reliquia....
aka OldFlak
Intel(R) Core(TM) i3-4160 @ 3,60GHz. 8GB Ram. NVidia GeForce GTX 750. Acer 24" Monitors x 2 @ 1920 x 1080. Windows 10 Pro 64-bit.
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 21st Dec 2018 12:17
One other word of caution, there are several reasons why doing things in the _init part of the script is not a good idea:
1) Any errors in the _init function will not get properly reported.

2) When you repeatedly test a map GG doesn't properly clean up between runs, this may mean for example that the emitters created in the first run still exist when you do the second run and the third etc.

3) Under some conditions I've found that the _init function doesn't get called, only seems to happen when there are a lot of scripted entities and they aren't 'always active'. I think this is caused by GG trying to be too clever and inhibiting too many active entities to improve performance, so only entities which are close to the player get their scripts called.

If you see performance problems in test runs the first thing to try is restart GG and see if the problem exists in a clean run.


Been there, done that, got all the T-Shirts!
PM

Login to post a reply

Server time is: 2024-11-24 02:58:40
Your offset time is: 2024-11-24 02:58:40