136
SFML projects / NetGore - C# open source MORPG engine
« on: April 17, 2010, 01:16:49 am »
Cross-platform was just a bonus. I can't think of all the reasons off the top of my head, but in brief, the big ones were:
XNA isn't bad, it just wasn't suiting my needs.
- Content pipeline - XNA pretty much forces you to compile your content. Loading bmps/pngs directly isn't very pretty, gives you assets that aren't able to be added to the ContentManager, and I believe is even deprecated now. While I like the idea of it, it made build times quite horrible. I didn't want people to have to manually add assets to the solution, so to even get them to build I had to create a custom msbuild project to do a "search and build". Even when content was already built, it took a good 4 seconds for just about 100 files. When they had to build, it took a good 20 seconds. Now, I just run a program in post-build that does a threaded compare/copy, and is nearly instant.
- ContentManager - I didn't like having to unload all content in one call, nor did I like having to maintain multiple ContentManagers. However, altering the ContentManager is brutal in XNA. Even just loading content without it is rough, so you can't just "roll your own" easily.
- Music - You HAVE to have Windows Media Player installed to use music in XNA, which was more just annoying. Playing music for the first time also resulted in a like 3 second stall on the calling thread, so I had to make a hack to create a background thread to just "prepare" the music.
- Portability - I never really cared if the client was cross-platform, but the server needs to be. This engine is focused at indy developers, and Linux VPSes are almost always significantly cheaper than Windows ones. Grabbing primitives like Vector2 and Rectangle and using those without referencing XNA got quite ugly and required some reference-juggling via msbuild hacks.
- Distribution - SFML is tiny. XNA isn't too big (a few MB), but the installation can be quite long for such a tiny thing.
- Text input - There just isn't any of it in XNA. It was annoying enough to get EN-US keyboard text to work. To support other keyboard layouts, it was looking like it would require some Windows API calls to transform the real keys into virtual keys to get the text.
- "The XNA way" - XNA pretty much forces you to use "their way". Usually, this wan't a problem. But at times, it became quite annoying (see ContentManager above). SFML isn't perfect either, nor is really any other engine (absolute flexibility just isn't really realistic), but at least SFML is open source so I can just change the engine. And this has turned out incredibly useful.
XNA isn't bad, it just wasn't suiting my needs.