If you’ve been around in the MonoGame discord lately, you may have seen me discussing recently porting the original Infiniminer game by Zachtronics from XNA 3.1 to (current) MonoGame 3.8.1.303. Thought I’d created a forum post here to track the status and log of the port development as I continue on
One of the reasons I took up doing this port was out of sheer curiosity. I had never done a XNA-to-MonoGame port before, let alone one from XNA 3.1. I also thought it would nice to have a more complex game such as this as an example repository for other to look at and see. This was also a large educational experience for myself.
main: This branch is where all the MonoGame 3.8.1.303 port and future updates are added
original: This branch contains the original source code for reference.
Current Port Status
Infiniminer has been successfully ported from XNA 3.1 to MonoGame 3.8.1.303 as a direct port. In it’s current state it is playable with no crashes or major known bugs. However, the port was done as direct and brute forced as possible, there are many things that need to be optimized or adjusted to get full performance out of the game.
The following is a list of know things that are either need optimizations or are broken
DirectX version runs significantly worse than the OpenGL version. Current suggestions are in how the DynamicVertexBuffer instances are created so often. Need to look into optimizing this
Server/Client networking code is using the initial Lidgren version 1.0 to make the porting simple. The network code needs to be updated to either Lidgren Gen 3 or something more actively maintained like LiteNetLib.
Some users have reported that while playing there are occasional lag spikes that hit for ~1 second then go away. This is most likely caused by the issue mentioned above in number 1, however this could be related to the network code as well, so it is currently under investigation. fixed by @nkast in PR 14
Planned Features
The following are features and improvements I plan to add to the game once the issues listed above are all or mostly solved.
Controller Support
Rebindable Keybindings
Fullscreen support and/or Independent Screen Resolution support
Sprinting key for movement
As more features are thought of or suggested and approved they’ll be added to this list.
The project has now been reorganized so that there are separate clients for a DesktopGL build and a WindowsDX build. This is so it would be eaiser to test between the two for optimizations since the WindowsDX build seems to perform significantly worse than the DesktopGL version.
Common Client code, include the Content files were moved to Infiniminer.Client.Shared. The DesktopGl and WindowDX projects both reference the content from there as linked content.
Restored the original title screen. Nothing against wideshanks new title artwork that was added, just prefered the original artwork. Will look into making this a client setting choice on which artwork to use
If the value of the timeout argument is Zero, the thread relinquishes the remainder of its time slice to any thread of equal priority that is ready to run. If there are no other threads of equal priority that are ready to run, execution of the current thread is not suspended.
This updates the FPS counter to accuratly display the FPS. The original method used was just counting the number of elapsed frames and dividing it with the total seconds passed in the game which gave inaccurate results.
Previously each project type (DesktopGL and WindowsDX) had a seperate Content.mgcb that both referenced the same assets. I was under the assumption that the /platform flag in the Content.mgcb is what the mgcb used when building content. However the MonoGame.Content.Builder.Tasks.targets actually overrites that value based on the project type being built, so separate Content.mgcb files are not needed
Pull Request #14: Create SamplerStates during initialization
Creates a cached SamplerState during initilization instead of a new one each draw frame. This improves performance and GC pressure. Thanks again to @nkast for all of this work
This version adds initial controller support to the game. Right now, controller support is only when playing the game itself. The next update will overhaul the title, sever select, team select, and class select screens to add controller support to them as well. For now, they still have to be navigated with keyboard/mouse.