Porting Tutorial


Gruso said:
WizardStan said:
. . .a beginner looking at complex and complete code like that would be like throwing a baby in the ocean.
Yes, you wouldn't want to Tampa with it too much.

(Topical joke for Australians, apologies to those who don't get it, and to those who do).


Worst. Joke. Ever. :)
 
Last edited by a moderator:
As a quote on the Linux Kernel Mailing List said a few days ago:

"A weak coder becomes a strong coder by reading code and writing code - every day, for fun."

I would have to say that "porting" is possibly the worst place to start programming, unless the program is incredibly simple and you have full source code, and fully compatible (ideally identical) compilers and libraries on both "ends" of the port (i.e. your existing platform and the "target" platform). The only thing worse would probably be device driver development or programming your own operating system. The things that can go wrong in even quite a simple port can be a nightmare, especially between disparate platforms. Plus, the worst thing that you can do is to be asked to analyse an unfamiliar coder's code style... it can add hours onto a porting project even for a skilled programmer.

Having said that, *programming* itself is quite simple. And you don't really learn much by reading about it - ten times more is learned by just doing it. You'll find that you can follow any tutorial on any programming language with no problems at all so long as you are in the mood, but if you then sit at a computer, you'll have no idea where to start or why things don't work. You need to follow along with the tutorial, compiling the source yourself, changing the examples instead of copying-by-rote and seeing what happens etc.

You can learn any language, but you just have to do it a lot for your own entertainment. You will inevitably start off with something ridiculous like Hello World but perseverance and good libraries of existing code can see you writing decent games (and other programs) in no time at all. SDL is great for this - a few lines of copy/pasted code and you get MP3's playing. A few more and you get joystick input. A few more and you're throwing PNG sprites around the screen.

Programming is like learning to type fast - you don't so much "learn" it as subconsciously acquire a memory of how it works the more you do it. However, I very much doubt that anybody could start programming without at least a basic tutorial. Ideally you want a good tutorial which targets to a language/compiler/library set that you can understand, can get and can install. There's nothing worse than using old tutorials which document all sorts of things which are no longer relevant (I have a still-in-print C++ book that talks about running DOS interrupts through inline assembly!), which aren't cross-compiler compatible or one which targets expensive compilers/platforms (Visual C++, I'm looking at you!). Don't throw yourself into a CygWin installation just to get gcc working on Windows - you're piling problems on top of problems.

I once started teaching my wife (who has zero computer knowledge but a keen mind) how to program. You can get through some things amazingly quickly if the person is willing to learn. She keeps bugging me about showing her more sometime but I'm afraid if I do that, she'll realise exactly why I don't hear anything she says while I'm in "coding mode" and we'd end up spending the evenings both tapping away on computers until the small hours...

If you want to be a programmer, you'll need a language tutorial to follow through so you understand what a programming language is and does and the basic syntax and most probably a list of functions... SDL games and the SDL library documentation in your chosen programming language is usually a good place to start. Then pick a small Open Source game at random, written in the same language/libraries that you like, read through the major portions of the code (you won't understand 50% of it at all, most probably) and then start using the code to write your own similar game.

P.S. I started out with BASIC back on the Spectrum, hence I regard BASIC as the epitome of beginners languages (while detesting it for anything serious) and like to start people off using BASIC to at least learn what "programming" means. For a while, Visual BASIC was simple enough for the real beginner to just pick up and use - that's no longer the case and the nearest "nice" modern, free BASIC I can find is Gambas which is Linux-only - and now BASIC is regarded (rather unfairly) as the hell-hole of programming languages. Ignore such nonsense and just pick a language that you can "read" easily. If that's C or Python or Java or BASIC or FORTRAN, it doesn't matter. You can worry about the language's limitations when you start hitting them.
 
Python is the new BASIC :)

