If AI were being used to modify code in SRB2, how would you feel?

Sls64LGamingBro

An ordinary coder...
I know I would feel disgusted, cause it just pains me how AI's been growned to effectively use to generate code with source material like the SRB2 Wiki. And not knowing if this can be allowed when it comes to Reusability.

And when I went on the website, and tried asking a question on "Can you make me an SRB2 script that allows you to Homing Thok without using "CA_HOMINGTHOK" in my S_SKIN" to see how it would generate the functions, hooks, and anything else that the game uses. It only surprised me how some are even corrected.

ChatGPT's Custom Homing Thok Script:
-- Define custom homing thok behavior
local homingThokTime = 0 -- Keeps track of time for the Homing Thok

-- This function will be called during every frame of the player's movement
function HomingThok(player)
    if player.mo and player.mo.valid then
        -- Make sure the player is on the ground or jumping
        if player.mo.playerstate == PST_LANDING or player.mo.playerstate == PST_JUMP or player.mo.playerstate == PST_FLIGHT then
            -- Check if the player presses the thok button (default is spin)
            if player.cmd.buttons & BT_ATTACK ~= 0 and homingThokTime <= 0 then
                -- Start the homing thok action
                homingThokTime = 30  -- Set cooldown time for another thok

                -- Create a homing projectile (this could be a homing missile or custom object)
                local missile = P_SpawnMissile(player.mo.x, player.mo.y, player.mo.z, player.mo.angle, MT_MISSILE)  -- Replace MT_MISSILE with your custom missile if desired
                if missile then
                    missile.target = P_LookForTargets(missile)  -- Find and set a target for homing behavior
                end
            end
        end
    end
end

-- Function to reduce the cooldown time
function UpdateHomingCooldown()
    if homingThokTime > 0 then
        homingThokTime = homingThokTime - 1  -- Decrement cooldown each frame
    end
end

-- Add to the main game loop
addHook("ThinkFrame", HomingThok)  -- Will run HomingThok function every frame
addHook("ThinkFrame", UpdateHomingCooldown)  -- Will run cooldown function every frame

Even though these are what they got from the SRB2 Wiki as their source material, it is stunning to see. But it can cause problems that'll define our future for Coding aspects. Though I wonder how you guys would feel or deal with problems like this in your hands.

Also, I'm hoping that I've not used the wrong thread. Since this is meant to be accorded to all people who are a part of the SRB2 community. This thread is also similar to this post in the "Long jump" discussion thread: https://mb.srb2.org/threads/long-jump.45268/#post-681702
 
I do not think Sonic Team Jr. would've posted any coding examples on the wiki that are not open for anyone to use, but AI software would've likely scraped far more than just the wiki with no distinction between reusable and non-reusable content.

Some communities have banned the posting of AI-generated material and have also blocked the scrapers from accessing the site, that is something that the staff here would have to decide and will need to decide at some point.
 
every time i try to say something on this, i just go on a rant about how much i hate AI and for good reason. so that has to say something for how i feel about AI being used to modify code.

dont use AI ever for anything.
 
I do not think Sonic Team Jr. would've posted any coding examples on the wiki that are not open for anyone to use, but AI software would've likely scraped far more than just the wiki with no distinction between reusable and non-reusable content.
Well, I mentioned the SRB2 Wiki cause ChatGPT detects the material that's closest to what you're referring to, unless it doesn't. But I know other AI websites contain this as well.
every time i try to say something on this, i just go on a rant about how much i hate AI and for good reason. so that has to say something for how i feel about AI being used to modify code.

