Page MenuHomeFeedback Tracker

vanilla scripts errors after being modded or modifed
Closed, ResolvedPublic

Description

This is a bit of a tricky one to explain, but I will do my best.

If you unpack the scripts.pbo file and run it in the root directory of the server, you're able to edit as long as the -filepatching parameter is set.
I understand this is expected behavior.

What I am noticing, though, is that if you add any lines or change anything in the class, even as simple as a Print("Hello World"); it seems to override some sort of error suppression that occurs on the vanilla scripts. This starts showing a lot of unsafe cast errors in the vanilla code.

Log E:\CCCPLogs\script.log started at 14.12. 04:29:01

SCRIPT       : Registered 371 temporary action enum(s), UAN==371
SCRIPT       : CreateGame()
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,197": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,207": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,208": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,209": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,215": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,216": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,217": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,218": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,219": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,220": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,223": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,225": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,226": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,227": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,228": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,232": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,233": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,239": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,240": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,241": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,242": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,243": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,244": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,258": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,661": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,1234": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,1244": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,1707": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,3029": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,3090": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,3130": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,3155": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,3184": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,3189": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,3337": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,3339": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,3352": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting
SCRIPT    (W): @"scripts/4_World/entities\manbase\playerbase.c,3766": Unsafe down-casting, use 'PlayerBase.Cast' for safe down-casting

Here is an example of some of the errors in the vanilla playerbase.c file.

These errors do not appear in the scripts.log file unless there is some form of modification being made to either the unpacked scripts folder, or adding a modded class over the top of the original. These are not errors in the mods, as the lines are very specifically referencing the vanilla pbo.

I think this might be some of the trouble you guys are having with debugging.

Details

Severity
Major
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Operating System Version
Latest
Category
Performance
Steps To Reproduce
  1. Unpack scripts.pbo and move folder to root of server directory
  2. add Print("Hello World"); to EEKilled() function in scripts\4_World\Entities\ManBase\PlayerBase.c line 438 below 'Print("EEKilled, you have died");' in the empty line.
  3. Run server and monitor scripts.log file to see unsafe casting errors.
Additional Information

Manually going through and editing the file with proper casting, improves server performance by a large chunk (50-200fps) and that is just one file.

Event Timeline

This is quite old, but still applies. Just the specifics of lines and such mentioned are outdated now.

rVn changed the task status from New to Need More Info.Apr 1 2019, 2:52 PM
rVn added a subscriber: rVn.

Can't reproduce this.
Not aware of anything that should suppress these warnings either, they are a debugging tool - although in this case it seems to be throwing warnings where it should not ("this" pointers in PlayerBase).
They are also compilation warnings and shouldn't affect server fps at all.

The fps difference changed with the performance update, in all reality. I will submit some more data over the next few days.

Normal log without any modded classes loaded: https://media.discordapp.net/attachments/492295576470290433/563786820773740565/unknown.png?width=1403&height=550

Steps to reproduce:
Launch the game with a mod that overrides the playerbase for example. So add config entry for 4_World into cfgmod config and add the following modded class

modded class PlayerBase
{
};

The class does nothing more than that. Yet it creates the following log output: https://media.discordapp.net/attachments/492295576470290433/563787471037661212/unknown.png?width=1003&height=649

Unknown Object (User) added a subscriber: Unknown Object (User).Apr 5 2019, 8:21 PM
rVn closed this task as Resolved.Apr 8 2019, 12:20 PM
rVn claimed this task.

Fixed in 1.03