Jump to content


annoying particle cap


10 replies to this topic

#1 n5p29

    Lurker

  • Project Leader
  • 1417 posts
  • Projects: NProject Mod, Recolonize, Tidal Wars

Posted 09 July 2010 - 07:23

I'm trying to find how to permanently remove the particle cap on ZH. I'm suspecting the particle cap as the main culprit of the lag bugs in MP games (beside pathfinding and AI issue).

1. I've tried to manually edit the Options.ini, changing the ParticleCap to very high number. not working, lags still happened sometimes.
2. there's also a WB script that will disable particle cap. it works on singleplayer missions, but not in MP games. the particles still removed and then lagging.

anyone can help?

#2 Genrail

    Semi-Pro

  • Project Team
  • 234 posts
  • Projects: Private Map Contractor

Posted 09 July 2010 - 07:41

Did you try both.... at the same time
This place still exists?

#3 Destiny

    Forum Nakadashi-er

  • Member Test
  • 3141 posts

Posted 09 July 2010 - 07:45

He's quite experienced as he is, I'm sure he's done it at the same time and separately.
Posted Image

#4 Kris

    <Custom title available>

  • Project Team
  • 3825 posts

Posted 09 July 2010 - 08:22

Actually, the particle cap is the one who "improves" the performance by cutting down unnecessary effects.

One thing i did to optimize my particles in C&C U was remove unused codes in the particle entries in ParticleSystems.ini and reduce some of the particle counts on some unnecessary effects.

For example, I turn this:

Quote

ParticleSystem ApacheMidAirExplosion
Priority = DEATH_EXPLOSION
IsOneShot = No
Shader = ALPHA
Type = PARTICLE
ParticleName = EXCloud01.tga
AngleZ = 0.00 7.00
AngularRateZ = -0.01 0.01
AngularDamping = 1.00 1.00
VelocityDamping = 0.90 0.92
Gravity = 0.00
SlaveSystem = MammothTankExplosionFlameSlave
SlavePosOffset = X:0.00 Y:0.00 Z:0.00
Lifetime = 100.00 100.00
SystemLifetime = 1
Size = 20.00 20.00
StartSizeRate = 0.00 0.00
SizeRate = 5.00 6.00
SizeRateDamping = 0.80 0.80
Alpha1 = 1.00 1.00 0
Alpha2 = 0.00 0.00 100
Alpha3 = 0.00 0.00 0
Alpha4 = 0.00 0.00 0
Alpha5 = 0.00 0.00 0
Alpha6 = 0.00 0.00 0
Alpha7 = 0.00 0.00 0
Alpha8 = 0.00 0.00 0
Color1 = R:255 G:125 B:25 0
Color2 = R:100 G:100 B:100 60
Color3 = R:0 G:0 B:0 0
Color4 = R:0 G:0 B:0 0
Color5 = R:0 G:0 B:0 0
Color6 = R:0 G:0 B:0 0
Color7 = R:0 G:0 B:0 0
Color8 = R:0 G:0 B:0 0
ColorScale = 0.00 0.00
BurstDelay = 0.00 0.00
BurstCount = 25.00 25.00
InitialDelay = 0.00 0.00
DriftVelocity = X:0.20 Y:0.20 Z:0.25
VelocityType = OUTWARD
VelOutward = -4.00 4.00
VelOutwardOther = -4.00 4.00
VolumeType = CYLINDER
VolCylinderRadius = 3.00
VolCylinderLength = 0.00
IsHollow = No
IsGroundAligned = No
IsEmitAboveGroundOnly = No
IsParticleUpTowardsEmitter = No
WindMotion = Unused
WindAngleChangeMin = 0.149924
WindAngleChangeMax = 0.449946
WindPingPongStartAngleMin = 0.000000
WindPingPongStartAngleMax = 0.785398
WindPingPongEndAngleMin = 5.497787
WindPingPongEndAngleMax = 6.283185
End


to this:

Quote