dont use AI ever for anything.
That's understandable, I know it's hard to describe the causes of its advantages and disadvantages that effectively change the future (That depends on how it'll go, though).
 
every time i try to say something on this, i just go on a rant about how much i hate AI and for good reason. so that has to say something for how i feel about AI being used to modify code.

dont use AI ever for anything.
It depends on the type of AI and how you're using it

if you're using it for a video, it must be satire. Don't be one of those AI bros who takes it seriously

The lip syncing example in Final Fantasy though is a good use for AI that just assists, instead of making entire new things for you.

Also, video game AI doesn't count (as in like goombas and motobugs)
 
AI is a great tool for coding if:

-You know what you're doing
-The internet has a massive surplus of documentation for the medium you're coding in

Most kids on this forum fail the former. The lack of publicly available complex and well-written Lua code for SRB2 fails the latter. I'd hate for people to use AI because they won't learn anything AND probably generate incomprehensible dogfood.
 
id say If you want to use ai to code dont post It to the public to download but instead use it to see How coding Works because most ais now can code actual great codes now,chatgpt coded an fly ability and it works Just fine
chatgpt code:
addHook("PlayerThink", function(p)
    if not p.mo then return end

    
    if p.isFlying == nil then p.isFlying = false end
    if p.toggleFly == nil then p.toggleFly = false end

    
    if (p.cmd.buttons & BT_CUSTOM2) ~= 0 and not p.toggleFly then
        p.isFlying = not p.isFlying
        p.toggleFly = true
    elseif (p.cmd.buttons & BT_CUSTOM2) == 0 then
        p.toggleFly = false
    end

    
    if p.isFlying then
        
        if (p.cmd.buttons & BT_JUMP) ~= 0 then
            p.mo.momz = 2 * FRACUNIT
        
        elseif (p.cmd.buttons & BT_SPIN) ~= 0 then
            p.mo.momz = -2 * FRACUNIT
        else
            
            p.mo.momz = 0
        end
    end
end)
 
Last edited:
id say If you want to use ai to code dont post It to the public to download but instead use it to see How coding Works because most ais now can code actual great codes now,chatgpt coded an fly ability and it works Just fine
chatgpt code:
addHook("PlayerThink", function(p)
    if not p.mo then return end

 
    if p.isFlying == nil then p.isFlying = false end
    if p.toggleFly == nil then p.toggleFly = false end

 
    if (p.cmd.buttons & BT_CUSTOM2) ~= 0 and not p.toggleFly then
        p.isFlying = not p.isFlying
        p.toggleFly = true
    elseif (p.cmd.buttons & BT_CUSTOM2) == 0 then
        p.toggleFly = false
    end

 
    if p.isFlying then
     
        if (p.cmd.buttons & BT_JUMP) ~= 0 then
            p.mo.momz = 2 * FRACUNIT
     
        elseif (p.cmd.buttons & BT_SPIN) ~= 0 then
            p.mo.momz = -2 * FRACUNIT
        else
         
            p.mo.momz = 0
        end
    end
end)
Yeah, but there's more than that. Publishing AI scripts that weren't made by the user technically breaks the Reusability system, but it hasn't been added as a new rule to defend against this problem. And because its work is to track down the resources it's getting from, specifically the name you're referring to. Most AI websites contain this to understand what they're rephrasing about. I've already said this a couple of times by now, but I'm just making sure.
 
Generative AI raises enough questions about copyright and ownership that it probably isn't worth using it for your code. AI tools like ChatGPT work by training on content scraped from the internet; some code on the internet is released under the terms that if you use it in your own project, you have to make your project reusable too (this is usually described as "viral open source"). AI text generators don't really "copypaste" code usually but sometimes they can produce outputs that are identical to some of their training data by random chance. If the AI tool produces a clone of some viral open source code, do you have to make your project reusable? How would you even tell if this happened? Those are questions you have to answer for yourself if you choose to use AI.
 
At the very least I'd say that it would be appropriate to mandate disclosure of AI usage. Banning it entirely could potentially be difficult in regards to enforcement as it might not always be easy to tell when code is made by AI and when it's made by a human, and for those who know what they are doing I can imagine AI being really useful in regards to making a starting point and then editing the code from there.

As for the reusability tag, that's a harder call for me. On one hand it might make sense to base it on how much of the code is written by AI, though that would again be difficult to know for sure. On the other hand I could see an argument for mandating reusability if AI is used at all. The individual didn't write all the code themselves, so from that perspective it could be said that they can't claim full ownership just like if they used someone else's reusable code as a starting point to edit from. I'm not really entirely sure where I actually stand on that matter yet though.

Either way, I don't think there's any way to stop it entirely from being used. People are going to use it regardless, so worst case scenario they won't be able to post their mods here. Rather than gatekeeping regarding usage of AI at all, it might be better to just make it so that users need to disclose when they use AI and only outright ban mods that are entirely made by AI with no manual human input at all, assuming there's even a way to tell and also way to tell when someone just changed one tiny little thing to get around such a rule, and etc. I'd say a "show your homework" approach could work to help tell how much of a mod is made with AI assistance, but that could also end up being an entire hassle for someone to put together that could disincentivize working on the mod at all so I'm not sure if that would be the best way to handle it.

Overall I'm not as outright against the usage of AI at all as a lot of people are, but I also know that there's still a lot of legitimate concerns regarding it and so it's hard for me to form a solid stance in regards to its usage. I do firmly think it needs to be at least regulated to some extent, but I'm not going to pretend to be an expert on exactly what that extent should be or how to go about doing it.
 
The way generative AI works means that it's basically impossible to track down the original authors behind the code it regurgitates. My own stance on it aside, that's pretty problematic for a forum that insists on the original programmer having the final say on whether or not their code can be used/modified.
 
I feel like this kinda destroys the point of what actual coding is. Elon musk would have a whole party if this happened
 
Ethics aside, you won't get anything useful from GPT beyond general coding gunk, and the example you gave isn't actually good code. AI is nowhere good enough to comprehend the SRB2 wiki or the systems of SRB2 fully, even with access to its source code. The example you gave does an excellent job of looking like actual BLUA from an SRB2 addon, but doesn't actually make sense on a micro or macro scale.

On a micro scale, it's using constants and variables that don't exist like PST_LANDING and player.mo.playerstate and doing the hooks all wrong and the timing variable isn't attached to a player. But ignoring the errors in execution, what GPT is trying to do isn't even what you asked. What the script it made is trying to do is spawn a missile when you press the spin button with a 30 frame cooldown.

It's nonsense on every layer. The devs couldn't use AI like this if they wanted, and I doubt they want to. I have to imagine it'd fair even worse trying to generate source code. The SRB2 source code is an enigmatic beast, only hardened souls dare brave its depths.
 
IS It ok or NOt ok to use AI for helping me with my Srb2 code?
A major issue with vibe coding tools is that they are advertised in a way that claims the ability to forget that the code is there altogether. There have been many people already who fell into that trap and faced the task of fixing code they do not understand.

Unless you know beforehand what the code you are working on is doing and why, then it is more likely to back you into a corner than actually help.

A key issue of AI in general is the idea of it replacing existing tools as opposed to just being another tool in the box that the user has control over (for tasks that are otherwise very difficult to write an optimized algorithm for). In other words, the intent being assistive and working with data that is already there or created with traditional algorithms with no actual generative component.
 
Last edited:
SO, as someone who in fact does use Ai for a little bit of my lua code (But definitely not all of it; most if it comes from either other open assets mods, or Me modifying it myself), is it still genuinely ok to use that code from the AI as long as I stay responsible, know what I'm doing, AND don't use it for everything code-wise (Which I do all three)?
 
OK.
I am going to put this out now, because I am on the verge of finishing my first Custom Character mod, but I want clarification from the public about this first to ensure that I'm both explaining myself correctly (since no one knows me), and the following things that I've done qualify as valid for my character before I'm fully ready to release him to the public:

///This was copied from my "Credits.txt" file in my mod after I wrote it, so Sorry if it looks sightly "odd" with the dashes and slashes./////////

ChatGPT Usage Validation (Just in Case):
(I've checked the Ai-Generation usage rules)....
Rules:
1. Your mod may not be entirely AI-generated. - True
2. You may not include AI-generated sprites, sounds, textures, or graphics for any purpose. - True
3. Some AI-generated or AI-assisted code is tolerated, but it may not comprise the entirety of your code. - True
//
Answer: All are _YES__, All of the sprites are completely created by me alone,
two of the songs included in the mod are actually original songs i created myself,
audio files (music & sfx) ripped from other mods,
and only a few of the Luas include Ai-generated code.
the rest of the code are other Luas sued from other creators, but some of the code in this mod were actually typed manually by ME MYSELF.
some of the Ai-Generated code was generated and put directly into Lua, but I myself had to review and MODIFY certain lines, fix errors, and check for bugs in the code,
so Yes, I DID learn how to write Lua code and NOT all for the ai-generated code was directly just 'copy-paste' into the folder.
I even edited other Luas of the recycled Luas as well, and even added custom functions to those.

Yes, I have not only learned how to Lua code, but I've also used those skills to check back over ChatGPT and write my own lines, additions, and modifications to my mod's functions.
-- While you may use some AI-generated code, if your addon has Lua scripting then a substantial chunk of it must still be made by you, a human. Recycled code from other addons will not count towards this, you must make it yourself. -- Check ,/

Even though the code that i changed and modified and even wrote ISN'T ABUDANTLY MINE, ChatGPT code i used, let alone never changed, IS NOT abundant either.
//////////////
Explanation:
//THIS WAS NOT A SIMPLE 'copy-paste and magical working' feat. This was a TASK that took quite a bit to figure out around, check for flags to ensure NO ONE IS KILLED BY ME, the kick works properly, and can break floors and walls, and lots of more bugs and errors that needed fixing.
Sometimes, the entire mod would come up invalid just because of a SINGLE TYPO in ONE LUA with 2000 lines...... UGH.
Anyone who thinks that I just use ChatGPT JUST to simplify my work and that's all i did (meaning i never learned how to read, check, or change, and even WRITE Lua code), you are orders-of-galactic-magnitude WRONG.
In fact, ChatGPT has not only helped me make the code, but also helped me learn how to check over it to make sure it is right.
I now have proper experience and have managed to learn Srb2 code enough that of someone asked me at random, I'm not clueless about it.

If you still have assumptions that I'm Just 'saying I learned Lua' and ONLY 'used chat to make it easier'...
this mode was tested OVER 100 TIMES, a substantial amount of those times being from simple typo errors I had to fix MYSELF, not even from Chat, Me.

I could not get this far into this mod's code WITHOUT learning or being able to create Lua code myself.
This is my validation explanation for using AI in my Code. I know its long and may even be a bit overexplanatory, but I do not want my first mod being ignored just because of Ai-generation being used for PARTS of it, not EVERYITHNG.

/// End of the thing////////////

Please, for those that would, DO NOT OUTRIGHT Criticize me or "Shoot me down" just because. And I apologize if I've overexplained. The point of this is for feedback and advise on ensuring I did everything I'm suppose to to be able to be accepted by the forum to release my mod when ready. Please give any advise or feedback for this. I would highly Appreciate it! :threat:
1782248149425.png
 

Who is viewing this thread (Total: 0, Members: 0, Guests: 0)

Back
Top