Making N64 Games?

Moderator:Moderators

User avatar
Fenrir
Posts:14
Joined:Wed Aug 27, 2008 9:20 am

Post by Fenrir » Sun Jan 04, 2009 3:57 am

Very well.

Sounds like you're gonna need to learn C, could possibly benefit from learning C++, and may very well end up needing a very good understanding of MIPS Assembly. It would be a very good idea to get a C/C++ compiler for your current platform (Windows? Linux?) and a nice cushy tutorial, and get some practice while you wait for a C or C++ compiler targetting the N64 hardware to turn up.

Displaying text is trivial - you'll be learning how to use printf() and the like if you're stuck with C, and the cushier cout if you get a C++ compiler. Displaying graphics, however, is a whole other ball-game, which requires either graphics libraries or some means of writing to the framebuffer directly (the latter ofwhich probably will be "TOO hard"). Maybe the compiler you get will come with SDL, which would make things a lot easier - and portable, too, you could get some practice in with it for your current platform.

As for N64 compilers, PsyQ would be the nicest, as you'd know by now. With it you get a fully-functioning graphics library (I assume), making actual game dev plausible (read: still very hard). I've had a hunt around for PsyQ and haven't found it merely lying around - not through any leads Google yielded, not on /rs/, not over at the Pirate Bay...
You're probably relying on how generous marshallh is feeling if you want that one.
There are other compilers out there, though. I stumbled upon a few ports of the GCC in my search, and if none of them work out, well, you're faced by the incedibly daunting task of either porting GCC yourself, or eschewing C and C++ entirely and learning MIPS assembly.

Anyway, what platform are you using now? Windows? I'd prefer to get you started on Digital Mars C/C++, so you can atleast become familiar with the language before you start trying to get stuff running on the N64. Digital Mars C/C++ targets Windows, btw.
The link above leads to a license agreement page, essentially the usual "no warranty provided" stuff - agreeing brings you to a download page.

Now, grab the Compiler and STLport. They're both zip files, and should be extracted in exactly the same directory as eachother, Compiler first. In other words, if you were to extract the Compiler to "C:\", also extract STLport to "C:\". Their directories will merge.

Now, go to "\dm\bin\" (using the example address above, that'd be "C:\dm\bin\"), open "sc.ini", and modify the line starting with "INCLUDE" to be:

Code: Select all

INCLUDE="%@P%\..\stlport\stlport";"%@P%\..\include";"%@P%\..\mfc\include";%INCLUDE%
And now you have a working C and C++ compiler.

You use dm\bin\dmc.exe to compile your code - call it from a command prompt with the address of the source file (*.c or *.cpp) you wish to compile. *.c files for C code, *.cpp files for C++ code. The output will be an executable binary, <filename>.exe, which'll be left in the directory you're currently working in (known as the current directory) in the command prompt.

As for writing C or C++ code? Get a tutorial. I linked one a few posts ago, but you can find one yourself if you want. Follow it as far as you feel you need to in order to gain a functional grasp of the language.

Let me know if you need anything else.


EDIT: Forum BBCode parser doesn't like brackets in links.
EDIT2: Broken BBCode

Code: Select all

 tags above fixed.
Last edited by Fenrir on Sun Mar 01, 2009 9:09 am, edited 2 times in total.

User avatar
Mario
Posts:1383
Joined:Mon Mar 05, 2007 7:20 pm
Location:Sunny California

Post by Mario » Sun Jan 04, 2009 11:12 am

Wow, thank you very much. That was extremely helpful. I can use either C or C++? I was planning on learning C++ anyway, is it easier?

Very in-depth reply. Thank you so much. :) I'll try to get something running before asking how to port it to N64 :P

EDIT: Lulz at the Digital Mars License Agreement. "The Software was not designed to operate after December 31, 1999." :lol:

EDIT2: If I already have Dev C++ installed with SDL, will that work?

User avatar
Fenrir
Posts:14
Joined:Wed Aug 27, 2008 9:20 am

Post by Fenrir » Sun Jan 04, 2009 1:37 pm

Mario wrote:Wow, thank you very much. That was extremely helpful. I can use either C or C++? I was planning on learning C++ anyway, is it easier?
Last I checked, anything with the *.c file extension will be compiled as C, anything with the *.cpp extension as C++.

However, it's really pretty insignificant. Pretty sure last I checked, I managed to come up with 17 or so tiny, niggling incompatibilities between C89 and C++98 (ie things considered valid C that aren't valid C++). The list grew with C99, because of some arsehats at the ISO C working group, but even then you've really gotta go out searching for ways to write valid C code that a C++ compiler will complain about.
So I'd just think of C as "C++ without OO".

