The Name Garden

Moby ID: 204072

Tell your (or a friend's) name to the garden gnome and watch it grow a garden unique to you.

Controls: directional arrows, or mouse dragging, or swiping (not tapping) if you're on mobile.

This was an experiment to see if I could achieve seed-based random generation and text input in the charmingly limited and simple Môsi game engine (very similar to the very popular Bitsy game engine).

There's 10 different palettes, 5 dirt types, 5 plant types and 5 flower types you can get, on top of a unique positioning of these elements, based on the name you enter.

The garden generation is random, but seed-based. That means it will always generate the same garden for a given seed (text entered). There is a script you can use in Môsi that returns random numbers each time you call it, but I couldn't use it because I needed the generation to stay consistent every time you entered a given name.

I assigned a number to each letter, which together form the first seed. I then used a linear congruential generator algorithm, a kind of (pseudo)random number generation technique, to generate new seeds from the previous ones. I used the last digit of each new seed, which codes for different sprite options, for sprite selection and positioning.

Since that takes a lot of scripting in Môsi (there's no arrays or loop functionality), I wrote a program that generated those lines of code for me. That way I could easily loop through the more than 70 repetitions of generating a new seed, selecting and placing the sprite at a given position.

If you're interested in random number generation but are new to the concept, here's a fun introductory video from the great channel Numberphile, which also explains the formula for the linear congruential generator I used.

Feel free to ask me any questions in the comments below as well.

Source:

itch.io description


Contributed by Lampbane.


Know of a missing ad blurb? Contribute.