Language for beginning programmers?

You can talk about almost anything that you want to on this board.

Moderator: Moderators

Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

In [url=http://nesdev.com/bbs/viewtopic.php?p=43347#43347]this post[/url], Banshaku wrote:
Hamtaro126 wrote:The thing is that Most 6502 tutorials, Even when applied to stuff NES-Specific, Are not really that great. I tried every tutorial known here.
It depends on your background too. Do you have any computer science background? If not, some tutorial may be more difficult because you may be confused by the basics like variables, loops, stack etc.

What kind of other language you know? If you don't know any other, it could be a good thing (but not required) to learn the basic in less cryptic one like C or even basic would be fine.

Basics are important to be able to understand how to program. Without the basics, you will get lost. I think this comment is quite general for anything you learn.
You know, it's funny because I find C a lot more confusing than 6502 (it helps that I know 6502, and don't quite know C). 6502 is just so straightforward, and it gives you 100% access to all of the registers. With C, it's harder to manipulate a specific byte without addressing it as a variable of some sort. Everything is just so not-up-to-you, it bothers me sometimes. Though doing Variable = 12/5 is a lot more fun than ldx #12, ldy #5 jsr DivideXbyY.

What really got me when I first came was that I didn't realize how much power was given to me, and how much was up to me to do. I didn't quite comprehend that I say how the maps are stored, I decide how to check for collision, etc. I guess I thought there was one magical answer to every "how do I..." but eventually it dawned on me that I had all this power, and I felt like an omnipotent genie (okay, no, not really). And that's the one thing that I really think is the most important to learn when programming a game. And also, I didn't know about the concept of a "game engine" at first, so when thinking about ways to make a game, I basically had to re-invent the wheel where I had to come up with the concept of a game engine on my own. When I really first started, I figured everything was completely hardcoded, which is just plain awful.

As for programming languages, Basic, however, I would recommend. QBasic in particular is super easy to get a feel for, and it's easy to draw graphics (though there aren't fun things like scrolling and hardware sprites). I was able to make a wireframe 3D simulator just using its "line" function and a little math.
tepples
Posts: 22345
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Post by tepples »

tokumaru wrote:Sometimes people seem to think books are magical things that can teach you anything. Personally, I think the internet is way more powerful than any book
One can read a book on the bus. But unless I'm missing something, one would need to finish high school,[1] buy a laptop, and subscribe to $700/year mobile broadband[2] to read a web page on a bus.
Celius wrote:6502 is just so straightforward, and it gives you 100% access to all of the registers. With C, it's harder to manipulate a specific byte without addressing it as a variable of some sort.
But why would you even need to manipulate a specific byte, and how will you remember in six months why the code you wrote is manipulating it? That's part of what a type system is for.
Celius wrote:As for programming languages, Basic, however, I would recommend.
QBasic is no longer distributed, nor can it run on 64-bit versions of Windows without an emulator. Would you recommend or recommend against a newer dialect such as Microsoft's Visual Basic? Is the NESdev community lacking an NES-based BASIC interpreter?


[1] This allows you to transition from school buses to city buses. Unlike city buses, school buses tend to have policies against carrying electronic devices not essential to classwork.

[2] Either that or spider an entire web site at home before boarding and limit your viewing to the sites you've spidered.
User avatar
Banshaku
Posts: 2404
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Post by Banshaku »

tepples wrote:QBasic is no longer distributed, nor can it run on 64-bit versions of Windows without an emulator. Would you recommend or recommend against a newer dialect such as Microsoft's Visual Basic? Is the NESdev community lacking an NES-based BASIC interpreter?
Instead of Visual Basic with is technically not supported anymore, it would be better to go for either C# or VB.NET. But if you never did any VB before, I would recommend C# instead. You can get the IDE for free with the express edition and they can do as much as the professional one (except a few things like remote debugging etc but you don't have to worry about that when you're just learning).
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

tepples wrote:One can read a book on the bus. But unless I'm missing something, one would need to finish high school,[1] buy a laptop, and subscribe to $700/year mobile broadband[2] to read a web page on a bus.
Ever heard of printers? I expect your next argument to be how much it costs to print something, but you can often reduce that a lot by printing multiple pages in a single sheet of paper.
User avatar
Zepper
Formerly Fx3
Posts: 3264
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Post by Zepper »

The 6502 in the bus. :)
User avatar
blargg
Posts: 3717
Joined: Mon Sep 27, 2004 8:33 am
Location: Central Texas, USA
Contact:

Post by blargg »

