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
Copy file name to clipboardExpand all lines: articles/getting_started/1_setting_up_your_development_environment_windows.md
+7-11
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,8 @@
1
1
---
2
2
title: Setting up your development environment for Windows
3
-
description: A step-by-step guide for setting up your development environment on Windows.
3
+
description: This section provides a step-by-step guide for setting up your development environment on Windows.
4
4
---
5
5
6
-
# Setting up your development environment for Windows
7
-
8
-
This section provides a step-by-step guide for setting up your development environment on Windows.
9
-
10
6
MonoGame can work with most .NET compatible tools, but we recommend [Visual Studio 2022](https://visualstudio.microsoft.com/vs/)
11
7
12
8
Alternatively, you can use [JetBrains Rider](https://www.jetbrains.com/rider/) or [Visual Studio Code](https://code.visualstudio.com/).
@@ -37,31 +33,31 @@ To create new MonoGame projects from within Visual Studio 2022, you will need to
37
33
1. Launch Visual Studio 2022
38
34
2. Select **Continue without code**. This will launch Visual Studio without any project or solution opened.
39
35
40
-

36
+

41
37
42
38
3. Click "*Extensions -> Manage Extensions* in the Visual Studio 2022 menu bar. This will open the Manage Extensions dialog window.
43
39
44
-

40
+

45
41
46
42
4. Use the search box in the top-right corner of the Manage Extensions dialog window to search for **MonoGame**, then click the **MonoGame Framework C# project templates** extension as shown below and download it to install it.
47
43
48
-

44
+

49
45
50
46
5. After it is downloaded, an alert will appear at the bottom of the Manage Extensions window that states "Your changes will be scheduled. The modifications will begin when all Microsoft Visual Studio windows are closed." Click the **Close** button, then close Visual Studio 2022.
51
47
52
48
6. After closing Visual Studio 2022, a VSIX Installer window will open confirming that you want to install the **MonoGame Framework C# project templates** extension. Click the **Modify** button to accept the install.
You now have the MonoGame templates installed and are ready to create new projects.
57
53
58
54
**Next up:**[Creating a new project](2_creating_a_new_project_vs.md)
59
55
60
56
## [Alternative] Install the .NET 6 SDK (compatible with JetBrains Rider and Visual Studio Code)
61
57
62
-
If you prefer to use JetBrains Rider or Visual Studio Code, and after installing either of them, you will also need to [install the .NET 6 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/6.0).
58
+
If you prefer to use JetBrains Rider or Visual Studio Code, and after installing either of them, you will also need to [install the .NET 8 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0).
63
59
64
-
Once the .NET 6 SDK is installed, you can open a Command Prompt and install the MonoGame templates by typing the following command:
60
+
Once the .NET 8 SDK is installed, you can open a Command Prompt and install the MonoGame templates by typing the following command:
Copy file name to clipboardExpand all lines: articles/getting_started/2_creating_a_new_project_netcore.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
---
2
-
title: Creating a new project
2
+
title: .NET CLI (JetBrains Rider or Visual Studio Code)
3
3
description: A step-by-step guide for creating a new project using JetBrains Rider or Visual Studio Code.
4
4
---
5
5
6
-
# .NET CLI (JetBrains Rider or Visual Studio Code)
7
-
8
6
This guide will walk you through building a starter game with MonoGame using only the command line/terminal on your operating system and a lightweight coding tool of your choice (such as [Visual Studio Code](https://code.visualstudio.com/) or [JetBrains Rider](https://www.jetbrains.com/rider/)).
9
7
10
-
> It is assumed that you have already properly installed the .NET 6 SDK and MonoGame.
8
+
> [!NOTE]
9
+
> It is assumed that you have already properly installed the .NET 8 SDK and MonoGame.
11
10
11
+
> [!IMPORTANT]
12
12
> Be aware that for iOS/iPadOS and Android, development might be limited when using the .NET CLI. Many of the development features for those targets are exclusive to Visual Studio 2022.
13
13
14
14
## Create a MonoGame Project
@@ -23,13 +23,13 @@ You can now create new MonoGame projects. To do that:
23
23
24
24
For example:
25
25
26
-
```
26
+
```cli
27
27
dotnet new mgdesktopgl -o MyGame
28
28
```
29
29
30
30
> To know which platform identifier (short name) to use for your project, please refer to [Target Platforms](./platforms.md), or type the following command into the command prompt to list the installed templates and their corresponding short names:
Copy file name to clipboardExpand all lines: articles/getting_started/index.md
+1-5
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,8 @@
1
1
---
2
2
title: Getting Started
3
-
description: Get started creating games with MonoGame.
3
+
description: This section walks you through the basics of MonoGame, and helps you to create your first game.
4
4
---
5
5
6
-
# Getting Started
7
-
8
-
This section walks you through the basics of MonoGame, and helps you to create your first game.
9
-
10
6
First, select the operating system and toolset you will be working with to create your first MonoGame project, then continue reading to understand the basic layout of a MonoGame project.
11
7
12
8
By the end of this tutorial set, you will have a working project to build for your target platform and will be ready to tackle your next steps.
Copy file name to clipboardExpand all lines: articles/getting_started/packaging_games.md
+4-7
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,6 @@ title: Package games for distribution
3
3
description: How to package your game for distribution.
4
4
---
5
5
6
-
# Package games for distribution
7
-
8
-
Once your game is ready to be published, it is recommended that you package it properly for consumption by players.
9
-
10
6
## Desktop games
11
7
12
8
To publish desktop games, it is recommended that you build your project as a [self-contained](https://docs.microsoft.com/en-us/dotnet/core/deploying/#publish-self-contained) .NET application. As such, your game will require absolutely no external dependencies and should run out-of-the-box as-is.
@@ -35,14 +31,14 @@ We recommend using the .tar.gz archiving format to preserve the execution permis
We recommend that you distribute your game as an [application bundle](https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFBundles/BundleTypes/BundleTypes.html). Application bundles are directories with the following file structure:
44
40
45
-
```
41
+
```text
46
42
YourGame.app (this is your root folder)
47
43
- Contents
48
44
- Resources
@@ -56,6 +52,7 @@ YourGame.app (this is your root folder)
56
52
```
57
53
58
54
The contents of the entry point script:
55
+
59
56
```sh
60
57
#!/bin/bash
61
58
@@ -67,7 +64,7 @@ else
67
64
fi
68
65
```
69
66
70
-
The Info.plist file is a standard macOS file containing metadata about your game. Here's an example file with required and recommended values set:
67
+
The `Info.plist` file is a standard macOS file containing metadata about your game. Here is an example file with required and recommended values set:
**Gaming consoles are restricted to registered developers and are not publicly available nor publicly documented. To get access to those platforms, please contact your console account manager(s). MonoGame documentation for closed platforms is available in their respective repositories.*
12
+
> [!IMPORTANT]
13
+
> **Gaming consoles are restricted to registered developers and are not publicly available nor publicly documented. To get access to those platforms, please contact your console account manager(s). MonoGame documentation for closed platforms is available in their respective repositories.*
16
14
17
15
## Understanding MonoGame's platform types
18
16
@@ -26,7 +24,6 @@ Below is a list of public platforms with their corresponding NuGet package, the
26
24
27
25
-[WindowsDX](#windowsdx)
28
26
-[DesktopGL](#desktopgl)
29
-
-[Windows Universal](#windowsuniversal)
30
27
-[Android](#android)
31
28
-[iOS](#ios)
32
29
@@ -68,28 +65,6 @@ You can target Windows 8.1 (and up), macOS Catalina 10.15 (and up), and Linux wi
68
65
69
66
DesktopGL currently does not have a `VideoPlayer` implementation.
| Windows 10, Xbox (UWP-only, not XDK) | MonoGame.Framework.WindowsUniversal | mguwpcore (core app, no xaml), mguwpxaml (xaml app) |
76
-
77
-
The WindowsUniversal platform runs on [Universal Windows Platform (UWP)](https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide).
78
-
79
-
WindowsUniversal uses **DirectX** for graphics, and XAudio for audio just like the WindowsDX platform.
80
-
81
-
UWP comes in two flavors, each with its own project template:
82
-
83
-
-**XAML app template**: an app in which your game will be hosted within an XAML page. This can be useful if you wish to offer a more complex UWP experience with multiple pages or XAML controls.
84
-
85
-
-**Core app template**: a raw app without any XAML, more straightforward if you don't need XAML controls.
86
-
87
-
This platform is meant to publish games on the **Windows Store**, for both **Windows** and **Xbox** (through the [Xbox Live Creators Program](https://www.xbox.com/en-US/developers/creators-program)).
88
-
89
-
Note that UWP games running on Xbox get [restricted access](https://docs.microsoft.com/en-us/windows/uwp/xbox-apps/system-resource-allocation) to the console capabilities. To unlock those restrictions, MonoGame has a dedicated Xbox platform for registered [ID@Xbox](https://www.xbox.com/en-US/Developers/id) developers targeting the XDK (this platform is private and requires you to contact your ID@Xbox manager).
90
-
91
-
Building for UWP requires the Windows SDK version 19041 or better to be installed.
Copy file name to clipboardExpand all lines: articles/getting_started/preparing_for_consoles.md
+6-11
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,8 @@
1
1
---
2
2
title: Preparing for consoles
3
-
description: How to get your game ready to run on consoles.
3
+
description: If you would like to port your game to consoles, there are some best practices to follow if you want to avoid running into issues while porting.
4
4
---
5
5
6
-
# Preparing for consoles
7
-
8
-
If you would like to port your game to consoles, there are some best practices to follow if you want to avoid running into issues while porting.
9
-
10
6
MonoGame for gaming consoles uses a dedicated .NET runtime that is not maintained by Microsoft. Therefore, a 100% accuracy and reliability is not guaranteed. Moreover, the console runtime makes use of `ahead-of-time` native compilation (AOT), which means that some .NET features will not, and cannot work on consoles.
11
7
12
8
This article explains the most common pitfalls and suggested guidelines to optimize your chances of having a smoother porting experience.
@@ -27,7 +23,7 @@ To publish with AOT:
27
23
- Add `<PublishAot>true</PublishAot>` to your `.csproj`.
28
24
- Then run `dotnet publish` from the command-line/terminal.
29
25
30
-
This will nativily compile your game in a fashion similar to consoles. The output executable will be in your output folder, within a sub-folder nammed`publish`.
26
+
This will natively compile your game in a fashion similar to consoles. The output executable will be in your output folder, within a sub-folder named`publish`.
31
27
32
28
From there, you can try running this executable. If it does not start or crashes later on, you likely are using reflection or another unsupported feature in a AOT runtime.
33
29
@@ -41,7 +37,7 @@ It should show you on which C# lines it crashed.
41
37
42
38
It is important to note that you should test every aspect of your game, and not just if it starts. Run through all the menus/screens, scene transitions and gameplay.
43
39
44
-
Another way to make sure that everything is safe is to enable `<EnableTrimAnalyzer>true</EnableTrimAnalyzer>` in your `.csproj`, and then **rebuild** (not just build) your game and check the build output for AOT warnings. Those warnings will tell you which parts of your code might trigger crashes or unexecpted results when running on AOT compilation. You should seek to resolve all of them.
40
+
Another way to make sure that everything is safe is to enable `<EnableTrimAnalyzer>true</EnableTrimAnalyzer>` in your `.csproj`, and then **rebuild** (not just build) your game and check the build output for AOT warnings. Those warnings will tell you which parts of your code might trigger crashes or unexpected results when running on AOT compilation. You should seek to resolve all of them.
45
41
46
42
## No runtime compilation / IL emit
47
43
@@ -61,7 +57,7 @@ It is advised to choose very carefully the libraries that you are using when por
61
57
62
58
The best way to make sure if they will work, is to search if they are **"AOT-compatible"**, or try to compile with the `<EnableTrimAnalyzer>true</EnableTrimAnalyzer>` setting in your `.csproj` and check if there are any warnings related to those libraries.
63
59
64
-
For example, here are some parsing libraries known for their compliance with AOT compilation and good handling of memrory:
60
+
For example, here are some parsing libraries known for their compliance with AOT compilation and good handling of memory:
@@ -88,7 +84,7 @@ Even though your game has good performance on PC and does not show stutters, you
88
84
89
85
The garbage collector is slower on consoles and if your game generates a lot of garbage memory, there will be visible stutters.
90
86
91
-
To verify that your game is not too garbage-prone, you can run Visual Studio's Perfomance Profiler (`Debug/Performance Profiler...`) and check the **".NET Object Allocation Tracking"** tool.
87
+
To verify that your game is not too garbage-prone, you can run Visual Studio's Performance Profiler (`Debug/Performance Profiler...`) and check the **".NET Object Allocation Tracking"** tool.
92
88
93
89
From there, you can check which parts of your code generate garbage and you can pinpoint where to optimize.
94
90
@@ -103,7 +99,7 @@ In order to avoid garbage, here are some best practices:
103
99
104
100
## Do not rely on system calls
105
101
106
-
If your game calls directly to system functions, like kernel, win32 or unix commands, you might want to get rid of them.
102
+
If your game calls directly to system functions, like kernel, win32 or Unix commands, you might want to get rid of them.
107
103
108
104
## Consider I/O to be asynchronous
109
105
@@ -116,4 +112,3 @@ If you consider all your I/O and system operations as asynchronous, you will lik
116
112
## Suggestions
117
113
118
114
If you have other tips or suggestions when building for consoles, then let the MonoGame team know by raising an issue and we will improve this article even further over time.
0 commit comments