[L4D2] Survivor Bot AI Improver
3 Attachment(s)
What's This?
Noteable Features:
ConVars: PHP Code:
Change Log: Code:
1.5 (14-June-2023) Requirements:
Installation:
|
Re: [L4D2] Survivor Bot AI Improver
Quote:
|
Re: [L4D2] Survivor Bot AI Improver
Quote:
For now, I don't see anything wrong. I'll let you know if I notice something strange. :up: :) |
Re: [L4D2] Survivor Bot AI Improver
Good work.
|
Re: [L4D2] Survivor Bot AI Improver
This plugin makes my server lag alot on the first level of Hard Rain and on the first and second levels of Dark Carnival and i don't know why that happens, only advancing further in the level makes the lag stop. And even removing some plugins doesn't help, maybe you could check it out?
|
Re: [L4D2] Survivor Bot AI Improver
This addon is Compatible with the mod "Left 4 Bots (Improved A.I.)" from steam?
|
Re: [L4D2] Survivor Bot AI Improver
Quote:
|
Re: [L4D2] Survivor Bot AI Improver
Quote:
|
Re: [L4D2] Survivor Bot AI Improver
Since some players are mentioning performance issues I thought I would have a look and recommend some changes.
- You have some "FindConVar" within the think function and other places in code that you could place in plugin start to optimize the performance. Hooking the convar for change and using a variable instead of retrieving the value from the convar each time. - "if (hWeaponList == null)delete hWeaponList;" and "if (hWepArray == null)delete hWepArray;" is not necessary, it's already null, no need to use delete here. Remove the whole line. Maybe there are other null checks you should remove, I only saw these skimming through. - You should probably re-write "GetSurvivorTeamItemCount" and store the equipped weapons/items each player has when they equip it, instead of constantly looping through all clients and weapons checking what they have. Use SDKHook_WeaponEquipPost and store the weapon type in an array such as: "int g_iPlayerItems[MAXPLAYERS+1][6]" and instead of checking for the string, check for the weapon type ID instead. A list of weapon types and IDs can be found in left4dhooks. - In some functions that are accessed a lot, especially from Think functions you could optimize the strings by changing "char" to "static char" so it's not re-created each time, unless (which I doubt anyway) you're expecting an empty string without writing data to it first before reading. You could probably change all the strings to this to save some CPU cycles. - You don't need to use "strcopy" when assigning a string to something, for example: PHP Code:
PHP Code:
- In "OnPlayerRunCmd" you should probably move "if (!IsClientSurvivor(iClient)) return Plugin_Continue;" to the top before pulling the origin/nav area data. - I don't know if the compiler optimizes for things like this, but instead of "500.0*500.0" just write "250000.0", there are multiple others like this. - "GetWeaponMaxAmmo" could be optimized using a StringMap to search for the string and return the weapon ID instead, although I'm not sure the string checks are even necessary since you're using "GetWeaponAmmoType", looks like all the types are covered here. Again FindConVar here could be put into plugin start. - "CheckEntityForItem" could be optimized to remove all the string checks, and match by weapon/item ID instead. - "ShouldUseFlowDistance" could be optimized slightly to avoid calling the same native twice, by changing it to: PHP Code:
- It might be better to use "OnEntityCreated" instead of "ScanMapForEntities" in a timer since you're only checking for "witch" and "weapon_*" entities. Also: "FindEntityByClassname(-1, "*")" would probably be faster than looping through all entities as the function is currently doing. Or maybe: FindEntityByClassname(-1, "witch"); and: FindEntityByClassname(-1, "weapon*); Might be a good idea to benchmark test and see which is the faster method. - "g_hWitchList" could be initialized with "g_hWitchList = new ArrayList(2);" and set witch ref into index 0 and userid into index 1, instead of nesting multiple ArrayLists within the g_hWitchList ArrayList: For example: PHP Code:
- You might want to call "ClearEntityArrayLists" on "round_end" event too, for round restarts or versus 2nd round - "Event_OnWeaponFire" could be optimized to use StringMap.ContainsKey or StringMap.GetValue to check if the weapon classname is correct. It might be optimized further by calling "GetRandomInt" for shotgun/sniper first then checking the strings if the value is 1. I would benchmark test if that's faster than comparing 2 strings that don't match. Also "static char" since its called often and you're filling the string data first before reading. The return within the if statement is unnecessary. There are probably other areas that could be optimized, this is just what I noticed skimming through. :up: |
Re: [L4D2] Survivor Bot AI Improver
I keep getting this error on the command console. I have the latest DHooks and Actions installed.
Code:
L 05/25/2023 - 16:24:25: [SM] Exception reported: Native is not bound |
Re: [L4D2] Survivor Bot AI Improver
any way to make bots less of insta-death aimbot killing machines?
|
Re: [L4D2] Survivor Bot AI Improver
Quote:
// The time required for bots to notice enemy target is multiplied to this value. // - // Default: "1.0" // Minimum: "0.000000" // Maximum: "4.000000" l4d2_improvedbots_vision_noticetimescale "1.0" Use this to to give the bots less compute time (helps performance too): // Bots' data computing time delay (infected count, nearby friends, etc). Increasing the value might help increasing the game performance, but slow down bots. // - // Default: "0.1" // Minimum: "0.033000" l4d2_improvedbots_process_time "0.1" I have been using this plugin for some time and love it! The bots are not totally useless now, and depending on how you configure them, they can survive a campaign almost as well as a typical expert player. |
Re: [L4D2] Survivor Bot AI Improver
Quote:
|
Re: [L4D2] Survivor Bot AI Improver
Quote:
Code:
throw_molotov = 0 |
Re: [L4D2] Survivor Bot AI Improver
sorry for my poor english
After l4d2 server crash,i get the Accelerator - Crash Reporting https://crash.limetech.org/7h6bxp7q5fy4 https://crash.limetech.org/tzznp7joweqc The following message is displayed in some information of the stack page, so I speculate that this plugin may cause the crash PHP Code:
|
Re: [L4D2] Survivor Bot AI Improver
Lastest l4dhooks
L 05/30/2023 - 02:42:49: [SM] Blaming: l4d2_sb_ai_improver.smx L 05/30/2023 - 02:42:49: [SM] Call stack trace: L 05/30/2023 - 02:42:49: [SM] [0] __action_setlistener L 05/30/2023 - 02:42:49: [SM] [1] Line 901, actions_processors::BehaviorActionListeners.O nUpdatePost.set L 05/30/2023 - 02:42:49: [SM] [2] Line 5736, F:\Games\Left 4 Dead 2\left4dead2\addons\sourcemod\scripting\l4d2_ sb_ai_improver.sp::OnActionCreated |
Re: [L4D2] Survivor Bot AI Improver
Quote:
|
Re: [L4D2] Survivor Bot AI Improver
05/31/2023 - 01:44:28: [SM] Exception reported: Native is not bound
|
Re: [L4D2] Survivor Bot AI Improver
Quote:
|
Re: [L4D2] Survivor Bot AI Improver
PHP Code:
|
Re: [L4D2] Survivor Bot AI Improver
Crash: ABQI-OXP4-GBRF
|
Re: [L4D2] Survivor Bot AI Improver
You're touching something that result in distance points not counting correctly sometimes in versus, first time i have that and it is since i have this plugin. I noticed that you do not add EventHookMode_PostNoCopy to round start even, it can create bugs.
|
Re: [L4D2] Survivor Bot AI Improver
The survivor bots seem to unable to throw grenades or deploy upgrade ammo packs. They just repeatedly equip it without using it. Then goes back to their firearms and does it again.
|
Re: [L4D2] Survivor Bot AI Improver
Quote:
|
Re: [L4D2] Survivor Bot AI Improver
Does this conflict with Gear Transfer? I was considering disabling/removing that other plugin until I notice you did not programmed the bots to optionally give and receive items from players.
|
Re: [L4D2] Survivor Bot AI Improver
Quote:
I have set it to grab only the chainsaw and it seem to work fine. i tested a bit with and without "Action" and didn't see much different for now, but i let Action installed for now for testing if there is crash people are playing on it. However, since i have this plugin installed, Source Admin tool didn't show the rules and their value and it also don't show the metamod and sourcemod revision. I also found my server restarting in loop yesterday and the error was "accelerator dump limit reached". I erased the dump file in sourcemod/data/dump and it seem to have fix the issue. I will see tonight if the server is still up |
Re: [L4D2] Survivor Bot AI Improver
who knows, things did change with the improver version. I think I will wait it out and see replies from others
|
Re: [L4D2] Survivor Bot AI Improver
I completely forgot to say to the author that his plugin is top.
The only thing I was not able to set was the bots behavior. My servers was too hard to play with bots but a real pleasure to play with good players (which is rare), so i had to set it less hard because it was too painful to play solo. Now, because of this mod, I can set my servers as hard as I wanted them and after a little setting for the process time to 1,5 and vision notice time scale to 1,8, bots are far better and useful. But i must admit that the default settings made the bots too good (I was able to stand in place and do nothing and almost never get hurt while without the mod it was a real pain to stay alive). |
Re: [L4D2] Survivor Bot AI Improver
I also experience other user's issue with bots stuttering with throwable items
|
Re: [L4D2] Survivor Bot AI Improver
Quote:
I prefer to use bots as storage as i use gear transfert. But i set them to use the chainsaw and to deploy special ammo. 3 bots with chainsaw is really fun :) |
Re: [L4D2] Survivor Bot AI Improver
that is also true. BTW, I wish for another feature for this plugin; we can set the options to allow what items for bots to throw at the tank, and perhaps change where they exactly throw the item -- like say at the general direction of the incoming horde?-- otherwise, they made the strategy worse
|
Re: [L4D2] Survivor Bot AI Improver
I did few tests yesterday and i had 2 times my server crashing ans stuck in a restart loop.
I reboot my computer ans start the server but it was restarting every 10 sec and the console write a segmentation core error (or something like that) I had to uninstall the plugin to be able to have my server to start. I will do more tests tonight (with and without "action" and without gear transfert. Update: My server crashed again and i manage to copy the content of the console.
Spoiler
and i had to remove the plugin or my server keep restarting with this message:
Spoiler
|
Re: [L4D2] Survivor Bot AI Improver
Quote:
./srcds_run: line 341: 25707 Segmentation fault (core dumped) $HL_CMD |
Re: [L4D2] Survivor Bot AI Improver
author, thanks for your wonderful plugin, really, but please, please correct your mistakes properly, the server really crashes because of it :D the plugin is really great)
|
Re: [L4D2] Survivor Bot AI Improver
I am afraid I am going to jinx myself by saying this, but I have been using this plugin since before it was posted on AlliedModders and I have never had it crash my server on Windows (but I have had plenty of exceptions reported). I wonder if those of you getting server crashes are all running Linux?
|
Re: [L4D2] Survivor Bot AI Improver
thanks for your wonderful plugin
|
Re: [L4D2] Survivor Bot AI Improver
1 Attachment(s)
This is a modified version of 1.4 - I sent to someone and they reported it no longer crashes.
Author: please compare to see the changes. Calling some natives before OnMapStart seems to be the crash. The next left4dhooks update will simply block the calls but for now you can add these checks into your plugin (and since some others maybe slow in updating left4dhooks). L4D2_NavAreaBuildPath and other NavArea natives, and a few other things. There are more things that could be optimized, I haven't had time to go through and write anything about it. |
Re: [L4D2] Survivor Bot AI Improver
Does anyone have a potential bug where the bots never picks up the Grenade launcher and or M60? there is no weapon pref. option for them, so....
|
Re: [L4D2] Survivor Bot AI Improver
Quote:
Run these two commands on the server console to verify the values: sm_cvar l4d2_improvedbots_tier3weaponlimit_grenadelau ncher sm_cvar l4d2_improvedbots_tier3weaponlimit_m60 |
Re: [L4D2] Survivor Bot AI Improver
Quote:
] sm_cvar l4d2_improvedbots_tier3weaponlimit_grenadelau ncher [SM] Value of cvar "l4d2_improvedbots_tier3weaponlimit_grenadela uncher": "1" |
All times are GMT -4. The time now is 18:19. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.