Lakota's GLua Developer Application

Status
Not open for further replies.

Laqota

Well-known Member
Apr 21, 2023
24
0
41
In-game name: Mr "Kota"
Steam ID: STEAM_0:0:134322298
Age: 16
For how long have you played on our servers?: About 6 months.
What country are you from?: USA
Time Zone: CDT
Do you have a mic?: Yes

Is this your first application for Developer? If not, link previous ones: I've done jobs on Roblox (whole games) and I do work on stuff on Garry's Mod once in a while. I can also do fluent Javascript.

Have you received any bans?: Sadly enough I have. Rules are hard to not break and follow especially if you're playing on the server for a long time. It's all for FailRP but the last two in my opinion was bullfart. I have not been banned for 2 months and I hope to stay in good standing for the future.

How confident are you with GLua? (Rate yourself 1-10 using rating guide): 8

Do you have any experience with Git?: I do not but I can learn. I believe I have used something similar (or probably is git) for a VPS.

Do you have previous experience as a Developer for GMod?:

Yes. I am working on a very experimental cooking system. Possibly, when it's completely finished it can someday be put onto the server at some point.

Crazy Cooks (InDev 1.0.0)

I haven't updated it in a little but and I should get on that to make a better looking prototype. If you want some screensharing of code add me on Discord as Laqota and we can work out a time to create a screensharing session. I prefer to keep my work off the world wide internet as it's still being developed and is private.

How many hours can you commit to developing per week?: As much as I can way more than 4. I currently don't have any part-time or full-time job so I have been looking for one. For experience, I can use this on my resume and it would help me a lot especially if I'm working in IT.

Why do you want to be a Developer? What can you help us with?: I want to be a developer because I have enjoyed/disliked the server experience. I enjoyed the server experience because of how much fun I have had and how many friends I've made along the way. I disliked the server experience entirely because the Strictness of some staff (Most were cool. Such as @Jason Mcbrandtville, @"Darkstar", @stee ven and some others. I have deemed them most fair and helpful) and the lag/optimization problems on the server. My goal is to attempt to fix some of these problems and debug possible future problems so other people don't have issues like I have and just make the gameplay much better in general.

I know you know, we all know, VWar is the source of the ping and crashing problems. It's clear.

I would also like to improve some systems such as cooking, arresting, things that really ruin the experience because of broken unexpected behavior. I don't wanna seem like I'm coding Jesus but I've been scripting for like 6 years now. Yeah, I started doing Javascript when I was 10. And learned lua when I was about 13.
 
Neutral.

I cyberstalked your Roblox profile, couldn't really find any big or normal sized games you've made on there.
What I did find was decently cool but a bit clunky. Not really enough work for me to make a judgement.

"I know you know, we all know, VWar is the source of the ping and crashing problems. It's clear."
Pretty bold statement even though VWar is kind of a monolithic addon. I don't think it's that crystal clear; you'd have to do a lot of server profiling to figure it out, and there's not really very good profilers for gmod servers.

EDIT:
I downloaded and took a look at the code of the Crazy Cooks gamemode.
Lot of repetition, code quality could be much better. Heavy use of _G which is bad practice in even normal Lua world, probably is in gmod as well.
 
Last edited:

Laqota

Well-known Member
Apr 21, 2023
24
0
41
Neutral.

I cyberstalked your Roblox profile, couldn't really find any big or normal sized games you've made on there.
What I did find was decently cool but a bit clunky. Not really enough work for me to make a judgement.

"I know you know, we all know, VWar is the source of the ping and crashing problems. It's clear."
Pretty bold statement even though VWar is kind of a monolithic addon. I don't think it's that crystal clear; you'd have to do a lot of server profiling to figure it out, and there's not really very good profilers for gmod servers.

EDIT:
I downloaded and took a look at the code of the Crazy Cooks gamemode.
Lot of repetition, code quality could be much better. Heavy use of _G which is bad practice in even normal Lua world, probably is in gmod as well.
I cyberstalked your Roblox profile, couldn't really find any big or normal sized games you've made on there.
What I did find was decently cool but a bit clunky. Not really enough work for me to make a judgement.
Stuff I've worked on by myself.
https://www.roblox.com/games/5867115816/Roblox-Stories-of-all-Story-games (Old and unfinished. Doesn't have a story yet)
https://www.roblox.com/games/12922872857/Innovation-Employee-Elevator-Beta (Semi-Finished. Just gotta add more levels and stuff)
https://www.roblox.com/games/12170194451/Bobbys-Bot-Manufacturing (Unfinished but finished for now. Creating a better camera system and map)

