![FLIPS_choose_game](https://user-images.githubusercontent.com/5766837/142780107-2ad191f9-12ee-433a-8ecb-139d62f566cd.png) ## Game Porting Adventures This article details my adventures and disadventures while porting my +9 years old XNA games (originally for Windows Phone) to MonoGame framework (Android and Desktop platforms). ### Part 1: Making Games At the beginning of **2012** I decided to create [`emegeme`](https://www.emegeme.com/) and start developing games. I got some experience with XNA framework so I decided to develop games for the new **Windows Phone platform** that was recently published and it was supported by the framework. First game I developed was `DART that TARGET`, a darts arcade game. It took me about **3 months** of work to **create all the graphics and write all the code**, it was released by **April 2012**. Sales were terrible. ![emegeme_dart_xna_screenshots](https://user-images.githubusercontent.com/5766837/142918653-3381a67c-ee01-4176-83e4-572d4bbf1bf7.png) > _`DART that TARGET` XNA game screenshots. I really put a lot of care in details, you can touch the neons for some sparks!._ ![cost_estimation_dart_xna](https://user-images.githubusercontent.com/5766837/142913608-2c69ac1a-2afd-4914-bec2-21ebde0bb1e0.png) > _`DART that TARGET` XNA source code development cost estimation analyzed with [scc 3.0.0](https://github.com/boyter/scc). > A really motivational tool to evaluate my productivity._ Despite `DART that TARGET` did not work as expected, I decided to develop a second game, `FLIPS`, a memory cards game. `FLIPS` development took me about **4 months** and it was released at the beginning of September. I put a lot of effort on localization (**9 languages supported**), it delayed the release a bit. ![emegeme_flips_xna_screenshots](https://user-images.githubusercontent.com/5766837/142916145-848bf9a9-8e08-410a-af1d-4750809203f9.png) > _`FLIPS` XNA game screenshots. Again, I put a lot of care in details. I draw the 64 veggies cards available by hand!._ ![cost_estimation_flips_xna](https://user-images.githubusercontent.com/5766837/142920944-25439ab5-ffe0-4371-b769-f0e5e8b12818.png) > _`FLIPS` XNA source code development cost estimation analyzed with [scc 3.0.0](https://github.com/boyter/scc)._ > _It does not reflect the amount od work it ook me to create all the art!_ Again, sales were terrible but thanks to that game I got a job offer to teach some videogames development lessons at a [private educational institution](https://www.cevbarcelona.com/), only for a couple of weeks... that turn into a **6 years full-time job**!. During that time, I started a new project called [raylib](https://www.raylib.com/) but [that's another story](https://gist.github.com/raysan5/04a2daf02aa2a6e79010331f77bf983f). By the **end of 2014**, I decided to give `emegeme` another try and, with the help of some of my students, we started working on games development again. By that time `raylib` was already a thing and some of the development efforts were put on it, actually, some of those efforts were the origin of `raygui` and several raylib features. Beside raylib, two videogames project were started, one was `Koala Seasons`, a raylib game for Android that was never released on that platform but [open-sourced](https://github.com/raysan5/raylib-games/tree/master/koala_seasons) and [released for web](https://www.raylib.com/games/koala_seasons.html) later on. Second videogame project was a port of `FLIPS` to other platforms. XNA was discontinued by Microsoft and MonoGame seemed to be the best alternative but it has many dependencies and the custom content processor tool was not ready yet, so, I decided to use [`SharpDX`](https://github.com/sharpdx/SharpDX), a lightweight alternative to support Windows desktop platform; actually, MonoGame was using `SharpDX` internally at that moment. `FLIPS` port from `XNA` to `SharpDX` started on **November 2014** and it was done in parallel with another two big game changes: a redesign from **portrait to landscape mode** (to better accomodate on Windows desktop) and a **code split for Engine and Game**, the engine was called `geme`. The plan was using that engine for future projects... never happened. ![geme_engine_logo_details](https://user-images.githubusercontent.com/5766837/142923407-9d12b279-131e-4316-8782-8b1c1a35d391.png) > _`geme` game engine logo and structure. It was a very simple engine with just a bunch of classes, intended for 2D games._ By the end of 2014 `FLIPS` was already running on Windows desktop, it was nice, it allowed the project to live a bit longer than on a Windows-Phone-only platform but from a business point of view, Windows desktop was not the best platform for that kind of game (or that was what I thought at that moment). I decided to **port the game again** to a new platform: `PSVita`, using [`PlayStation Mobile`](https://en.wikipedia.org/wiki/PlayStation_Mobile) (PSM). `PlayStation Mobile` platform had been around for some time and it was intended for independent developers, the most interesting feature was that **it supported C# to code games** (using Mono), so, it seemed a really nice fit for `FLIPS`. **PSM API** was similar in some aspects to `XNA` but it required more work than `SharpDX` to port so, this time the port approach was a bit different, instead of replacing all `XNA` functionality by `PSM` equivalents, I decided to create an auxiliar library to map `XNA` to `PSM`, that library was called `XNA2PSM`. I'm not an expert on games porting but during those ports I realized that, usually, porting a game between platforms requires reviewing some common elements. I thing most SDKs provide this kind of base elements: - `Graphics Device Manager`: Functions for Graphic Device initialization and drawing on it. - `Content Manager`: Functions to manage loading/unloading assets data. - `Inputs Manager`: Functions to read and manage inputs, usually Keyboard, Mouse, Gamepad and Touch inputs. - `Storage Manager`: Functions to access some persistent storage system to save and load game info. - _System-specific features_: For example networking, ads, trophies, system-level error messages, etc. Porting `FLIPS` to `PSM` took longer than expected, about **5 months** and it was finally released on **June 2015**. Worth noting that I was working full-time as a teacher while developing those projects. Unfortunately, Sony announced that the **PSM store was closing by 15 July 2015**, so, `FLIPS` was on the market for about 1 month until it dissapeared forever. At that moment I stopped `XNA/SharpDX/PSM` development and I focused on `raylib`. [FLIPS on PSVita Video](https://www.youtube.com/watch?v=___goqWDGC8) ### Part 2: A new hope It was more than 6 years since `FLIPS` last release and more than 9 years since last `DART that TARGET` release. I had not touched those projects in that time; `emegeme` was mostly abandoned and all my efforts on those years were put on `raylib` and `raylib technologies`, where I developed several tools using `raylib` and `raygui`. A couple of weeks ago I released `raylib 4.0`, it's been 8 years working on that project, mostly coding in C and last week I decided to take a raylib small break and try something different. I decided to review and publish `FLIPS` and `DART that TARGET` again. I decided to port them to latest MonoGame, this framework has improved a lot and now it supports multiple platform seamlessly.