AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [DEV] Entity Limits Logger (https://forums.alliedmods.net/showthread.php?t=329223)

Dragokas 12-13-2020 15:51

[DEV] Entity Limits Logger
 
1 Attachment(s)
Description:
When the total number of networked entities become > 2048* (depends on your game),
server receive crash
Quote:

ED_Alloc: no free edicts
This plugin can help you with manual searching for a reason of entities leaking by logging all entities once per map whenever the total number of networked entities become > MAX, defined by you.
List of info that is to be logged:
- Time
- Map name
- Delta report since the latest snapshot (it is a difference between entities, spawned when map started and entities at the moment of a leak detection )
- Weapon names per each slot per each player
- Player names and their teams
- total entities
- total networked entities
- per each entity:
> class name
> target name
> model name
> origin (position)
> is within Saferoom (L4D only)
> HammerId
Log location: /addons/sourcemod/logs/entity_limit_<date-time>.log

ConVars (Settings):
Located at cfg/sourcemod/sm_entity_limit.cfg

- sm_entity_limit_unsafe_left - def.: 150 - Plugin creates report when the number of free entities is less than this ConVar
- sm_entity_limit_delay - def.: 10.0 - Delay to be used after map start to create entities snapshot for calculating the entities delta when a leak happens
Commands:
- sm_entlog - instantly creates the entities report
- sm_entsnap - creates entities snapshot which is to be used for calculating the entities delta (when leak happens or sm_entlog used)

- sm_entcrash - (available if only you enable DEBUG 1) - creates new 300 dummy entities to imitate the crash
Installation:
- copy .smx to addons/sourcemod/plugins
Example of a log:
Spoiler


Related plugins:
- [ANY] Security entity limit
- [Any] Crash Helper / Log A Lot
Donate
Donates are very appreciated and welcomed for further inspiration, make me happy, and make next updates came out more often:
- Patreon (Paypal)
- BitCoin
- Ю.Money

Dragokas 03-07-2021 19:32

Re: [DEV] Entity Limits Logger
 
Updated to v2.0.

Original version report contained too many entities of each class making the manual analysis of a leak to be quite a non-trivial task.

In v2.0, I decided to provide a delta.
So, when the map is started, logger creates snapshot of all entities.
Next time, when the leak heppens, Entity Logger creates a report for you with a delta:

1) Difference in total number of entities per each class between current moment and a snapshot.
2) Detailed list of all entities MINUS those entities from a snapshot.

Thus, you can quite easily detect which identical entities are leaking. See the sample log in 1st post.

ChangeLog:

Quote:

- Added Delta report
- Beautified
- New ConVar "sm_entity_limit_unsafe_left"
- New ConVar "sm_entity_limit_delay"
- New command "sm_entsnap"
- Logs are separated by file per date/time.

PC Gamer 03-08-2021 01:10

Re: [DEV] Entity Limits Logger
 
Thanks for this. I'll give it a try.

I'm assuming there is no problem with running this concurrently with the wonderful '[ANY] Security entity limit' written by the talented Benoist3012'?

Dragokas 03-08-2021 07:55

Re: [DEV] Entity Limits Logger
 
They do not conflict, if priorities met. My plugin should be first in detection order. By default - everything OK.

"Security entity limit" has a detection point == 1950 entities.
"Entity Limits Logger" has sm_entity_limit_unsafe_left ConVar == 150, means MAX (e.g. 2048 ) - 150 = 1898 entities,
which will be detected earlier.

Dragokas 03-08-2021 08:51

Re: [DEV] Entity Limits Logger
 
Updated.

Quote:

v2.1
- Added HammerId

Wizards 11-18-2021 09:03

Re: [DEV] Entity Limits Logger
 
1 Attachment(s)
This is my Entity Log file. Can somebody explain it to me? i really dont understand this error because it's too much line. :shock:

Dragokas 11-18-2021 09:56

Re: [DEV] Entity Limits Logger
 
Automatic parser is already provides analysis for you at the very begin of the file:

Quote:

DELTA - {Class Count}
*
This section describes the number of entity classes, which increased since the latest snapshot
*

+5 prop_physics_override
+1 commentary_dummy
+8 predicted_viewmodel
+1237 info_particle_system
+3 point_hurt
+1 weapon_hunting_rifle
+4 weapon_grenade_launcher
+4 player
+1 weapon_tank_claw
+19 weapon_molotov
+1 ability_throw
You have info_particle_system leaking. Some plugin creates particles, but don't delete.

NoroHime 02-12-2022 08:32

Re: [DEV] Entity Limits Logger
 
may we log entity name as GetEntityNetClass? GetEntityClassname is so hard to identify

Dragokas 05-01-2023 06:55

Re: [DEV] Entity Limits Logger
 
@NoroHime, can you provide an example, which class?

NoroHime 05-01-2023 09:47

Re: [DEV] Entity Limits Logger
 
Quote:

Originally Posted by Dragokas (Post 2803722)
@NoroHime, can you provide an example, which class?

sometime counts many prop_physics_override, but they has different net class, just another suggestion, maybe generate more info to debug

king kong 07-13-2023 17:59

Re: [DEV] Entity Limits Logger
 
Don't worry about crashing due to too many entities in the custom map

kayletid201 12-14-2023 12:22

Re: [DEV] Entity Limits Logger
 
I have been using it now and have had no problems at all. But i have not tested whether this plugin actually works, when there are many players playing a custom map with too many entities. I'll try and test it next time, hoping it works
So anyway, this is a pretty good plugin. I have a lot of respect for people who make bug fixing plugins like this.

Dragokas 12-14-2023 12:29

Re: [DEV] Entity Limits Logger
 
@kayletid201, it's not a bug-fixing plugin. It's just a logger for subsequent manual analysis.
Thanks for feedback.


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

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