Stuff I've helped with
https://www.roblox.com/games/14592356629/Catalog-Discounter (If you play Roblox and use the Catalog often. Use this. We make like 2% but you get the rest 23% back from purchases because Roblox gives us 25% of the item you bought and we take 2% and send back 23%. Currently fixing and improving stuff)
https://www.roblox.com/games/14547592833/The-Hidden-Union-Clifftown-ALPHA (Coding, animating and minimal building. Almost all building was by admak08 and ASTROPUR0)
https://www.roblox.com/games/5412621627/The-Meme-RV (Don't work on it anymore because I broke friends with the creator since he was leaked as a
pedophile
. I made some maps for it. You'll have to look up videos on YouTube)
Pretty bold statement even though VWar is kind of a monolithic addon. I don't think it's that crystal clear; you'd have to do a lot of server profiling to figure it out, and there's not really very good profilers for gmod servers.
Yeah. Pretty bold. Bold enough to catch the developers printing every tick the current memory usage of VWar. It would go up and up until it reaches your memory and restarts. VWar is also the cause of 323 since they're in the same Code Sandbox.

I did post an image in a ticket but it's closed now cause I thought it was a bug. I was told it was actually them debugging the memory leaks.
I downloaded and took a look at the code of the Crazy Cooks gamemode.
Lot of repetition, code quality could be much better. Heavy use of _G which is bad practice in even normal Lua world, probably is in gmod as well.
Lua is repetitive. Any coding language is repetitive. I don't know if I'm looking at it wrong and repetitive is a different meaning for you but lmk cause I cringed at this word when we're talking about Lua.

Yes. I could move around a few variables and parts to have it line up with function but this was just a first code and release to prototype the idea. I do currently have a version that is in the works that uses a Base for food so you can easily create recipes and stuff without the pain.

Heavy use is an Overstatement. I use _G variables only twice in CrazyCooks to register recipes and food objects. It's a prototype. _G also is a Global Variable and isn't bad practice depending on your use case. _G is literally just "local" but you can use it anywhere.

Most people call _G terrible because code is usually single-threaded unless you use coroutines. Nobody knows when the script it's in is gonna load. Hence why its "bad practice" when in reality it's just because they don't want to wait for the script that first calls the _G like for example.

Code:
function Wait(seconds)
    seconds = CurTime() + seconds
    repeat until CurTime() >= seconds
    return true
end

function AwaitForGlobal(name)
    local I
    for I=1,5 do
        if _G[name] ~= nil then
            break
        end
        Wait(1)
    end
    return _G[name]
end

local Recipes = AwaitForGlobal("Recipes")
for i,v in pairs(Recipes) do
    print(v)
end
 
Thank you for the ROBLOX game links. Got a much better idea of what you've actually worked on from this.
I was intending on my other reply being a fairly short, cursory look at things, but I'll leave something more detailed.

1. Repetition is not an inherent issue of the language, at least by my meaning of it. Let me give you an example of some of your code that could easily be abstracted down to a local function, and remove probably about ~40 LOC in the process, along with making it more readable;
Code:
if self.panslot == 0 then
 self.panslot = 1

 local Angles1 = self:GetAngles()
 Angles1:RotateAroundAxis(Angles1:Up(), math.random(45,135))
 if ent:GetClass() == "cce_pan" then
    CookingProp:SetPos(self:GetPos() + self:GetAngles():Up()*44.7 + self:GetAngles():Forward()*8.1 + self:GetAngles():Right()*-5.8)
 else
    CookingProp:SetPos(self:GetPos() + self:GetAngles():Up()*47.2 + self:GetAngles():Forward()*8.1 + self:GetAngles():Right()*-5.8)
 end
 CookingProp:SetAngles(Angles1)
-- And a bunch more of the same thing.. 4 times in a big elseif.

Some more examples of repetitive code;
1a.
Code:
draw.SimpleText(self:GetNWString("Ingred1",""), "DermaDefault", 0, -120,color_white,TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER)
draw.SimpleText(self:GetNWString("Ingred2",""), "DermaDefault", 0, -105,color_white,TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER)
draw.SimpleText(self:GetNWString("Ingred3",""), "DermaDefault", 0, -90,color_white,TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER,color_white,TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER)
draw.SimpleText(self:GetNWString("Ingred4",""), "DermaDefault", 0, -75,color_white,TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER)
draw.SimpleText(self:GetNWString("Ingred5",""), "DermaDefault", 0, -60,color_white,TEXT_ALIGN_CENTER,TEXT_ALIGN_CENTER)
-- Similar code segment executed like 8 times in this file with slight changes.
1b.
Code:
self:SetNWFloat("SecondsCooked",self.CurrentHeat)
self:SetNWString("Ingred1",_G["FoodNames"][self.Contents[1]] or "")
self:SetNWString("Ingred2",_G["FoodNames"][self.Contents[2]] or "")
self:SetNWString("Ingred3",_G["FoodNames"][self.Contents[3]] or "")
self:SetNWString("Ingred4",_G["FoodNames"][self.Contents[4]] or "")
self:SetNWString("Ingred5",_G["FoodNames"][self.Contents[5]] or "")
-- Could be replaced with a 3 line for loop. Replacing such constructs would also make it easier to support more than 5 ingredients without significant code edits.
More examples exist most likely, however I can't be bothered to go through the rest of this codebase.

