Descent Retromod on Mac

Need help?
User avatar
sdfgeoff
Not Active
• Gold Phoenix Guard
Posts: 9
Joined: Sun Sep 04, 2011 4:04 pm
Contact:

Descent Retromod on Mac

Postby sdfgeoff » Mon Apr 28, 2014 4:49 am

Howdy guys. Seems quite a few people are having issues because we're all playing retromod, and it's not available for Mac.

So here's a list of solutions:
- Play it in Windows Emulator. I played for a couple months on WINE before I compiled regular version for Linux, and a quick test now shows that the current retromod also runs fine under WINE.
- Install linux, either on your computer or in a virtual machine on top of Mac. It's free, and if you pick Linux Mint or Ubuntu, I can help you with compiling rebirth.
Running under WINE or in a virtual machine will require a little more processing power though. Maybe you'll have to pretend it's the old days and 20FPS is playable...

OR:

- Compile it on Mac. This is the ideal one, because if someone can do it, chances are it's a copy-paste exercise for everyone else.You can grab the source from . Inside that package you will find a file called 'INSTALL.TXT' which has the instructions for compiling on Mac. It looks a little harder than on Linux, but I see nothing too bad there.
If you try to compile it, and have issues. let us know and we'll try to help.
This statement is self referential and therefore meaningless.....
User avatar
PigmyRhino
Major
Major
• Blue Lightning
• Event Manager
• Junior Officer
• News Manager
Posts: 126
Joined: Wed Dec 05, 2012 7:23 pm
Contact:

Re: Descent Retromod on Mac

Postby PigmyRhino » Mon Apr 28, 2014 8:57 am

I'll try compiling it because Ive tried all of the above options to no avail.... hopefully this'll work
Descent Rangers Reign Supreme

Past:
Red Dragons Applicant, Associate, Cadet, Ranger, Ensign, Corporal
Black Lions 2nd Lieutenant, 1st Lieutenant, Major, Captain

Current:
Blue Lightning Lt. Commander

RIP S.H. (10/1/1986-3/3/2014)
User avatar
Icewolf
2nd Lieutenant
2nd Lieutenant
• Black Lions
• Junior Officer
Posts: 491
Joined: Fri Sep 02, 2011 12:52 pm
Location: ISD-II Avenger TIE/x1 Squadron

Re: Descent Retromod on Mac

Postby Icewolf » Mon Apr 28, 2014 1:29 pm

That would be awesome if you could compile it for mac. I'm not mac user but lack of mac build does affect entire community.
Pigmy - there is a deal then - if you compile it then you get promoted, if not - I'll have to find someone else to promote :P
:lol: :lol: :lol:

:oops:
User avatar
Ryusei117
Captain
Captain
• Blue Lightning
• Event Manager
• Game Manager
• News Manager
• Senior Officer
Posts: 110
Joined: Mon Sep 05, 2011 9:15 am

Re: Descent Retromod on Mac

Postby Ryusei117 » Mon Apr 28, 2014 1:49 pm

User avatar
Drakona
Not Active
• Red Dragons
Posts: 64
Joined: Sun Jun 23, 2013 8:05 pm

Re: Descent Retromod on Mac

Postby Drakona » Tue Apr 29, 2014 6:29 am

I've sunk, literally, probably over 100 hours into attempting to compile on mac. To no avail. I have tried in xcode and scons. I have tried with help from AFP, Kreator, Zico, Kp, and REALM, all of whom gave up. Currently spud and Gwar are trying. Some of these people are professional developers who primarily code on mac!

Spud is one of the mac developers. He seemed to have great hope, as of about a week ago, and seems to have gotten the farthest of anyone who has made a serious attempt. He is probably the best person to pester about it / offer to help, if you want to make it happen.

I can send anyone who wants to make their own attempt the same notes I sent spud . . . but fair warning: if you are not already a programmer, I seriously doubt you will be able to resolve the issues that stopped REALM and me.

Windows emulation seems like a much easier approach, if all you want is to be able to play! I believe this is what LoNi_ does, and I believe there ARE performance issues, but I'm sure it depends on your system. Installing Linux even seems like an easier approach than getting the mac build working, and you know THAT'S a bad sign. ;)
User avatar
Drakona
Not Active
• Red Dragons
Posts: 64
Joined: Sun Jun 23, 2013 8:05 pm

Re: Descent Retromod on Mac

Postby Drakona » Tue Apr 29, 2014 6:55 am

Here's the brain dump I sent spud and gwar:

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

Some background about Retro, to help you understand what you're seeing.

