gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > Hi everyone I am new and I have a few questions~ >.<

#136394 - SprazeR - Wed Aug 01, 2007 10:36 am

First of all, thanks for all informations on this site. I've been through the n00b faq already, but with my poor english skill, I still have things I don't understand T_T


I'm a basic C programmer and I'm really interested in game programming. Now my aim is to make an easy program or game on my Nintendo DS with R4 cart Do I need to go through the 2nd step in the noob faq?

which is this one
Get the 'curses' library (which may be called 'ncurses' on GNU/Linux or 'pdcurses' on DJGPP or MinGW) and make more sophisticated text-based programs for the PC.

If I need to, please let me bother you to explain me what is the curses library, I really have no idea in this

I've made a text-based game on C.
If any of you don't mind, please take a look, maybe it can tell you where I am and where should I move next!

http://files-upload.com/409594/sprazertbgame.rar.html

Thanks for any answer, I'm looking forward to learning from any reply!


edited: Ps: is it possible to convert/complie my above mini-game(can I call it? lol) to .nds I just wish I can develop it further!


Last edited by SprazeR on Thu Aug 02, 2007 1:27 am; edited 1 time in total

#136407 - tepples - Wed Aug 01, 2007 12:58 pm

I haven't played much of your game, given that I don't know what equipment to buy the first time and I have to get to work right now. Can you give me some basic play tips so that I can evaluate how well this game and your skills would translate to the GBA or DS?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#136412 - SprazeR - Wed Aug 01, 2007 1:55 pm

The guide to my game is

Hint for how to fight
1.Always use skills as long as you have enough mana(30)
2.Your mana recovery 5 unit / turn
3.Block option increases a lot of defensive rate!
4.Don't worry if you die, the game automatically saves your data.
(This game is short, it's like less than 10 minutes)


first time you have to buy the A grade weapon
and armors(1,4,7,11), becoz you don't have enough money to buy the B grades yet. (Don't forget to buy weapon as well otherwise you will not be able to take any damage)

Then go hunt the 1 boss Positron Dragon, you will get some money to buy the B grade now, but you won't have enough money to buy the B grade weapon yet, so you have to hunt monster for some money(you can see this option on the menu screen)

The second boss Atomus, after defeat him you will face the same problem, so hunt monsters for more money to get full A grade weapon and armors.

Last Boss Bahamuth(lol sorry if I made you laugh)
This Boss was kind of difficult to kill! You might think that I made a bug on this but believe me! I didn't!. If u can't manage to kill him ,take this guide then

(Skillsx5 -> attackx2 -> Skillx1 -> attackx3 -> Blockx2 -> skillx1 -> attackx1)
The following numbers are
(2,2,2,2,2,1,1,2,1,1,1,3,3,2,1)


I was thinking to develop this game in many things but since my C programming class was going to end and I had to submit my Project so this game ended up with something simply

This is the list the I was thinking to put in the game which I already came up with Ideas how to do it

1. Leveling with hp mp increased
2. Classes in the game and skills
3. Boss can use skills

Anyway , I want to take my chance to develop this game to my NDS and I want to implement some graphic and sound hope this can be done by learning from the internet >.<

Ps: I'm sorryif my code makes you feel lazy to look through, I know I spam a lot of codes in the program T_T

#136420 - gauauu - Wed Aug 01, 2007 3:43 pm

SprazeR wrote:

I'm a basic C programmer and I'm really interested in game programming. Now my aim is to make an easy program or game on my Nintendo DS with R4 cart Do I need to go through the 2nd step in the noob faq?

which is this one
Get the 'curses' library (which may be called 'ncurses' on GNU/Linux or 'pdcurses' on DJGPP or MinGW) and make more sophisticated text-based programs for the PC.


That step is really there to give people a path to start learning how to write C code. It's a practice step....telling people to get their feet wet on an easier platform than gba/ds.

If you already are a C programmer, that's not necessary. If you really do know how to code, you can skip down to the parts about downloading devkitPro and setting up your development environment.

But if you start ask questions about simple C/C++ stuff, and everything seems over your head, then you probably DON'T have enough programming experience, and going back to complete those steps would be a good idea.

#136449 - tepples - Wed Aug 01, 2007 10:16 pm

The part about "ncurses" or "pdcurses" was intended to help people learn how to make text user interfaces. Tiled graphics modes on GBA and DS are programmed in much the same way as a TUI.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#136463 - SprazeR - Thu Aug 02, 2007 1:36 am