2. Extensive copying of the file 'imgui.lua', which is 477 LOC. I refuse to believe that there is not a space in the addon where you could put this file where it could simply be shared across all entity Lua files and be accessible through include()

3. The main reason _G is bad practice and terrible except for very, very specific circumstances is because there's simply better alternatives. In stock Lua, the better alternative is require(). In GMod, this seems to just be include(). Why would you create arbitrary burden on the task scheduler/Lua thread to wait for something to be initialized, when you can just include a file directly for configuration of your recipes/food items? Alternatively, even addons on Civil Networks provide a somewhat better alternative; they just use things like "VWar = {}" to create globals for anything needed by the addon itself/other addons. _G is unclean practice to use and there almost always exists a better alternative for it.

4. There are literally no comments in this code. Even in more confusing sections where it may not be immediately apparent what it's doing, there is quite literally just no comments anywhere. This is bad practice and makes the code less readable for anyone else other than you.

5. Fairly sure (though I could be wrong) that there's no way to get specific memory usage of one addon through Lua in GMod. The entire client/server realms run on one Lua state, so you'd kind of only be able to get the memory usage of either the entire server or entire Lua state. Doesn't seem like GMod sandboxes each addon, either. Any other addon could technically be causing the memory corruption/overwriting (?) that seems to cause the 323 issue.
 

Laqota

Well-known Member
Apr 21, 2023
24
0
41
Thank you for showcasing the repetition.

The first code (Showing the pan slot assigner) there is no other way to scale it down. You mention I could use a function. This just in general wouldn't be any cleaner and would still use a bunch of elseif's. I could however, move this code above the first if checking the next available panslot.
Code:
local Angles1 = self:GetAngles()
Angles1:RotateAroundAxis(Angles1:Up(), math.random(45,135))
Because the rest and the if's check what the available pan slot is and move the pan to a specific spot within the Entity and merging them to keep a pan on the cooktop effect.

The second example though is a good example. On the newer version of CrazyCooks (which is still being worked on) I did indeed instead use networking with an array and using a for loop for each ingredient (since it was cleaner)

As I said. I was pushing crazycooks to be a functional prototype. I was not aiming for something extremely clean. However this is still a good example.

^ I wanted the quickest way to do things. So I just used _G. I'm using include now.

^^ Yep. No comments. It's hard to rush something before you go to bed.

You are. GMOD, and Roblox, lua in general runs every script within' an internal coroutine but It's not called a coroutine (I'm saying coroutine because idk what it's called but I know it works this way). It runs each script within' their own thread. Hence why you cant just retrieve variables from another script or find it by scrapping the thread. They run in their own little "Sandbox". If they didn't if one script had an error, all the other scripts would yield or stop as well since scripts stops the thread during an error.
 
You are. GMOD, and Roblox, lua in general runs every script within' an internal coroutine but It's not called a coroutine (I'm saying coroutine because idk what it's called but I know it works this way). It runs each script within' their own thread. Hence why you cant just retrieve variables from another script or find it by scrapping the thread. They run in their own little "Sandbox". If they didn't if one script had an error, all the other scripts would yield or stop as well since scripts stops the thread during an error.
I wouldn't count protected calls or coroutines as a complete sandbox. Wouldn't be able to get memory usage stats from that either. Not too sure how gmod handles that internally. There's no sandbox, just protected error catching I believe. You can probably fuck with stuff outside the function with the debug library.
 
Dec 19, 2020
188
51
71
Application Denied


Hi @Laqota ,

Thanks for taking the time to make a programmer application.

I have chosen to deny your application as you have not demonstrated a proficiency for GLua. I suggest if you were to reapply that you do so with a greater portfolio of GLua addons so that we can better evaluate your ability to develop for Garry's Mod.

You may re-apply in 2 weeks.​
 
Status
Not open for further replies.