Retro Mod began life as Retro Homers, a proof of concept that the original homing missile behavior could be made playable while the rest of the game ran at 200 FPS. It has grown to include several fixes, but at this point is still very close to Rebirth itself -- a couple hundred lines or so changed, none of which would impact a build process. All of the infrastructure used to build Descent (and there is kind of a lot of it) is stuff I inherited from Rebirth, which I did not write, and which I generally don't understand, and which I have not really put time into understanding in the hopes that the project will be TEMPORARY.

The mac build infrastructure is in particularly bad shape. The Rebirth guys don't build the mac project on a daily basis, and the build tools they do have for mac typically have not been maintained. They are undergoing a huge refactoring effort at the moment that touches every file and breaks all the build tools -- which they've been working on for most of a year now. I don't know if they've gotten the mac build working on the other side of that change yet, but I don't think so. And at any rate, they are not likely to fix the old build process for us; they have their hands full making the new one work, and that will be true for the forseeable future.

There are two ways to build Descent on mac: from the command line via scons, and through the xcode project distributed with the source. Neither of them work as advertised. The scons script has sufficiently fatal bugs that it clearly has not ever been used to successfully build the project -- it looks like it was written but not tested. I was able to repair it enough to get the project to build, but not to run without crashing. It is definitely not the tool that was used to build the 0.58.1 release.

The xcode project doesn't work out of the box, either, and I don't think it was the project used to build the 0.58.1 release -- it seems to be missing some compiler flags. However, Kreator (the guy who does the mac builds for Rebirth) has confirmed that he typically uses XCode, and all of the mac experts who have tried to help with this so far have preferred to go that route. So we'll do that.

I mention the scons route mainly because the Windows and Linux paths in that same script ARE used every day, and WERE what were used to build the 0.58.1 release. If there are critical missing flags, they may contain hints.

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

Okay. Here is what you do. And let's stick to D1 for now. :)

Download the following:

- The source for Retro Mod 1.2. https://dl.dropboxusercontent.com/u/146 ... source.zip
- Put the D1 part of this in a build folder somewhere.
- The xcode project is in there

- The Vanilla 0.58.1 app (for comparison purposes) http://www.dxx-rebirth.com/download/dxx ... macosx.dmg
- This has the frameworks we'll be using. We'll download and install them fresh, but this
lets you see how they've been deployed with the app. If you look at the package contents,
you'll see SDL and SDL_Mixer in the Frameworks folder, and physifs.dylib in both the
Frameworks and the root directory.
- This also lets you verify (sanity check) that Descent does indeed run on a mac pain-free. Put it in the same folder as your Descent.hog and Descent.pig, and it should run fine. :)

- The SDL framework, version 1.2 -- http://www.libsdl.org/download-1.2.php
- This goes in /Library/Frameworks
- Make sure you get both SDL.framework and SDL_Mixer.framework

- Physfs. I was advised to use whatever version is most recent -- still 2.0.3. https://icculus.org/physfs/downloads/
- This is a source tarball; we'll be building it.
- We'll be using cmake to build it, so if you don't have that, get it too -- (cmake.org)

Okay. My notes get kind of sketchy at this point. Realm was talking me through it pretty fast, and while we did get it all building on my system, it was a couple months ago. I'm not 100% positive I can reconstruct exactly what we did.

Building PhysFS -- my notes say:
Put physfs where it wants to be inside the build tree -- you can't move it. On my system,
the D1 source is at /users/a/Descent/d1, and physfs is at /users/a/Descent/physfs/build. Apparently that relationship is non-negotiable. (???) From that folder,

mkdir Debug
mkdir Release
cmake .
ccmake .
Edit the line CMAKE_OSX_ARCHITECTURES, it needs to say i386;x86_64
(This is a departure from the directions in Rebirth's Install.txt building for Mac section,
which suggest supporting ppc. Realm and I felt that was a little extreme at this point.)

