Laserbrain Studios

Games Forum Blog Contact

Author Topic: Ascii Sector Development Updates  (Read 29937 times)

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Ascii Sector Development Updates
« Reply #30 on: February 14, 2015, 11:37:58 PM »
It seems there are two things that need fixing for the Max OS X version to work properly:

1) Hiding the cursor via SDL results in a black box where the cursor is.

2) I need to use proper Mac OS X file system practices. This means installing the game to the /Applications folder; save games, options file and the like to the user's /Application Support/[App Name] folder; and temp files in the user's /Application Support/Caches folder.

I'm also reading up on how to make a proper Max OS X installer package.

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Ascii Sector Development Updates
« Reply #31 on: February 15, 2015, 11:31:41 PM »
I've now got the Mac version behaving as it should with regards to proper file system practices. I didn't need to make an actual installer, as the game will just be a zipped app bundle. When you run the game the first time, it will create an 'Ascii Sector' folder in 'Library/Application Support' which contains the log and options file, as well as the saves, movies and quests folders. Figuring out how to get the correct paths from the system was a bit of a hassle, especially getting Free Pascal to expand '~' to the user name.

This new setup means that the game will no longer ship with any quests packed in, as the quests folder doesn't exist until you've run the game at least once. I'll also have to figure out what to do with the manual PDF file, as hiding it inside the bundle probably won't be much help. I'll probably just not pack it in with the game download, but just offer it as a separate download. Or I could have the bundle inside an 'Ascii Sector' folder in the downloaded zip file and then just also have the manual in that folder. That's probably the best solution, though I don't like having the app bundle in a folder when all saves and stuff are stored elsewhere. Hmm...

Also, the game currently crashes when loading a save game, so I'll have to figure out what's going on there.

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Ascii Sector Development Updates
« Reply #32 on: February 18, 2015, 07:49:24 PM »
Oh, for fuck's sake. I tried testing the game on another Mac virtual machine and for some stupid reason, the app can't just figure out to use the SDL frameworks that are bundled with it. So now I'm back to struggling with Xcode to get it to work properly.

I really, really don't understand why this shit has to be so goddamn complicated. In Windows, you just place the dll files in the program directory. End of story. Here I have to spend hours trying to wrangle Xcode and frameworks to just do the simplest thing. It's really frustrating as hell.

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Ascii Sector Development Updates
« Reply #33 on: February 18, 2015, 09:31:59 PM »
So here's what I've wasted the last 2½ hours on...

The reason why the app bundle won't use the bundled SDL2 frameworks is because when you build an executable on Xcode, it takes information about where to find the needed frameworks from the frameworks themselves. The information in the SDL2 frameworks tells the app to look for the frameworks at something like this path:

"@rpath/SDL2.framework/Version/A/SDL2"

But this is supposed to be:

"@executable_path/../Frameworks/SDL2.framework/Version/A/SDL2"

This is because of how the frameworks are placed relative to the executable in the bundle. The above path simply tells the system that the framework will be found if it goes up one folder in the hierarchy and into the Frameworks folder.

Now, there's this command line tool called install_name_tool that you can use to change the information in the executable itself. That worked fine. The executable was now looking for the SDL2 frameworks in the right place, but...

The frameworks themselves still had the incorrect "@rpath/SDL2.framework/Version/A/SDL2" path! And install_name_tool exits with an error when I try to change the paths in the SDL executables!

At this point I'm considering not bundling any frameworks with the app bundle and just telling people to install the SDL2, SDL2_mixer and SDL2_image frameworks themselves. But I really hate having to do that, since I'm pretty sure that when I release Hidden Asset, I'll be swamped by requests from people that can't get it to run because they don't have the SDL2 frameworks installed.

Again, in Windows you just copy the required dll files into the game directory and it works. This is ridiculous.
« Last Edit: February 18, 2015, 09:51:01 PM by Christian Knudsen »

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Ascii Sector Development Updates
« Reply #34 on: February 19, 2015, 04:09:28 PM »
Yes! I figured out what was going on...

The parameters I had set for @rpath in Xcode simply wasn't passed on to the Free Pascal compiler, so I had to manually add a command line compiler option for FPC: -k"-rpath @executable_path/../Frameworks"

So the app bundle is now using the bundled SDL2 frameworks, which means that you don't have to manually download and install SDL2, SDL2_image and SDL2_mixer if you don't already have them installed.

Christian Knudsen

  • Administrator
  • Ace
  • *****
  • Posts: 3014
    • View Profile
Re: Ascii Sector Development Updates
« Reply #35 on: January 06, 2016, 06:02:46 PM »
The new capital planet will be in the Loye System: