How do you actually port a game?


stupot

Still Fresh
Joined
Oct 5, 2008
Messages
54
Ok im interested in porting Moto-x an opensource linux game to pandora.

The small problems im thinking exist are:-

a, I dont know how to port a game
b, or program
c, have never used a linux machine
d, the above

In my favour are:-
a, It should be an easy port as the game is pretty basic graphics wise
b, The moto-x community is active and has all of the resources you could want available.
c, I am a quick learner ;)

So where would I start to learn the things i would need to do this?
Any guides? websites? good forums to get help
 
bosbeetle said:
you don't

(sorry for sounding harsh but anyway I dont think porting is as easy is 'they' make it sound)

Dont worry that doesnt sound harsh just not that helpful either ;)

Im assured that 'they' werent born with the ability to program stuff and Port games etc
So hopefully someone will point me in the first direction.

thanks
 
with some things it's as easy as a recompile, but for XMoto, you'll probably want to know how to code
 
Well to program stuff is easier. Just read a book start with "hello world" and go on. (I did some msx-basic coding when I was 10 and managed to get to some little game type thingies and a calculator) But I would look for resources on different coding languages and see what you want to use and try and write things you want for your normal desktop computer. And then go with trail and error. Definitely read some books on the subject. After you've finished a couple of programs come back here and ask how to port your own stuff. After that try an port more advanced games.
 
I did used to do some bits back in the old OLD days of bbc micro and acorn electron but probably forgot most of it.

the moto x pages have the following info does this help narrow down what someone would need to know?

Installing on Linux (or other UNIX variant) from sources

If you're not using Debian (or another distribution with X-Moto) and can't use any of the unofficial packages, you should install X-Moto from the sources. Before starting, make sure you've got the following:

* Latest gcc and g++
* SDL development libraries and headers
* OpenGL development libraries and headers
* SDL_mixer with headers
* libjpeg with headers
* libpng with headers
* zlib with headers
* libbzip2 with headers
* liblua50 with headers
* liblualib50 with headers
* libode0 with headers
* libcurl3 with headers

With these things straightened out, you can download the latest X-Moto non-Windows source. The building and installation should be pretty standard stuff; you start by unpacking the tar-ball into some suitable directory, in which a xmoto-x.y.z directory will be created. cd into it. And then type in:

./configure

If it succeeds, continue to type:

make

If it also goes well, you have two options; either you install the game globally on the machine, or you install it for this user only.
To install globally, su into superuser mode and run:

make install

That should do the job, and everyone should be able to play now. To later uninstall it, run:

make uninstall
 
stupot said:
a, I dont know how to port a game
b, or program
c, have never used a linux machine
d, the above
Ok, then we'll take (a) and (d) as given for starters.

How much you need (b) depends on how complex the port is. If you're porting something that has no dependencies other than the libraries which are likely to be available on the Pandora very shortly (stuff like SDL) you don't need to know much about programming at all. If the app/game you want to port uses libraries or APIs that won't be readily available (think here about the differences between "regular" OpenGL and OpenGL ES) you need to know enough to convert from what its running on now to what it's going to run on when it reaches the Pandora.

You don't necessary need (c) as you can develop on a Windows machine. What you do need to know is how to build/compile the program in question in the environment you're going to be working in. This includes setting up that environment (so a forum search for SDK and see what pops up).

stupot said:
In my favour are:-
a, It should be an easy port as the game is pretty basic graphics wise
b, The moto-x community is active and has all of the resources you could want available.
c, I am a quick learner ;)
I wouldn't bank on (a) working out as you expected (see OpenGL comment above). Hopefully there are people in (b) that have done ports before, which is an obvious advantage. In your case (c) is going to be a requirement ;-)

stupot said:
So where would I start to learn the things i would need to do this?
Any guides? websites? good forums to get help
Understand first that porting a game isn't going to be easy if you have absolutely no programming experience. Maybe get your SDK set up and see if you can compile something simple (for example a general library that doesn't have any dependencies) from source. If you make it though that, you need to start looking at the requirements of the game you want to port, what's already available in terms of libraries, what's not, and how to bridge that gap. A good primer on programming in C and/or C++ would also be advantageous. Google will find you all of the above without too much hassle.
 
Thanks SteveM thats some nice replying :)

Guess it looks like thisisnt going to be a short term fix:) will deff start taking a look at it is something im interested in learning.

As a slight aside it seems likely ubuntu will be working on pandora how feasible is it thst the ubuntu package already created of moto-x would be an easier translation set up?

Running through ubuntu is I assume an easier set up?

I'll wait 2 mins now for someone to point out all of the obvious flaws :D

http://www.getdeb.net/app.php?name=x-moto
 
Why can`t you just post that game here : viewtopic.php?f=2&t=141

And just learn how to code by buyin a book or just erad the forum and join others so you learn to code for the pandora. And if you know how to code you can try and port the game if it isn`t ported yet.

Or just mail the creators and ask if they want to make a port for the pandora :p
 
disjfa said:
Why can`t you just post that game here : viewtopic.php?f=2&t=141

And just learn how to code by buyin a book or just erad the forum and join others so you learn to code for the pandora. And if you know how to code you can try and port the game if it isn`t ported yet.

Or just mail the creators and ask if they want to make a port for the pandora :p


I already posted it in port request but then thought to myself rather than asking someone else to do the work i should look into how realistic it would be to do this myself.

I will start reading up on programming id love to learn how to make some simple games.

I left a mail on their forums ;)
 
stupot said:
As a slight aside it seems likely ubuntu will be working on pandora how feasible is it thst the ubuntu package already created of moto-x would be an easier translation set up?