Thanks for the replies

So I think I'd better work on the ncurses for a while.

Anyway, about the converting idea, can I convert my code into NDS? How do you guys compile a program to dot .nds?

can DevkitPro compile C code to .nds one?
If it could, is it an engine or what?


Again, thanks for your affords to my noob question~

#136485 - gauauu - Thu Aug 02, 2007 6:22 am

You can't really convert your program to nds without a lot of effort and recompiling.

To compile things to .nds (or .gba) you have to

1. Write code using libraries that are available for that platform. Generally, that means avoiding printf and scanf, and using other specialized code for drawing on the screen and reading control input. There are quite a few docs and things out there about how to do that.

2. Use DevKitPro's tools to compile your code. Instead of using a normal gcc or visual studio or whatever, you use the version of gcc that comes with DevKitPro, and it will compile things down to a file that is (more or less) the right format for running on a DS or GBA. Again, there are some tricks to it, but there's plenty of documentation on here about how exactly it's done.

#136501 - SprazeR - Thu Aug 02, 2007 12:01 pm

Thank you very much gauauu!

I think I'm beginning to understand things now! seems like I have to use specific command for the specific platform! I'll try to work on DevkitPro now

thanks!

anyway I came up with another question

Is Devkitpro a compiler? or is it an Engine?

is its purpose only to make a program which runs one DS?

Or it was designed to the compile a program that can run on cpu ARM platform...


thanks for any answer!

#136504 - wintermute - Thu Aug 02, 2007 12:21 pm

devkitPro is the name I chose to release toolchains under - it's more like a brand identity than anything tangible.

devkitARM is the toolchain used to create applications for many ARM based systems including the DS. It includes the gnu compiler tools and many other handy little utilities for programmers.

There are currently two other toolsets called devkitPPC and devkitPSP, used mainly to write code for Gamecube and PSP respectively.

With devkitARM, libnds and libfat you have the ability to use printf and standard file IO on the DS but standard input is not yet implemented.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog

#136505 - SprazeR - Thu Aug 02, 2007 12:29 pm

thanks wintermute!

another question >.<

is C++/C/Ms Studio.net a toolchain too? >.<

#136508 - Dwedit - Thu Aug 02, 2007 12:38 pm

SprazeR wrote:
thanks wintermute!

another question >.<

is C++/C/Ms Studio.net a toolchain too? >.<


Yes, it is a toolchain for making PC programs. If you look around in the program's directory, you will see a bunch of EXE files, including a make tool, the compiler and the linker.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#136514 - SprazeR - Thu Aug 02, 2007 1:11 pm

Thanks Dwedit!!!

and another question becoz of my curious :P

There are a lot of tool chain in C program then

what method do they use to create this toolchain ?? If the answer is C itself, I think I'm lost now 0.0

is it Asembly?

#136515 - tepples - Thu Aug 02, 2007 1:16 pm

gauauu wrote:
To compile things to .nds (or .gba) you have to

1. Write code using libraries that are available for that platform.

Correct. But especially on the DS, some libraries that don't directly perform I/O can be ported, such as music decoders.

Quote:
Generally, that means avoiding printf and scanf

scanf I can understand because the DS doesn't have a keyboard. But I see nothing wrong with iprintf/siprintf (Newlib's version of printf/sprintf that doesn't handle floating-point formats). What you need to avoid is C++ iostream because it bloats your binary with a quarter megabyte of unused code, unless you have either 1. the time to investigate and fix the defect in GNU ld that causes it to drop sections and in turn libstdc++ to not split individual source code files such as ios.cpp into multiple sections, or 2. the money to license a proprietary implementation of the C++ standard library designed specifically for embedded systems.

(StoneCypher suggested on Slashdot that I RTFM as to the reason behind iostream's bloat. Now which other manual do I need?)

As for Visual Studio, you can probably reuse the editor with devkitARM. I don't know if you'll be able to replace the compiler and linker with the one from the Windows Mobile development kit, which also compiles for ARM; if you try, you're going to have to port at least the crt0 and linker script from GNU Binutils to the Microsoft tools.

GCC was originally developed on Solaris using older C compilers, then ported to GNU/Linux using itself, then ported to Windows using itself. Look up cross-compiler on Wikipedia sometime.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.