Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Cross-Platform Development => Topic started by: pnwkayaker on May 08, 2015, 01:05:57 pm

Title: Newbie: compiling with Xcode 6 on Yosemite
Post by: pnwkayaker on May 08, 2015, 01:05:57 pm
Hello all,

Newbie to FS2Open here. I'm trying to compile FS2Open using Xcode 6 under Yosemite. I downloaded the source using git according to the instructions contained at http://www.hard-light.net/wiki/index.php/Mac_Development_Guide  but then I'm seeing two different folders containing Xcode projects (under fs2open/projects): an Xcode folder and an Xcode4 folder, which one should I use?  I've tried to compiling either and both of them are giving me errors, so would like to know which one to concentrate :-)

Reason I'm trying to compile my own version is that I bought Freespace 2 at GOG, downloaded FS2 3.7.2 using the Java installer but when I try to run FS2, either my screen becomes completely black or it crashes. I am suspecting that the binary available is not correctly compiled for Yosemite. 

I'm not afraid of source code nor debugging big systems, but this would probably be my first approach to Mac programming in many years, so it will be a very interesting learning curve.

In case it matter, my machine is a MacBook Air 2013 with an Intel HD Graphics 5000 video chipset. Any pointer will be appreciated.

Title: Re: Newbie: compiling with Xcode 6 on Yosemite
Post by: chief1983 on May 08, 2015, 01:10:30 pm
Xcode4 is really Xcode4+.  The other was the original for Xcode 3, and will probably be abandoned soon.  You need to extract the Frameworks.tgz in the Xcode4 folder.  Then you can just run "xcodebuild" in the project folder and it should compile fine.
Title: Re: Newbie: compiling with Xcode 6 on Yosemite
Post by: pnwkayaker on May 08, 2015, 05:10:55 pm
Thanks for the very fast response, I tried what you suggested and was able to compile a debug version with no problem, thanks!

Now...I'm still seeing the same behavior as before with 3.7.2 (this is 3.7.3), meaning, the screen becomes completely black and nothing else happens.

Are there any known limitations with the Intel HD 5000 video chipset in my Macbok Air (meaning is not supported) before I try to sit down to track done the problem?


Xcode4 is really Xcode4+.  The other was the original for Xcode 3, and will probably be abandoned soon.  You need to extract the Frameworks.tgz in the Xcode4 folder.  Then you can just run "xcodebuild" in the project folder and it should compile fine.
Title: Re: Newbie: compiling with Xcode 6 on Yosemite
Post by: chief1983 on May 08, 2015, 05:27:34 pm
Yeah I hoped my response was clear enough, typed it on my phone so it was a bit rushed.  Now I'm at my Macbook Pro proper.  The Intel series in general does have some issues with OpenGL, especially since we're not on the Core Profile yet on OS X.  I mean to do what I can to help get 10.10 support in shape as soon as I get my new MacBook Pro at work, right now I'm on Mountain Lion on a late 2011 model.  Still has Intel though, but the game runs ok for me on 3.7.2 and master.  The Intel in the Air is probably even weaker of a card though, with regards to OpenGL.  Make sure you have the 10.10.3 system update.  Also, you might try to add Swifty's fork (https://github.com/SamuelCho/fs2open.github.com) as a remote and attempt to compile his shadows_transform_deferred branch, and see if that helps or hurts the situation.

Also, there are some various graphics debugging options available, if you're using wxLauncher you should be able to toggle them easily.  Most of them stand out as being obviously graphics related, but you might try disabling most of the things under the Graphics section to start, disabling sound and music, disabling video playback, OpenGL VBO, disabling IBX, render targets, PBO, GLSL (that's a big one), etc.  I also recommend setting it at 1024x768 and running in windowed mode.

Additionally, you could post your debug log found at ~/Library/FS2_Open/data/fs2_open.log which can help shed some light on what went wrong.

Can you describe what happens besides being completely black?  How do you manage to terminate the program?  Just hitting Escape?  There is no sound in the background?

I posted my ideas as they came to me, but really if you read this far into the post you should probably attempt them in reverse order.  I'm too lazy to rewrite this in the correct ease of implementation order.
Title: Re: Newbie: compiling with Xcode 6 on Yosemite
Post by: Echelon9 on May 09, 2015, 12:58:12 am
Hi pnwkayaker,

I'm one of the other FS2Open developers who is familiar with OS X. Suggest that you go through chief1983's suggestions and post results, in particular from the fs2open.log file.

We can work with you from there to see what the issue is and how to go about resolving it for you.
Title: Re: Newbie: compiling with Xcode 6 on Yosemite
Post by: pnwkayaker on May 09, 2015, 08:35:37 am
Thanks to all - I'm away from my computer for a couple of days (camping), will go through all the suggestions when I return
Title: Re: Newbie: compiling with Xcode 6 on Yosemite
Post by: pnwkayaker on May 10, 2015, 10:38:01 pm
OK, I mentioned I'm a newbie in FS2 (and FS2Open too) - I was not able to find the above mentioned log files in the specified location, so I played with the advanced settings and found that it was possible to run FS2 in windowed mode *with* a debug window and without capturing the mouse/keyboard. 

Once i did that, I learned that FS2Open was not able to find the FreeSpace files in the FS2Open location - I had loaded FS2Open in a "fs2_open_3.7.3" subfolder under the main FreeSpace folder. Once I moved the binary up one level (to the main FreeSpace location) that game was able to start correctly.

Question: is there any documentation about the FreeSpace architecture, like a newbie guide to hack/contribute to FreeSpace?  Depending how hooked I end up, I may want to contribute back (probably chasing some bugs).

Thanks a lot for your help!  Now, if you excuse me, I have some missions to play :-)

Title: Re: Newbie: compiling with Xcode 6 on Yosemite
Post by: Echelon9 on May 11, 2015, 07:09:37 am
In the most literal sense, we have some pre-selected 'Newbie Projects (http://www.hard-light.net/wiki/index.php/Newbie_Projects)' to start contributing to the source code.

There's also a larger section on the Freespace 2 Wiki here (http://www.hard-light.net/wiki/index.php/Development_Reference), plus the stickied threads on these forums.

We can also point you in the right direction or assist on our IRC channel.
Title: Re: Newbie: compiling with Xcode 6 on Yosemite
Post by: pnwkayaker on May 13, 2015, 12:23:49 pm
Thanks for the Wiki link, will start reading the documentation there