ParticleSystem ApacheMidAirExplosion
Priority = DEATH_EXPLOSION
IsOneShot = No
Shader = ALPHA
Type = PARTICLE
ParticleName = EXCloud01.tga
AngleZ = 0.00 7.00
AngularRateZ = -0.01 0.01
AngularDamping = 1 1
VelocityDamping = 0.90 0.92
Gravity = 0
SlaveSystem = MammothTankExplosionFlameSlave
SlavePosOffset = X:0 Y:0 Z:0
Lifetime = 100 100
SystemLifetime = 1
Size = 20 20
StartSizeRate = 0 0
SizeRate = 5 6
SizeRateDamping = 0.80 0.80
Alpha1 = 1.00 1.00 0
Alpha2 = 0 0 100
Alpha3 = 0 0 0
Color1 = R:255 G:125 B:25 0
Color2 = R:100 G:100 B:100 60
Color3 = R:0 G:0 B:0 0
ColorScale = 0 0
BurstDelay = 0 0
BurstCount = 25 25
InitialDelay = 0 0
DriftVelocity = X:0.20 Y:0.20 Z:0.25
VelocityType = OUTWARD
VelOutward = -4 4
VelOutwardOther = -4 4
VolumeType = CYLINDER
VolCylinderRadius = 3
WindMotion = Unused
End


Doing that to ALL particles kindof improved the overall performance of the game.

If you still want to "increase" the particle cap of ZeroHour, edit the MaxParticleCount parameter in GameData.ini instead of the particle cap parameter in Options.ini.







#5 Failure

    Professional

  • Project Team
  • 302 posts
  • Projects: None

Posted 09 July 2010 - 10:16

First of all that makes lag - particles with PRIORITY - CRITICAL
It makes the game try to show those particles at all costs.

I have found this in gamedata.ini. Not sure if it'll help you though.
  MaxParticleCount = 2500	  &#59; the maximum number of particles that can exist at one time &#40;to 5000 for demo&#41;
  MaxFieldParticleCount = 30&#59; the number of field type particles rendered to the screen, beyond which this type will begin skipping
							&#59; a field particle is one of Priority AREA_EFFECT and isGroundAligned = Yes
							&#59; Typically these are puddles, toxic contamination, radiation, decontamination, etc.



Chris does that particle tuning, greatly improve performance?
You just delete unused stuff?

Edited by Failure, 09 July 2010 - 10:17.


#6 Kris

    <Custom title available>

  • Project Team
  • 3825 posts

Posted 09 July 2010 - 10:39

View PostFailure, on 9 Jul 2010, 18:16, said:

First of all that makes lag - particles with PRIORITY - CRITICAL
It makes the game try to show those particles at all costs.
Not only that, some particles have unnecessary particle count for little gain and some are not even working properly (not properly timed, unused etc,.).  Which in turn, just eats space and wastes SAGE's CPU cycles checking if the particle is used or not = Lag / performance loss.  I just forgot the exact names of those particles though.

Some are explained by Beng in C&Cmaps:

Quote