Celius wrote:I find C a lot more confusing than 6502 (it helps that I know 6502, and don't quite know C). 6502 is just so straightforward, and it gives you 100% access to all of the registers.
Yes, 6502 asm is one of the simplest computer languages. But the tradeoff is that your programs become more complex, because the language is doing less for you. So instead of score=score+1000, you have to execute several 6502 instructions.
User avatar
MottZilla
Posts: 2835
Joined: Wed Dec 06, 2006 8:18 pm

Post by MottZilla »

Hamtaro126 wrote:The thing is that Most 6502 tutorials, Even when applied to stuff NES-Specific, Are not really that great. I tried every tutorial known here.

And About 6502 books: They are hard to buy nowadays for me. If there is one gripe about them, The price is ranging from $100-$200. And does not actually cover ''Programming the NES PPU and APU''

I will try the tutorials one last time. If I could not see anything after that, I should not have done anything about NESDev.
To be clear, I'm not advising you to quit forever. I am saying that your current approach seems to be flawwed. Do you have any programming experience? If you have never put together a program by yourself before, you might want to try to learn C or BASIC before trying to learn 6502 ASM programming on the NES. You certainly shouldn't be trying to do advanced assembly hacks when you can't program something from scratch.

Honestly that seems to be your problem. You want to make very big changes to games that you don't understand are not changes for a newbie to attempt. You will get nowhere that way. Start small, build up. You can do it but you are going about it all wrong right now.
User avatar
Memblers
Site Admin
Posts: 3901
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Post by Memblers »

I've never understood the whole "learn another language before you learn 6502 asm", or "learn 6502 asm on another platform before NES" approaches. With C, and even QBASIC, it seems like 70% of what you have to learn is about the syntax and what the language expects, and not even exactly related to programming. Maybe I'm biased because I only knew a few commands to get by in QBASIC before really learning how to program in asm.

Definitely though taking on advanced ROM hacks isn't the easiest way to learn 6502 assembly. I could compare it to learning how to make a sculpture, making a simple demo would be like making a little figurine. While hacking a game like SMB would be like taking a part out of your car's engine and trying to make a replacement with new raw materials.
User avatar
MottZilla
Posts: 2835
Joined: Wed Dec 06, 2006 8:18 pm

Post by MottZilla »

Well, my thinking is that ASM going to be more difficult than C or BASIC, so why not first learn about programming concepts like conditionals, loops, tiled graphics, etc. Avoid some of the complications of doing it in ASM. Personally I recommend BlitzBasic for Windows for beginners as there is no advanced setup required and it's got great documentation.

When you don't know anything about programming I think adding onto it, doing it all in low level assembly is not the best idea. Before I ever made anything in ASM I already had written full games in BASIC. So I already knew how to make a program like a game so all I had to learn was how ASM worked, not how a game works.
Celius
Posts: 2159
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Post by Celius »

Well whatever you learn first is going to bring a certain level of "unlearning" with learning the next. If one learns C, then 6502, they'll have to "unlearn" the syntax of loops and finite programming. For me, it's having to unlearn infinite programming and other things. Oh, and not to mention trying to set up your C compiler and linking and all that stupid crap where I seriously have no clue what I'm doing (e.g. trying to set up the compiler for GBA Dev. Yeah, no clue).

I found it nice to start with 6502 because there's so little to learn with it. There aren't that many keywords you work with, unlike with C where even though there are specific keywords you work with, one will generally want to learn about all the standard library functions thus making it take a long time. Really learning C is a much broader task than learning 6502.
User avatar
GradualGames
Posts: 1106
Joined: Sun Nov 09, 2008 9:18 pm
Location: Pennsylvania, USA
Contact:

Post by GradualGames »

I learned intel assembly language when I was a teenager, using Jeff Duntemann's "Assembly Language: Step by Step." If you have an old DOS machine, or DOSBox, and can get your hands on MASM, or TASM, or other assembler, that book is a great way to learn to program. I actually didn't start with assembly language, I learned QBasic and C/C++ first, but when I went to teach myself x86 assembly language that book was absolutely amazing. I think an awful lot of the concepts in there carry over quite neatly to 6502 assembly language. I know that my previous programming and assembly language knowledge have, thus far, really eased my transition into NES development. I'm still a big noob when it comes to NES though. I think if I had had NO programming experience, it probably would have been a lot more difficult to learn, though clearly possible as some members of this board indicate.
strat
Posts: 396
Joined: Mon Apr 07, 2008 6:08 pm
Location: Missouri

Post by strat »

One thing I never want to do is write VGA programs. But if you insist, the sample programs in Mike Abrash's Graphics Programming Black Book still work in Win XP. I didn't have much trouble converting a few of them to NASM, either.
http://www.gamedev.net/reference/articl ... le1698.asp
Wkter
Posts: 60
Joined: Sat Feb 07, 2009 1:35 pm

Post by Wkter »

I can tell, if you are a completely newbie with programming in general, you probably don't want to start with NES Assembly.

If you learn the simpler programming languages first, you'll learn the logic behind programming in general, and then make the more advanced programming easier to learn :)

Not that NES Assembly is that advanced, but it's quite confusing :P
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

Wkter wrote:Not that NES Assembly is that advanced, but it's quite confusing :P
True, since most people have no idea how computers actually work. Higher level languages are easier for them to understand. However, with some computer architecture knowledge it might be possible to dive directly into assembly.
User avatar
Zepper
Formerly Fx3
Posts: 3264
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Post by Zepper »

split.me ?
Post Reply