OutlawByteStudios / Persistent-Kingdoms

Persistent Worlds Overhaul Mod for Mount and Blade Warband
Other
7 stars 7 forks source link

Merge try_for_agents and try_for_players loops #442

Closed Thomas-Smyth closed 6 years ago

Thomas-Smyth commented 6 years ago

Task Description

Merge try_for_agents and try_for_players loops

Thomas-Smyth commented 6 years ago

@LuisEngelniederhammer @Saptortacus

Can you have a look at the changes I made to branch ta-442-merge-loops.

I think these changes will increase performance, however, I think it may cause the same issue as with submarining where agents are not being checked enough. It seems that the time delay for the server to check each agent depends on the number of agents on the server?

The current way it is done seems a bit meh. A try_for_agents loop is run everytime a player is processed. Doesn't seem very efficient, though it seems this is done to spread the load out over time.

Saptortacus commented 6 years ago

I think the game engine does not allow a trigger to run for too long, hence, the distribution of work over time is necessary.

Thomas-Smyth commented 6 years ago

@Saptortacus I've asked on Discord to see. Waiting for the answer.

If that's the case though, what about splitting them into separate triggers.

Thomas-Smyth commented 6 years ago

The scope of this issue is too big, gonna make a better issue.