Overview Features Instructions Performance Forum Downloads Products OrderV4 Reseller Contact

Welcome to the Apollo Forum

This forum is for people interested in the APOLLO CPU.
Please read the forum usage manual.
VISIT APOLLO IRC CHANNEL



All TopicsNewsPerformanceGamesDemosApolloVampireAROSWorkbenchATARIReleases
Running Games and Apps.

Port Lua 2D Engine LÍVE to Amiga

Olle Haerstedt

Posts 102
09 Mar 2020 18:24


How much work do you think it would be to port this 2D game engine to Amiga/Vampire? Could be cool, would immediately give access to a lot of different and free games, as well as lower the bar for creating new games (that could also be run on different platforms). :)
 
  EXTERNAL LINK


Marlon Beijer

Posts 175
09 Mar 2020 23:14


Dependencies:
SDL2
OpenGL 2.1+ / OpenGL ES 2+
OpenAL
Lua / LuaJIT / LLVM-lua
FreeType
ModPlug
mpg123
Vorbisfile
Theora

---------

I have already looked at this before, and there's some issues regarding porting this to classic Amiga.

OpenGL and OpenAL will definitely be a problem. SDL2 could possibly be solved in the same way it was solved for DevilutionX.

LUA: I don't really know if it would be easy to port, and if it is, if it would run at a decent speed on Amiga.

These libs are known working on Amiga: Freetype, vorbisfile, theora, modplug, mpg123

But, with that said. For DevilutionX to actually be playable, Samuel Devulder spent a lot of time painstakingly optimizing parts of DevilutionX with assembly.

Even though the 68080 is the fastest 68k based CPU, it doesn't matter when modern games are made with no consideration to optimization of their code, since they don't really have to do that kind of optimization on an modern Ghz processor with loads of RAM to spare.

So even if a game looks pixeled/low-res and looks like something that would run on Amiga, it probably won't without loads of work.

Also, something to have in mind is that data-files on PC are stored in little endian, while Amiga requires big endian. This is one of the main reasons why porting DevilutionX took Arczi and I over a year from start to finish, and that was before Sam put his teeth in it to optimize it further.

There are a lot of shoddy ports to Amiga that has been put on Aminet over the years, where people basically got it to compile for Amiga, but then never bothered to optimize it or didn't understand how much effort was needed unfortunately.

We have further ports in the pipeline. But we'll see what it'll be. :)

-------------
You can follow updates on future ports on Arczi's blog:
EXTERNAL LINK 
and support him on his patreon:
EXTERNAL LINK 
You can also support me on Github:
EXTERNAL LINK


Olle Haerstedt

Posts 102
09 Mar 2020 23:18


What about porting it BUT reduce some of the functionality to make it more Amiga friendly? Partly defeating the purpose since maybe some games won't run out-of-the-box, but could still be a beneficial project for people who want a game framework on Amiga?


Olle Haerstedt

Posts 102
09 Mar 2020 23:20


And also, instead of spending time to optimize ONE game, wouldn't it be more interesting to spend time to optimize a game ENGINE?


Marlon Beijer

Posts 175
09 Mar 2020 23:25


Olle Haerstedt wrote:

And also, instead of spending time to optimize ONE game, wouldn't it be more interesting to spend time to optimize a game ENGINE?

The issue is, we have spent time optimizing SDL for Amiga, which is the part that is responsible for the rendering and to some extent the audio. And even that's not enough.

I didn't say it was impossible, but I said it would take a lot of effort and time.

The biggest issue with LÖVE is that it uses OpenGL and OpenAL. The SAGA Gfx does not support OpenGL yet, and using some sort of soft rendering would make it really slow.

Putting in some work to make LUA usable on Amiga would perhaps be a good idea, since it could be re-used for other games that also make use of it. If it hasn't already been optimized by somebody else already.

Before starting to work on a port, we need to do some research on what needs to be done, and that takes time too.


Olle Haerstedt

Posts 102
09 Mar 2020 23:30


Oh yes, I understand that a lot of pre-production and planning must be done before even considering porting a bigger project.

Without knowing much about graphic routines on Amiga (or anywhere), would it be possible to replace OpenGL usage with, say, AmigaOS routines instead?


Marlon Beijer

Posts 175
10 Mar 2020 00:09


Olle Haerstedt wrote:

