Albion


M-HT

Very Active Member
Joined
Nov 30, 2007
Messages
688
Location
Bratislava
Website
github.com
Hi,

I finally managed to finish the first playable version of Albion for the GP2X.

Music/sound does not work (except for intro video).
Virtual keyboard is not implemented yet.

Original Albion version 1.38 is required for playing.

Read the readme-GP2X.txt file in the archive for instructions.

Albion alpha 1 on the gp2x archive

For those who don't know:
Albion is a computer role-playing game released by Blue Byte Software in 1995 for the PC.
Read more on this wikipedia page.

P.S.
I also uploaded a 1kb demo I created while practicing ARM assembly to the gp2x archive.
WaterPlasma2x
 
Awesome, can't wait to try this out tomorrow. Albion is one of my favorite roleplaying games, but I never got to finish it before, would be a good opportunity to play it on gp2x. How good is the speed on the gp2x?
 
I bought this game *years* ago, and never erally got into it despite it's obvious awesomeness - somehow on the then top-of-the-range Pentium 2, it looked out of date, and my 386 wouldn't run it :(.

Very very cool to try it again on a 2x, although won't be able to get the data files til X-mas when I can get at the disks :).
 
I loved this game alot. Strangly did not finish it after so many many hours. It must have been a long or hard game. But the story was very interesting. recommended. Anyone finish this game?

I'll wait for the port to be more complete before finding my old CDs.
 
You... you... you... you... did.. Albion? You.. you're kidding, right? This really can't be happening! :D

Albion is my favorite RPG ever! I tested it out... and it works perfectly. This is so awesome I can't really comprehend it. o_O;

Especially as it seems to have been released exactly on my birthday :)

Thankyou so much :)
 
Idd, how have you managed this? Is this a port of an interpreter, or have you somehow got hold of the source code for the game, since I wasn't aware that it had had the source released for it, and I can't see any evidence to that effect with a brief search?

Or even more insanely, reverse engineered the entire thing and re-written it for the 2x....?
 
Tobriand said:
Idd, how have you managed this? Is this a port of an interpreter, or have you somehow got hold of the source code for the game, since I wasn't aware that it had had the source released for it, and I can't see any evidence to that effect with a brief search?

Or even more insanely, reverse engineered the entire thing and re-written it for the 2x....?
There has been no source code release, and I think he reverse engineered it himself. Though, there was some work done on building an Ambermoon engine earlier that is very similar in structure to Albion's engine. Also, I found some documents detailing the 3D engine mapping, and some of the XLD file structures (it was really quite interesting), which could have been used. But the main engine? Heh, I don't think anyone touched that until now :3

Now that I've calmed down about it, I wanna ask a question too. How are you rendering a 360x240 screen on 320x240? Everything seems to be perfectly done apart from the text. :)
 
Last edited by a moderator:
In which case, I'll play this one at x-mas, and cross my fingers that M-HT gets a Craiginator to port it to as and when they come out!

Then there won't be any *need* of a virtual keyboard!
 
Sorry for not responding sooner.

Draken: It's not always fullspeed, but the speed is always playable (as far as my testing goes).

icurafu: I finished it few times. Four if I remember correctly. Although the first time I helped myself with a walkthrough :)

Khatoblepas: Happy Birthday!

Sphinxter: It works with demo files, provided it's version 1.38. Actually I don't know whether different version demo exists. I downloaded the demo from bluebyte site and it's the correct version.

Tobriand: None of it. I forgot to write it here, but I wrote it on gp2x archive - I statically recompiled the original DOS executable (MAIN.EXE) into GP2X executable.

Khatoblepas: Almost no reverse engineering and no description of internal Albion workings was used. For rendering 360x240 screen on 320x240 I'm using some kind of interpolation. I don't know whether it has a name or not. I can describe it in detail if you're interested.


I will be getting Craiginator eventually. But that's a long time from now. So the need of virtual keyboard stays.
That's what I'm working on at the moment. When it's usable I will make a new release.
 
M-HT: I'm curious about how difficult this was and the level of dedication needed to finish such an undertaking (static recompilation). I mean, we don't see games like this done everyday. Again, thanks for your work!
 
How do you do "static recompilation"? You did a binary x86 to binary ARM code conversion?
 
Well, holy crap that's awesome. Static recompilation, eh???? XCOM needs some of that!
 
QUOTE
Khatoblepas: Almost no reverse engineering and no description of internal Albion workings was used. For rendering 360x240 screen on 320x240 I'm using some kind of interpolation. I don't know whether it has a name or not. I can describe it in detail if you're interested.


