Jump to content
Sign in to follow this  
Coolinator

How to make a mission LAG FREE?

Recommended Posts

I'm so frustrated and sad right now :( I just created a mission that took me 2 weeks to finish it, 24/7 each day. Then I played it in a dedicated server with my friends. It was just a nightmare, my 2 week effort, sweat and tears making my mission just wasted :( because it keeps lagging like hell. I didn't even use a lot of Ai's. I have seven objectives, with EOS markers for each. Each objectives don't have any Ai's in it, except the last one like about 20. But each objectives has some small objects in it like desks and chairs, laptops and intels.

I just don't know what causing the LAG :( should I cut down my objectives to 3-4? Delete more small objects like desks and chairs? Delete more Ai's even I only put 20 Ai's in my mission and rest are eos spawn markers?

Most of my friends also use weapon and clothing mods, I don't know if that cause the lags? Most of them also use Voice chats.

Should I make mission really short?? And less populated (objects and Ai's)?

I need your advice guys! I'm really depressed right now T_T

Share this post


Link to post
Share on other sites

There are limitless reasons why the mission lags so much. Most of them beyond the scope of what anyone could reasonably list in one post. Number of objectives should not affect it nor amount of objects unless there are hundreds or thousands. 20 Ai should not cause problems either. I've no ideah how efficient your coding is or how many simultaneous process are happening. What I'd really like to mention is that I've seen the best coded and simplest missions take a dump and it have nothing to do with the mission, but have everything to do with mods. If a client is running a mod the server or the other clients are not running then that could cause lag. Have a look at the Dedi's .rpt and your rpt to see what is going on. #monitor as admin on dedi to see server fps. As an experiment run some weapon mods on your client that the server is not running and load a saved loadout from VAS or VA and watch the frames dip. Every time from them on when you fire it will dip aswell and spam everybody's rpt.

Only run mods on server that mission is using and limit mods allowed on client by enabling keys on server. Once you have that under control and you have a well chosen (bug free modset as much as possible) and everyone is running the same mods, and only then, use -nologs on server and client start ups to reduce further lag caused by residual rpt spam from mods and game engine. the difference will be night and day. Careful about using -nologs on server because you will not be able to catch mission errors generated on server. Either way you could post you mission and brave critique. I'm sure someone will figure a more efficient way to do something in it even if mods are not an issue. My 2 pesos.

Share this post


Link to post
Share on other sites
Post the mission file. Someone is bound to have a look.

Can I post the download link in this thread?

Share this post


Link to post
Share on other sites
Can I post the download link in this thread?

No, you can make it a little bit more complicated... :cool:

Share this post


Link to post
Share on other sites

Okay guys I will post my mission download link tommorow, I need to get some sleep right now. It's midnight here. Also, Thank you for everyone sharing their advice and who's trying to help, I really appreciate it.

---------- Post added at 10:12 ---------- Previous post was at 10:05 ----------

I forgot to include this in my post, I don't use mods in my missions, just scripting. I don't know how to mod.

I'm not a scripter either, I'm more like a mission maker, but I have to know how to use scripts just to be able to make simple respawn, AI patrols,etc.. You know what I mean? Without scripts my mission will be very bland.

This community helped me so many times with scripting for my missions that I created back then from arma 2, and also arma 3. That's why I always say "I really appreciate it" every time someone help me with scripting in this forum because I know it takes a lot of their time and effort trying to solve my scripting problems. Without them , I don't think I would ever create at least one decent mission.

I want to give a special thanks to everyone who helped me with scripting, especially to iceman77 and Jshock, who helped me a tons of times :)

Edited by Coolinator

Share this post


Link to post
Share on other sites
I'm so frustrated and sad right now :( I just created a mission that took me 2 weeks to finish it, 24/7 each day. Then I played it in a dedicated server with my friends. It was just a nightmare, my 2 week effort, sweat and tears making my mission just wasted :( because it keeps lagging like hell. I didn't even use a lot of Ai's. I have seven objectives, with EOS markers for each. Each objectives don't have any Ai's in it, except the last one like about 20. But each objectives has some small objects in it like desks and chairs, laptops and intels.

