How about a tutorial about Coding?

Post Reply
User avatar
PasseGaming
Posts: 239
Joined: Sun May 31, 2020 2:27 am
Location: Philadelphia
Contact:

How about a tutorial about Coding?

Post by PasseGaming » Thu Sep 10, 2020 11:54 am

I find myself asking for help a lot. I don't know much about coding other then tiny bits and pieces I've picked up over the years. The concept is something I've always struggled with. An I feel like there are a solid chunk of us that would appreciate a mini-tutorial series that deals with just scripting. What each command is and the flow of code and all that. I understand some is spattered across the many tutorials, but I figured it'd be helpful having a basics tutorial so I can understand what I am doing. Anyhow, it's just a suggestion. I've managed to pick up on what some of this code does but I cant quite get the complete picture cause I don't know what BEQ is, for example.
Remember; wherever you go, there you are. :mrgreen:

My Projects: Spirit Impel
Pauldalyjr
Posts: 102
Joined: Wed Sep 12, 2018 4:01 am
Location: Tennessee

Re: How about a tutorial about Coding?

Post by Pauldalyjr » Fri Sep 11, 2020 12:11 pm

Start here...

viewtopic.php?f=35&t=5542

Really easy lessons.... BEQ is used to set up IF statements. BEQ means branch if the outcome is equal to whatever you are looking at. You can use it to check just about anything. For example... Do I have a key in my possession? BEQ, I have a key so branch of to that code, if I don't have a key so something else.

This is a really basic example....

LDA camScreen ; loading what screen we are on
CMP #$01. ; Compare to 1.... Is this screen one?
BEQ doThis ; if it is screen one, branch to the doThis code
JMP dontDoThis ; it wasnt eqaul so the code moves on to the next line... we didn't branch, we will do this instead, the code will JMP to your dontDoThis code
User avatar
PasseGaming
Posts: 239
Joined: Sun May 31, 2020 2:27 am
Location: Philadelphia
Contact:

Re: How about a tutorial about Coding?

Post by PasseGaming » Fri Sep 11, 2020 3:08 pm

okay, that kind of makes sense now... but what is IF statements?
Remember; wherever you go, there you are. :mrgreen:

My Projects: Spirit Impel
User avatar
mouse spirit
Posts: 850
Joined: Tue May 12, 2020 1:13 am
Location: Ohio,North America
Contact:

Re: How about a tutorial about Coding?

Post by mouse spirit » Thu Sep 17, 2020 2:11 pm

If means just that, if. What if we never ask if. The code would usually just read every line. We would ask "if" if we wanted to skip or branch something.

Object collides with enemy bullet
IF it is player, decrease life
But IF it is not player ,go here
If it is player bullet, destroy enemy bullet and player bullet
If it is not player bullet,(and we already said its not player)
Then do nothing.(so if enemy or enemy bullet or ect we simply do nothing.)

Think of what you want. Leta say to make a tile that if player has 3 health, this tile hurts you, but only if you have 3 health.

Warning, simplified example...

LDA player health
CMP 3
BEQ gohere
RTS
gohere:
Hurt player here

Is players health 3?
If so, skip to hurt code.
If not, rts (dont do the hurt code because we return with rts)

Kind of say it outloud. Like each step. I want player to get an upgrade when i grab item 4 or i want enemy to die when they touch tile 7. Or level is beaten when 10 enemies are destroyed by player bullets only.
I am game, hear me blip.

WIP my game Almika The Star Rider Densetsu Gaiden
https://www.mediafire.com/file/phef252j ... p.zip/file
Forum link viewtopic.php?f=51&t=5278
User avatar
mouse spirit
Posts: 850
Joined: Tue May 12, 2020 1:13 am
Location: Ohio,North America
Contact:

Re: How about a tutorial about Coding?

Post by mouse spirit » Thu Sep 17, 2020 2:26 pm

Heres simplistic descriptions, not totally accurate,
But its fine for starting to learn.

Beq.. if equal to
Bne.. if not equal to
Cmp.. Compare to
Lda.. Load
Jmp.. Jump
I am game, hear me blip.

WIP my game Almika The Star Rider Densetsu Gaiden
https://www.mediafire.com/file/phef252j ... p.zip/file
Forum link viewtopic.php?f=51&t=5278
User avatar
Jonny
Posts: 167
Joined: Tue Apr 14, 2020 3:18 pm
Location: United Kingdom
Contact:

Re: How about a tutorial about Coding?

Post by Jonny » Thu Sep 17, 2020 11:32 pm

Some great info here!

I don't want to put words in their mouths but I don't think the Nesmaker guys would ever do a dedicated ASM tutorial series as such. They got a lot of hate from a few people in the nesdev commuinity based around the "create nes games without any programming" concept. If they started posting up ASM tutorials on the website it would go against that and maybe but off some newcomers. Joe encorages people to learn code and where to do it which is maybe the best way to go about things which so many new developers just wanting to make a start.

