PDA

View Full Version : Guide to beginner DS programmers?



Falseblue
June 24th, 2007, 06:10
Ive ran a couple of searches on the forum, and google, but cant find much. So, is there a good guide to a beginner that has no codeing knowledge, to code for DS?

Krisbam
June 24th, 2007, 10:50
http://www.palib.info/wiki/doku.php

Helped me loads.

Enjoy~!

yaustar
June 24th, 2007, 14:17
Simple answer, don't. The DS is not a beginner's platform to learn programming on.

Learn how to program on the PC and once you have a decent grounding in the language syntax and common programming concepts, then start looking to develop on other platforms.

I would heavily recommend learning Python: http://www.python.org/

It's a good solid language that will teach you the basics of programming with plenty of tutorials and documentation: http://docs.python.org/tut/tut.html

After learning Python, you can either switch to another language such as C or C++ or continue on and start using some of the other Python 'add on' libraries such as PyGame: http://www.pygame.org/news.html

Krisbam
June 24th, 2007, 19:19
It's not as bad as you're trying to make it, Yaustar.

I was a complete novice myself, but I managed to make games in no time with the help of PAlib. Try reading up on the url I posted and see for yourself, it's really not hard whether you've had former coding experience or not.

Falseblue
June 24th, 2007, 19:37
Thanks. Im not looking to create a great game rigth as sooin as I do it, but create some simple stuff, then work up.

Ill check python too. I tried once, but gave up.
Ill be doing it first.

kcajblue
June 25th, 2007, 04:14
give ds lua a try.
http://www.bio-gaming.com/jeremy/dslua/index.php?act=tutorials

Falseblue
June 25th, 2007, 04:25
DSLua and PAlib look like the best things so far. I do not understand python through any of the tuts...

Falseblue
June 25th, 2007, 07:02
It's not as bad as you're trying to make it, Yaustar.

I was a complete novice myself, but I managed to make games in no time with the help of PAlib. Try reading up on the url I posted and see for yourself, it's really not hard whether you've had former coding experience or not.

Sorry for double post, but...

I do not understand it. At all. Im trying to read a tut, but cant retain the info. So, any help from you?

kcajblue
June 25th, 2007, 09:32
not trying to be mean or anything but you could still use the edit button.

and i should try to learn palib.
if its like ds lua, it should be kinda easy to learn.

EDIT: nvm. dont want to try to learn palib anymore. lol.
it looks harder than ds lua. and im having trouble with that so yeah...

yaustar
June 25th, 2007, 11:12
It's not as bad as you're trying to make it, Yaustar.

I was a complete novice myself, but I managed to make games in no time with the help of PAlib. Try reading up on the url I posted and see for yourself, it's really not hard whether you've had former coding experience or not.
The DS hardware not withstanding, C and C++ are programming minefields. They are not recommended for programming beginners. Trying to learn C or C++ on top of a hardware specific library on a unfamiliar hardware platform and trying to learn to program all at the same time is just a recipe for confusion. The fact that the OP doesn't understand Python worries me even more.

The PSP development scene shows what I am trying to explain above.

Krisbam
June 25th, 2007, 14:20
I see your point, and I'm sure you're right about most of it, but PAlib really doesn't need any former experience doing ANYTHING. All the hard stuff with allocating memory, etc. is done automatically and all you have to worry about is basic things.

All the commands are straight forward as well. To load a sprite, all you need to do is PA_CreateSprite, and to move it? You guessed it! PA_MoveSprite.
The only thing that's common with both PAlib and C++ etc. are variables, if()'s, etc. and you hardly need to learn C++ to understand how they work.


As for you, Falseblue, my only recommendation would be reading all those chapters in the tutorial I posted, and use the examples that come with PAlib.
This is another great thing with it, it comes loaded with examples on how to do anything, and if you're not yet certain how to code something you could always take a peek at how they did it in the example and perhaps "borrow" some code.

Start by installing PAlib (explained in "Day 1 - Installing and Compiling"). I learn best by trying out things, so I jumped straight to the Sprites chapter and tried out pretty much everything in it. If this is how you learn, I don't know, either way that tutorial along with the PAlib examples should be more than enough to learn PAlib (and if it isn't, PAlib has a great community with people always willing to help out a newcomer!).

yaustar
June 25th, 2007, 14:53
Variables, pointers, functions, structs, parameter passing, program structure, bit-shifting, type casting, if statements, loops, expressions.

This is just from looking at Day 4 of the tutorials. To be fair, this is covered in Day 2.

At the moment, you are asking the OP to dive in a very deep pool. The OP has no concept of the tools/applications involved nor the concept of programming which is why I suggested he/she to learn Python just to at least get comfortable with writing code, program flow and developing in general.