Running through ubuntu is I assume an easier set up?
You'd still be missing OpenGL, which Moto-X would appear to require. I'm no expert in that department (so someone please correct me if I'm spouting nonsense) but as I understand it there's no simple way to port to OpenGL ES; you'd need to rewrite the OpenGL bits. That said, you could luck out and discover that Moto-X lends itself to the conversion. You may wish to consider porting something simpler to start with, like a game which uses only SDL, for example.
 
SteveM said:
stupot said:
As a slight aside it seems likely ubuntu will be working on pandora how feasible is it thst the ubuntu package already created of moto-x would be an easier translation set up?

Running through ubuntu is I assume an easier set up?
You'd still be missing OpenGL, which Moto-X would appear to require. I'm no expert in that department (so someone please correct me if I'm spouting nonsense) but as I understand it there's no simple way to port to OpenGL ES; you'd need to rewrite the OpenGL bits. That said, you could luck out and discover that Moto-X lends itself to the conversion. You may wish to consider porting something simpler to start with, like a game which uses only SDL, for example.

According to Svartalf it's not necessarily that hard:
ES doesn't automagically prevent porting. ES is a subset of OpenGL. In many cases, you only need to make minimal changes to your code to make it compile properly against it. If you're using fixed functionality, you'll tweak a little bit at most and work against 1.1. If you're using any shader based stuff, you'll clean up any fixed functionality so th...=&showtopic=43547&view=findpost&p=643373]link

I don't think arm-Ubuntu have X-moto, but arm Debian has, maybe that could be some help? http://packages.debian.org/sid/xmoto

But still it's maybe better to start with something simpler and solely SDL based (although I don't really know how hard it would be to port X-moto.)

Actually I should try to port something myself soon, I've never done that.
 
Last edited by a moderator:
Dentrado said:
Actually I should try to port something myself soon, I've never done that.

Seems like Fate says this should be your first project! :D
 
With these things straightened out, you can download the latest X-Moto non-Windows source. The building and installation should be pretty standard stuff; you start by unpacking the tar-ball into some suitable directory, in which a xmoto-x.y.z directory will be created. cd into it. And then type in:

./configure

If it succeeds, continue to type:

make

If it also goes well, you have two options; either you install the game globally on the machine, or you install it for this user only.
To install globally, su into superuser mode and run:

make install

That should do the job, and everyone should be able to play now. To later uninstall it, run:

make uninstall

This all assumes you're building natively (which is a good idea to do on your build machine to see if the code will actually build). To cross-compile for the Pandora (unless you plan to install a toolchain on the Pandora - will be slower than building on a Linux box, mainly due to the lack of memory and access speed to the SD cards) you'll need to use the --target and --host switches to configure. E.g. something along the lines of:

./configure --target=arm-linux --host=i686-pc-linux-gnu

Packaging the game will have to be done some other way than "make install" if you cross-compile, but I was never a big packager so I'll leave that to someone else to explain.
 
Well I've got to say I didn't read all the way to the end, but to begin with they were just saying that SDL audio is rubbish.

What was the reason given for not being able to port to Linux?

I could understand it being very hard to do so if you already use a different and not available 3D library (or acceleration), but other than that surely it's just a matter of working through the code.
 
stupot said:
Dentrado said:
Actually I should try to port something myself soon, I've never done that.

Seems like Fate says this should be your first project! :D

Well I guess I could try, but I never done any porting or even crosscompiling, I'm not very good at programming, actually I have only programmed with java, processing and some python and no c or c++ (yet) and I have no experience with OpenGL.

But I found this, It seems there have been some work done to port X-moto to SDL_gfx. That version is probably easier to get to run, but will also probably not be as fast as the openGL version, because SDL_gfx uses don't use the 3D hardware (if I understand it correct).

I think I'll try to port something smaller and easier first, but maybe I try to port X-moto after that.
 
Dentrado said:
stupot said:
Dentrado said:
Actually I should try to port something myself soon, I've never done that.

Seems like Fate says this should be your first project! :D

Well I guess I could try, but I never done any porting or even crosscompiling, I'm not very good at programming, actually I have only programmed with java, processing and some python and no c or c++ (yet) and I have no experience with OpenGL.

But I found this, It seems there have been some work done to port X-moto to SDL_gfx. That version is probably easier to get to run, but will also probably not be as fast as the openGL version, because SDL_gfx uses don't use the 3D hardware (if I understand it correct).

I think I'll try to port something smaller and easier first, but maybe I try to port X-moto after that.

Everyone has to start somewhere! :D I am certainly learning that.
I think it will be months if mnot years till I am able to do anything :(
 
fettouhi said:
Might be a bit off-topic but here something about one of the devs from Braid (XBox 360) trying to port it to Linux maybe.

http://braid-game.com/news/?p=364

From the responses he gets it seems like making/porting a game to linux isn't possible at all (more or less).

Regards

André

It can sometimes be hard to port windows games to linux, but that depends much how much OS-specific code you have. And just because it's very hard to port one game doesn't mean that you can say it's impossible for all games, for some games it's not much work at all.

Anyway this isn't even relevant in this case as X-moto already has a linux version, the problem is to port it to run on OpenGL ES, and adapt it to pandoras screen resolution and controls.
 
Controls shouldnt be an issue as it would just map to keyboard I assume?

although ideally you would want to map left right keyboard controls to dpad and up(accel) down(brake) to the game buttons.

Screen wise the game runs windowed and scales to fit so might be straightforward.

I hope someone does port it as I have just finished my 60th level! and there are hundreds more Im addicted. :D
 
Back
Top