AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019] (https://forums.alliedmods.net/showthread.php?t=319156)

Lux 10-16-2019 01:56

[L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
1 Attachment(s)
Hi, This plugin fixes level changing from degrading server performance with a native to use in your map changing plugins

This plugin does near nothing on it's own it's for dev's to include in their mission managers.

However there is a command
"sm_changelevel" This requires Admin_Root or from server console function same as sm_map.


Tech stuff
Spoiler


Native
PHP Code:


/**
*    @param    sMapName                Map String without .bsp
*    @param    bShouldResetScores        Reset all scores in all gamemodes
*    @noreturn
*/
native void L4D2_ChangeLevel(const char[] sMapNamebool bShouldResetScores=true); 

[L4D2] Improved Automatic Campaign Switcher (ACS)

Thanks:
SirPlease for testing.
Silvers throwing ideas.
A1m` testing and reporting issue.


Maybe this method will get merged into sourcemod for l4d2 only?

Installation:

1.Download the .zip file.
2.Merge with \addons\ folder.
3.Restart the server.

Eyedol 10-16-2019 18:18

Re: [L4D2] Proper Changelevel
 
Hello, using this method solves the problem of CPU increase over time? Or is it focused on something else?

Sorry if the question seems to be very obvious but I was testing it and I can't understand :(

Psyk0tik 10-17-2019 10:12

Re: [L4D2] Proper Changelevel
 
Oh hey, you finally released it here. Nice! :D

Lux 10-18-2019 04:07

Re: [L4D2] Proper Changelevel
 
Quote:

Originally Posted by Crasher_3637 (Post 2669961)
Oh hey, you finally released it here. Nice! :D

:twisted:

Quote:

Originally Posted by Eyedol (Post 2669915)
Hello, using this method solves the problem of CPU increase over time? Or is it focused on something else?

Sorry if the question seems to be very obvious but I was testing it and I can't understand :(

If the issue with CPU increase overtime is related to vscript then yes that i know of.

AK978 10-18-2019 08:01

Re: [L4D2] Proper Changelevel
 
Unzip failed.

Psyk0tik 10-18-2019 08:07

Re: [L4D2] Proper Changelevel
 
Quote:

Originally Posted by AK978 (Post 2670045)
Unzip failed.

Not his problem. Use a program like 7Zip or Winrar to extract the files...

AK978 10-18-2019 09:10

Re: [L4D2] Proper Changelevel
 
ok.
tks~

Lux 11-01-2019 12:06

Re: [L4D2] Proper Changelevel [Left 4 Fix] [1/11/2019]
 
Update 1.2.0
Included resetting scores for gamemodes that require it, that persist across levelchanges. thanks A1m`

https://github.com/LuxLuma/Left-4-fi...8163eddf4dd8fd

tRololo312312 11-04-2019 16:21

Re: [L4D2] Proper Changelevel [Left 4 Fix] [1/11/2019]
 
One issue i have with plugin that it doesnt reset the survivors when it changes map like normal changelevel does. Like, if i was playing Passing Francis, then load into new map, im still Francis instead of the being one of the l4d2 survivors...

Lux 11-04-2019 16:42

Re: [L4D2] Proper Changelevel [Left 4 Fix] [1/11/2019]
 
That's normal, game saves and restores your character when using game's voting functions.

Since no one really uses voting stuff on modded servers was never noticed.
If you vote for start new campaign will have same effect as using my plugin since both voting function have similar code paths, other than campaign accepts the "name" from the mission file and my plugin accepts bsp names.

Voevoda 11-23-2019 14:30

Re: [L4D2] Proper Changelevel [Left 4 Fix] [1/11/2019]
 
very long card change

Lux 12-17-2019 01:49

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
update 1.2.1

Added optional arg to changelevel native for score reset, requested by sir

This change to the native is backcompat so already compiled binaries will function as default clearing scores on change.

Dragokas 02-16-2020 06:26

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
hi, Lux!

Your previous github samples contains "scripted_mode_shutdown" code when "CDirector::OnChangeChapterVote" fail.

Code:

if (!L4D2_ChangeLevel(sMap))
{
        ShutDownScriptedMode();
        ForceChangeLevel(sMap, "Map Vote");
}

Isn't it require anymore?

Lux 02-16-2020 21:48

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Nope, that's only in the mission manager fork incase someone don't install the alt level changing method.

Dragokas 02-17-2020 00:50

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Is there some significant difference between shutdown scripts method and "CDirector::OnChangeChapterVote" ?

Lux 02-17-2020 03:42

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Yes that's why this plugin exists, don't really remember fully think MapScript something like that and does nothing to global table.

Why are you interested in the old ShutDownScriptedMode();?

Dragokas 02-17-2020 03:53

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
I think adding to my MapChanger, so I instering in most simple method.

Dragokas 02-17-2020 04:02

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Also, I curious about this part:

Quote:

vscript is apart of the issue there are still issues else where in the game which causes same effect just is far less of an impact now.
so, in your opinion, some issues with map change can be caused not only by VScript?

In such case, can I guess the problem can persists in L4D1, maybe some identification markers can prove that?

--
P.S. On my other addons server, it's often I faced with problem when I can't change map using ForceChangeLevel(). I see loading window of the next campaign, and after loading finishes, I see not map of this campaign but the map of other compaign set by default on server.

So, I also curious, is there better method, maybe "CDirector::OnChangeChapterVote" or I should try ServerCommand("changelevel %s", sMap), dunno is ForceChangeLevel() just an alias to changelevel... maybe you know.

Lux 02-17-2020 04:41

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
not really sure about l4d1, it has no vscript engine why ShutDownScriptedMode() is pointless, it's still kinda pointless in l4d2 since it don't do everything the alt method of changing level does.

You can try calling that "CDirector::OnChangeChapterVote()"in l4d1 see if it fixes the issue.

And ServerCommand("changelevel %s", sMap) is just the same as ForceChangeLevel() calls changelevel cmd, like every other level changing method including mine, it is called one way or another.


As for the other issues with the game, the talker system leaks, filling up some table or something with lots of concepts i think, after a while it can take whole game frames to process a response, this is persistent across levels i have unable to understand how to fix the problem.


EDIT: This is why alot of l4d actions don't happen when forcing a map change without voting, e.g. intro sequence don't play these seem to be legacy cmds from counter strike maybe

Dragokas 02-17-2020 04:52

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Thank you for explanation. I will try.

Dragokas 03-13-2020 08:53

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Just share my experiments in L4D1.

Using
Quote:

"linux" "@_ZN8Director19OnChangeChapterVoteEPKc"
causes skipping intro scene in first mission, freezing the client during scene time.

Also, in rare cases I found all clients spawned in the wrong location (usually, blocked under the map).
So, I refused that idea.

Lux 03-18-2020 15:18

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Quote:

Originally Posted by Dragokas (Post 2686806)
Just share my experiments in L4D1.

Using


causes skipping intro scene in first mission, freezing the client during scene time.

Also, in rare cases I found all clients spawned in the wrong location (usually, blocked under the map).
So, I refused that idea.

This is odd effect since the game it's self calls them functions, it may get called from else where intil it gets to that function maybe try and follow the call order see where the the chain starts.

Xada 01-09-2021 21:29

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Using the custom changelevel command of late causes my server to respawn all survivors dead on map reset/fail (or just spawn nick/bill or some other strange variant, but all players spawn dead permanently with no way to spawn in) for some reason.
Is this plugin still being managed past the TLS update and such? It was useful for avoiding some of the inherent L4D2 bugs on mapchange but this seems to be a pretty severe issue when using it.

Lux 01-10-2021 04:04

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Quote:

Originally Posted by Xada (Post 2731998)
Using the custom changelevel command of late causes my server to respawn all survivors dead on map reset/fail (or just spawn nick/bill or some other strange variant, but all players spawn dead permanently with no way to spawn in) for some reason.
Is this plugin still being managed past the TLS update and such? It was useful for avoiding some of the inherent L4D2 bugs on mapchange but this seems to be a pretty severe issue when using it.

No issues here, likely due to your specific server environment config you run.

Your post about your problems in the link below could be related so i'v no idea
https://forums.alliedmods.net/showthread.php?t=329838

This plugin still functions as it should post TLS if it did not then it will just crash or ingame voting system would have the same problem you discribe.

Dragokas 01-10-2021 06:39

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Xada, I'm using it integrated in my MapChanger plugin, and constantly on my L4D2 server.
No issues since TLS, especially as one you described.

HarryPotter 01-10-2021 07:32

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Quote:

Originally Posted by Xada (Post 2731998)
respawn all survivors dead on map reset/fail (or just spawn nick/bill or some other strange variant, but all players spawn dead permanently with no way to spawn in) for some reason.

I have this issue sometimes since The Last Stand update.

After all survivors wipe out, and server prepares to restart the round, no any survivor bots respawn, they are just dead :(, we have to restart map or change map

I don't think it is "Proper Changelevel's" problem, I can surely say it is fu?king the last stand team problem, they messed up something.

Mystik Spiral 01-10-2021 10:52

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Not sure if this is related, but I have also found that since the TLS update, I'm having intermittent problems with changing level. Sometimes random players, myself included, will get "stuck" during the change level and will never finish loading...have to disconnect and reconnect. This never happened before TLS, and I can't figure out what the cause is. However, one thing I noticed that is different... before when changing levels the players would spawn in frozen until the cut scene (which you cannot see) is finished, then the players can move again normally. Since TLS, it seems to hold the loading screen until everyone spawns/preloads, then shows everyone the full cut scene. I wonder if Silvers plugin "First Map - Skip Intro Cutscenes" would help (or hurt). If it makes a difference, I have "sv_forcepreload 1" set on the server, and using "Improved ACS" with the included "Proper Changelevel" plugin.

Dragokas 01-10-2021 11:02

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Quote:

Originally Posted by Mystik Spiral (Post 2732082)
will get "stuck" during the change level and will never finish loading...have to disconnect and reconnect.

I always had that even before TLS. But, only when finale map finishes.
Loading screen holds at 100% for ~ 20 seconds (or more).
When I finally spawn, I see that half of players displayed with a message: "Player XX becomes idle" and they got disconnected soon.
Dunno about the reason. Maybe something related to download tables. However, that never happens when non-finale map changes.

Mystik Spiral 01-10-2021 15:51

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Quote:

Originally Posted by Dragokas (Post 2732084)
I always had that even before TLS. But, only when finale map finishes.
Loading screen holds at 100% for ~ 20 seconds (or more).


I think you might be right about it only happening after the finale when loading a new campaign, but in my case, it hangs indefinitely and never loads for anyone until the person who is stuck disconnects, then everyone finishes loading normally.

I can't remember if Improved ACS requires Proper Changelevel. If not, I will experiment with disabling Proper Changelevel and see if the problem goes away or persists.


UPDATE: I disabled Proper Changelevel (l4d2_changelevel) and still had the same problem (map does not finish loading for anyone until "stuck" player disconnects. Whatever the cause, it does not appear to be related to Proper Changelevel.

Dragokas 09-24-2021 11:17

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Double-checked.
Calling CDirector::OnChangeChapterVote causes all dead on round start bug.

Lux 09-24-2021 18:37

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Quote:

Originally Posted by Dragokas (Post 2758761)
Double-checked.
Calling CDirector::OnChangeChapterVote causes all dead on round start bug.

I'm open to suggestions for other methods, seems like a quirk with the game.

Dragokas 09-25-2021 08:04

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Obviously, some clearing code doesn't execute.

Maybe, native votes could be an alternative, need to find which function they call on vote finish...

Also, I'm curious, what was your method of checking those vscript leaks, when you ensured CDirector::OnChangeChapterVote is a clear way.

Lux 09-25-2021 09:15

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Quote:

Originally Posted by Dragokas (Post 2758827)
Obviously, some clearing code doesn't execute.

Maybe, native votes could be an alternative, need to find which function they call on vote finish...

Also, I'm curious, what was your method of checking those vscript leaks, when you ensured CDirector::OnChangeChapterVote is a clear way.

Ill give the short version when I tested years ago.

script cmd to run useless stuff memory keeps going up, run map cmd change to new level memory still full, ran a vote to change level and memory went down to avg usual usage.

There is more to this like script hooks and call to nothing leading to high spikes as they pile up over time iirc but those are dependent if you run vscripts alongside also, but was so long ago I don't remember much, however i'm not sure if this is still an issue since TLS update may have been fixed but I just use this anyway since I don't really wanna input more time.

sorallll 10-24-2022 15:07

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Quote:

Originally Posted by HarryPotter (Post 2732051)
I have this issue sometimes since The Last Stand update.

After all survivors wipe out, and server prepares to restart the round, no any survivor bots respawn, they are just dead :(, we have to restart map or change map

I don't think it is "Proper Changelevel's" problem, I can surely say it is fu?king the last stand team problem, they messed up something.

The game uses incorrect transition data to restore player and survivor bots. In my tests iaNanaNana's [L4D2] Transition Info Fix fixes this bug, now it's perfect

Red Flame 12-02-2022 10:12

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Hello, is there any method to reset/manipulate "m_bAreTeamsFlipped" gamerule state.
Plugin works fine but if you change the map in the second half of round in versus, "m_bAreTeamsFlipped" state will be the same.

GameRules_SetProp("m_bAreTeamsFlipped", 0 or 1, 4) sets it only for one frame then it resets back to original value.

update:
nvm, found the way to play around with "CDirector::SwapTeams".

tiphong 06-08-2023 03:08

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
hi Lux, i seem to have a problem while using this plugin (i am not 100% sure it is caused by this). since using this plugin, sometimes on map change while loading the new map, the server will freeze and eventually you will be timed out. the server wont crash but it will freeze and you cannot see it on server browser anymore. since removing this plugin I have not experienced this freeze anymore, there are no error logs from this plugin but just a headsup.

KadabraZz 08-21-2023 20:23

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Hello, is there any way to keep the fix, but without having to wait for everyone to connect to actually start the map? Some people have a very slow pc and it takes a long time.

Lux 09-15-2023 13:07

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Quote:

Originally Posted by KadabraZz (Post 2809013)
Hello, is there any way to keep the fix, but without having to wait for everyone to connect to actually start the map? Some people have a very slow pc and it takes a long time.

It's what valve does as mentioned it just calls valve method to change the level.

Fraggor 10-21-2023 16:13

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Quote:

Originally Posted by Lux (Post 2758834)
Ill give the short version when I tested years ago.

script cmd to run useless stuff memory keeps going up, run map cmd change to new level memory still full, ran a vote to change level and memory went down to avg usual usage.

There is more to this like script hooks and call to nothing leading to high spikes as they pile up over time iirc but those are dependent if you run vscripts alongside also, but was so long ago I don't remember much, however i'm not sure if this is still an issue since TLS update may have been fixed but I just use this anyway since I don't really wanna input more time.

Based on your testing, the issue seems to be that the server is using script command to execute Vscripts (which will leak memory over time).
So the question is: if we replace the script with logic_script, or by using this plugin Script Command Swap - Mem Leak Fix would avoid memory leaking issue on a global scale (instead on just map changes)?
Am not sure if people here are aware of that plugin

Lux 11-10-2023 16:00

Re: [L4D2] Proper Changelevel [Left 4 Fix] [17/11/2019]
 
Quote:

Originally Posted by Fraggor (Post 2811873)
Based on your testing, the issue seems to be that the server is using script command to execute Vscripts (which will leak memory over time).
So the question is: if we replace the script with logic_script, or by using this plugin Script Command Swap - Mem Leak Fix would avoid memory leaking issue on a global scale (instead on just map changes)?
Am not sure if people here are aware of that plugin

There was more it did don't remember it's been years now.


All times are GMT -4. The time now is 22:11.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.