Code Monkey home page Code Monkey logo

tmaze's Introduction

TMaze

Simple multiplatform maze solving game for terminal written entirely in Rust

Install with cargo install tmaze and run with tmaze


Crates.io

Screenshot of in-game

What's this

Features

  • Responsive to terminal size
  • Fire banger OST from step
  • Configurable maze sizes through config file
  • Configurable colors
  • Various maze generation algorithms: Randomized Kruskal's, Depth-First Search
  • Timer and move counter
  • Show visited places
  • Spectator mode, where you can fly and see the gameboard
  • Floors and 3D mazes (that's what spectator mode is mainly for)

Rationale

Since I'm a student, I've got to attend classes, but even when I'm listening I wanted to do something more than sit there. Also at the time this project came to life, I started to learn Rust, so it seemed to make sense to make some kind of game, but since my notebook is not the newest and I wanted to make it as lightweight as possible, I decided to make it for a terminal. It's also pretty cool.

Another requirement was that it would be multiplatform so that I could play it anywhere. A bonus was that I could play it on the server.

And it ended up as maze solving game because I just couldn't find any other.

To do

  • Better settings UI
  • Render path (you will be able to disable this)
  • Maybe multiplayer
  • Saving and exporting and importing game state, mazes

Credits and thanks

How to run

  • You can either download from GitHub releases, they are built automatically now, using GitHub Actions althought there are old builds, and I won't update them so frequently, maybe in the future
  • or build from source, you need cargo installed on your system

Using package managers

Scoop

  1. Make sure you have the latest version of Scoop installed
  2. Add Henshouse bucket using scoop bucket add henshouse https://github.com/henshouse/henshouse-scoop
  3. And finally install tmaze with scoop install henshouse/tmaze

Feature flags

TMaze uses cargo features to enable/disable some features. In Github release binaries they are all enabled, but not all of them are enabled by default when building from source. From version 1.14.0 all features are enabled by default and should be disabled manually. To disable them, use --no-default-features flag. After disabling them, enable specific ones you want with --features <feature1>,<feature2>,... flag.

The features are:

  • hashbrown - uses hashbrown instead of std hashmap, which is faster
  • updates - enables checking for updates, which is done on startup, can be disabled (this doesn't install new version)

How to build from source

Enabling/disabling features

After cargo command add --features to enable features, such as updates. To disable default features, such as hashbrown, add --no-default-features. To enable all featueres add --all-features.

Install it using cargo from crates.io

  1. Make sure you have cargo installed
  2. Run cargo install tmaze
  3. It's recommended that you have ~/.cargo/bin in the PATH, so that you don't need full path to run it

Or directly from Github

  1. Make sure you have cargo installed
  2. Clone GitHub repository or download it as zip, then extract it
  3. Go to that folder
  4. Run command cargo run --release to run (or you can just build it with cargo build --release without runing it)
  5. You can find compiled executable in the directory ./target/release/ with name tmaze or tmaze.exe , which you can move or link somewhere else

If you are Docker enjoyer, you may use it too

  1. Make sure you have Docker installed
  2. Build the image with docker build -t tmaze . --tag tmaze inside the repository folder, image is not published on Docker Hub yet
  3. Then you have multiple options of actually running it (and ofc more)
    1. Run it one time only: docker run --rm -it tmaze
    2. Run it with persistent storage for config and saved data: docker run -it --rm -v tmaze_data:/root/.config/tmaze tmaze
      • In this case you can edit config using somthing like docker run --rm -it -v tmaze_data:/root thinca/vim:latest

tmaze's People

Contributors

ur-fault avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

filip2cz

tmaze's Issues

DOS version

Create version for MS-DOS compatible operating systems.

Settings warnings

Allow showing warnings on startup of tmaze of the settings, such as enables functions, but built without support for them, empty maze list, and such

Add OST

OST is already made by an excellent music thing maker step, only thing remaining is to actually add them to the game

Complete rewrite of settings module

TMaze's current settings implementation and workings are horribly designed, with some major flaws.

  • Switch settings format from .ron to .toml or smt like that, mainly cause of task 2
  • Support unknown fields (somehow state right now), and be able to get list of them - for #33
  • Auto reloading and better support for #32 in the future
  • Less code/boilerplate code needed to add new setting/option
  • Overlays, such as specific maze has specific color scheme
  • Better stucture overall
  • #25

Enable all features by default

Since most users will just want to run the full game by default, it makes much more sense to enable them by default, only select few will actually touch this option of disabling them.

So, let's enable 'em.

Auto solver

Make mazes solve themselves, basically screensaver

Modding support

Well, what's one of the most useless features to add to this simple game ? Multiplayer and modding of cource.

I'd like to use https://extism.org/ for it. Because it supports multiple "plugin" languages, such as C++, Rust and C#.

Lot of architecture is gonna need change thought.
Things mods would be able to add/change

  • Settings configuration
  • Color schemes
  • Maze generation algorithms/acquisition
  • Rendering
  • Screens/menu items
  • Music

Tasks to do:

  • Come up with a structure for mods
  • Integrate Extism, loading plugins and their configuration
  • Make the whole codebase more modular

Add to package managers

Add TMaze to selected package managers, list is not exhaustive and managers may be added

Feel free to suggest other ones in the comments.
Or make pull requests with support for them, please consult before that tho.

Rewrite generation algorithms

For more options during the generation of the mazes, we need complete rewrite.

Right now, we generate each "block" individually, meaning floors in the tower are separated mazes and then combined into a list of floors.

This method is not bad, but not general enough. I'd like it to be general enough to be used anywhere, so that we can have blocks of blocks of mazes and something like island maze.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.