|
|

Thanks to MonoGame, I was able to port my WP7 (XNA) 3d Mahjong game over to Win8 with just a few bumps in the road, and it's now live in the Windows Store. While not a Geared or an Armed, it did manage to sneak into the top 40 WP7 apps last year (as "3d
Mahjong Solitaire") and I'm curious to see how it does on Win8.
My random rambling notes about the port, for other folks contemplating porting their games as well:
- Overall, it went a lot more smoothly than I expected given that the develop3d branch is still in development. The main pain point was adapting to the realities of the desktop. MonoGame did exactly what it said it was going to do.
- I spent a lot of time on moving from a fixed 800x480 to the many resolutions and aspect ratios that Windows supports. Some of that time was tweaking layouts, some of it was revamping my code to support changing resolutions at run time.
- I never fully understood the best input approach to support both desktop (mouse) and touch (touchpanel). I ended up using TouchPanel for Pinch, and CoreWindow.GetForCurrentThread().Pointer[pressed/released/etc] for everything else. That works
for my app, but I strongly suspect there's a better model out there that everyone but me knows about.
- Web services threw me at first. The model was just different enough for me to struggle at first with async/await (I hadn't used those before). Once I understood the model though, it was cake to port the majority of my service APIs. I didn't
have to change anything on the backend.
- The lack of GetData on VBs was initially a pain. I read Tom's post about why GetData was evil and understand his opinion, but the way my game works is to have one tile model, one spritesheet (1024x1024) for the tile faces, and just load the one model
and create multiple instances of it and (brace yourself) change the texture coordinates in each model's vertexbuffer through Get/SetData. This kept me from having to create and load 30 different tile models. After trying gamely to add support for
vb.GetData in the develop3d branch, I gave up and (brace yourself again) solved it by running the WP7 version with a breakpoint immediately after the GetData, copied the model's retrieved data from the watch window, and just pasted the values directly as a
text array (byte[] bits = [pasted text]) into the code, acting as if I'd called GetData. Yeah; I've had better moments but it works ;-).
- I used the adrotater component and it worked flawlessly.
- 3D Perf in the simulator and in the Samsung tablet I had was fantastic. On WP7 I had to implement the tiles as a single model with tiles transformed via bones (so that the entire table could be rendered with just one DIP) - but that wasn't necessary
here.
- No idea yet if it's running smoothly on Surface RT devices or not :/. Anyone with one mind d/l'ing it and letting me know?
- I had to convert my WAVs to WMAs to get monogame to load them as Content. I used Audacity (free, easy) to convert. All other Content worked flawlessly once I figured out the model; have a Content folder in your solution, set all resources in
it to build action=content and 'copy to output dir' = "copy if newer.
- Get Callisto, if only for the custom dialog. For folks (like me) that haven't worked in the SL model much, it makes text input muuuuch easier.
- IAP was surprisingly simple, although there was the inevitable moment of "whew, it
did work" when I tried it with the live version.
I'm happy to answer any Qs or post code snippets if other folks are caught on any of the above things that snagged me.
Next up: trying to port the game to iOS/MonoGame.
You can find the app here: http://apps.microsoft.com/windows/app/3d-mahjong-touch/135ea7ff-0461-47cc-bd4d-6889de67cd25
Cheers,
Jeff
while (true) { Thanks for MonoGame, guys! }
Random side note: If you find dropbox or outlook failing inexplicably, try closing the VS2012 simulator. It creates an exact duplicate of your desktop, including running services, so it can inadvertantly do things like lock the outlook datafile or
run two instances of DropBox at once (which must confuse it immensely). Took me a while to figure out what was going on with my machine...
|
|
Coordinator
Dec 14, 2012 at 11:57 AM
|
Congratulations on getting your game out there.
I just tweeted about it from the @MonoGameTeam account.
|
|
|
|
Congrats!
I also noticed that problem with Dropbox. I fixed it by turning off the flag in preferences that says "Launch on Start" but before I figured that out I had horrible problems with synchronization... probably lost an equivalent of a day of work dealing
with it.
I had many similar problems as you did since my game(although unpublished on WP7 as of yet) was initially developed on that platform. Moving from 1k x 1k textures to 2k x 2k textures caused alot of grief because I had to go and re-draw a bunch of them in
order that they didn't look blocky... imagine redrawing 13 alien backgrounds. But I learned some new techniques in Paint.Net that made things look even better than before.
In answer to your question, I am exclusively using the Touch gestures but I went and modified my local version of MonoGame to pipe the mouse clicks in as touches. I had to tweak a few things to get that to work properly but its now fairly performant and
accurate. I dont allow the screen to auto-rotate so I think I might be side-stepping issues related to screen coordinates vs touch coordinates.
Personally I think your solution to the GetData problem could be solved by simply loading in the textures individually and then they all can be mapped to the same texture coordinates... just change the texture reference in the effect before you start the
draw pass. I do that for my planets and it doesn't seem to impact the draw speed or the load speed for that matter. If you make the small textures square and a power of 2 then you can utilize DXT compression which allows the texture to essentially be
placed directly into GPU memory because it is already in the correct format.
Anyways, good luck with your game. I personally haven't had much luck on the marketplace yet but I hope too soon.
|
|
|
|
Thanks Rob. What's the name of your game? Maybe we can trade reviews :). I just submitted an update with a few bug fixes and another game mode.
Can you clarify what you mean by the "Launch on Start" flag in preferences? I checked "[X] Do not launch, but debug my code when it start" in Properties|Debug, but I still see two instances of Dropbox (et al) running. I'd
sure love to figure this one out...
I'll have to take another look at my input code with your approach in mind; I remember struggling a bit with piping the Pointer* events over to my TouchPanel code, but it's good to hear that it worked for someone else (so it's at least possible).
You're probably right on the GetData approach. If I find myself tweaking that code then I'll contemplate moving away from my current 'spritesheet' like model to something more granular.
Thanks for your input!
Jeff
|
|
|
|
My game is Polyhegrams, a 3D word puzzle game. I would certainly give your game a review(and would really really like some nice reviews or feedback if anyone was willing to share).
With regards to Dropbox, that's all I had to do. Now I have to remember to launch it whenever I reboot but since the simulator borrows the preferences from the desktop it also doesn't get automatically launched... perhaps you are changing the preferences
within the simulator?
Also, I grabbed the latest bits from MonoGame and it appears that they have added Mouse->gesture support. All you have to do is add these lines during the initialization:
TouchPanel.EnableMouseTouchPoint
= true;
TouchPanel.EnableMouseGestures
= true;
Now if only I could get my shader code converted properly then I could have nice bump-mapped objects :(
Rob
|
|