Inspiration
Pokemon is of course the main inspiration for this game. In particular, I really liked the idea in Pokemon Go of being able to walk around the real world and capture pokemon. I was also inspired by my childhood memories of drawing monsters and all kinds of other things. I think that almost every child that plays pokemon tries to design their own at some point, so I thought 'why not let them do that?'.
What it does
You upload an image. It can be a drawing, a photo, or even an AI picture. The game cleans it up and removes the background for you. Then it reads the pixels and gives your creature six stats, a type, four moves, and a chart showing what it is weak and strong against.
The shape sets the stats. How much of the canvas the creature fills becomes its HP. How spiky the outline is becomes Attack. How long and thin it is becomes Speed. Color sets the type. Blue leans Water. Red leans Fire. A see-through creature becomes a Ghost. A dark blob under the body reads as a shadow and makes the creature fly.
After that you build a team of up to six. You can drag creatures around to set the order. Then you battle other players and watch the fight play out one turn at a time. Wins put you on a leaderboard. The same picture always makes the same monster, so your creature is really yours.
How it was built
Monster Mash runs inside a Reddit post using Devvit. You do not make an account. Being on Reddit is your login. Everything saves to Reddit's own storage. Battling another person feels as normal as upvoting them.
The battle engine is simple on purpose. If you give it the same two teams and the same random seed, it always plays out the exact same fight. That one decision made a lot of things easier. The server runs the real battle and decides who wins. Then it sends your device just the seed. Your device replays the same fight to show the animation. The result and the animation can never disagree, because they run the same math.
The picture reading is its own system. Every pixel votes on a type. The stats come from the shape of the silhouette. Every creature is scaled to the same total power, so builds differ in shape, not in raw strength.
Challenges
Creating and calibrating the creature generation algorithm was a significant challenge. I can't say that it was necessarily fully solved, and will likely need continuous refinement. The characteristics for some creature types is easy (fire, water, etc.), but for others less so (dragon, psychic), but overall I hope that it will be fun for the players to try to figure out what characteristics lead to which stats and types!
Another challenge with the creature creation came from image transparency. Trying to create an algorithm for determining what is background and what isn't (without relying on machine vision) wasn't that easy. Even now, it's not perfect but I've decided to err more on the side of leaving in pieces of the image that may be background rather than being overzealous and potentially removing parts of an image which aren't part of the background.
The last challenge was the leaderboard. I didn't have any previous experience with Devvit, and solving that problem meant going beyond the typical approach that I would have taken (Firebase). Overall it was a good learning experience!
Accomplishments
I am proud that the whole thing runs right inside a Reddit post and still feels like a real game. It has an upload flow, a team builder, a leaderboard, and animated battles, all in a small window that loads fast on a phone!
What was learned
I learned a lot about Devvit and making Reddit games!
What's next for Monster Mash
I want to add dual types, so a blue dragon could read as Water and Dragon instead of losing one of them. The battle engine already handles them, but it needs some more testing before release.
I also would like to add a kind of monster breeding mechanic to get monsters with types, stats, and movesets that wouldn't normally be possible via monster uploading. This would likely work via rewarding the player with eggs after battles, up to a limit. The eggs then hatch after a certain number of days, with a combination of features of the monsters you used in that battle and the monsters they faced.
Built With
- claude
- phaser.js
Log in or sign up for Devpost to join the conversation.