I just don't know what causing the LAG :( should I cut down my objectives to 3-4? Delete more small objects like desks and chairs? Delete more Ai's even I only put 20 Ai's in my mission and rest are eos spawn markers?

Most of my friends also use weapon and clothing mods, I don't know if that cause the lags? Most of them also use Voice chats.

Should I make mission really short?? And less populated (objects and Ai's)?

I need your advice guys! I'm really depressed right now T_T

Is this an actual dedi or a virtual dedi running off your home computer?

If you try to host even a modest sized MP scenario from your home PC, you will likely have bandwidth choke and that can cause all sorts of issues.

Edited by MDCCLXXVI

Share this post


Link to post
Share on other sites

Sorry it took long for me to upload my mission file, i just woke up and had to some house chores.

EDIT:

i made some few changes last night, this is the latest updated one (i changed the old link to a new link)

Here it is :): (link closed)

Edited by Coolinator

Share this post


Link to post
Share on other sites
Is this an actual dedi or a virtual dedi running off your home computer?

If you try to host even a modest sized MP scenario from your home PC, you will likely have bandwidth choke and that can cause all sorts of issues.

MDCCLXXVI has a good point with the above quoted.

Looking through just the scripts and such I don't see many possible issues (mind that I am just looking in the mission folder, I'm not actually going into the editor a looking at stuff), but when does it get laggy? Is it constant or only at certain points in the mission?

Share this post


Link to post
Share on other sites
Is this an actual dedi or a virtual dedi running off your home computer?

If you try to host even a modest sized MP scenario from your home PC, you will likely have bandwidth choke and that can cause all sorts of issues.

just virual dedicated server from home pc

---------- Post added at 02:10 ---------- Previous post was at 02:09 ----------

MDCCLXXVI has a good point with the above quoted.

Looking through just the scripts and such I don't see many possible issues (mind that I am just looking in the mission folder, I'm not actually going into the editor a looking at stuff), but when does it get laggy? Is it constant or only at certain points in the mission?

