Port of AGS to Commodore Amiga

Started by Emufr3ak, Sat 19/03/2022 16:32:55

Previous topic - Next topic

Emufr3ak

Hi there

I'm an entusiast for Oldschool Computers and Adventure Games. There are some quite modern development tools for computer games on the Commodore Amiga but unfortunately not for adventure games. I'd like to change this.

Because of this I thought of porting an adventure engine over to the commodore Amiga. AGS looks like an interesting candidate:

- It's actively developed
- It has a lot of features
- No 3D stuff that makes it more complicated
- C++ programming for the Amiga is possible (No Std Library though)

On the other hand there are really a lot of question marks. Is the code of the AGS Engine efficient enough to run on such limited hardware? My target system would have around 6MB of RAM. I don't expect all the AGS Adventure Games to run on it, but it should be possible to run some reasonable complex adventure games on it similar to theAdventure Game Classics.

I'm reasonably good in Programming C and Assembler on the Amiga. My knowledge of C++ is more theoretical as i never did a serious C++ project beforehand. The AGS Engine is new to me too.

Maybe there are some Engine Developers on this forum who might be able to estimate if this is a realistic project.

eri0o

#1
It's feasible somewhat, because the SDL2 library is ported to amiga. I would use the latest sdl2 version along. You need to write down a new platform driver and some functions are platform specific too. You may have some minor writing yourself on allegro remnants parts and some build system adjustments and code adjustments in the macros used in the FreeType version used.

AGS uses only C++11 but there are in fact C++17 compilers for amiga too - yes including std.

Overall more trouble you will have is RAM, AGS is very economical on that front but any game that is not really low resolution will have trouble running. I think you will have more lucky if you make games that yourself that are specifically meant to be ported to Amiga.

Also bear in mind it's not a platform AGS is meant to support so you will probably do hacks that are only useful for you and it's not something that is interesting to support in the main project.

Crimson Wizard

