You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Note we are making use of the `PublishAot` option. Using `Aot` has some restrictions which may require changes to your game code. Especially if you are using Reflection.
19
+
> We are making use of the `PublishAot` option. Using `Aot` has some restrictions which may require changes to your game code. Especially if you are using Reflection.
20
20
21
21
You can then zip the content of the publish folder and distribute the archive as-is.
22
22
@@ -34,7 +34,7 @@ YourGame.app (this is your root folder)
34
34
- YourGame.icns (this is your app icon, in ICNS format)
35
35
- MacOS
36
36
- YourGame (the main executable for your game)
37
-
- Info.plist (the metadata of your app, see bellow for contents)
37
+
- Info.plist (the metadata of your app, see below for contents)
> Note we are making use of the `PublishAot` option. Using `Aot` has some restrictions which may require changes to your game code. Especially if you are using Reflection.
55
+
> We are making use of the `PublishAot` option. Using `Aot` has some restrictions which may require changes to your game code. Especially if you are using Reflection.
56
56
57
-
Next we need to comibne the two binaries into one Universal Binary which will work on both arm64 and x64 machines.
57
+
Next we need to combine the two binaries into one Universal Binary which will work on both arm64 and x64 machines.
The above command will combine the two output executables into one.
64
+
The above command will combine the two output executables into one. It assumes you are using the standard `Output` path for your application.
65
+
If you are using a custom `Output` folder, you will need to make adjustments to the above command.
65
66
66
67
Copy over your content
67
68
@@ -116,8 +117,8 @@ The `Info.plist` file is a standard macOS file containing metadata about your ga
116
117
117
118
For more information about Info.plist files, see the [documentation](https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Introduction/Introduction.html).
118
119
119
-
After completing these steps, your .app folder should appear as an executable application on macOS.
120
-
However it does need an icon. So we need to create an `.icns` file. We can use online tools to do this or you can use the following
120
+
After completing these steps, your `.app` folder should appear as an executable application on macOS.
121
+
However it does need an icon. So we need to create an `.icns` file. We can use online tools to do this or you can use the following:
Note this code is expecting an `Icon.png` file to be in the same directory. This file should be `1024` x `1024` pixels.
138
+
> [!NOTE]
139
+
> This code is expecting an `Icon.png` file to be in the same directory. This file should be `1024` x `1024` pixels.
138
140
139
-
For archiving, we recommend using the .tar.gz format to preserve the execution permissions (you will likely run into permission issues if you use .zip at any point).
141
+
For archiving, we recommend using the `.tar.gz` format to preserve the execution permissions (you will likely run into permission issues if you use `.zip` at any point).
> Note we are making use of the `PublishAot` option. Using `Aot` has some restrictions which may require changes to your game code. Especially if you are using Reflection.
150
+
> We are making use of the `PublishAot` option. Using `Aot` has some restrictions which may require changes to your game code. Especially if you are using Reflection.
149
151
150
152
You can then archive the content of the publish folder and distribute the archive as-is.
151
153
152
-
We recommend using the .tar.gz archiving format to preserve the execution permissions.
154
+
We recommend using the `.tar.gz` archiving format to preserve the execution permissions.
153
155
154
156
---
155
157
@@ -160,7 +162,7 @@ We recommend using the .tar.gz archiving format to preserve the execution permis
160
162
### PublishAot
161
163
162
164
This option optimises your game code "Ahead of Time". It allows you to ship your game without the need to JIT (Just In Time compile).
163
-
However you do need to currently add some additional settings to your .csproj.
165
+
However, you do need to currently add some additional settings to your `.csproj`.
164
166
165
167
```
166
168
<ItemGroup>
@@ -169,37 +171,37 @@ However you do need to currently add some additional settings to your .csproj.
169
171
</ItemGroup>
170
172
```
171
173
172
-
The `TrimmerRootAssembly` stops the trimmer removing code from these assemblies. This will on the whole allow the game to run without
174
+
The `TrimmerRootAssembly` stops the trimmer removing code from these assemblies. This should allow the game to run without
173
175
any issues. However if you are using any Third Party or additional assemblies, you might need to add them to this list or fix your code to be `Aot` compliant.
174
176
It is recommended that you publish using AOT as it simplifies the app bundle.
175
177
176
178
See [Trim self-contained deployments and executables](https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trim-self-contained) for more information.
177
179
178
-
There are some known area's you need to watchout for.
180
+
There are some known areas you need to watchout for:
179
181
180
182
1. Using `XmlSerializer` in your game will probably cause issues. Since it uses reflection it will be difficult for the Trimmer to figure out what needs to be kept.
181
-
It is recommended that instead of using the `Deserialize` method, you write your own custom deserializer using `XDocument` or `XmlReader`.
183
+
It is recommended that, instead of using the `Deserialize` method, you write your own custom deserializer using `XDocument` or `XmlReader`.
182
184
Alternatively you can use the Content Pipeline and create a custom `Processor` and `Reader` to convert the Xml into a binary format that can be loaded via the usual `Content.Load<T>` method.
183
185
2. Dynamically loading assemblies via `Assembly.LoadFile`.
184
186
3. No run-time code generation, for example, System.Reflection.Emit.
185
187
186
188
### ReadyToRun (R2R)
187
189
188
-
[ReadyToRun](https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-3-0#readytorun-images) is advertised as improving application startup time, but slightly increasing binary size. We recommend not using it for games, because it produces micro stutters when your game is running.
190
+
[ReadyToRun](https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-3-0#readytorun-images) is advertised as improving application startup time, but slightly increasing binary size. We recommend not using it for games because it produces micro stutters when your game is running.
189
191
190
-
Ready2Run code is of low quality and makes the Just-In-Time compiler (JIT) to trigger regularly to promote the code to a higher quality. Whenever the JIT runs, it produces potentially very visible stutters.
192
+
ReadyToRun code is of low quality and makes the Just-In-Time compiler (JIT) trigger regularly to promote the code to a higher quality. Whenever the JIT runs, it produces potentially very visible stutters.
191
193
192
194
Disabling ReadyToRun solves this issue (at the cost of a slightly longer startup time, but typically very negligible).
193
195
194
-
ReadyToRun is disabled by default. You can configure it by setting the `PublishReadyToRun` property in your csproj file.
196
+
ReadyToRun is disabled by default. You can configure it by setting the `PublishReadyToRun` property in your `.csproj` file.
195
197
196
198
MonoGame templates for .NET projects explicitly set this to `false`.
197
199
198
200
### Tiered compilation
199
201
200
202
[Tiered compilation](https://docs.microsoft.com/en-us/dotnet/core/whats-new/dotnet-core-3-0#tiered-compilation) is a companion system to ReadyToRun and works on the same principle to enhance startup time. We suggest disabling it to avoid any stutter while your game is running.
201
203
202
-
Tiered compilation is **enabled by default**. To disable it set the `TieredCompilation` property to `false` in your csproj.
204
+
Tiered compilation is **enabled by default**. To disable it, set the `TieredCompilation` property to `false` in your `.csproj`.
203
205
MonoGame templates for .NET projects explicitly set this to `false`.
0 commit comments