Skii is a 2D top-down skiing game with a procedurally generated landscape and fully json constumizable assets.
Skii uses cargo, so compiling only consists in writing:
cargo build
If you want to directly play the game, you can also use:
cargo run --release
Skii has only one non-cargo handled dependecy, SDL, derived from ggez. To find instruction on how to install SDL, you may want to read this.
The game reads json file in resources/config to find info about the tiles, objects and player.
There are three types of description files: tile, object, and player.
type: the file typeproperties: all the tile propertiestexture: the tile texture, found inresources/texturesforward_friction: the forward friction with the skiessideway_friction: the sideways friction with the skiesdistribution: the base chance of generating the tile
{
"type": "tile",
"properties": {
"texture": "deep_snow.png",
"forward_friction": 0.2,
"sideway_friction": 30.0,
"distribution": 0.05
}
}type: the file typeproperties: all the object propertiestexture: the object texture, found inresources/texturesdistribution: the base chance of generating the objecthitbox: the object hitboxwidth: the hitbox widthheight: the hitbox height
{
"type": "object",
"properties": {
"texture": "tree1.png",
"distribution": 0.06,
"hitbox": {
"width": 1.0,
"height": 1.0
}
}
}type: the file typeproperties: all the object propertiestexture: the player texture
{
"type": "player",
"properties": {
"texture": "player.png"
}
}The generation algorithms, (found in src/generation.rs) are cellular automata inspired, and modify the generation chance starting from the distrubution value declared in the json files.
if identical neighbors is between 1 and 3 => generating chance *= 2
if identical neighbors is more than 3 => generating chance /= 5
if objects in 3.0 radius are between 1 and 2 => generating chance *= 2
if objects in 3.0 radius are more than 2 => generating chance /= 6
Note that the objects in range do not need to be the same as the object we are considering to generate.
