Home   Help Search Login Register  

Author Topic: SP mission lag reduction/benchmark improvement question  (Read 665 times)

0 Members and 1 Guest are viewing this topic.

FLBEE

  • Guest
During the mission I'm working on, there are constant battles going on in which the player may or may not be involved. The battle happens anyway even if it is just atmosphere for the player.

Right now I have a script set up to delete the fallen troops and create unit new soldiers at the next point of the battle.

So, would it be better for lag reduction if i just setpos and set dammage the dead guys back to life, or continue with the deletevehicle createunit routine?


Another lag question--If i set the view distance to 900 in init,and set the fog to blur out just before the 900-- do the units outside of the view distance pull on the computer resources very much?- enough that I should only create unit them right before they are mission important?-or can I let them be ready to go until needed?


thanks

Offline Kuro

  • Former Staff
  • ****
  • 2./FschJgBtl 251 Green Devils
    • VBS2 Mission Download Site
Re:SP mission lag reduction/benchmark improvement question
« Reply #1 on: 14 Apr 2004, 03:29:50 »
Hello,
So, would it be better for lag reduction if i just setpos and set dammage the dead guys back to life, or continue with the deletevehicle createunit routine?

You can not setdammage a guy back to life.  You have to stay with delete and create.

Another lag question--If i set the view distance to 900 in init,and set the fog to blur out just before the 900-- do the units outside of the view distance pull on the computer resources very much?- enough that I should only create unit them right before they are mission important?-or can I let them be ready to go until needed?

The viewdistance influences two things: One is the fog. the second is the checking distance for the AI.

To really reduce lag, do the following things:
- Select Island carefully. Big islands with a lot of objects lag a lot more than small ones.
- Select viewdistance carefully.  A lot of lack can be prevented with less viewdistance.
- Place/ Create Units and Objects carefully. Do you really need so many units.
- Use Sound wisely.  For athmosphere some well placed battlesounds and ambient sound are more effective and less laggy than a lot of units.
- If you use ECP turn of the effects you do not use. (can be done in the init file of your mission).

Kammak

  • Guest
Re:SP mission lag reduction/benchmark improvement question
« Reply #2 on: 14 Apr 2004, 09:00:32 »
Quote
You can not setdammage a guy back to life.  You have to stay with delete and create.

?

You can in my OFP.

Guy named "hGuy", with this in init field:

this addventhandler["killed",{hGuy setdamage 0}]

You can shoot until you run out of ammo but he will never die.

Now, to the original question - I have no clue what performance effect this has over delete and create, but intuitively I would guess this is slightly better.  Delete and Create (and their analogs) are usually "expensive" operations, compared to resetting a bool (dead/not dead) or just adjusting a real (change .9 to .2) etc...




FLBEE

  • Guest
Re:SP mission lag reduction/benchmark improvement question
« Reply #3 on: 15 Apr 2004, 03:50:28 »
Thx,
 :)

Kammak,
that makes sense to me, i'm going to rewrite the script to setpos setdammage and see if it lags less during the battles. My script waits for the 24 troops (2 groups) to all die before deleting them, and i always get a little hiccup when it delets and creates all 24.

thx again

Offline Kuro

  • Former Staff
  • ****
  • 2./FschJgBtl 251 Green Devils
    • VBS2 Mission Download Site
Re:SP mission lag reduction/benchmark improvement question
« Reply #4 on: 15 Apr 2004, 03:55:20 »
Do not create 24 troops at once ! This is big LAG (you can cover it with a autosave BTW).
Create them one by one with half a second break between will work much better.

FLBEE

  • Guest
Re:SP mission lag reduction/benchmark improvement question
« Reply #5 on: 16 Apr 2004, 12:47:27 »
thx  ;D
solved..