/BadCoderz

Find unoptimized gmod addons and KILL the devs who made them

Primary LanguageLuaMIT LicenseMIT

BadCoderz Blue

Anyone telling you this addon reports false-positifs is stupid or lying, CANNOT report false positives, just remember to check the number of calls of the reported functions

BadCoderz

Find unoptimized addons and KILL the devs who made them

Roasting darkrp """devs""" since 2019

Workshop page

English video

Video in french for my fellows baguettes (Oudated since the video doesn't show GMA path support)

How is it different from a profiler ?

A profiler doesn't tell you if code is shit so you don't know if there is a good reason for a code to be "slow", here BadCoderz highlights you the shit code of your server and explains you why it's shit.

Finds un-optimized code and bottlenecks

Supports code ran in hooks, GM functions, Entities and Panels

Exports reports in TXT format to work with your team

Detailed call stack history

Even shows the absolute path with GMAs (Gmod doesn't natively support it)

Code preview

Ingame advices and hook/function documentation (Right click on it opens the wiki page)

Compatibility with GLib allowing you to decompile functions generated with CompileString or RunString (you need to download GLib if you want to use it)

RunString explorer (no defensive/offensive mechanism)

  1. Download BadCoderz
  2. Identify the addons coded like shit
  3. Do something about it :
    • Remove the addon
    • Fix it
    • Send the report to the dev so he can fix it
  4. (Optional) Smash the dev's head on the ground
  5. Keep your players because your server now has much better performances and less shitty code

BadCoderz isn't exactly a profiler, a profiler is only measuring how much time the CPU spend on each function, without telling you if the CPU has a good reason to do so.

A profiler can flag a function as "heavy/slow" without knowing if it's actually optimized.

BadCoderz uses a database of known mistakes (function and contexts) to find the unoptimized code in your addons/gamemode.

So, how does it work exactly ?

Simply open BadCoderz using the badcoderz command.

Then you can start scanning for unoptimized code on the Client or on the Server (or even both at the same time)

https://www.youtube.com/embed/CxLTw-b6ObY

In this video i downloaded 7 hud from the workshop, and as expected the code was total shit.

The BF4 hud, for example re-reads the textures from the disk on each frame.

If you put your mouse over the Function name it tells you what the function does (fetched from the wiki on the fly) and explains you why it's wrong to use it in this context.

Right clicking on the function name opens the wiki page. (Same with the hook).

Bellow we can see the places (in the code) where the function was called.

It also shows you the call stack.

Hover the one of the call stack line and it will show you a preview of the code

Wait, do i need to understand Lua to use it ?

Not at all, but it's obviously much better to know how Lua and gmod works, but with common sense you can easily find which addon is coded like shit.

You can also export the Clientside/Serverside report to .txt and share it with your team/the dev of the addon.

Obviously, there might be some "false positive" detections, but with common sense and with the stack call history, you should be fine.

I got a short memory, can you explain me quickly the difference between a profiler and this ?

A profiler finds CPU intensive functions without knowing if they are actually coded like shit, this addon finds all the functions coded like shit.

Then you can actually blame the dev who coded it for making shit code.

Most of the people who use fprofiler actually don't know what they're doing.

Optimized doesn't mean being fast, optimized means being efficient.

I still got a short memory, who can use this addon ?

Here is a non-exhaustive list :

  • Server owner : His server is lagging, his players are leaving or complaining, he want to fire his server dev, but since he is his brother-in-law he need evidence.

  • Server owner 2 : His server is lagging and he wants to find which addon is coded like ass.

  • Junior Lua dev releasing his first addon : He wants to be sure he didn't do anything that would destroy the server performance.

Anything else i should know ?

Keep in mind this is a technical tool, it's meant to be used with a brain and at least one eye.

If you want your staff to help you, export a report and send it to them.

The addon is using debug functions, so it's not compatible with SecureGmod

Thanks :

RE Lexi for the banner

Threebow for TDLib

Metastruct for the html lua editor