I'm quite interested to see how you've done this. It can't be simply missing out lines, as it doesn't look as truncated as it would have done. But it does look a little narrower, leading me to believe it's a kind of smoothed scaling. I'm looking forward to getting to the cut scenes. :)

The virtual keyboard will make the game completable, but there's been something I can't help but ask. How easy would touchscreen support be for the mouse in the future? It would be an awesome addition, and make some of the bits a little easier (especially the overreach cheat to get my filthy paws on the Iskai Spear :D, and, uh, interacting with the 3D map. Some of the timed puzzles are hard even with the mouse and keyboard) though... how are you incorporating the changes in the GP2x engine, if it's a static recompilation? Are you doing it all in raw ASM?

I'm also impressed by your recompilation of the Smacker player, which seems to run absolute full speed! :)
 
Jaguarandine: How difficult it was? Let me put it this way. If I had to do it again from scratch, I wouldn't do it :)

dmantione: I did x86 binary code to ARM assembler code conversion.

Senor Quack: I don't know which XCOM you mean, but XCOM: UFO Defense and X-COM: Terror from the Deep can't be recompiled using my approach and later XCOM games are too resource hungry (CPU, resolution) to be played on GP2X. Sorry.


The screen drawing works like this:
For each horizontal line I want to draw 360 pixels on 320-pixel screen.
That means that for every 9 pixels in source I must output 8 pixels on screen.
7 pixels are copied unchanged and remaining 2 neighbouring pixels are interpolated into 1 pixel.
The interpolation work as follows:
For every color (red, green, blue) I calculate the difference of the two pixels. ( d = r1-r2 )
If the difference is below defined treshold I do linear interpolation.
Otherwise the result is the higher of the two values. ( if d<D then r = (r1+r2)/2 else r = max(r1,r2) )

Actually Albion is completable without virtual keyboard, but one quest can't be succesfully completed without it.
Touchscreen support: no idea. I never used a touchscreen, much less implement support for it, so I can't answer this question.
Overreach cheat is possible, but more difficult.
Timed puzzles are easier using ctrl+arrow keys (R+Stick in keyboard mode on GP2X) = faster movement.

The program can be described as 4 parts.
1) recompiled part - statically recompiled binary - in ASM
2) emulation part - functions needed for the program to work - written in C
3) translation part - functions for translating calls from first part to second part and vice versa - written in ASM
4) optimalization part - optimized functions from second part - written in ASM

Actually the Smacker player is not recompiled (it can't be recompiled using my approach), but written from scratch using information from this page :)
The player can't play every smacker file, but plays Albion videos in fullspeed.
 
M-HT said:
Jaguarandine: How difficult it was? Let me put it this way. If I had to do it again from scratch, I wouldn't do it :)

dmantione: I did x86 binary code to ARM assembler code conversion.

Senor Quack: I don't know which XCOM you mean, but XCOM: UFO Defense and X-COM: Terror from the Deep can't be recompiled using my approach and later XCOM games are too resource hungry (CPU, resolution) to be played on GP2X. Sorry.

OK, I am insanely curious about how you did all this, can you please release the source code so I can look at it. If you don't want to release it publicly, I understand. Maybe you could just email it??? :D dansilsby AT gmail DOT com

Can you go more in-depth with UFO:Defense, too. That's the XCOM I was referring to and I am wondering why this method can't be applied, too. It almost inspires me to try it, but I only have a small amount of experience with assembly (ARM only)
 
Last edited by a moderator:
Public source code release: No. If I get bored with it, or I'm stuck with it and don't know what to do, or I changed my mind about it, then I'll consider it until then the answer is no.

Also if you want to look at the source code consider this:
The static recompiler is ~400 kB of mostly uncommented code.
Other source code is ~150kB more.

What can I say - when I ask myself whether to code or to comment, the answer is mostly to code :)


XCOM: To put it simply - I wanted to run Albion on GP2X, so due to speed and simplicity reasons I decided to only implement recompilation of a code that Albion has - 32bit, uses flat memory model (doesn't use segment registers), ...
Albion has such code (or more precisely can be easily transformed into such code), but XCOM doesn't have such code. So XCOM can be statically recompiled, but using a different aproach from mine - my recompiler would have to be significantly changed to recompile XCOM.
 
no way.. albion on gp2x? I must be dreaming, first long beged frontier, now this... I can't believe it.. wow, I'm angry cause I haven't my gp2x with SD here... hehe
thank you!! and keep good work
 
Back
Top