Did you mean tutorials from Nesmaker themselves or from the forum? I might have got the wrong end of the stick.

I'm in the same boat, I need to learn some ASM too. I started a while back with a Youtube series specifically about 6502 Assembly and NES but I think I'm going to switch to some text based help. They were pretty hard to follow. I'll keep looking around, if I find any nice courses I'll let you know. I've started learing about famitracker and found Ben Burnes videos to be excellent. Very easy to follow and well explained.
- - - - - - - - - - - - - - - - - - - -
Game: BAD HARE DAY
Youtube: JONNY'S YOUTUBE
Twitter: JONNY'S TWITTER
User avatar
PasseGaming
Posts: 239
Joined: Sun May 31, 2020 2:27 am
Location: Philadelphia
Contact:

Re: How about a tutorial about Coding?

Post by PasseGaming » Thu Sep 17, 2020 11:50 pm

I was just thinking that a very basic tutorial about scripting asm from scratch would be helpful. I'm not asking for a complete tutorial, a single video that does a little more exploration into asm would be highly beneficial for those like myself who know literally nothing about coding. Like learning terms, basic commands, etc. Just a simple introductory into asm. It would be a good way to get people like myself into basic scripting and lead into more advanced coding and hopefully eventually learning 6502. It is odd to have a tool that requires some coding (to make a decent basic game) and not at the very least provide a lead-in to said coding. Can't learn without having been shown some stuff. The community can only help so much. An I highly doubt that a introduction to ASM video would turn people off. Getting the tool and being completely baffled like I was can definitely do that. When I heard "no coding required" I thought just that, but it's not exactly the truth. You can make a very, very basic game with what's provided, but if you want to do even a slightly more advanced things with your game (like pausing, switching weapons and stuff like that it is mind numbingly difficult not knowing or understanding the process). An that sort of thing isn't supposed to be advanced stuff but it is if you don't understand coding. Anyhow, it has been a month of nearly 10 hour days working on my project, I've only picked up bits and pieces of how it works. I know I have a long way to go but a video like that would do wonders. At the very least I could better understand what I am looking at when I go digging around the code or when someone shares their own.

Anyone with a problem with those who need a helping hand getting into NES development are jerks. This is supposed to be fun and bring about more games into the community. As opposed to just a few folk releasing new games as it has been up till recently. My guess is they are upset with more games on the field of play and potentially taking from their profits. It only does the community good with a tool like the NESmaker. Forget them.
Remember; wherever you go, there you are. :mrgreen:

My Projects: Spirit Impel
User avatar
Jonny
Posts: 167
Joined: Tue Apr 14, 2020 3:18 pm
Location: United Kingdom
Contact:

Re: How about a tutorial about Coding?

Post by Jonny » Fri Sep 18, 2020 8:17 am

I agree with that. Just one video as a start wouldn't hurt anything, an introduction from the nesmaker team, then people could go on and find out more themselves. Then the messgae is like "you can do this is you wan't but you don't need to" rather than being the next step.

My plan is to learn as much as my brain will take about ASM then go back to the older tutorials people have done for older versions of nesmaker and try to get the same theorys to work with the newer scripts. I know the code itself wont work but the logic is still there. Thats what I stuggle with, not the syntax.

If you get chance, read back on some of the early nesdev and reddit posts about nesmaker. It's shoking how people think sometimes. There was one comment saying it would flood the market with crappy games and others saying is was "unnecessary" to make a NES game. Just insane comments.

Anyway, good luck with your code learning.
- - - - - - - - - - - - - - - - - - - -
Game: BAD HARE DAY
Youtube: JONNY'S YOUTUBE
Twitter: JONNY'S TWITTER
User avatar
dale_coop
Posts: 5752
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: How about a tutorial about Coding?

Post by dale_coop » Fri Sep 18, 2020 10:15 pm

You can actually find a lot of ASM coding introductions... or Coding in NESmaker video on Joe Granato Vimeo channel https://vimeo.com/joegranatoiv
(And also on the official Youtube Channel about editing the scripts)
-----
I know... my english is not perfect
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
My son's game: KUBO 3
User avatar
PasseGaming
Posts: 239
Joined: Sun May 31, 2020 2:27 am
Location: Philadelphia
Contact:

Re: How about a tutorial about Coding?

Post by PasseGaming » Sat Sep 19, 2020 2:02 pm

I know he occasionally pokes at asm in the NES tutorial videos. I just thought it'd be easier and more convenient for new folk to have a single intro to asm video. Where he can give some explanations of what the commands mean. Write some simple practice code and call it a day. Instead of making the asm coding stuff like a scavenger hunt.

Anyhow, it was just an idea. I know it would have helped someone like me, who knows literally nothing about coding and even through all of this (ByteOff) has only picked up some odd and ends. Anyhow, said my peace.
Remember; wherever you go, there you are. :mrgreen:

My Projects: Spirit Impel
Post Reply