at certain points, like time to time :( you can check the editor, if u want to see if i put too many objects or ai's.

Share this post


Link to post
Share on other sites
just virual dedicated server from home pc

at certain points, like time to time :( you can check the editor, if u want to see if i put too many objects or ai's.

Ok, if these certain points are when the ambush scripts are ran, they could be part of the issue (should only be short stint lags, maybe at a max of a few seconds), and that's because, seeing how I believe these are the scripts I wrote a while back for you :p, I forgot to put a short sleep within the loop, so it's not giving the time needed for the server to spawn the group and cache the next, it's just trying to spawn them all at once :p.

So to fix, put this in both files:

//ambush.sqf
_area = (_this select 0);  
_distance = (_this select 1);  
_numGrps = (_this select 2); 
_center = createCenter EAST;  


for "_i" from 0 to (_numGrps) step 1 do 
{ 
   _rndConfig = ["OIA_InfTeam", "OIA_InfSquad", "OIA_InfTeam_AT"] call BIS_fnc_selectRandom;  

   _pos = [(getPos _area), _distance, random(359)] call BIS_fnc_relPos;  

   _grp = [_pos, _center, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> (_rndConfig))] call BIS_fnc_spawnGroup;  

   [_grp, (getPos _area)] call BIS_fnc_taskAttack; 

   sleep 0.05;//<<<<this
};

And as far as you running off your own home PC, you need to realize that you will be supporting both you playing the game and the server (in a sense), so as MDCCLXXVI pointed out not only would you have bandwith throttles with enough network traffic, but your also doing the work of technically two players at once, so without a CPU/RAM backend, it may be detrimental on your end.

And with what you described the number of objects/AIs shouldn't be an issue at all.

Edited by JShock

Share this post


Link to post
Share on other sites
Ok, if these certain points are when the ambush scripts are ran, they could be part of the issue (should only be short stint lags, maybe at a max of a few seconds), and that's because, seeing how I believe these are the scripts I wrote a while back for you :p, I forgot to put a short sleep within the loop, so it's not giving the time needed for the server to spawn the group and cache the next, it's just trying to spawn them all at once :p.

So to fix, put this in both files:

//ambush.sqf
_area = (_this select 0);  
_distance = (_this select 1);  
_numGrps = (_this select 2); 
_center = createCenter EAST;  


for "_i" from 0 to (_numGrps) step 1 do 
{ 
   _rndConfig = ["OIA_InfTeam", "OIA_InfSquad", "OIA_InfTeam_AT"] call BIS_fnc_selectRandom;  

   _pos = [(getPos _area), _distance, random(359)] call BIS_fnc_relPos;  

   _grp = [_pos, _center, (configfile >> "CfgGroups" >> "East" >> "OPF_F" >> "Infantry" >> (_rndConfig))] call BIS_fnc_spawnGroup;  

   [_grp, (getPos _area)] call BIS_fnc_taskAttack; 

   sleep 0.05;//<<<<this
};

And as far as you running off your own home PC, you need to realize that you will be supporting both you playing the game and the server (in a sense), so as MDCCLXXVI pointed out not only would you have bandwith throttles with enough network traffic, but your also doing the work of technically two players at once, so without a CPU/RAM backend, it may be detrimental on your end.

And with what you described the number of objects/AIs shouldn't be an issue at all.

hmm i guess MDCLXXVI would be the closest explanation for my mission lag.

but i hosted it last friday just for my friends, i didn't play at all, i just let the server running, they said they were still lagging like crazy :/ thats what i was really worried about :( How could they still lag even im not even playing? :(

---------- Post added at 02:36 ---------- Previous post was at 02:35 ----------

Also, i dont think it's your ambush script Jshock, because they still lagged even there was no ambush :(

Share this post


Link to post
Share on other sites
hmm i guess MDCLXXVI would be the closest explanation for my mission lag.

but i hosted it last friday just for my friends, i didn't play at all, i just let the server running, they said they were still lagging like crazy :/ thats what i was really worried about :( How could they still lag even im not even playing? :(

Depends on the number of players, again bandwith, RAM, and CPU levels decide how "good" the server is to run the mission, the more players, the more these things are affected.

Share this post


Link to post
Share on other sites
Depends on the number of players, again bandwith, RAM, and CPU levels decide how "good" the server is to run the mission, the more players, the more these things are affected.

ahh kk i see thnx :), quick question, does rain and fog cause lag too? also i noticed that it doesn't sync in mp, is there a way to sync it in MP? or do u suggest i just keep my weather with no rain and fog, just sunny weather?

Share this post


Link to post
Share on other sites

