jaxaceron Posted August 9, 2018 Share Posted August 9, 2018 I was looking at the Assembly-CSharp.dll trying to understand how zombie pathing is determined (Haidrgna does this thing in GNAMOD where the zombies do a zigzag while chasing you and it gave me some ideas...) and I immediately noticed a ton of what appear to be infinite loops build into the game code. For example: if (!RZ) { while (true) { switch (2) { default: return; case 0: break; } } } You've got a while(true), which would loop forever (ignoring the unnecessary switch clause). I was wondering if any other modders noticed this and if it's common in game code? I know most programs have limiters which prevent infinite loops from running forever and causing issues, but that's still an extra routine that has to run and like I said, I see them everywhere. Could this be causing some of the lag issues within the game? And might it be worth creating a mod that cleans this up?... Link to comment Share on other sites More sharing options...
Alphado-Jaki Posted August 9, 2018 Share Posted August 9, 2018 It's just same as if (!RZ) { return; } They intentionally obfuscate codes to protect their assets. Link to comment Share on other sites More sharing options...
jaxaceron Posted August 9, 2018 Author Share Posted August 9, 2018 This one is a bad example, since the return won't cause it to loop infinitely, but it's still unnecessary decision clauses. I didn't think TFP did obfuscation since they're so supportive of the modding community. You usually obfuscate important variables, classes, and function names, and most of those are crystal clear what they are. Link to comment Share on other sites More sharing options...
sphereii Posted August 9, 2018 Share Posted August 9, 2018 This one is a bad example, since the return won't cause it to loop infinitely, but it's still unnecessary decision clauses. I didn't think TFP did obfuscation since they're so supportive of the modding community. You usually obfuscate important variables, classes, and function names, and most of those are crystal clear what they are. If you run the DLL through the SDX Launcher, with no mods selected, then it'll clean up the DLL to be more readable. Link to comment Share on other sites More sharing options...
Prisma501 Posted August 9, 2018 Share Posted August 9, 2018 Just use de4dot to de-obfuscate the assembly and then a reflection tool like dnspy to export it to a project. Cheers Link to comment Share on other sites More sharing options...
jaxaceron Posted August 9, 2018 Author Share Posted August 9, 2018 I guess it really is just obfuscation, sorry I doubted you Alphado. Thanks sphereii. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.