new technologies for developing on NES

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems.

Moderator: Moderators

Post Reply
iamooos
Posts: 16
Joined: Tue Oct 18, 2022 2:37 pm

new technologies for developing on NES

Post by iamooos »

so i have been talking to chatgpt.


i showed it a function in C that loads metatiles, top to bottom: (this is essentially shiru's metatile code)

Code: Select all

        if(pad&PAD_UP)  //this code loads metatiles to fill the entire the screen, top to bottom, from an array of metatiles.
	{

		if(!(level_y&7))//put new row every 8 pixels
		{

			prepare_row_update(name_row,level_y/16); //where on the screen first, then what part of the level to load.
			set_vram_update(update_list);//the update is handled at next NMI
			
		    if(name_row<30) //30 rows worth of 8 pixels.
			{
			++name_row;//next row.
			}
		}

		scroll(0,scroll_y);//scroll value will be applied on the next nmi as well
		++level_y;

	}


then i told the bot:
now make a new function so that: when i press down the metatiles fill the screen bottom to top


not only did it write the function instantly, it explained exactly what it was doing.

Code: Select all

void fill_screen_bottom_to_top() {
    if(pad&PAD_DOWN) {
        if(!(level_y&7)) {
            prepare_row_update(name_row, (level_y/16) + 30);
            set_vram_update(update_list);
            if(name_row > 0) {
                --name_row;
            }
        }
        --level_y;
    }
}

i plugged it into my NES rom and it actually works..

how do you guys feel about it? are you using this tech right now? is it a gamechanger? will this make your game come faster?
i'd love to hear more thoughts.

i am not sure if the bot can really handle your assembly language i havent tried, that might be where it can no longer be helpful.

but honestly for prototyping something it's a super useful thing to have!

it doesn't always help or work out the best though, but sometimes it does, and it comprehends things very well!
User avatar
tokumaru
Posts: 12318
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: new technologies for developing on NES

Post by tokumaru »

I had some fun with ChatGPT, but the code it wrote for me often had silly errors in it, like reading past the end of arrays and things like that. It would promptly fix the mistakes once I pointed them out (I'd just say "you're reading past the end of the array" and it'd realize where the mistake was), but the fixes themselves weren't always correct either, so it'd take a few iterations before things would work as expected.

I'm definitely not ready to take ChatGPT's output to put directly in my programs, specially in 6502 assembly, which it can write to some extent, but is completely oblivious when it comes to addressing modes and how registers can be used.
iamooos
Posts: 16
Joined: Tue Oct 18, 2022 2:37 pm

Re: new technologies for developing on NES

Post by iamooos »

i agree, maybe though it would be beneficial to keep correcting it's errors. maybe that will slowly train it so that eventually it can produce good results
Oziphantom
Posts: 1406
Joined: Tue Feb 07, 2017 2:03 am

Re: new technologies for developing on NES

Post by Oziphantom »

ChatGPT is a "copy my homework but change it to make it your own" tool. Basically it is essentially "shiru's metatile code" because that is what it copy pasted and then pushed around a bit to make "unique". Basically its a 5 year old that copies SO answers without any concept of what it is doing.
User avatar
tokumaru
Posts: 12318
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: new technologies for developing on NES

Post by tokumaru »

iamooos wrote: Fri Jan 20, 2023 10:05 pm i agree, maybe though it would be beneficial to keep correcting it's errors. maybe that will slowly train it so that eventually it can produce good results
It doesn't look like ChatGPT can be trained by users though, it's frozen in time with the knowledge it currently has. Which's probably a good idea, considering that random internet trolls could easily screw it up by intentionally feeding it a bunch of crap. I guess people working on the project could still review logged conversations manually and decide to make use of user input to improve the tool, so it's still possible that our corrections will help in the end.
Oziphantom
Posts: 1406
Joined: Tue Feb 07, 2017 2:03 am

Re: new technologies for developing on NES

Post by Oziphantom »

yeah its closed otherwise you will have it spewing CD keys and getting DMCA'd to death. They have teams in Africa who have to scan and tag things to make sure it avoids the destruction of its predecessor https://twitter.com/billyperrigo/status ... J7DAvwp1kg

But even then it has two uses cases.

People who don't know what they are doing and think it helps them get ahead, but then will get things done without learning anything and rapidly hit a wall/get killed by all the bugs they don't understand how to fix.
And
People who know what they are doing, and hence I can make such trivial code faster than trying to talk to it and fix its output.

So basically it has no real use in programming, as it can't actually help anybody learn and anybody who can fix its output can do things faster without it, making it a negative addition. Its main job is to be a better "Hi welcome to our website my name is Mark, how can I assist you today?" bot.
User avatar
tokumaru
Posts: 12318
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: new technologies for developing on NES

Post by tokumaru »

When it comes to programming, I've used ChatGPT to do something similar to "rubber duck debugging", where we basically talk about some programming problem, the possible solutions, relevant algorithms, and so on. It never came up with anything groundbreaking that would solve everything, but just talking with someone/something that can keep up a conversation about such obscure topics will often help me come up with good ideas.
Oziphantom
Posts: 1406
Joined: Tue Feb 07, 2017 2:03 am

Re: new technologies for developing on NES

Post by Oziphantom »

so its a better inanimate rubber duck :D
iamooos
Posts: 16
Joined: Tue Oct 18, 2022 2:37 pm

Re: new technologies for developing on NES

Post by iamooos »

Oziphantom wrote: Fri Jan 20, 2023 10:34 pm yeah its closed otherwise you will have it spewing CD keys and getting DMCA'd to death. They have teams in Africa who have to scan and tag things to make sure it avoids the destruction of its predecessor https://twitter.com/billyperrigo/status ... J7DAvwp1kg

But even then it has two uses cases.

People who don't know what they are doing and think it helps them get ahead, but then will get things done without learning anything and rapidly hit a wall/get killed by all the bugs they don't understand how to fix.
And
People who know what they are doing, and hence I can make such trivial code faster than trying to talk to it and fix its output.

So basically it has no real use in programming, as it can't actually help anybody learn and anybody who can fix its output can do things faster without it, making it a negative addition. Its main job is to be a better "Hi welcome to our website my name is Mark, how can I assist you today?" bot.

i think this is incredibly short sighted.


the bot helped me design a rendering engine architecture that would run in monogame.
it only wrote useless pseudo code, but that's not the point of it, since it has all of the siggraph papers, i could make proposals to the ai for methods to render scenes, and also to precompute and store data for rendering scenes.
the bot didn't come up with any ideas, all of the ideas were mine, but it helped me outline a whole system of global illumination that can render a morning to night time scene all precomputed and stored in texture atlases.

the idea to use texture atlases to reconstruct light volumes only occurred to me while we were planning the whole thing, but as soon as i asked if it was possible it gave me ideas of how it could be done

in fact, the system it ended up proposing, supposedly can handle refractions too. which is something i didn't even think of or consider.
but since it knows all of the formulas for physics, it's as simple as plugging them in sometimes, so it does. (it didn't give me literally the shader/function for it in this instance, but all i have to do is ask)



i've written a deferred rendering engine before with a ton of bells and whistles, but this global illumination system would be so complex that there's no way i could have planned it all by myself especially not with the proposed "hacks" to save on memory and processing. and never this quickly.
the rendering engine planning took a long time, and with the bot i can do comparable work in 1 day
Drag
Posts: 1491
Joined: Mon Sep 27, 2004 2:57 pm
Contact:

Re: new technologies for developing on NES

Post by Drag »

I don't like the sensationalization surrounding ChatGPT, because it's basically Stack Overflow without the peer review, yet everyone talks about it like there's some kind of grand revolution happening.

That and ironically, being a programmer and knowing how AIs work makes me trust them even less. :D

Therefore, I'm disinterested in using them for anything other than just screwing around for fun.
Drag
Posts: 1491
Joined: Mon Sep 27, 2004 2:57 pm
Contact:

Re: new technologies for developing on NES

Post by Drag »

To add more to the AI discussion, AIs don't actually understand the underlying theory behind what they generate. Their knowledge is more like "this keyword means this output, based on what I've seen before". By looking at billions of examples in its training set, it does not acquire any understanding of theory (nor is it even interested in it), it only gains a huge database of snapshots to choose output from, sorted by keyword.

Ironically enough, this means AIs are the ultimate cargo cult programmers. :D

The other thing that bugs me is, the anthropomorphization of AI means people won't understand the above fundamental difference between an AI's knowledge and a human's knowledge, leading to:
- Bad comparisons like "an AI looking at thousands of examples isn't any different from a person doing the same thing" (it's not, because an AI gains no understanding of causation or theory or anything meta by looking at examples, unlike a person)
- The incorrect assumption that an AI is capable of learning from its mistakes (it can't because once trained, an AI's knowledge is immutable until you update its training set and retrain it from scratch, which is expensive).

And that's why I don't like the sensationalism behind it.
strat
Posts: 405
Joined: Mon Apr 07, 2008 6:08 pm
Location: Missouri

Re: new technologies for developing on NES

Post by strat »

Drag wrote: Tue Jan 24, 2023 10:45 am it's not, because an AI gains no understanding of causation or theory or anything meta by looking at examples, unlike a person
Soooo... this means we're not getting Skynet anytime soon?
Drag
Posts: 1491
Joined: Mon Sep 27, 2004 2:57 pm
Contact:

Re: new technologies for developing on NES

Post by Drag »

strat wrote: Wed Jan 25, 2023 6:00 pm Soooo... this means we're not getting Skynet anytime soon?
We already have Skynet, but it's the dumber one where it just determines whether or not you're allowed to post your thing and/or keep your account, and all anyone does is throw their hands up, "sorry, nothing we can do to fix this!" because money. You can ask it to rhyme like Dr.Seuss though, so that's something I guess. :P
Fiskbit
Posts: 623
Joined: Sat Nov 18, 2017 9:15 pm

Re: new technologies for developing on NES

Post by Fiskbit »

The phone discussion can be be found here. Please avoid debating cell phones in this thread.
semanticism
Posts: 1
Joined: Mon Feb 06, 2023 5:15 pm

Re: new technologies for developing on NES

Post by semanticism »

Drag wrote: Tue Jan 24, 2023 10:45 am To add more to the AI discussion, AIs don't actually understand the underlying theory behind what they generate. Their knowledge is more like "this keyword means this output, based on what I've seen before". By looking at billions of examples in its training set, it does not acquire any understanding of theory (nor is it even interested in it), it only gains a huge database of snapshots to choose output from, sorted by keyword.

Ironically enough, this means AIs are the ultimate cargo cult programmers. :D

The other thing that bugs me is, the anthropomorphization of AI means people won't understand the above fundamental difference between an AI's knowledge and a human's knowledge, leading to:
- Bad comparisons like "an AI looking at thousands of examples isn't any different from a person doing the same thing" (it's not, because an AI gains no understanding of causation or theory or anything meta by looking at examples, unlike a person)
- The incorrect assumption that an AI is capable of learning from its mistakes (it can't because once trained, an AI's knowledge is immutable until you update its training set and retrain it from scratch, which is expensive).

And that's why I don't like the sensationalism behind it.
This would assume that the AI is a purely linguistic model, it does not have a fully functional brain in the same way that a human does, yet there's nothing stopping an AI from having an understanding if a human brain is actually fully simulated, while usually we want computer neurons to have an infinity of stages, while that's not achievable because of memory size limitations, the stage of a biological neuron can be described by a single bit (btw i learned watching this video here https://youtu.be/IHZwWFHWa-w?t=610, I am not an actual neurologist), If we wanted to store the stage of a simulated brain, we'd need approximately 86 gigabits (bits, not bytes), which is 10,75 gigabytes (Not to be confused with Gibibits), and then try to model our brain after "the neurons that fire together wire together" theory of neurology, and then try to make the network interact with other human beings, to try to make it imitate the behavior of the others around it, because that's how humans tend to learn the basics of how to interact with others, I'd recommend you watch MarI/O playing https://youtu.be/qv6UVOQ0F44, while I don't think this is just like the human brain nor I do think that SethBling (MarI/O's creator) is someone who is a pretty qualified person in actual neurology, I think it's pretty interesting to see how it's not just the weights and biases that are being adjusted the number of neurons and how they're connected, all of that is being adjusted too, which an interesting design choice for a neural network
Post Reply