FreeSO on Mac

Zach

New Member
Are there any updates on playing FreeSO on Mac? I've been busy all day trying to make it work using wine just to read a forum thread saying that doesn't work.
 
Hi,

Currently I'm digging into the problem. FreeSO technically works on Mac with mono64.

Running the game as few issues that we need to focus on:
  • Exiting the game make it not responding even if the game window disappear. High CPU usage can occur at this point. Process has to be killed by the user.
  • You need to launch the game using a terminal
  • High CPU usage on an old 2008 Mac (futher testing needed on modern Mac before jumping into any conclusion)
  • Manual install
Building the game as more issues:
  • Need to have a Mac: we need to figure out how to build for Mac from another OS
  • Strange behavior with DLL remapping but non-blocking
  • Need to find a userfriendly way to launch the build

As a proof/teaser here is a screenshot:
FreeSO_on_mac.jpg
 
Last edited:
High CPU usage is to be expected - the UI could use some optimization, there are lots of draw groups for the renderer regenerated on demand, and there are so many objects on that lot that it gets a bit intensive simulating them all (will also be improved in future). Specifically, this lot is hard to run in general, since it has like double our future object limit. You might be able to improve performance using walls down instead of cutaway.
 
If figured out that FreeSO is missing some plateform specific code for Mac OS X.
Seems like it will improve and fix a lot of side effects/unexpected behavior.

I wish I figured out earlier. But you know, I kinda out-dated on C# programming.

EDIT: PlatformID.MacOSX won't work with Mono. This is one of our problems.
 
Last edited:
Hmm, I thought that was made for Mono. I'll need to look into it when I have time.
 
I found out this time.

I haven't spotted the MonoGame/MacOS folder shipped with the FSO source code. This includes a MonoGame framework based on MonoMac (now sort of deprecated).
It's now easier to use Xamarin.Mac instead of MonoMac, plus both are incompatible, you can't mix them.

Replacing the old MonoGame by a fresh Xamarin.Mac based version and by adding a new mac projet into the solution you can make a Kickstater program for Mac like:

Code:
#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;

using AppKit;
using Foundation;
using FSO.Client;
using static FSO.Client.Program;
#endregion

namespace FSO.Client
{
    static class OSXKickstart
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            NSApplication.Init(); //Init Mac stuff

            Program.Main(args); //Then launch FreeSO
        }
    }
}

Having a "kickstater" program would make the FreeSO code free of Mac stuff including packaging and others.

Now we get FreeSO able to launch on Mac like any other app.