#2
It's hard to tell. AGS code is not very efficient, and may be quite slow in places. Namely its script interpreter currently became slow due to some compatibility layers (mostly meant to run a range of game versions). Contemporary desktop systems don't care (unless there's a 3D raytracing engine written in script, or something), but low-end devices may struggle with it.

We had a PSP port a while ago (I think PSP is more modern than Amiga and has more ram?), and yet we had to drop it eventually because after some changes the games run too slow; and we did not have enough time and human resources at that time to put an effort in improving this situation.

6MB of RAM sounds too little to run contemporary games. Maybe some early 2000-ies games will be able to run in this amount of memory. Disabling certain features, like digital music, may also help.
Perhaps cutting of some layers of code may also improve the memory requirements and speed things up.
Maybe even taking the much older version, such as 3.2.1, from the times before the opensource project has began, could provide better results; it was much less "safe" and more fragile, yet faster in certain ways.

Emufr3ak

I think it would be mainly about creating custom games with the Amiga in mind not about existing games. So we're talking about really low resolutions. Most likely 320*256. CD quality music would be out of the question also. I think AGS does support MOD files.

This would still be great as you could use the AGS Authoring tools to create your Amiga game.

eri0o

Do you have the hardware to test? Including some way of getting the binary file in Amiga - some adapter for SD card or some other hardware.

Crimson Wizard

#5
Quote from: Emufr3ak on Sat 19/03/2022 18:06:03
This would still be great as you could use the AGS Authoring tools to create your Amiga game.

Well, theoretically that may be done; AGS Editor and tools produce "game data" as an intermediate step before deploying full build for the target system. Any port or even alternate engine may load that data up and execute on specific platform. So the question is mainly in having such ported engine.

eri0o

#6
By leveraging the software rendering and using the latest sdl2 available you may probably get the port going in an afternoon (with software rendering) - maybe minus sound. I would use some of the modified gccs or clang that have better support and crossbuild the port from a normal modern hardware.

You can also add a new system in the CMake and pass the required toolchain to get all dependencies along.

Also at first I would avoid ifdefs and modify the code directly for the port, so some changes can be experimented either directly in windows or linux , whichever you are more familiar debugging, I think amiga doesn't have nice ways to run things in a debugger...

Emufr3ak

Does SDL on Amiga  support RTG only or also native resolutions? In the end i might want to get rid of SDL but for a first port it might be cool even if the hardware requirements are a bit higher. I have a Vampire V4 and an original A1200 to test on.

Atm I'm using https://github.com/BartmanAbyss/vscode-amiga-debug to develop this. It's great but I think it will be hard to get std working with this. Where to I get std for Amiga?

eri0o

Not so sure on how SDL and amiga will work, reading on everyone only appears to be running emulators on raspberry PIs, so maybe it will be a ride getting the thing working...

From a quick google I could find two compilers:

- https://github.com/mooli/gcc-amiga
- clang+llvm upstream appears to also support --target=m68k

Not sure how to assemble the whole kit though, it appears things change a lot between linux/windows when crosscompiling. I found an Amiga Ports org in github: https://github.com/AmigaPorts

They appear to have a lot of things that may be useful for you.

morganw

I don't think there is an SDL2 version for the hardware you are trying to target, the classic OS3 machines would only have the original SDL library and I'm not sure how heavily it is tested. For OS4 (and MorphOS) there are already ScummVM builds and that has some AGS support so in theory that could run a new AGS game and that hardware would likely be up to the job.

Maybe the best similar option for making adventure games on the classic machines would be GRAC 2:
https://aminet.net/package/game/role/GRAC2

Emufr3ak

Thanks for all your suggestions. This really helps.

I checked out GRAC2. It's nice. However AGS has more potential. It's based on AMOS (A Basic language) which makes it slow and there wasn't any development on it for a long time.

All in all I think it sound doable. I'll give the AGS Port a go. My approach would be:

- Convert it for "pimped" Amigas with graphics cards and loads of RAM. Change SDL 2 calls to SDL 1.2
- Remove SDL alltogether (or optional) and use native calls. This should then run on Lowerend machines as well.




Mehrdad

#11
Sorry if it's out of this topic

Francois Lionet was the creator of AMOS and he made AOZ last year. it's cross platform and so similar to AMOS.
I think it support Amiga too ( See FAQ section)

Main page:
https://www.aoz.studio/

 
My official site: http://www.pershaland.com/

Crimson Wizard

Emufr3ak, as you mentioned that amiga does not have a std library, I don't know if that will help you, but ScummVM project has its own replacement for STL and some other standard C++ functions:
https://github.com/scummvm/scummvm/tree/master/common

eri0o

Hey, Emufr3ak, if you have any news share here!

After CW mentioned ScummVm I noticed it's actually ported to AmigaOS (https://wiki.scummvm.org/index.php/Platforms) , perhaps this could be used to test how AGS games run on it.

doimus

A bit late to the party, but here's my two cents...

Over the past few months I have tested old AGS versions running on MS-DOS, both real hardware and in Dosbox.
I've tested all versions of AGS that I could find, starting from 2.62 going backwards.

The conclusion is: AGS is almost pointless on DOS - it's just too slow. It runs, but it needs at least 486DX4 or Pentium CPU,with lots of RAM, which kind of defeats the whole purpose of DOS gaming.
And it's not (just) script, as I run the most basic one-room example. It's the pathfinding that completely kills the gameplay. It stutters every time it processes movement paths, even on 486DX2. Even the documentation of those versions recommend Pentium over anything else. Remember, this was early 2000s, DOS was "ancient and useless" back then, not "retro and cool" as it is now.  :-D
AGS really was never a DOS software, but Windows 9x software that could run in Win9x MSDOS mode. Which is similar, but not the same.

So, based on this experience, I really doubt AGS would run effectively, even if it could theoretically, on any classic Amiga, even with the 68060 cpu. It's not you Amiga and DOS, it's the Moore's Law. :(

Crimson Wizard

#15
Quote from: doimus on Tue 12/04/2022 14:27:05It's the pathfinding that completely kills the gameplay. It stutters every time it processes movement paths, even on 486DX2.

To be fair, the original pathfinding was very slow and also buggy. IIRC it was based on a floodfill algorithm. We now use a different pathfinding algorithm (A*, where grid is built from a pixel mask) written by a contributor, which sped it up by a lot, and also works universally (from what i could tell). There's still a room for optimization.

doimus

#16
Even with all possible optimizations, it would be completely unfair to judge AGS by its ability to run on systems it was not designed for.

I also did some research into SCUMM(VM) innards to see how it all worked back then. The level of optimizations it used to display scrolling backgrounds and animated sprites is absolutely huge. Even the pathfinding is just simple 4-sided polygons, using precalculated table for movement between them. Old cpus couldn't possibly handle even the simplest A* by today's standards.
That's when talking about "classic" early 90s era. From late 16bit 286PC or A500 to early 32bit 386 or A1200.

AGS, if optimized to insane levels, and with executable written from ground up in 32bit protected mode, could probably reach the performance of let's say, Full Throttle or Curse of Monkey Island. That's based on how AGS treats rooms, sprites, scripts, etc... which is similar to late era Lucasarts. But even those games are out of reach for a good old 386 or Amiga 1200. If not just by CPU power, then definitely by RAM usage. Let's not mention the 1MB Amiga 500, or 640k 286 PC.  Those old beasts just can't effectively handle C  , middleware libraries, and other late 90s "modern" stuff.

And the whole reasoniing of today's retro development is to be able to run on low end classic hardware or its emulation. Otherwise, what's the point.

Well, the point is to learn 16bit programming from the ground up, obviously!  :-D
That's what I'm doing right now and it's the most fun I had on a computer in a quite a long while!


SMF spam blocked by CleanTalk