The problem is when following tutorials as specific as these that teach you how to use the library, you become very constrained by tutorials themselves since you are not learning to program, but learning to use the library.

This happens a lot (in the PSP community especially) where they come to the end of the tutorials and try to build something bigger then what the tutorials taught but continuously bump into problems such as "How do I do collision?", "How do I animate sprites?" or "How do I do AI?". They get so used to following tutorials to produce an effect that they don't stop and think on how to break down a problem and solve it with existing knowledge. What's worst is that they find a tutorial on let's say, collision but they can't apply it to their program because they don't bother to understand the logic and try to plant it directly in their code without considering what they need to change.

Programming is about solving problems and this is what must be learned first. The tutorials on PA_Lib (as good as they are for teaching the library) are not for teaching programming.

Edit: It even teaches bad practices:

#include <PA9.h>

// PAGfxConverter Include
#include "gfx/all_gfx.h"
#include "gfx/all_gfx.c"
Never EVER include source files. Source files are meant to be compiled and linked.

Falseblue
June 25th, 2007, 18:05
I learn through example, and the tut had none. Ill keep trying.

I understand being able to print "hello world". but then it gets complicated.

yaustar
June 25th, 2007, 18:29
Example (http://docs.python.org/tut/node6.html#SECTION006100000000000000000)
Example (http://docs.python.org/tut/node6.html#SECTION006700000000000000000)
Example (http://docs.python.org/tut/node5.html#SECTION005120000000000000000)
More tutorials (http://www.google.co.uk/search?q=python+tutorials&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a)
Free Ebook (http://www.mindview.net/Books/TIPython)

Falseblue
June 25th, 2007, 22:35
Hmm, thanks. As soon as I get my other computer, Ill be able to code.

What can you make in python?

I am much more interested in codeing for the DS, but that will have to wait. Speaking of which, how difficult in your opinion is it to code a program where you move a dot around the screen?

Krisbam
June 25th, 2007, 22:42
how difficult in your opinion is it to code a program where you move a dot around the screen?

I'm unsure how hard/easy this is in Python, but with PAlib, on a scale from 1 - 10, that would be a 1.

It's actually the first thing I made with PAlib.

Falseblue
June 25th, 2007, 23:26
Allright. Ill keep trying with PAlib.

Can you send me the best tut for palib? Or the one you used.

yaustar
June 26th, 2007, 00:41
Hmm, thanks. As soon as I get my other computer, Ill be able to code.

What can you make in python?
Anything. Web pages, applications, games. Civilisation 4 on the PC used it for most of their gameplay logic systems.


how difficult in your opinion is it to code a program where you move a dot around the screen?
Using something like PyGame Library (http://www.pygame.org/), very easy.


Allright. Ill keep trying with PAlib.

Can you send me the best tut for palib? Or the one you used.
He linked it in the first reply in this thread. Do you actually look at the links we post here? All the 'examples' I linked in my last post were all from the same page that I posted in my first reply.

Krisbam
June 26th, 2007, 00:44
Allright. Ill keep trying with PAlib.

Can you send me the best tut for palib? Or the one you used.

As I already said, I used the tutorial I linked to and the examples that come with PAlib (palib.info).

I agree with yaustar though, learning Python first would be a great idea, and it would certainly make everything easier. In fact, I think I might go learn Python now~

Falseblue
June 26th, 2007, 01:01
Yes, I checked all of the links. I was just wondering if you actually used something different, or there was maybe something better. I greatly appreciate your help. all I did was ask. Sorry.


As you guys recommend, I shall try to learn python. I understand some of the basic material, but I get confused with variables and such. Ill kep trying.

squeakypants
June 26th, 2007, 22:45
No offense, but if you can't understand Python, you won't be doing any programming for awhile. It's a great beginner platform, and is very simple. You might want to look into programming theory (how programs work) first. Try just wikipediaing Object-Oriented Programming and Procedural Programming.

If you want to program for the DS, you pretty much need to use C++. I'm working on that now ;)

Falseblue
June 27th, 2007, 01:05
Yeah, I am understanding most of beginner sutff in python so far.

Understand, print (lol), while, variables, range, inputing (but cant get anything to use it...), and some other stuff. I wasnt able to use a beginner guide anyways, it was meant for people who knew how to program already.

Python is pretty easy so far.

I can write some simple stuff, but dont know how to save anything I code.

yaustar
June 27th, 2007, 12:29
Open IDLE.
Go to File->New Window
A new window will pop up. Write your code in here.
To run it, go to Run->Run Module.
To save it, go to File->Save As.

Falseblue
June 28th, 2007, 02:29
Thanks. I used the command line ;)