As "easy" as it is, Python (or more accurately, it's addon modules like PyGame) is still a pretty powerful language. Like BASIC, it's designed with beginers in mind, but it is easier to make more advanced games in Python than in BASIC. Like most people over the age of 25, I first learned to program in BASIC. But there is a better starter language available to you kids these days, and I'd say you should take full advantage of it :D
 
Yeah, I started with BASIC but don't use it at all these days. Python on the other had is hugely flexible and even if you don't end up writing games, using PyGame or moving onto other programming languages it will stand you in good stead and prove a useful skill.
 
BASIC isn't really useful anymore, whereas python is a starting point but it still has practical uses.
 
1+ on learning python
i'm a teen myself and learning python last year proved to be invaluable in providing a good programming foundation
then i moved on to c++ and now i'm working on objective c (for mac development basically the same as c but with some Smalltalk in it)
so how would porting be for me? and what would be a simple first porting job?
 
I thought this was a great starting point for Python, even having done some coding before. It's less of a book about Python and more of a book that teaches you the fundamentals of programming using Python. That is considerably more important if you're planning on learning other languages down the road. There is a newer revision of this book due out next year, but you can check it out here in the meantime. There may be some differences between this and the final version, and to be honest I haven't read this one, but if it's anything like the first one, it's a keeper.
 
Aren't the various versions of quickBASIC available somewhere? It's how I started, and it's okay as long as you're not too ambitious with it.
 
QuickBASIC is DOS based. If you're going to get into a basic language for game development, I'd recommend one of the great languages out there like Darkbasic, Playbasic, Purebasic, and GLbasic. Visual Basic is fine for quickly making windows apps but it's not really a language that's meant for game development.

If you're interested in moving onto a lower level language like C++ or perhaps even assembly one day then start with python. Moving from basic to c/c++ is one of the most confusing things I've ever done.
 
bustaballs said:
QuickBASIC is DOS based. If you're going to get into a basic language for game development, I'd recommend one of the great languages out there like Darkbasic, Playbasic, Purebasic, and GLbasic. Visual Basic is fine for quickly making windows apps but it's not really a language that's meant for game development.

If you're interested in moving onto a lower level language like C++ or perhaps even assembly one day then start with python. Moving from basic to c/c++ is one of the most confusing things I've ever done.
DarkBasic and PlayBasic only works on Windows due to many DirectX dependencies. PureBASIC works on Intel Linux so it won't be portable to the Pandora's ARM compatible processor unless the authors decide to port it themselves.

GLBasic seems to be available for the GP2X so running it under an emulator on the Pandora might be possible. Also there has been some talk on another thread about using sdlBasic on the Pandora. I'll be trying to make an LLVM-based Basic compiler sometime as well.

Moving from Python to C++ is easier than moving from Basic to C++ so if you plan on moving over to C++ later on, that might be the approach to take.
 
Last edited by a moderator:
I actually spoke to the developer of GLBasic a few months ago about working on a Pandora option. He/she stated it as being a possibility. I'm sure the Wiz will come first, though.
 
PoisonedV said:
bustaballs said:
Darkbasic,
:lol:


Darkbasic is actually a really nice language for what it does. You can do some really really cool stuff with it and if you're just looking to make a nice game quickly. It has a huge community and even full reference books out there that you can purchase.
 
Last edited by a moderator:
PoisonedV said:
especially when coming across advanced issues like graphics processing, stacks, and buffer which are all issues in porting to handhelds.

hey, vilmos, any plans to bring Pocket Dimension 1 and 2 to GP2X or pandora? I played it on a Palm emulator, it was great.
Sorry I missed this post, haven't been on for a while since the forums melted down.

I didn't have any plans to port either game but if there is interest then that would definitely change my mind. I do plan on playing around with Pandora but I'm a second batch buyer as I couldn't find out any information on shipping to Canada without UPS so I didn't buy. Thruster would look good with some opengl loving and lots of effects.

Pocket Dimension 1 is open source so anyone could port it, it is also very simple line drawings and bitmaps. The simple games are often the good ones though. Should be really easy to port.

Pocket Dimension 2 is closed source because I sold it for a while, but it is free now so I should really open the source for it but it will take some tidying first. That code is pretty embarrasing now. If anyone wants to start porting PD2 now PM me and I'll see what I can do.
 
Last edited by a moderator:
Back
Top