Quantcast
Channel: Mac OS X - Community | MonoGame
Viewing all 207 articles
Browse latest View live

Notarizing 3.8 Monogame Apps

$
0
0

Hi,

Has anyone successfully notarized an MacOS app built with MG3.8 using dotnet publish for distribution.

I need to do this and could do with some pointers. Documentation is pretty complicated and continually refers to XCode which obviously I am not using to build.

cheers

1 post - 1 participant

Read full topic


Simple python script to make application bundle for maOS

$
0
0

Hi guys,

I’m working on a simple python script to help people to build monogame projects into macOS application bundle.

The script is on my github if anyone wants to check.

I will be happy to help and improve this with new features.

if anyone is interested

1 post - 1 participant

Read full topic

Monogame V3.8 For Macintosh 3D Files Do Not Work

$
0
0

Hi. I’ve been using Monogame 3.8 for Macintosh for 2D stuff without any problems. However, when used for 3D stuff, the build always fails. Some of the files that cause build failure are .fx, .fbx and .3ds files. It gives the error below for .fbx files. I’ve verified that the files are in the referenced location. Even running the Whitaker 3D tutorial verbatim without any modifications is not working on my Mac. Does the current version of Monogame for Macintosh work for 3D stuff or is that something that will be implemented later? Please note that my Mac has an M-1 chip and is running Big Sur 11.2.3.