Oh yes, I understand that a lot of pre-production and planning must be done before even considering porting a bigger project.
 
  Without knowing much about graphic routines on Amiga (or anywhere), would it be possible to replace OpenGL usage with, say, AmigaOS routines instead?

Perhaps, it all depends on how OpenGL was used. All special features/audio effects of OpenAL would definitely be missing, but I know for certain that this could be replaced with AHI code.

Nothing is impossible. But we need to weigh in a couple of things, like would it be worth the effort? are there enough good games that use this engine? would it be fun for the developer? :)

We all do this in the spare time, so it definitely helps when it's an app or game that you'd personally like to see ported. Diablo on Amiga was a given, of course.

I always keep an eye out on this site: EXTERNAL LINK


Manfred Bergmann

Posts 182
10 Mar 2020 08:25


Marlon Beijer wrote:

  Putting in some work to make LUA usable on Amiga would perhaps be a good idea, since it could be re-used for other games that also make use of it. If it hasn't already been optimized by somebody else already.

LUA is AFAIK used in Hollywood. So it is possible.
I'm not sure if it is jit compiled there but on classic it's not the fastest.

Manfred


Olle Haerstedt

Posts 102
10 Mar 2020 21:26


Marlon Beijer wrote:

Olle Haerstedt wrote:

  Oh yes, I understand that a lot of pre-production and planning must be done before even considering porting a bigger project.
 
  Without knowing much about graphic routines on Amiga (or anywhere), would it be possible to replace OpenGL usage with, say, AmigaOS routines instead?
 

  Perhaps, it all depends on how OpenGL was used. All special features/audio effects of OpenAL would definitely be missing, but I know for certain that this could be replaced with AHI code.
 
  Nothing is impossible. But we need to weigh in a couple of things, like would it be worth the effort? are there enough good games that use this engine? would it be fun for the developer? :)
 
  We all do this in the spare time, so it definitely helps when it's an app or game that you'd personally like to see ported. Diablo on Amiga was a given, of course.
 
  I always keep an eye out on this site: EXTERNAL LINK 

What's AHI code?

Number of (good) games already available in the engine, don't know. Maybe there are other more suitable engines to consider. But it *is* a pity that we have no good open-source game engine on Amiga (that I know of)!

So yeah, maybe this could be split in two separate projects:

1) Port Lua (and LuaJIT?) to Amiga;

2) Choose a game engine (possibly one that uses Lua) to port, with an already existing game library.

Worst alternative: Create a new game engine from scratch. But maybe most fun?


Martin White

Posts 85
10 Mar 2020 21:30


Lua works on Vampire without porting. Just compile it (I've done it and so have others).
 
I have something along these lines in the pipeline if I ever get back to it but I can't say anything about it publicly at the moment. (Not just me of course - a couple of other people involved, none of them Amigans)


Olle Haerstedt

Posts 102
10 Mar 2020 21:31


Martin White wrote:

Lua works on Vampire without porting. Just compile it (I've done it and so have others).
 
  I have something along these lines in the pipeline if I ever get back to it but I can't say anything about it publicly at the moment.

The JIT compiler, too?


Martin White

Posts 85
10 Mar 2020 21:32


I don't know, i haven't tried.


Olle Haerstedt

Posts 102
11 Mar 2020 18:54


Martin White wrote:

    I don't know, i haven't tried.
   

   
    Can't be, 68k is not listed as support, and the files in the source does not list it either. Need to add a new vm_68000.dasc with implementation, I'd assume. https://repo.or.cz/luajit-2.0.git/tree/HEAD:/src
 
  My inspired guess is that the dasc files map JIT bytecode to the underlying CPU instruction set.
 
  Edit: "Bytecode interpreter" it says right there. ^^ 5k LOC, so not a small project unless you really know what you're doing. In another dimension a millionaire could give the LuaJIT author a bag of gold and tell him to port it. :)


Olle Haerstedt

Posts 102
11 Mar 2020 19:05


Couple of other game engines using Lua:
   
    Defold: EXTERNAL LINK   
    Corona: EXTERNAL LINK   
    Gideros: EXTERNAL LINK   
    Raylib: EXTERNAL LINK   
    Instead3: EXTERNAL LINK   
    And a lot more (list from stackoverflow): EXTERNAL LINK 

  List from slant, with LÖVE having most recommendations: https://www.slant.co/topics/2590/~best-2d-lua-game-engines

posts 14