A personal etude into rust software (RPG<-it's more fun to debug) development: Tales of the Great White Moose

Related tags

Games TGWM
Overview

TGWM (Tales of the Great White Moose)

NB: Currently compiles. Should compile and run on both 1.28.0 and 1.31.1 if the Cargo.lock files are deleted.

A flat RPG written in rust as an etude in using the language.

Aim

An etude in machine learning and using the conrod library for making a universal GUI (one that can be easily recompiled between triples without having to reprogram too many things. Since debugging a game is more fun, it ended up being a game.

About

This document describes the above repository, first it covers the kind-of-technical details, and then the gameplay related topics.

Current State

Play:

The mechanics work (for the most part), and you can run around the world getting killed and leveling up, but there is no story, no real start or end.

UI:

Currently there is a working GUI with a main, game and battle menu. Shortcut keys exist for overland travel, but not for navigating the menu (maybe a good idea). Brightness and size of window can be adjusted. Due to how glium uses OpenGl, brightness of flat texture widgets and images (ie sprites) are adjusted separately.

Sound:

There is a juke box powered by rodio, which plays music in battle, which can be customised or silenced. There are currently no sound effects. (As this is an etude in programming and not composing, the game music is half-hearted and the in-game song list can be changed. Currently looping needs tweaking in order to not be jarring.

Graphics:

Widget buttons as sprites. Uses images as backgrounds. World map is generated from instructions in the executable. In battle sprite shake on damage. Update 11-08-2018: Basic graphics for spell effects and attacks have been implemented.

Mechanics:

Implemented: The mechanisms for travelling the world, battle, in battle spellcasting, exp. and dungeons have been implemented. Mostly implemented: NPCs,story. Unimplemented: Teleportation spells and inventory have not been implemented.

AI:

Currenly there are three mechanisms for the "AI"

Random:

Monsters take "random" actions against "random" targets.

Traditional:

Monsters use a simple algorithm in battle, as a function of the stats of a battle's participants.

Algorithm:

The computer simulates battles for ten seconds at the start of a battle (using the above algorithm), and then uses this battle record to make a decision. Currenly the algorithm probability tables of actions and consequences, and uses them to decide the best action. As a back up uses a cause-effect algorithm, however this currently has some "bugs" related to healing spells. If the "statistics are weak" it will resort to the first two methods. Currently this approach is problematic for battles which aren't one-on-one, and where there is a small chance of winning or losing. In fact it's problematic in general and needs work. It should be noted that obviously it's not a computationally efficient "AI" for a computer game. The idea in using this is to use the game as a machine learning platform (I will work on this more once the rest of the game is written).

Notes on compiling

It appears that Cargo does some funny things with different rust versions. Should compile and run with 1.31.1 if the Cargo.lock files in this repository are deleted (otherwise it compiles, but does not run). Should also work with rust 1.28.0, but that no longer seems to be able to access crates.io, so I am not sure whether or not it is possible to get it to work on 1.28.0.

NB: for a clean, release version (on Windows) add " --release -C link-args="-Wl,--subsystem,windows" "

Linux:

cargo run --release --features="winit glium libc"

Windows (x64):

From windows:

cargo run --release --features="winit glium libc"

Crosscompile from Linux:

cargo rustc --bin q-moose --release --features="winit glium libc" --target=x86_64-pc-windows-gnu -- -C linker=x86_64-w64-mingw32-gcc

Dependencies:

TGWM uses conrod 0.57.0 (newer versions may or may not work). However the compiled program seems to work correctly only if the dependencies to conrod are specified as exact (eg: glium = "=0.20"). However the dependencies on the glium and winit also have to be specified as exact (modify the Cargo.toml on the dependencies).

License

Since this is not a useful project, but something of an etude, and anyone who feels like it is free to "do whatever" with it, it almost doesn't need a licence. However, just in case, it is under the GPL 3.0 licence.

Gameplay

The game play is classical turn based party on party, player vs computer fantasy battler. The main feature is the player does not know the exact numerical value of their stats (nor does the main AI layer). There is one player party, theoretically containing up to 5 creatures (but currently only up to two) and four enemy parties (which do not have a condition of allied victory, but often consider you a high priority target). The player travels the world, "explores" (currently about a dozen) dungeons and completes "quests" (currently none really).

Story Related Elements

As of the 16th of September 2018, the storyline engine has been written, but the story line has not (a simple demo quest triggered when the player has spent 10 Exp points has been written).

Comment

If anyone has comments on why this sucks and what should be changed to improve it, they are welcome.

You might also like...
The video game for Fonts of Power. A tabletop roleplaying game made in Rust with Bevy!

The code and rules for Fonts of Power, a tactical TTRPG / video game about exploring magical places. You can follow its development in our Discord ser

A refreshingly simple data-driven game engine built in Rust

What is Bevy? Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever! WARNING Bevy is still in the ve

Data-oriented and data-driven game engine written in Rust
Data-oriented and data-driven game engine written in Rust

What is Amethyst? Amethyst is a data-driven and data-oriented game engine aiming to be fast and as configurable as possible. Principles These principl

Rust library to create a Good Game Easily

ggez What is this? ggez is a Rust library to create a Good Game Easily. The current version is 0.6.0-rc0. This is a RELEASE CANDIDATE version, which m

Minesweeper game developed with Rust, WebAssembly (Wasm), and Canvas
Minesweeper game developed with Rust, WebAssembly (Wasm), and Canvas

👉 click here to play the game 👈 Minesweeper game Revealing all the cells without hitting the mines is the task. Each number in the cell denotes how

A Gameboy emulator written in Rust
A Gameboy emulator written in Rust

An open source Gameboy emulator written in Rust that can use a command line interface as a screen and input device.

Snake Game in rust for the web

About This template shows how to create a web app using Yew and wasm-pack. 🚴 Usage 🛠️ Build When building for the first time, ensure to install depe

Pong-like videogame made with Rust and Bevy
Pong-like videogame made with Rust and Bevy

Rust pong Pong-like videogame made with Rust and Bevy Features Correct Physics AI Score Wasm TO DO Score Wasm Multiplayer How to run For the desktop v

A solver for the popular Wordle game written in Rust.

Wordle Solver A solver for the popular Wordle game written in Rust. It does not attempt to be the most efficient solver possible but tries to avoid us

Comments
  • Fix bugs and groundwork for certain parts of AI

    Fix bugs and groundwork for certain parts of AI

    Fixes 1)AI crashes in battle after escaping. 2)v_count/l_count incrementation fix. Groundwork for causes/effects based decision (which hopefully won't take a year worth of thinking time).

    opened by aleshaleksey 0
  • Bump smallvec from 0.6.10 to 0.6.14

    Bump smallvec from 0.6.10 to 0.6.14

    Bumps smallvec from 0.6.10 to 0.6.14.

    Release notes

    Sourced from smallvec's releases.

    v0.6.14

    • Fix a possible buffer overflow in insert_many (#252, #254).

    v0.6.13

    • Use the maybe-unit crate in place of soon-to-be-deprecated std::mem::uninitialized (#180). When built with Rust 1.36 or later, this fixes a source of undefined behavior. It also fixes deprecation warnings in Rust 1.39 and later, and test failures when run in MIRI. In Rust 1.35 and earlier it provides some safety improvements but does not completely eliminate undefined behavior. (However, we are not aware of any cases where the undefined behavior causes bugs in practice in those toolchains.)

    v0.6.12

    • Move code using default fn into its own module (#161).

    v0.6.11

    • The unstable alloc feature is no longer needed. This crate can now build with the std feature disabled on stable Rust 1.36 or later (#159).
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump image from 0.18.0 to 0.22.5

    Bump image from 0.18.0 to 0.22.5

    Bumps image from 0.18.0 to 0.22.5.

    Changelog

    Sourced from image's changelog.

    Version 0.22.5

    • Added GenericImage::copy_within, specialized for ImageBuffer
    • Fixed decoding of interlaced gif files
    • Prepare for future compatibility of array IntoIterator in example code

    Version 0.22.4

    • Added in-place variants for flip and rotate operations.
    • The bmp encoder now checks if dimensions are valid for the format. It would previously write a subset or panic.
    • Removed deprecated implementations of Error::description
    • Added DynamicImage::into_* which convert without an additional allocation.
    • The PNG encoder errors on unsupported color types where it had previously silently swapped color channels.
    • Enabled saving images as gif with save_buffer.

    Version 0.22.3

    • Added a new module io containing a configurable Reader. It can replace the bunch of free functions: image::{load_*, open, image_dimensions} while enabling new combinations such as open but with format deduced from content instead of file path.
    • Fixed const_err lint in the macro expanded implementations of Pixel. This can only affect your crate if image is used as a path dependency.

    Version 0.22.2

    • Undeprecate unsafe trait accessors. Further evaluation showed that their deprecation should be delayed until trait impl specialization is available.
    • Fixed magic bytes used to detect tiff images.
    • Added DynamicImage::from_decoder.
    • Fixed a bug in the PNGReader that caused an infinite loop.
    • Added ColorType::{bits_per_pixel, num_components}.
    • Added ImageFormat::from_path, same format deduction as the open method.
    • Fixed a panic in the gif decoder.
    • Aligned background color handling of gif to web browser implementations.
    • Fixed handling of partial frames in animated gif.
    • Removed unused direct lzw dependency, an indirect dependency in tiff.

    Version 0.22.1

    • Fixed build without no features enabled

    Version 0.22

    • The required Rust version is now 1.34.2.
    • Note the website and blog: [image-rs.org][1] and [blog.image-rs.org][2]
    • PixelMut now only on ImageBuffer and removed from GenericImage interface. Prefer iterating manually in the generic case.

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump linked-hash-map from 0.5.1 to 0.5.4

    Bump linked-hash-map from 0.5.1 to 0.5.4

    Bumps linked-hash-map from 0.5.1 to 0.5.4.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Owner
null
4fun open-source Cave Story reimplementation written in Rust

doukutsu-rs Download latest Nightly builds (Requires being logged in to GitHub) A re-implementation of Cave Story (Doukutsu Monogatari) engine written

null 564 Jan 1, 2023
A roguelike game in Rust

A fantasy deathcrawl in Rust Work in progress. To run, with Rust compiler and Cargo package manager installed: cargo run --release When building on W

Risto Saarelma 347 Nov 21, 2022
Snake implemented in rust.

rsnake - An implementation of classic snake in rust This game was built using the piston_window window wrapper. Download the game If youre using mac-o

Maximilian Schulke 85 Jan 7, 2023
A Doom Renderer written in Rust.

Rust Doom A little Doom 1 & 2 Renderer written in Rust. Mostly written while I was learning the language about 2 years ago, so it might not the best e

Cristi Cobzarenco 2.2k Jan 1, 2023
ASCII terminal hexagonal map roguelike written in Rust

rhex Contributors welcome! Rhex is looking for contributors. See Contributing page for details. Introduction Simple ASCII terminal hexagonal map rogue

Dawid Ciężarkiewicz 137 Dec 2, 2022
An implementation of Sokoban in Rust

sokoban-rs This is an implementation of Sokoban in the Rust Programming Language. An example level: Build Instructions Before building sokoban-rs, you

Sébastien Watteau 137 Dec 23, 2022
😠⚔️😈 A minimalistic 2D turn-based tactical game in Rust

Zemeroth is a turn-based hexagonal tactical game written in Rust. Support: patreon.com/ozkriff News: @ozkriff on twitter | ozkriff.games | facebook |

Andrey Lesnikóv 1.3k Jan 5, 2023
⬡ Zone of Control is a hexagonal turn-based strategy game written in Rust. [DISCONTINUED]

Zone of Control The project is discontinued Sorry, friends. ZoC is discontinued. See https://ozkriff.github.io/2017-08-17--devlog.html Downloads Preco

Andrey Lesnikóv 354 Nov 14, 2022
This is a simple implementation of the classic snake game in rust

My snake game Looks like this. This is with Roboto Mono Nerd Font. If you use a different font it may look different or distorted. Install rust In ord

Konstantinos Kyriakou 16 Apr 4, 2021
The classic tetris game written in Rust using ncurses

tetris.rs This is the classic tetris game I wrote to have a bit of fun with Rust. Installation and playing cargo install --

null 71 Jul 25, 2022