Yes, instant changes in weather cause lag issues, progressive changes shouldn't be much of an issue, as far as syncing it all, I wouldn't know exactly how to do it, as weather is finicky when it comes to syncing/broadcasting (or at least from what I've seen in the past).

Share this post


Link to post
Share on other sites
Yes, instant changes in weather cause lag issues, progressive changes shouldn't be much of an issue, as far as syncing it all, I wouldn't know exactly how to do it, as weather is finicky when it comes to syncing/broadcasting (or at least from what I've seen in the past).

ahh thank you :)

Share this post


Link to post
Share on other sites

My 2 cents is also check your triggers where the ambushes take place. if they are not set to be spawned on the condition by the server only it will spawn them for every player hopping in the trigger area. thus cousing for lets say 10 people instead of maybe 1 squad and 1 tank, 10 squads and 10 tanks i had this problem aswel befor and no matter how powerfull a dedi is spawning to much AI at the same time will case serious lag issue

Share this post


Link to post
Share on other sites

I am no expert here,but can you tell me if a script your running has an AI unit to get position of a player/players,and move to his position.

From experience i can say that constantly changing player positions constantly getting updated can have nightmarish results if the script wasnt made well,or your running something else thats in conflict with it.

On that note,if your not running something like this,is a script running something with similar effects?

Hope you sort it out

Share this post


Link to post
Share on other sites
My 2 cents is also check your triggers where the ambushes take place. if they are not set to be spawned on the condition by the server only it will spawn them for every player hopping in the trigger area. thus cousing for lets say 10 people instead of maybe 1 squad and 1 tank, 10 squads and 10 tanks i had this problem aswel befor and no matter how powerfull a dedi is spawning to much AI at the same time will case serious lag issue

My ambush trigger has "&& isServer" in it, so im sure it wont spawn multiples Ai's.

---------- Post added at 10:24 ---------- Previous post was at 10:22 ----------

I am no expert here,but can you tell me if a script your running has an AI unit to get position of a player/players,and move to his position.

From experience i can say that constantly changing player positions constantly getting updated can have nightmarish results if the script wasnt made well,or your running something else thats in conflict with it.

On that note,if your not running something like this,is a script running something with similar effects?

Hope you sort it out

Im using EOS spawn makers and like 20 Ai's. What i did for now is i decreased the Ai's, hopefully it will fix my lag problems :(

Share this post


Link to post
Share on other sites

Setting up your PC to run a dedicated server will help as well. You can then fire up A3 client and join your own server... just make sure you set the CPU affinity to separate cores for each .exe (ie: 2 for server, rest for your client)

http://forums.bistudio.com/showthread.php?147537-Tutorial-How-to-run-ArmA3-on-a-dedicated-server

Share this post


Link to post
Share on other sites
Setting up your PC to run a dedicated server will help as well. You can then fire up A3 client and join your own server... just make sure you set the CPU affinity to separate cores for each .exe (ie: 2 for server, rest for your client)

http://forums.bistudio.com/showthread.php?147537-Tutorial-How-to-run-ArmA3-on-a-dedicated-server

How do i set the CPU affinity to separate cores for each .exe?

I've never done that before :(

Share this post


Link to post
Share on other sites

In Windows open the Task Manager (ctrl-shift-ESC) and click on the Processes tab. Start the dedicated server then look for arma3server.exe in the process list. Right-click on it, choose Set Affinity and assign it 2 cores. In that menu you can select which cores are assigned to the process.

After that start your game and repeat the procedure...assigning Arma3.exe to the rest of your cores.

Share this post


Link to post
Share on other sites
Just to ask.. with other missions you don't have this problem?

Yes, actually we i just finished playing the whole mission last night with my friends, it went beutifully. there was still some lag but it was not that bad compared to the first time i played it.

I just deleted more Ai's, i think what caused it is enemy vehicles. and if there's too many players playing.

THere were only 4 of us last nite, it went pretty smooth we were able to finish the mission, took 6 hours to finish it lol.

Also, I change the clean up time for dead ai's, to 15 seconds and i added in description.ext the remove wrecks code.

What i learned is if ur doing a big mission, you need a faster time Dead Cleanup script, less AI's including Vehicles. im using the one made by Jshock. and use the remove wrecks code and put it in description.ext. and if u want really smooth gameplay, you need to play with less online players 4-6.

Thank you guys for your help, i finally solved my problem.

My 2 weeks effort creatng this mission did not go to waste :)

---------- Post added at 23:10 ---------- Previous post was at 23:07 ----------

In Windows open the Task Manager (ctrl-shift-ESC) and click on the Processes tab. Start the dedicated server then look for arma3server.exe in the process list. Right-click on it, choose Set Affinity and assign it 2 cores. In that menu you can select which cores are assigned to the process.

After that start your game and repeat the procedure...assigning Arma3.exe to the rest of your cores.

Okay thank you so much!!! i will try this :)

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×