monogame 은 MS 의 XNA 프레임워크에

기반한 멀티 플랫폼 게임 개발을 위한

.NET 라이브러리입니다.

 

소개가 거창한데 .NET 환경을 사용하기에

C#으로 프로그래밍을 하며 XNA는

과거 MS사가 서드파티들이 XBOX 게임개발을

개발하기 위한 도구로써 개발한 프레임워크로

지금은 업데이트도 끓겼고 중단이라고 봐야지요.

 

하지만 monogame 이 XNA 코드를 끌어쓰면서

오픈소스로 부활시켰기 때문에 지금도

그 CORE는 사용되고 있습니다.

 

monogame은 크로스 플랫폼이기 때문에

데스크탑 PC와 콘솔게임기(PS, XBOX 등)

그리고 모바일 게임까지 개발이 가능하며

인디게임 개발자들이 게임을 개발하는데

많이 사용되고 있습니다. 유명한 사례는

글로벌 히트를 친 Stardew Vally 등이 있습니다.

 

3D 보다는 2D 게임에 적합하다고 합니다.

아무래도 3D는 리소스가 많이 들어가고

상업용 프로그램인 유니티나

언리얼엔진을 많이 사용합니다.

 

 

monogame과 유니티를 많이 비교하는데

오픈소스 라이브러리의 장점으로 보면,

 

- 게임툴 제작사에 돈을 낼 필요가 없다.

(유니티와 언리얼은 상업 개발을 위해

수수료를 지불해야 합니다)

 

- .NET 환경의 크로스 플랫폼 개발이 가능하다.

 

- 툴에 구애받지 않고 유연한

(flexible)프로그래밍이 가능하다

 

- 툴 사용법 보다 더 집중하여 C#

프로그래밍 기술을 습득할 수 있다

 

...이 정도의 평가가 있습니다.

 

해외에서는 인디게임 제작사들이

monogame과 유니티 중 선택하는

경우가 있는 것 같습니다.

 

게임의 밑바탕 부터 설계하려는 경우

게임 엔진보다 프레임워크가 장기적으로

유리할 수도 있는데 단점은 그만큼

더 많은 작업을 해야하는 트레이드오프가 있습니다.

monogame의 설치

크로스 플랫폼으로 .NET과 함께 사용하며

아래 Getting Started 페이지를 참고합니다.

 

Getting Started | MonoGame Documentation

 

Getting Started | MonoGame Documentation

Getting Started This section walks you through the basics of MonoGame and helps you create your first game. First, select the toolset and operating system you will be working with to create your first MonoGame project, then continue reading to understand t

docs.monogame.net

여기서는 윈도우 환경의 설치를 알아봅니다.

 

두가지 방법이 있는데

첫째는 Visual Studio 에서 설치하는 방법이고

다른 하나는 CLI(명령어 인터페이스) 에서 설치합니다.

 

그런데 최근에 나온 Visual Studio 2022에서는

아직 마켓플레이스 등록이 안되어 있습니다.

(역시 MS 스타일은 좀 느립니다)

 

현재는 2019 버전의 확장 기능에서

설치할 수 있는데 기본 .NET Core 도구를

Visual Studio를 깔고 monogame 만

설치하는데도 용량을 상당히 많이 차지합니다.

 

Visual Studio 가 시간이 흐르면서

좀 많이 무거운 IDE가 되버렸습니다.

 

monogame 을 설치하려면 2019버전을

설치해야 할 것인데 MS 웹사이트에서

과거 버전을 찾아서 설치해야 합니다.

 

*여기서는 .NET SDK 와 monogame 을

.NET CLI로 설치하도록 하겠습니다.

 

1. .NET SDK 를 설치합니다. SDK x64이며

런타임이 포함되 있습니다.

(monogame은 x64를 사용)

 

Download .NET (Linux, macOS, and Windows) (microsoft.com)

 

