LordGolias / antistasi

Antistasi improved, a mod for the game Arma 3.
BSD 3-Clause "New" or "Revised" License
30 stars 18 forks source link

MP Spawn System #58

Open StefArma opened 7 years ago

StefArma commented 7 years ago

Brilliant idea to let clients handle the spawning of units, this is probably the only way to populate a server with 60 people and spread around Altis without problems.

Because of Arma3 code, a client can't handle more than 100 AI efficiently because the game will start deleting their action queue to save FPS, however this lead to retarded AI behaviour.

Your current spawn system checks on client average FPS giving a rating and multiplying it x3 if it is an headlessclient.

What i suggest is to count units to spawn, assign to client ("worker" as it's named in the code) and check the amount + the amount it already to make it not exceede 100 - 150 AI per client regardless FPS balance. To be perfect, also ping should be taken into account... 100 AI with a 300ms won't be easy to fight by another player because of the warping.

I tried myself to do such things.. sadly was unsuccessful attempt. That's why i'm sharing the idea here. Probably that's not even the best idea, i tought about giving to players only certain units, and let the core handled by server and headlessclients, however let's find a compromise considering also what is possible/convenient to do.

LordGolias commented 7 years ago

I agree with this. Prob a combination of FPS and AI number should be enough. What happens when the work load of all machines reaches above a threshold?

StefArma commented 7 years ago

I'd suggest assign them to the Server.

Considering that 5 players can keep up 500 units + server and headlesclients should provide another 100... then i can assume those 5 ppl are lonewolves. Even if it's a very difficult situation to have that many units spawned, indeed you're right considering what to do then.

highwave70 commented 7 years ago

well, did you already tried "Liberation" from KillerPotatoes's ? The system show you a message when you reach the maximum amount of active units defined in the init sqf and ask you to concentrate your effort on a cities list already active. All others sectors are disabled for capture unless you get below the max active units threshold.

StefArma commented 7 years ago

This is a sample on players ported to Gravia: we were 5 players, all the spawns look assigned to worker 14. No headlessclient connected

14:38:26 "[AS] 2: new spawn 'gravia_civ'" 14:38:26 "[AS] Server: scheduler_fnc_execute(AS_spawn_fnc_execute):" 14:38:26 "Worker 2: 91.9828" 14:38:26 "Worker 7: 52.9474" 14:38:26 "Worker 11: 60.0567" 14:38:26 "Worker 9: 55.1538" 14:38:26 "Worker 13: 90.8955" 14:38:26 "Worker 14: 113.841 <- Assigned" 14:38:26 "[AS] 2: new spawn 'gravia'" 14:38:26 "[AS] Server: scheduler_fnc_execute(AS_spawn_fnc_execute):" 14:38:27 "Worker 2: 91.9828" 14:38:27 "Worker 7: 52.9474" 14:38:27 "Worker 11: 60.0567" 14:38:27 "Worker 9: 55.1538" 14:38:27 "Worker 13: 90.8955" 14:38:27 "Worker 14: 113.841 <- Assigned" 14:38:27 "[AS] 2: new spawn 'as_base_4'" 14:38:27 "[AS] Server: scheduler_fnc_execute(AS_spawn_fnc_execute):" 14:38:27 "Worker 2: 91.9828" 14:38:27 "Worker 7: 52.9474" 14:38:27 "Worker 11: 60.0567" 14:38:27 "Worker 9: 55.1538" 14:38:27 "Worker 13: 90.8955" 14:38:27 "Worker 14: 113.841 <- Assigned" 14:38:27 "[AS] 2: new spawn 'roadblock_14757_17419'" 14:38:27 "[AS] Server: scheduler_fnc_execute(AS_spawn_fncexecute):" 14:38:27 "Worker 2: 91.9828" 14:38:27 "Worker 7: 52.9474" 14:38:27 "Worker 11: 60.0567" 14:38:27 "[AS] 2: spawn 'hill[4188.99,10754.9,-156.821]' finished state 'run'" 14:38:27 "[AS] 2: spawn 'hill_[4188.99,10754.9,-156.821]' started state 'clean'" 14:38:27 "Worker 9: 55.1538" 14:38:27 "Worker 13: 90.8955" 14:38:27 "Worker 14: 113.841 <- Assigned" 14:38:27 Performance warning: SimpleSerialization::Read 'resources' is using type of ,'TASK' which is not optimized by simple serialization, falling back to generic serialization, use generic type or ask for optimizations for these types 14:38:27 Performance warning: SimpleSerialization::Read 'resources' is using type of ,'TASK' which is not optimized by simple serialization, falling back to generic serialization, use generic type or ask for optimizations for these types 14:38:27 "[AS] 2: spawn 'fia_hq' finished state 'clean'" 14:38:27 "[AS] 2: new spawn 'roadblock_14602_16416'" 14:38:27 "[AS] Server: scheduler_fnc_execute(AS_spawn_fnc_execute):" 14:38:27 "Worker 2: 91.9828" 14:38:27 "Worker 7: 52.9474" 14:38:27 "Worker 11: 59.9816" 14:38:27 "Worker 9: 55.1538" 14:38:27 "Worker 13: 90.8955" 14:38:27 "Worker 14: 113.841 <- Assigned" 14:38:28 "[AS] 2: new spawn 'as_resource_7'" 14:38:28 "[AS] Server: scheduler_fnc_execute(AS_spawn_fnc_execute):" 14:38:28 "Worker 2: 91.9828" 14:38:28 "Worker 7: 49.8734" 14:38:28 "Worker 11: 59.9816" 14:38:28 "Worker 9: 55.1538" 14:38:28 "Worker 13: 90.8955" 14:38:28 "Worker 14: 113.841 <- Assigned" 14:38:28 "[AS] Server: scheduler_fnc_execute(AS_movement_fncsendAAFpatrol):" 14:38:28 "Worker 2: 91.9828" 14:38:28 "Worker 7: 49.8734" 14:38:28 "Worker 11: 59.9816" 14:38:28 "Worker 9: 55.1538" 14:38:28 "Worker 13: 90.8955" 14:38:28 "Worker 14: 113.841 <- Assigned" 14:38:28 "[AS] 2: spawn 'hill[4188.99,10754.9,-156.821]' finished state 'clean'"

StefArma commented 7 years ago

This is a rpt with 10 ppl no headlessclient

Kavala https://pastebin.com/guA4c3v0

Gravia https://pastebin.com/X9NifF6w