SamSuka
farmrpg
farmrpg

patreon


Game Dev Blog #1 - How Farm RPG Works

So far, most of my posts here have been to let Patrons know about alpha or beta changes or to present ideas, features or additions to the game.  I've had a number of people reach out and suggest that I also post more behind-the-scenes related content and share how I'm doing some of the things I do.  So this is my first attempt at this kind of post and it might be technical, so just be forewarned!

One of the most common questions I get is how is Farm RPG setup, what's it written in, etc.  Basically, it's a big website running on a single dedicated server.  

Everything is under FarmRPG.com and the UI itself uses Framework7, a JavaScript based mobile framework that supports iOS/Android styles and UI concepts.  Framework7 does most of the menus and navigation you see in the game, and the gameplay concepts are custom built using the controls and tools in Framework7.  There's a lot of JavaScript involved to make certain things, like fishing, do what you see.

The backend code is all PHP and all the game data is stored in a MySQL database.   I'm using the latest PHP version as well as MySQL and using the InnoDB storage format, which has proven to be pretty fast.  The backend has jobs that run every minute to do certain things in the game, like produce boards from a sawmill.  These jobs also clean up junk and try to keep the database from growing too quickly.

The mobile apps for the game are actually native-code wrappers that load FarmRPG.com in a browser control, or webview.  There is more to the apps though, especially on the iOS side (and Android in the future).  The game itself talks to the native apps with JavaScript to tell the native code to do certain things, like play background music or start an In-App-Purchase (IAP).  But overall, the apps are very small and don't have a lot of the complexity in them.  There's good and bad to this approach though.

The good thing about this setup is I can develop the game and push changes without having to do an app update and approval every time.  The bad thing is that I deal with performance issues more due to network speeds and latency, because the app isn't running the game in native code.  It's just a website.  The other benefit to this approach is the game can probably run on any device that has a web browser just by going to FarmRPG.com, which is pretty cool.

So that's a high level view of how Farm RPG is setup.  The Alpha game is on a different server and address and I have another local dev sandbox as well.  I can probably write another post later on that details a bit more of my process in updating the game.

Thanks for reading and let me know if you'd like to see more of this kind of thing!


Comments

Thanks for this! I reached out to you directly asking some of this, and I really appreciate your response, as well as adding more detail here. I'd love to see more!

Thanks for sharing xD :)


More Creators