And to answer your question, C++ probably is easier in a way, because you get the Standard Library which handles strings and arrays and the like more generously than C ever could. That said, C++ adds the functionality of Object-Oriented Programming (OO, OOP, etc), as well as several other advanced features. I would say these things are more difficult to grasp than C, and since they are provided alongside C's feature set, they've lead to the common assertion that C++ is an extremely feature-bloated and convoluted language. There's a bit of a divide in the industry as to whether the feature-bloat of C++ is worthwhile, but people generally agree that it is among the harder common languages to master.
Mario wrote:EDIT: Lulz at the Digital Mars License Agreement. "The Software was not designed to operate after December 31, 1999." :lol:
People read those things?!? :P
Mario wrote:EDIT2: If I already have Dev C++ installed with SDL, will that work?
I don't see why not.
Dev C++ is what's known as an Integrated Development Environment (IDE), or in other words a GUI app that does nice things like code highlighting and helps you organise projects and the like. They bundle it with the MinGW compiler, which is a Windows port of the GCC mentioned earlier, however they also offer the IDE without the compiler as a separate download - hopefully you downloaded the IDE+MinGW package, in which case you have everything you need and can write and run your C and C++ programs from the IDE.

User avatar
Mario
Posts:1383
Joined:Mon Mar 05, 2007 7:20 pm
Location:Sunny California

Post by Mario » Sun Jan 04, 2009 7:48 pm

So, I just have to write a game in C or C++, then I have to compile it for N64. How does that work?

If I took a game called Super Mario War (written in C++, open source), could I port it to N64? I know the problem with the texture size limit, but could I?

grumpymonkey
Posts:6
Joined:Sun Jan 25, 2009 8:48 pm
Location:Behind You
Contact:

Post by grumpymonkey » Mon Jan 26, 2009 2:55 pm

I dont know much about consol programming, but im pretty sure you can use something like C++, or C. the language is the last thing i would worry about. your gunna need to know how to get them onto a cartridge, plus youll have to find an N64 API.
HEY! the conversation is up there ^


User avatar
MegatronUK
Posts:177
Joined:Sat Apr 04, 2009 12:08 pm

Re:

Post by MegatronUK » Tue Apr 14, 2009 8:37 am

Mario wrote:So, I just have to write a game in C or C++, then I have to compile it for N64. How does that work?

If I took a game called Super Mario War (written in C++, open source), could I port it to N64? I know the problem with the texture size limit, but could I?
You would also have to port any and all libraries that Super Mario War uses. Then also realise that the N64 has got virtually no RAM to speak of and that game probably uses hundreds of times more memory while running than is available in an N64....

wiseguy12851
Posts:1
Joined:Thu Jul 30, 2009 2:33 am

Re: Making N64 Games?

Post by wiseguy12851 » Thu Jul 30, 2009 7:49 am

I program in C++ and BASIC and non revalent languages such as HTML and Javascript, You are extremely ambitious like I was when I started but N64 even for me is out of my league, When you are able to program a direct x game in straight C++ coding using no easy point and click programs like FPSC then you can attempt with much ease at programming an N64 game.

First of all N64 is a console, it's very obviously not a computer. While this may seem obvious let me quickly break it down. Instead of using normal quick methods like declaring a variable wich takes about 2 seconds on a computer will work entirely different on a gaming system.

Gaming systems cannot easily be upgraded, they have set features, a certain number of buttons, RAM, and their own operating system and hardware engineered for that system.

This may answer most of your background questions and probably many others on exactly why it's so entirely difficult to make games for and why it's so hard to find programming tutorials, tools, compilers, etc...

The N64 or in translation Nintendo ( x64 ) was the first and probably the only current ( 2009 ) gaming system created with a 64 bit processor. It uses 2 x 32-bit processors or a 64 bit processor making it one of Nintendo's most prized gaming systems even as of today

It way more powerful than a PS3 and over a hundred times faster. The cartridges it used were chip to chip fast much like hardware to a motherboard 99% of time eliminating any loading time at all. The graphics and sound would blow any gaming system out of this world.

Anything Nintendo 64 developing related will be several years before release, The Nintendo Wii can play N64 games meaning you'll have to wait for the Wii to be older than N64 as of now. Nintendo is keeping the lid on everything related to N64 developing and will remove licenses from it's 3rd party vendors if they release any information not permitted (if there are any vendors)



With all that being said, even though N64 was sorry graphics compared to systems like the PS3 and sorry music etc... at that time it was the best they had, and if they were sill making it today it would blow PS3 out of this world.

It would be extremely difficult to jump to N64 from BASIC. and these langauges are meant for computers, again the N64 is a console, you'll have to learn to develop games that work with the N64 processor, and games that work with the allocated resources and storage methods will will be 0% like Windows, much like trying to run built-for-mac programs on a Linux system

you'll also have to learn 64-bit programming which was introduced for computers several years or possible a decade after the release of N64 which is another reason why it's Nintendo's most prized system

Anything your used to programming or have previously learned does not apply to the N64, it's by far the most complex system built as of today and goes for any console.

Project 64 and other emulators are designed to play the ROM not to restrict the ROM, in other words their designed to play the ROM that comes from a cartridge and most likely will not restrict ROM's in testing that you may build since it's not exactly like an N64 and in reality doesn't have much restrictions but the proper coding so ALWAYS check with an actual genuine N64 system for both speed and working condition