(Something got busted on my system and I can't follow the directions past here; ccmake is giving me an error that I think may be related to having upgraded my OS since last time I ran it . . . ok, I can run that down later. Just copying my notes from here out. )

g (to generate and exit)
run make

rename test_physfs to physfs

copy the physfs.dylib to the debug and release directories

xcode should now see all the missing libraries

Building Descent
You get a lot of compile errors that are really warnings, which is a big reason I don't think this project is what was used for the release build. Realm's solution was to go to Build Phases and suppress all the errors by putting a -w flag on every file.

On the products dropdown, make sure you have d1xgl selected.

If you're very lucky, that will build, and run, and it'll complain about not being able to find the .hog and .pig files. It will do this even if you get the app and put it in a directory with them. Fortunately, you can put them Resources/Data folder, and it will see them. But that's going to have to be fixed ultimately; we can't legally distribute those files.

If you get past that, you'll get one of two outcomes. In Realm's case, he was able to run the game in a window, but not full screen. In mine, it gives me the following unavoidable error:

Error: Could not set 1024x768x32 opengl video mode: Error setting OpenGL fullscreen: invalid fullscreen drawable.

Googling that did not give us enough information to get past it . . . and that's where Realm and I got stuck. He seemed confident he could resolve it, but then had to go do his Real Job.

A further point of interest! When you do get this building, what you get is Descent's "Debug" version rather than "Release", unlike on Windows from the same source -- so it has the old level editor accessible from the main menu, among other things. You can go into the source itself and set the #DEFINE, but . . . isn't the build tool supposed to do this? Another hint that the xcode project is missing some pieces.

Further reading:

You can view my efforts to get the build working (and ultimately Realm's) in both scons and xcode, and the advice the Rebirth team gave us, here:
http://www.dxx-rebirth.com/frm/index.php?topic=1788.45

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

If I seem despondent about the mac build, it is that I have invested a lot of hours into it since last August, and every time, I get tantalizingly close . . . but it doesn't work. And I think about five people have cheerfully offered to help, worked real hard on it, and gave up. Realm seemed to get the furthest, and would really be the person to talk to (Shane Valdez on Facebook -- but as I said, he's off shooting a movie, and pretty busy) if you get stuck.

I . . . well, I had to google how to go to a raw directory in Finder while reconstructing these notes. So that'll tell you how useful *I* am on a mac. ;)

Anyway. Anything you can do would be helpful. Ideally, I'd like to have a working build process on my system so I can do Retro releases, but . . . I don't think they're going to be that frequent anymore, and I still hold out hope that the Retro ultimately won't be needed. So I'd settle for you being able to build the project, so long as I could find you when I needed to do a release, and you left good notes in case you had to go shoot a movie. :)

Or, shoot, just leave me a working Retro 1.2 binary for Mac and nothing else, and I will owe you big time. :)

Thanks in advance for looking at it / messing with it!! Catch me on Mumble/Facebook any time if there is news or you have questions or . . . anything, really.

- Drak
User avatar
PigmyRhino
Major
Major
• Blue Lightning
• Event Manager
• Junior Officer
• News Manager
Posts: 126
Joined: Wed Dec 05, 2012 7:23 pm
Contact:

Re: Descent Retromod on Mac

Postby PigmyRhino » Tue Apr 29, 2014 7:56 am

I'm making some great progress in compiling this for mac, just ran into a snag, It's giving me an error telling me that i'm explicitly assigning variables to themselves. I.E.

key_code = key_code;


What do I do in this instance? :)
Descent Rangers Reign Supreme

Past:
Red Dragons Applicant, Associate, Cadet, Ranger, Ensign, Corporal
Black Lions 2nd Lieutenant, 1st Lieutenant, Major, Captain

Current:
Blue Lightning Lt. Commander

RIP S.H. (10/1/1986-3/3/2014)
User avatar
Drakona
Not Active
• Red Dragons
Posts: 64
Joined: Sun Jun 23, 2013 8:05 pm

Re: Descent Retromod on Mac

Postby Drakona » Tue Apr 29, 2014 8:30 am

Those are compiler warnings being promoted to errors. You need to unpromote them somehow. This is a problem with xcode, and not with scons, and I think Realm solved it by applying a -w switch to all files . . . I think on the build phases tab somewhere? I really know very little about xcode. :(
User avatar
PigmyRhino
Major
Major
• Blue Lightning
• Event Manager
• Junior Officer
• News Manager
Posts: 126
Joined: Wed Dec 05, 2012 7:23 pm
Contact:

Re: Descent Retromod on Mac

Postby PigmyRhino » Tue Apr 29, 2014 10:55 am

Fortunately, i got past that and found how to add the -w switch :)

I'm still stuck at the sdl_mixer.h error. xcode cant seem to find it, yet i can in the directory for retro.

I'll be picking REALM's brain on Facebook as well. so we'll see what happens.

Idk if this is false happiness but I feel like i'm making progress. :)
Descent Rangers Reign Supreme

Past:
Red Dragons Applicant, Associate, Cadet, Ranger, Ensign, Corporal
Black Lions 2nd Lieutenant, 1st Lieutenant, Major, Captain

Current:
Blue Lightning Lt. Commander

RIP S.H. (10/1/1986-3/3/2014)

Return to “Tech Support”

Who is online

Users browsing this forum: No registered users