Download .NET (Linux, macOS, and Windows)

Free downloads for building and running .NET apps on Linux, macOS, and Windows. Runtimes, SDKs, and developer packs for .NET Framework, .NET, and ASP.NET.

dotnet.microsoft.com

설치가 잘 되었는지 명령프롬프트에서

dotnet을 실행해 봅니다.

설치가 잘 되었다면 아래와 같이 나옵니다.

C:\>dotnet

Usage: dotnet [options]
Usage: dotnet [path-to-application]

Options:
  -h|--help         Display help.
  --info            Display .NET information.
  --list-sdks       Display the installed SDKs.
  --list-runtimes   Display the installed runtimes.

path-to-application:
  The path to an application .dll file to execute.

 

monogame의 콘텐츠 관리를 위한

mgcb 에디터를 설치하고 등록합니다.

런타임 버전에 따라 .NET Core 3.1을

설치하라고 나올 수 있습니다. 그런 경우

데스크탑 앱 3.1 버전을 설치해야합니다.

 

Download .NET Core 3.1 (Linux, macOS, and Windows) (microsoft.com)

 

Download .NET Core 3.1 (Linux, macOS, and Windows)

.NET Core 3.1 downloads for Linux, macOS, and Windows. .NET is a free, cross-platform, open-source developer platform for building many different types of applications.

dotnet.microsoft.com

dotnet tool install --global dotnet-mgcb-editor
mgcb-editor --register

 

C# 템플릿을 설치합니다.

C:\>dotnet new --install MonoGame.Templates.CSharp
다음 템플릿 패키지가 설치됩니다.
   MonoGame.Templates.CSharp

성공:MonoGame.Templates.CSharp::3.8.0.1641이(가) 다음 템플릿을 설치했습니다.
템플릿 이름                                                  약식 이름          언어    태그
------------------------------------------------------  -------------  ----  --------
MonoGame Android Application                            mgandroid      [C#]  MonoGame
MonoGame Cross-Platform Desktop Application (OpenGL)    mgdesktopgl    [C#]  MonoGame
MonoGame iPhone/iPad Application                        mgios          [C#]  MonoGame
MonoGame NetStandard Library                            mgnetstandard  [C#]  MonoGame
MonoGame Pipeline Extension                             mgpipeline     [C#]  MonoGame
MonoGame Shared Library Project                         mgshared       [C#]  MonoGame
MonoGame Windows Desktop Application (Windows DirectX)  mgwindowsdx    [C#]  MonoGame
MonoGame Windows Universal Application (CoreApp)        mguwpcore      [C#]  MonoGame
MonoGame Windows Universal Application (XAML)           mguwpxaml      [C#]  MonoGame

템플릿 설치가 잘 되었는지는

아래 명령어로 확인합니다.

dotnet new --list

템플릿 중 크로스 플랫폼 데스크탑 앱을

설치해보겠습니다. 현재 위치에서

프로젝트 이름으로 폴더가 생깁니다.

dotnet new mgdesktopgl -o 프로젝트이름

폴더안으로 들어가서 Program.cs 를 실행합니다.

기본 파란 윈도우창이 나오면 성공입니다.

dotnet run Program.cs

비주얼 스튜디오 코드를 실행하여 Game1.cs를

확인해 보면 프레임워크 코드가 있습니다.

여기서부터 시작하면 됩니다.

 

다음 포스팅에서는 기본 튜토리얼 정도를

만들어 봐야 겠네요.

 

API 등 기본 사항은 monogame의

공식 웹사이트를 참고합니다.

 

Getting Started | MonoGame Documentation

 

Getting Started | MonoGame Documentation

Getting Started This section walks you through the basics of MonoGame and helps you create your first game. First, select the toolset and operating system you will be working with to create your first MonoGame project, then continue reading to understand t

docs.monogame.net

 

공유하기

facebook twitter kakaoTalk kakaostory naver band