And like any other console there is an slight chance you could mess things up, if your writing a game you know little about such as buffer overflows in computers similar things can go wrong with gaming systems causing the game to crash and posiibly your system

Hope this helps and if your wondering why they discontinued the system if it was so great is was because no one could afford the games as they were twice the price of games now much less a system. Cartridges and 64-bit games were too high-tech and too pricy so Nintendo took a step back to 32-bit and Disc based systems

User avatar
marshallh
Moderator
Posts:2986
Joined:Sat Sep 10, 2005 2:17 pm
360 GamerTag:marshallh
Location:here and there
Contact:

Re: Making N64 Games?

Post by marshallh » Fri Jul 31, 2009 10:31 pm

I would say about half of that is correct and half of it is nonsense.

Facts:
1. The N64 was designed completely by SGI. The only thing nintendo provided was the physical lockout chip/interface (called the PIF, which is a Sharp microcontroller). SGI drew up the board design on their own, then handed it over to Nintendo for cost-cutting in later revisions.
2. The MIPS R4300i is a very, very close cousin to the R4200. It basically has a smaller amount of I/O by using a 32-bit external bus instead of a 64-bit bus (while being 64-bit internally.) It's pretty much comparable to the second generation of Pentium I's running about 90mhz. Its FPU does have an advantage.
3. The RCP was what the big deal was all about. It's not a graphics chip, and it's not an audio chip. It's an RDRAM controller, DAC interface, cart interface, and signal processor rolled into one. The RSP runs code called microcode that transforms 3d vertices, while the RDP rasterizes (draws) the triangles.

The RSP can also run code to do other things (like resample/mix audio, decode video streams, etc) and in that sense it's very powerful. It was really under-utilized most of the time.

For example: World Driver Championship uses custom-written 3d microcode which pushes easily 2-3x the amount of polygons in typical games, decodes MP3 music, plays all the car sounds, while keeping a solid framerate.

The microcode stuff is a real hairy mess. It's a lot like the Emotion Engine in the PS2 - a crazy design that was powerful, but only if very carefully used.
Image

User avatar
kibble
Posts:439
Joined:Wed Jul 29, 2009 10:41 am

Re: Making N64 Games?

Post by kibble » Fri Dec 11, 2009 11:07 am

Good luck with this, Mario! I've always wanted to to get into this myself, just haven't.

Too bad it's like impossible to find one of those n64 dev boards and software that were inside the SGI Indy machines. I have an R5000 Indy sitting in my garage.
Coming Soon: Kibble's L'Ectroshop (parts and stuff FS)

User avatar
bentendo64
Posts:163
Joined:Tue Nov 10, 2009 7:22 pm
Location:Tinysota

Re: Re:

Post by bentendo64 » Mon Apr 25, 2011 12:06 pm

MegatronUK wrote:
Mario wrote:So, I just have to write a game in C or C++, then I have to compile it for N64. How does that work?

If I took a game called Super Mario War (written in C++, open source), could I port it to N64? I know the problem with the texture size limit, but could I?
You would also have to port any and all libraries that Super Mario War uses. Then also realise that the N64 has got virtually no RAM to speak of and that game probably uses hundreds of times more memory while running than is available in an N64....
Wouldn't you technically be able to have up to 16MB of ram in a Nintendo 64, without insane modifications being done? Because, you could switch out the internal ram with 2 4MB chips, then get a 3rd party expansion pack, and also put 2 4MB chips in that.
http://bentendo64.co.cc/" onclick="window.open(this.href);return false;
"Mmm, extra performance for free. The essence of overclocking."

dsv101
Posts:106
Joined:Tue Feb 01, 2011 5:58 pm
360 GamerTag:Dsv101

Re: Making N64 Games?

Post by dsv101 » Tue May 03, 2011 5:36 pm

first of all, super bump, second of all i don't think its that easy, or even close to that easy. You can not use libraries i believe, at least not like ones such as SDL, OpenGL, or allegro or anything like that. Talk to marshall about it, he seems to know what the heck he's doing.

spinout
Portablizer
Posts:107
Joined:Wed Jul 12, 2006 9:01 pm
Location:California
Contact:

Re: Making N64 Games?

Post by spinout » Mon Aug 08, 2011 3:11 am

Image

As far as libraries go: There are libraries that are not at all hardware dependent (ex: LZO compression), some which are partially hardware/kernel/OS dependent (newlib), and some which are completely hardware dependent (libdragon, fat64).

If you're interested in N64 homebrew, check out dragon's stuff:
http://www.dragonminded.com/n64dev/" onclick="window.open(this.href);return false;
He has a completely open-source development setup for the N64. If you have marshallh's 64drive, you can use the fat64 library to access the SD/CF in the 64drive.

If you're interested in proprietary N64 development stuff shoot me a PM.

Finally, sorry for such a late reply, but this section of this forum is very. slow.

Post Reply