/Users/davidlent/Projects/Whitaker3DTutorial/Whitaker3DTutorial/Content/LargeAsteroid.fbx: Error: The source file ‘/Users/davidlent/Projects/Whitaker3DTutorial/Whitaker3DTutorial/Content/*0’ does not exist! (Whitaker3DTutorial)
/Users/davidlent/.nuget/packages/monogame.content.builder.task/3.8.0.1641/build/MonoGame.Content.Builder.Task.targets(5,5): Error MSB3073: The command “dotnet /Users/davidlent/.nuget/packages/monogame.content.builder.task/3.8.0.1641/build/…/tools/netcoreapp3.1/any/mgcb.dll /quiet /@:”/Users/davidlent/Projects/Whitaker3DTutorial/Whitaker3DTutorial/Content/Content.mgcb" /platform:DesktopGL /outputDir:"/Users/davidlent/Projects/Whitaker3DTutorial/Whitaker3DTutorial/Content/bin/DesktopGL/Content" /intermediateDir:"/Users/davidlent/Projects/Whitaker3DTutorial/Whitaker3DTutorial/Content/obj/DesktopGL/Content" /workingDir:"/Users/davidlent/Projects/Whitaker3DTutorial/Whitaker3DTutorial/Content/"" exited with code 1. (MSB3073) (Whitaker3DTutorial)

1 post - 1 participant

Read full topic

Incompatible framework (.Net 4.7.1) when referencing nez

$
0
0

Hello,

I am new to Monogame and I wanted to try and learn game development using this framework. However, when setting up nez, I run into an issue that seems to have a problem with the targeted version of .NET (4.7.1). Can’t find a fix either…any help would be really appreciated!

1 post - 1 participant

Read full topic

MacOS - Compile to .exe

$
0
0

Hello. I would like to send my game to my friend, FindyKindly (sub to him on YouTube), but the problem is he doesn’t want to download Visual Studio to compile it himself, which I can understand, but how would I compile my game to a .exe file? I know it is possible, because I play Terraria which was made using XNA, and they DID compile it to a .exe. So, how would I do this?

5 posts - 4 participants

Read full topic

Visual Studio For Mac Workaround For When Git Won't Let You Add a File

$
0
0

If you’re using subdirectories inside subdirectories with Visual Studio for Mac you may come across a situation where GIT won’t let you check the files in. There is a simple workaround though, see the following video: https://youtu.be/eaf0K0D2L3g

2 posts - 2 participants

Read full topic

On Mac I'm getting a bad data storage path only if my game is downloaded from the internet

$
0
0

Hi this is a weird one. The strategy I’ve used for storing save data works in all situations except in the one case where you try to play the game after downloading it from the internet on Mac.

In troubleshooting this I’ve made a simple MonoGame app that just saves/loads a .txt file.

Exporting from Windows for Mac, it works just fine if I transfer the application via a USB stick. We can see the path it’s saving to is relevant to the location of the application on my USB stick called “Ferry”

However if I download this very same application via the internet, it does not work. You can see in the image that the Data Path is not relevant to the .app file. No matter where I put it, it’s this weird private path that I can’t write files to.

I’ve been troubleshooting this quite a bit, and I’m happy I at least know this much. But I have no idea how to properly work around this.

Below is my basic strategy for saving and loading data. Perhaps this is just an issue of using a different strategy that works on all platforms? I’ve tried a few different things, but none of them seem to work.

public static class Storage
{
    // For testing I'm just trying to save and load a number, 
    // normally this would be JSON or something.
    public static SaveData int = 1;
     
    // Get BasePath based on Platform
    public static string BasePath()
    {
        string root = AppDomain.CurrentDomain.BaseDirectory;
        string result = "";

        if (MyGame.Platform == PlatformType.Windows)
        {
            result = $"{root}Content";
        }
        else if (MyGame.Platform == PlatformType.Linux)
        {
            result = $"{root}Content";
        }
        else if (MyGame.Platform == PlatformType.Mac)
        {
            result = $"{root}../Resources/Content";
        }
        else
        {
            result = "";
        }

        return result.Replace("\\", "/");
    }

    public static void Save()
    {
        MyGame.Log("Saving");

        if (!Directory.Exists($"{BasePath()}/Storage"))
        {
            Directory.CreateDirectory($"{BasePath()}/Storage");
        }
        string path = $"{$"{BasePath()}/Storage"}/savedata.txt";
        File.WriteAllText(path, SaveData.ToString());
    }

    public static void Load()
    {
        MyGame.Log("Loading");

        string path = $"{BasePath()}/Storage/savedata.txt";
        if (File.Exists(path))
        {
            string data = File.ReadAllText(path);

            if (!String.IsNullOrWhiteSpace(data))
            {
                SaveData = Int32.Parse(data);
            }
        }
    }
}

Thanks!

2 posts - 1 participant

Read full topic

Why Does My Standalone Mac Export Suddenly Require a Newer MacOs Version?

$
0
0

I’m trying to test a Mac export of my game on a Macbook Air that is running MacOs 10.15 Catalina. It worked fine last month, but now I get a prompt saying something along the lines of “You need MacOs 11.X or higher to run”. The laptop is a little old and I’d like to avoid upgrading the OS.

I have no idea what I could’ve changed that would have made it so I need a higher MacOs version to run my game. Does anyone know what could’ve caused this?

Thanks!

2 posts - 1 participant

Read full topic


Mac Publish Failed as it Creates folder with ** as the name.

$
0
0

The game Runs fine in visual studio 2019 mac, however when packaging “dotnot publish -r osx-x64” it creates a top level folder with the name ** here is a picture.!

Screenshot 2022-01-01 at 12.09.39

It crashes because it tries to search paths using these ** for instance it tried to grab a *.mgcb. Even if you copy it over manual and rename the file, it expected every single content to now follow a ** naming convention. its very odd.

Any ideas about how to resolve this would be greatly appreciated.

Edit: It seems that it tries not to overwrite existing foldrs and instead creates ** folders. The existing builds/nugets it works fine. But id have to delete it both ways everytime.

2 posts - 2 participants

Read full topic

Apple silicon goodness

$
0
0

Just wanted to say that I compiled and ran monogame natively on the M1 chip with dotnet 6.0.

There might be issues I dont know of and it seems the monogame content has to be compiled with rosetta… I just compiled SDL with xcode, popped the .dylib in the runtimes folder and before I knew it there was some sweet apple sillicon cornflower blue :heart_eyes: Made me happy thats all:)

1 post - 1 participant

Read full topic

MGCB doesn´t work correctly from within Visual Studio

$
0
0

Hi there,

when I try to launch a project from within Visual studio it tells me that it crashed with code 4. If I paste the command from Visual Studio to a terminal it executes without an error.
And if I try to open MGCB-Editor it crashes from within Visual Studio and from Terminal as well.
I´ve tried to install it manually via terminal and it doesn´t give any errors during installation but when I try to open the editor it crashes.
I´m using Visual Studio for Mac (Community) version 8.10.19 (build 2).
Was anybody able to open MGCB-Editor or launch a project with assets that are processed by MGCB successful lately?

Thank you,

Harry

1 post - 1 participant

Read full topic

MacOS compatibility across different versions

$
0
0

I am a total amateur when it comes to working on MacOS. I made some efforts to gain some knowledge and was able to port my MonoGame game project to mac by working on the Monterey OS (latest) on a MacBook Air 2017 and so far so good.

However, I had someone that also has a Mac try the game out and he can’t open it. He has Big Sur, the previous version of MacOS. He says that when he tries to open the same file I open that launches the game, the OS simply tries to open thet file with a text editor.


this screenshot is from my machine showing the file in question

So, my next efforts were concentrated on installing Big Sur on a stick and boot from that. Unfortunately, I was unsuccessful with Big Sur and Catalina. After the first restart, the boot takes forever and not really going anywhere.

I was able to make a perfectly functional boot USB with High Sierra, but I cannot guarantee that debugging and fixing the problem on that one will ensure it will work on all versions up from that.

So, basically I have these questions:

1. Am I doing it wrong? Do I have to publish my game differently? I currently use this:
dotnet publish -c Release -r osx-x64 /p:PublishReadyToRun=false /p:TieredCompilation=false --self-contained
… and when I start the game from the file in the screenshot, it launches a console first, so maybe I should do it differently?

2. If I make it work on High Sierra, am I guaranteed the game will work on all other versions newer than High Sierra?

4 posts - 3 participants

Read full topic

Textbox in Xamarin.Mac

$
0
0

Hi there again,

I´m trying to open a textfield with an ok-button to let players enter text (i.E. for a highscore name). I´ve tried to import AppKit but that doesn´t seem to be available.
On Android I´m using AlertDialog and on iOS UIAlertView for that purpose and on Mac (with Xcode and ObjectiveC) I used NSAlert which doesn´t seem to be available in Xamarin.MAC.

Thank you,

Harry

1 post - 1 participant

Read full topic

MacOS templates doesn´t use Xamarin.Mac Modern anymore

$
0
0

Hi there,

a few years ago a project that was created with the standard-template of monogame for MacOS used Xamarin.Mac modern which also included support of appkit or other stuff:


If I create a new monogame project with the newest templates it just uses .Net 3.1 or .Net 5:

As I would like to use NuGet-Packages like “InappBilling.plugin” to include InAppBilling I would need support for the Xamarin.Mac as it doesn´t work with .net 3.1 or .Net 5.
I´ve tried to edit the csproj.-file to add Xamarin.Mac but wasn´t successful. I´ve also tried to run an older project of mine where monogame was still using Xamarin.Mac but wasn´t able to run it as I´ve copied it from an old Backup and some of the directories on the machine don´t seem to exist anymore. I was able to alter a spritekit-project to run Monogame but encountered other problems (like two windows that open up) and hoped that there is an easier solution for this.
Did anybody else come across that issue and found a solution for this?

Thank you,

Harry

1 post - 1 participant

Read full topic

Compile & Run Native M1 MonoGame Applications

$
0
0

Hi there! This is my first time posting on the forums and wanted to share some advice on how to run and compile MonoGame projects on M1 as there is not a lot of information out there about MonoGame and Apple’s M1.

  1. To begin, you are going to want to remove the following NuGet packages from your project:
    MonoGame.Content.Builder.Task,
    MonoGame.Framework.DesktopGL, and
    MonoGame.Framework.Content.Pipeline.

  2. Then, you will want to make sure you have the Arm64 version of .NET 6 installed on your Mac, you can download it from Microsoft’s website.

  3. Once installed, create a folder anywhere on your Mac and open a new terminal and set the directory to the created folder, and run the following commands:
    git clone https://github.com/MonoGame/MonoGame.git
    git submodule update --init

  4. Once you have cloned the MonoGame project, open each solution pertaining to the removed NuGet packages from earlier(ex: MonoGame.Framework.DesktopGL) and do the following for each:

    • Make sure to change the .NET target to .NET 6 only (make sure no other targets are set).

      • Note: It is okay to see IDE errors, the projects should still build just fine.
    • Then, run the following command for each project: dotnet publish -c Release -r osx-arm64

    • After all projects have successfully been built, continue to the next step.

  5. Now, find each of the framework’s DLLs and reference them in your project. These DLLs can be found in the root folder of the MonoGame clone in the Artifacts folder(go into the Release folder for each project and find the single DLL, ex: MonoGame.Framework.dll).

  6. Now, in order to actually be able to run the ARM compiled version you need to make sure you have SDL2 and OpenAL-Soft frameworks installed on your Mac. Note: It must be compiled and installed manually on your Mac in order to work! You can follow the instructions below:

    SDL Installation Instructions:
    You will first need to clone the repository found at this link: https://github.com/libsdl-org/SDL

    Then, after cloning open a terminal in the directory and run the following commands:
    mkdir build,
    cd build,
    ../configure,
    make, and finally,
    sudo make install

    SDL should now be installed on your computer, continue to OpenAL instructions below.

    OpenAL-Soft Installation Instructions
    Just like earlier you are going to want to clone the OpenAL-Soft github repository found at: https://github.com/kcat/openal-soft

    Once cloned, open a terminal in the directory and cd into the build folder. Then, follow these commands:
    cmake ..
    make
    sudo make install

    Now OpenAL-Soft should be correctly set up as well!

Testing Time!
Now, if all goes to plan your project should successfully compile and run on M1! You can confirm that your application is running in arm by opening Process Monitor and looking for the Kind category, where it should read Apple. If it does, you can give yourself a pat on the back because you are all set and ready to go!

Really hope this helps out other fellow M1 users since this has been annoying me for a while as I could not find any information on it online, I wanted to be able to let others know what worked for me.

2 posts - 2 participants

Read full topic


Searching for Monogame Developer for Help with little 2D game project

$
0
0

Hello, im searching for a Ghostwriter for my 2d game. We are a group of 6 people and each of us have little tasks for example my task today is creating the textbuttons and making it prettier by adding content.

1 post - 1 participant

Read full topic

Cannot launch the game

$
0
0

Using Monogame 3.8.1.2155-develop.

Launching the game always fails with the Failed to load library: libSDL2-2.0.0.dylib error which seems to come from not finding the dylib file. In a fit of desperation I’ve copied the lib at every single searched location and it still fails. It’s been a week and I’ve ran out of ideas.

Terra v0.1
        Platform:       Unix 12.3.1 64-bit (via DesktopGL)
        Process:        /usr/local/share/dotnet/dotnet (12056) 64-bit
        Graphics:       OpenGL

        Directory:      /Users/lancelot/Developer/Game/Terra/Client/bin/Debug/net6.0
        Assemblies:     /Users/lancelot/Developer/Game/Terra/Client/bin/Debug/net6.0

System.TypeInitializationException: The type initializer for 'Sdl' threw an exception.
 ---> System.Exception: Failed to load library: libSDL2-2.0.0.dylib
   at MonoGame.Framework.Utilities.FuncLoader.LoadLibraryExt(String libname)
   at Sdl..cctor()
   --- End of inner exception stack trace ---
   at Microsoft.Xna.Framework.SdlGamePlatform..ctor(Game game)
   at Microsoft.Xna.Framework.Game..ctor()
   at Terra.TerraGame..ctor() in /Users/lancelot/Developer/Game/Terra/Client/Terra.cs:line 22
   at Terra.Program.Main() in /Users/lancelot/Developer/Game/Terra/Client/Program.cs:line 29

2 posts - 2 participants

Read full topic

Filepicker on Mac OS X M1

$
0
0

I just got a Macbook Air M1 and I am trying to convert my game/editor to Mac OSX. One problem I have is that I can not use Windows.Forms OpenFileDialog/SaveFileDialog.

What would be the easiest way to get the path to a specific file for my Monogame Application?

1 post - 1 participant

Read full topic

MGFXC 8.3.1 / Wine

$
0
0

Hey Folks,

Since 8.3.1 I have had no luck getting MGFXC to work with Wine on MacOS (x64).

The steps I’m taking:
Install .NET 6 SDK & Runtimes
Install MGFXC Dotnet tool
Install Wine64 & update to 6.0
Run mgfxc_wine_setup.sh helper script

mgfxc test.fx test.fx.out /Profile:OpenGL

Compilation has never succeeded but have seen it fail in various different ways:
Exits silently, doesn’t compile (most common)
Wine fails to find c:/windows/system32/dotnet.exe (it’s there, I’ve checked!)

I believe this approach worked well using 8.3 (but shaders compiled on 8.3 are not compatible with 8.3.1).

I’ve also failed with similar results on Ubuntu x64 and ARM64. The only success I’ve had was from using Windows (Bootcamped on Mac x64), which suggests the issue lies in compatibility with Wine.

Has anyone had any luck using 8.3.1 version MGFXC with Wine?

Thanks!

2 posts - 2 participants

Read full topic

How Can I Fixed this problems?

$
0
0

Mac OS
Visual Studio Code 2019

dotnet Version 6.0.302
else
dotnet-tools version 3.8.1.303

1 post - 1 participant

Read full topic

Viewing all 207 articles
Browse latest View live