Well... except a crash that maybe not Mac related.
Code:
MacBook:Release poogly$ ./FSO.Client.Mac.app/Contents/MacOS/FSO.Client.Mac
False
2016-12-17 14:47:41.126 FSO.Client.Mac[3654:159984] warning: exception inside UnhandledException handler: Object reference not set to an instance of an object
[ERROR] FATAL UNHANDLED EXCEPTION: Microsoft.Xna.Framework.Graphics.MonoGameGLException: GL.GetError() returned InvalidFramebufferOperationExt
  at Microsoft.Xna.Framework.Graphics.GraphicsExtensions.CheckGLError () [0x0002a] in /Users/poogly/Projects/FreeSO-master/Other/libs/FSOMonoGame/MonoGame.Framework/Graphics/GraphicsExtensions.cs:906
  at Microsoft.Xna.Framework.Graphics.GraphicsDevice.PlatformClear (Microsoft.Xna.Framework.Graphics.ClearOptions options, Microsoft.Xna.Framework.Vector4 color, System.Single depth, System.Int32 stencil) [0x0010a] in /Users/poogly/Projects/FreeSO-master/Other/libs/FSOMonoGame/MonoGame.Framework/Graphics/GraphicsDevice.OpenGL.cs:376
  at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Clear (Microsoft.Xna.Framework.Color color) [0x00020] in /Users/poogly/Projects/FreeSO-master/Other/libs/FSOMonoGame/MonoGame.Framework/Graphics/GraphicsDevice.cs:439
  at Microsoft.Xna.Framework.Graphics.GraphicsDevice.ApplyRenderTargets (Microsoft.Xna.Framework.Graphics.RenderTargetBinding[] renderTargets) [0x000c1] in /Users/poogly/Projects/FreeSO-master/Other/libs/FSOMonoGame/MonoGame.Framework/Graphics/GraphicsDevice.cs:787
  at Microsoft.Xna.Framework.Graphics.GraphicsDevice.Initialize () [0x000ca] in /Users/poogly/Projects/FreeSO-master/Other/libs/FSOMonoGame/MonoGame.Framework/Graphics/GraphicsDevice.cs:299
  at Microsoft.Xna.Framework.Graphics.GraphicsDevice..ctor (Microsoft.Xna.Framework.Graphics.GraphicsAdapter adapter, Microsoft.Xna.Framework.Graphics.GraphicsProfile graphicsProfile, Microsoft.Xna.Framework.Graphics.PresentationParameters presentationParameters) [0x0013c] in /Users/poogly/Projects/FreeSO-master/Other/libs/FSOMonoGame/MonoGame.Framework/Graphics/GraphicsDevice.cs:211
  at Microsoft.Xna.Framework.GraphicsDeviceManager.Initialize () [0x00089] in /Users/poogly/Projects/FreeSO-master/Other/libs/FSOMonoGame/MonoGame.Framework/GraphicsDeviceManager.Legacy.cs:393
  at Microsoft.Xna.Framework.GraphicsDeviceManager.CreateDevice () [0x00002] in /Users/poogly/Projects/FreeSO-master/Other/libs/FSOMonoGame/MonoGame.Framework/GraphicsDeviceManager.Legacy.cs:84
  at Microsoft.Xna.Framework.GamePlatform.BeforeInitialize () [0x0003a] in /Users/poogly/Projects/FreeSO-master/Other/libs/FSOMonoGame/MonoGame.Framework/GamePlatform.cs:144
  at Microsoft.Xna.Framework.Game.DoInitialize () [0x0000d] in /Users/poogly/Projects/FreeSO-master/Other/libs/FSOMonoGame/MonoGame.Framework/Game.cs:680
  at Microsoft.Xna.Framework.Game.Run (Microsoft.Xna.Framework.GameRunBehavior runBehavior) [0x0003b] in /Users/poogly/Projects/FreeSO-master/Other/libs/FSOMonoGame/MonoGame.Framework/Game.cs:384
  at Microsoft.Xna.Framework.Game.Run () [0x0000d] in /Users/poogly/Projects/FreeSO-master/Other/libs/FSOMonoGame/MonoGame.Framework/Game.cs:370
  at FSO.Client.GameStartProxy.Start (System.Boolean useDX) [0x00012] in <426405eb6cf94e63b5788599132990c0>:0
  at FSO.Client.Program.Main (System.String[] args) [0x00010] in <426405eb6cf94e63b5788599132990c0>:0
  at FSO.Client.OSXKickstart.Main (System.String[] args) [0x00005] in <7de7b226884845efb0077f14864d711d>:0

EDIT See: https://github.com/MonoGame/MonoGame/pull/4286
EDIT2: Launching without errors. But exiting after loading data. No window opened.
EDIT3: Running, make sure TSOGame run with Synchronous GameRunBehavior.
EDIT4: Exit crash fixed! Lower CPU load. Keyboard input bug: backspace won't work.
 
Last edited:
I can't contribute at all but this progress is looking mighty fine!
I can't wait to play Freeso in bed on my macbook :D
 
Mac build v0.1-preview

This is NOT an official build. No warranty. No official support. Use at your own risk.
Please make sure your game data is in your Documents folder and that you have patched the packingslips. (ex: /Users/<your name>/Documents/The Sims Online/TSOClient/...)

Feedback needed!
If you encounter a problem please make sure to post your configuration (Mac model, OS X version).

Known bugs:
- Backspace doesn't work
 
How'd you get the mono bundle working? Any way to self modify dlls within a .app bundle or does macos not let you do that?
 
The mono bundle was generated by Xamarin using a MonoGame template. Self modification does not work.
This bundle is a temporary solution. Need to work on a launcher/updater.
 
Works surprisingly well! Great job so far @Poogly, it's actually quite stable heh :D
5c4bc1365e284eab9449ab95794395ad.png
 
Works fine (minus the backspace key as already stated), Where do I store recover blueprints I tried: ~/Documents/The Sims Online/TSOClient/housedata/blueprints/

Ok for some reason it stores data there but won't read copied data there including if i overwrite for example house_00.xml. I changed permissions chmod to test even.
 
Last edited:
Blueprints can also be loaded from /Content/Blueprints/, if you're willing to copy any changed blueprints there. It really should be saving here too.
 
Currently /Content/Blueprints are in the app package under Contents/Resources. This will be resolved when a proper Mac launcher will be done.
For the backspace bug I'm looking into it.
 
I don't think so. It's actually playable but not perfect.
I'm still working on the installer/launcher. But you should keep in mind this is not an official build so every update released will have some delay before having a Mac version.

Main problem is that Rhys has a lot to deal with before working on Mac version.
But stay tuned!
 
Back
Top