Jump to content
Double Fine Action Forums
Sign in to follow this  
marcus

Hack'n'Slash on Linux

Recommended Posts

Well, though I'd try to see if I could get H'n'S running on Linux, and got it started at least.

A small patch is needed to Data/Scripts/config.lua, so first you need to unluac that file. Then apply the following patch:


--- AfHack.old/Data/Scripts/config.lua    2013-01-13 13:58:19.460421436 +0100

+++ AfHack/Data/Scripts/config.lua    2013-01-13 12:43:21.891880212 +0100

@@ -17,4 +17,6 @@

  MOAIEnvironment.appBuild = "1"

  MOAIEnvironment.documentDirectory = MOAIEnvironment.documentDirectory .. "/" .. MOAIEnvironment.appDisplayName

  MOAIEnvironment.connectionType = MOAIEnvironment.CONNECTION_TYPE_WIFI

+elseif MOAIEnvironment.osBrand == "Linux" then

+  package.path = "Data/Scripts/?.lua;Data/Common/?.lua;Data/Moai/?.lua"

end

Note that if you, like me, is running on an architecture which is not 32-bit little-endian, then you'll need to unluac all the dumped lua files, since the dump format is not portable (boo! hiss!), more details about that at the bottom.

With just this modification I was able to start the game with "moai-untz Data/Scripts/config.lua Data/Scripts/main.lua":

afhack_linux.png

Once I got to this point, the character was immovable and I got lots of errors about the mainloop dying. I expect this is due to the FMOD stuff not being available in the upstreams codebase yet...

I'm rather curious about the purple rectangles that can be seen though. These are clearly not the same graphical glitch that has been reported elsewhere, since they are not restricted to individual tiles (and one of them is even rotated 45°!). Could this be a difference in behaviour between DF MOAI and upstreams MOAI? Or is it just a MOAI bug, in which case it might be dependent on CPU or GPU architecture? Could someone running Linux on e.g. a little-endian system with an Nvidia GPU try it and see if they get the same result?

--------------------

Regarding unluac:ing all the dumped lua files, I ran into problems with two files. The first was Data/Scripts/SaveLoad.lua, where unluac simply crashed halfway through. I got it compiling by manually closing the last function and adding "return lib" at the end, but I have no idea if all the functionality to actually load and save is there. The other file was Data/Scripts/Room.lua, where unluac added a spurious line "do break end" in Room:init. Removing this line fixed the issue.

Share this post


Link to post
Share on other sites

Actually, looking closer at the trace outputs, it looks like it's the lack of coroutines which is preventing the game from proceeding further:


Mainloop death #0:



Data/Scripts/main.lua:147: attempt to call method 'getLuaCoroutine' (a nil value)

stack traceback:

   Data/Scripts/main.lua:147 in function 'autosave'

   Data/Scripts/main.lua:102 in function 

I take it this is also a DF extension which has not been integrated upstreams yet?

Share this post


Link to post
Share on other sites

You see those lines because unluac can't decompile a small part of hack and slash that has if debug or something in it.

Share this post


Link to post
Share on other sites

Well, that makes sense I guess. Then someone who can use the original dumped files should be able to get the game started without the lines simply by not unluac:ing anything except config.lua, and even figure out which file contains the non-decompiled part by unluac:ing the files one by one...

Share this post


Link to post
Share on other sites

I think you'll probably have other problems due to missing the MOAI c++ changes to support the full save/load. The main file that fails to decompile is SaveLoad.lua which Df Paul du Bois has posted elsewhere, however there are a few more scattered minor issues. Like the monster.lua file randomly is missing a bit of the AI code.

Share this post


Link to post
Share on other sites

Actually it seems like tehtmi has been busy updating unluac the past week. SaveLoad.lua now decompiles fine. I haven't compared the result with the posted source version yet, but the result looks ok at a quick glance...

Share this post


Link to post
Share on other sites
Sign in to follow this  

×
×
  • Create New...