I have fixed those and also fixed a lot of the non-functioning particle systems (loads of them had an initial delay longer than a non-zero system lifetime, which means that the system will be deleted before it has has a chance to make the first burst of particles, this was especially true of aircraft carrier, sneak attack snow, avalanche, and bomb truck systems - whoever made those didn't know what he was doing). I have also edited the firestorm and inferno cannon fire field systems and the missile backblast systems to make them better.




View PostFailure, on 9 Jul 2010, 18:16, said:

Chris does that particle tuning, greatly improve performance?
You just delete unused stuff?


Yeah, trimming the codes did improved the performance of ZeroHour. Atleast for me...
Not only that, it also trimmed my ParticleSystem.ini filesize from 1.7MB down to 817KB; Without custom particles i've added, the file's around 600KB .

ParticleSystem.ini seriously have the case of bloatware :read:.

Edited by Kris, 09 July 2010 - 10:47.








#7 Failure

    Professional

  • Project Team
  • 302 posts
  • Projects: None

Posted 09 July 2010 - 11:08

Good I'll trim mine too.

Also there are many particles that have alpha problems. It's strange, since in stock generals you could've have a big alpha delay aka
Alpha1 0.00 0.00 0
Alpha2 1.00 1.00 200

In zero hour it varies. I'm usually making it max fade in at 25 frames. Higher values sometimes return nothing and particle isn't even spawned ( look at zero hour nukemushroomringsmoke - it works in generals, in zero hour not )

Maybe I'll have some time to trim the whole file :read:

Edited by Failure, 09 July 2010 - 11:09.


#8 n5p29

    Lurker

  • Project Leader
  • 1417 posts
  • Projects: NProject Mod, Recolonize, Tidal Wars

Posted 09 July 2010 - 11:12

View PostKris, on 9 Jul 2010, 15:22, said:

Actually, the particle cap is the one who "improves" the performance by cutting down unnecessary effects.

I think it's not the particle effects that makes the lag. I've once tried to trigger a lot of particles in a custom SP map and turned off the particle cap via coding. it's not lagged at all. even the framerate were dropped, all particles still shown up.
I think it depends on the computer's capability. I have a computer that can run many newer games smoothly, but how could it can't run ZH smoothly?

View PostKris, on 9 Jul 2010, 15:22, said:

One thing i did to optimize my particles in C&C U was remove unused codes in the particle entries in ParticleSystems.ini and reduce some of the particle counts on some unnecessary effects.

Doing that to ALL particles kindof improved the overall performance of the game.

I'm still converting my ParticleSystem.ini for that. but that will be take a LOT of time. so I'm finding another alternatives.

View PostKris, on 9 Jul 2010, 15:22, said:

If you still want to "increase" the particle cap of ZeroHour, edit the MaxParticleCount parameter in GameData.ini instead of the particle cap parameter in Options.ini.

ah, I missed this one. tried this later.

View PostKris, on 9 Jul 2010, 17:39, said:

View PostFailure, on 9 Jul 2010, 18:16, said:

First of all that makes lag - particles with PRIORITY - CRITICAL
It makes the game try to show those particles at all costs.
Not only that, some particles have unnecessary particle count for little gain and some are not even working properly (not properly timed, unused etc,.). Which in turn, just eats space and wastes SAGE's CPU cycles checking if the particle is used or not = Lag / performance loss.  I just forgot the exact names of those particles though.

Some are explained by Beng in C&Cmaps:

Quote

I have fixed those and also fixed a lot of the non-functioning particle systems (loads of them had an initial delay longer than a non-zero system lifetime, which means that the system will be deleted before it has has a chance to make the first burst of particles, this was especially true of aircraft carrier, sneak attack snow, avalanche, and bomb truck systems - whoever made those didn't know what he was doing). I have also edited the firestorm and inferno cannon fire field systems and the missile backblast systems to make them better.


anyway, because they checked them one by one, I think that's the source of the lags. so I have theory that if we skip that "checking", it will be solved. like how uncapped FPS worked.

#9 JJ

    Half dead member

  • Project Leader
  • 3294 posts
  • Projects: Real life things, personal RA3 mod

Posted 09 July 2010 - 12:47

View Postn5p29, on 9 Jul 2010, 19:12, said:

View PostKris, on 9 Jul 2010, 15:22, said:

One thing i did to optimize my particles in C&C U was remove unused codes in the particle entries in ParticleSystems.ini and reduce some of the particle counts on some unnecessary effects.

Doing that to ALL particles kindof improved the overall performance of the game.

I'm still converting my ParticleSystem.ini for that. but that will be take a LOT of time. so I'm finding another alternatives.


Get Notepad++, use the replace function.

#10 n5p29

    Lurker

  • Project Leader
  • 1417 posts
  • Projects: NProject Mod, Recolonize, Tidal Wars

Posted 09 July 2010 - 13:49

View PostJJ_, on 9 Jul 2010, 19:47, said:

View Postn5p29, on 9 Jul 2010, 19:12, said:

View PostKris, on 9 Jul 2010, 15:22, said:

One thing i did to optimize my particles in C&C U was remove unused codes in the particle entries in ParticleSystems.ini and reduce some of the particle counts on some unnecessary effects.

Doing that to ALL particles kindof improved the overall performance of the game.

I'm still converting my ParticleSystem.ini for that. but that will be take a LOT of time. so I'm finding another alternatives.


Get Notepad++, use the replace function.

I can't do that very risky action. I need to check each ParticleSystem to make sure they're optimized correctly.

#11 Ion Cannon!

    Mountain Maniac

  • Gold Member
  • 5812 posts
  • Projects: European Conflict - Particle FX & Coder

Posted 22 July 2010 - 16:32

Although you can increase the particle cap using the gameoptions ini, the game still has a hard cap. I had the cap set as 100k for a bit, and one of my early firewalls still caused the game to crash. Reverting it back to 5k stopped it crashing, but I didn't experiment much more than that.

Indeed there are shitloads of particles which are extremely inefficient or bloated, but finding them can be hard. There are also some particles with odd Colourscale values, which seems to completely mess up the lifetime. One such particle was an element of the default napalm explosion. I also had to rework alot of the default flame effects for EC, as I remember the small napalm fire - used something like 800 particles.. There are other cases of certain effects using 2 of the same effect as well. I never bothered to prune stuff though. Hence my particlesystem is a bit over 2mb 8|
Posted Image

Posted Image



1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users