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.
 

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

Back
Top