Giter VIP home page Giter VIP logo

grumpy_visitors's Introduction

Amethyst Game Engine

Build Status Crates.io docs page MIT/Apache Join us on Discord Community forum Reddit Code coverage Lines of Code

Inactively Maintained!

Inactively Maintained

The Amethyst Game Engine has halted its development. Read this post about it: https://amethyst.rs/posts/amethyst--starting-fresh

For 0.15.3 and older, the following Rust version has to be used for compiles to work.

rustup override set 1.47

What is Amethyst?

Amethyst is a data-driven and data-oriented game engine aiming to be fast and as configurable as possible.

Principles

These principles are what makes Amethyst unique and competitive in the world of game engines:

  • Massively parallel architecture.
  • Powered by a correct Entity Component System model.
  • Rapid prototyping with RON files for prefabs and an abstract scripting API.
  • Strong focus on encouraging reusability and clean interfaces.

Why Amethyst?

Extreme Multithreading

Amethyst is based over a very powerful parallel ECS called Specs. This allows games built with Amethyst to maximize the available processing power to run as smoothly and as quickly as possible, without the headaches of multi-threaded programming.

Clean

By design, the Amethyst engine encourages you to write clean and reusable code for your behaviours and data structures. This allows engine users to easily share useful components, thus reducing development time and cost.

Using the ECS architecture, the code of games can be cleanly divided between data and behaviour, making it easy to understand what is going on, even if the game is running on a massive 64-core processor.

Community

  • Discord - Announcements, help, useful information, general discussion.

Features

Please visit the features page for a list of features Amethyst provides.

Navigation

Usage

While the engine can be hard to use at times, we made a lot of documentation that will teach you everything you need to use Amethyst comfortably.

If you don't understand a part of the documentation, please let us know. Join us on Discord or open an issue; we are always happy to help!

Getting started

Before you begin

This repository uses Git LFS for some files used in examples. If you intend to run the examples, make sure you have LFS installed in your system before you clone. You can download it and read the installation instructions at Git LFS home page.

Examples

To compile any of the examples run:

$ cargo run -p name_of_example

All available examples are listed under the examples directory.

For a full-blown "Hello World" tutorial check out the Getting Started chapter in the book.

Showcase games

Our official showcase games demonstrate larger, continuously developed game projects made with Amethyst:

For more examples see Games Made With Amethyst topic on the community forum for some good sources of inspiration.

Dependencies

If you are compiling on Linux, make sure to install the dependencies below.

Arch Linux

pacman -Syu grep gcc pkgconf openssl alsa-lib cmake make python3 freetype2 awk libxcb

Debian/Ubuntu

apt install gcc pkg-config openssl libasound2-dev cmake build-essential python3 libfreetype6-dev libexpat1-dev libxcb-composite0-dev libssl-dev libx11-dev libfontconfig1-dev

Fedora

dnf install pkgconfig gcc openssl-devel alsa-lib-devel cmake make gcc-c++ freetype-devel expat-devel libxcb-devel libX11-devel

openSUSE

zypper install gcc pkg-config libopenssl-devel alsa-devel cmake gcc-c++ python3 freetype2-devel libexpat-devel libxcb-devel

Nix/NixOS

In your project's root folder, create a file shell.nix with the following contents:

let
  mozilla = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz);
  nixpkgs = import <nixpkgs> { overlays = [ mozilla ]; };
in

  with nixpkgs;

  mkShell {
    buildInputs = [
      alsaLib
      cmake
      freetype
      latest.rustChannels.stable.rust
      expat
      openssl
      pkgconfig
      python3
      vulkan-validation-layers
      xlibs.libX11
    ];

    APPEND_LIBRARY_PATH = lib.makeLibraryPath [
      vulkan-loader
      xlibs.libXcursor
      xlibs.libXi
      xlibs.libXrandr
    ];

    shellHook = ''
      export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$APPEND_LIBRARY_PATH"
    '';
  }

Other

See your distribution-specific installation process for the equivalent dependencies.

Please note that you need to have a functional graphics driver installed. If you get a panic about the renderer unable to create the context when trying to run an example, a faulty driver installation could be the issue.

Building Documentation

You can build the book locally with:

cargo install mdbook
mdbook build book

If you're actively editing the book, it's easiest to run:

mdbook serve book

and navigate to http://localhost:3000. The text itself can be found in book/html/index.html. For more information, please see the mdBook project.

To generate the API documentation locally, do:

$ cargo doc

The API reference can be found in target/doc/amethyst/index.html.

Questions/Help

Amethyst supports only the latest stable release of Rust. Use the nightly and beta channels with this project at your own risk.

If you have a question, please check out the FAQ before asking. Chances are, the solution to your problem is already present there. If you still need help, feel free to ask on our Discord server.

Other places you might want to check out are r/rust_gamedev and the #rust-gamedev IRC.

Contributing

Note: Any interaction with the Amethyst project is subject to our Code of Conduct.

Amethyst is a community-based project that welcomes contributions from anyone. If you're interested in helping out, please read the contribution guidelines before getting started.

We have a good first issue category that groups all issues or feature requests that can be made without having an extensive knowledge of Rust or Amethyst. Working on those issues is a good, if not the best, way to learn.

If you think you are not ready to code yet, you can still contribute by reviewing code written by other members of the community. Code reviews ensure that code merged into Amethyst is of the highest quality as possible. Pull requests that are available for reviews can be found here.

If for some reason we don't have any open PRs in need of a review nor any good first issues (that would be a good thing), feel free to consult our issue tracker.

Backers

Thank you to all our backers! 🙏 Become a backer

Sponsors

Amethyst is supported by:

License

Amethyst is free and open source software distributed under the terms of both the MIT License and the Apache License 2.0.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

grumpy_visitors's People

Contributors

canadaduane avatar doimhneacht avatar henryksloan avatar jstnlef avatar mvlabat avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grumpy_visitors's Issues

Cover more scenarios when looking for resources folder

Right now the game checks only the working directory for resources folder. It might be counter-intuitive for people running the release on Linux or MacOS from console.

All 3 scenarios should be considered:

  1. Resources folder is in the working directory (already covered)
  2. resources folder has the same subpath as the running binary, but working directory is different
  3. Running from development environment (with cargo run for instance), while being in any directory of the project. Working directory might not be the root directory, but bins/client for example, so we probably should check for CARGO_MANIFEST_DIR env variable and traverse back to the root

The fix should be implemented with std::env::set_current_dir, as there are a lot of path references in .ron files. Otherwise we'd have to modify the values of every loaded path from .ron files during runtime

Blank screen

I've compiled gv_client with and without --release and the screen is always blank.

On the cmdline, the following happens if I blindly click around to presumably hit the "Single player" as defined in main_menu.ron:

[INFO][gv_game::states::loading_state] LoadingState started                                                                                                             
[INFO][gv_game::states::menu_state] MenuState started                                                                                                                   
[INFO][gv_game::states::playing_state] PlayingState started

There is no sound. An F11 doesn't toggle fullscreen.

Any idea why this might be happening? I've checked out older commits to see if they worked, but the very earliest have different issues, and from roughly commit 0782772 it compiles but there's still a blank screen. All other showcase games work for me: evoli, pong, space-menace, space_shooter_rs.

Git LFS over data quota

↪ git lfs pull
Git LFS: (0 of 243 files) 0 B / 35.58 MB                                                                               
batch response: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access.
batch response: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access.
batch response: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access.
error: failed to fetch some objects from 'https://github.com/amethyst/grumpy_visitors.git/info/lfs'

Polish multiplayer

Implement error/warning modal windows for the following cases (Is blocked by #31):

  • IP address is invalid
  • Connecting is failed
  • Disconnects (bad internet or anything else)
  • The room is full
  • Being kicked
  • Fails to start the server

Implement the following features:

  • Implement resetting multiplayer related resources on switching states or menus
  • Forbid more than 4 players joining a multiplayer room
  • Implement kicking
  • In case of self-hosting allow the first connection to be only from the host's client

Fixing bugs:

  • Investigate and fix the bug when the multiplayer game is paused right on start
  • Some of the players not getting spawned (make sure to pass all the information about players before start)

Doesnt compile on Linux

I wanted to give this project a try, but the client throws errors in the build. It seems like I need to install some libraries, would be nice if you could provide a full list of dependencies.

$ cargo build -p gv_server
Finished dev [unoptimized + debuginfo] target(s) in 1.02s
$ cargo -Z features=itarget build -p gv_client
Compiling shaderc-sys v0.5.1
Compiling gfx-backend-vulkan v0.3.3
Compiling imgui-winit-support v0.2.1
error: could not find native static library `SPIRV-Tools-opt`, perhaps an -L flag is missing?

Compiling shaderc v0.5.1
error: aborting due to previous error

The following warnings were emitted during compilation:

warning: Checking for system installed libraries.  Use --features = build-from-source to disable this behavior
warning: Found SPIRV.  Linking libSPIRV & libglslang

error: could not compile `shaderc-sys`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

Statistics backend (first iteration)

Endpoints

GET /statistics

Parameters

  • player
    • type: string
    • required: false

Response

  • If player parameter is present, return top 10 of all players ordered by score, 4 players before the best player score
  • If player parameter is absent, return top 20 of all players ordered by score

Example:

[
  {
    "player": "Player 1",
    "score": 100,
  },
  // ... 13 other results
  {
    "player": "You",
    "score": 12,
  },
  // ... 4 other results
]

POST /statistics

Parameters

  • player
    • type: string
    • required: true
  • score
    • type: number
    • required: true

Response

  • If player isn't present in the DB, create a new record
  • If player is already present in the DB and the submitted score is higher, update the score
OK 200

random_spawn_position math seems to be incorrect

This function should pick a random position on a specified Side to spawn. For instance, if we have a side Side::Left defined as two points A(0, 0) and B(0, 2000), this function should return a random point on the line (-100, 0),(-100, 2000). Currently monsters are sometimes spawned quite far away (I noticed homing missiles reaching a map border faster than a first spawned monster).

https://github.com/mvlabat/grumpy_visitors/blob/d6690fcf7f9ef9df92e91b02b424884cae0e99c7/libs/game/src/utils/world.rs#L92-L110

Refactor systems with using SystemData

There are some systems that are good candidates for introducing a separate SystemData struct for them: such systems require a lot of resources and pass them around their helper functions (making those functions' argument list really huge).

Some examples of bad systems:
bins/client/src/ecs/systems/input.rs
bins/client/src/ecs/systems/client_network.rs

Some examples of good systems:
libs/game/src/ecs/systems/monster/spawner.rs

Note that you shouldn't refactor all the systems in one pull request. As it's a "good first issue", just look through the systems and pick the one which you think will be feasible for you to tackle. But nothing stops you to make more than one PR, of course. :)

"Unsupported image format"

I've compiled gv for my first time, but when I run the client, it complains with the following errors:

  • "Unsupported image format"
  • "Failed loading sub asset"

Here's the debug output:

[ERROR][amethyst_assets::storage] "Mesh": Asset "resources/assets/atlas.png" (handle id: Handle { id: 9 }) could not be loaded: Failed to load asset with name "resources/assets/atlas.png"
[ERROR][amethyst_assets::progress] Error loading handle 9, Mesh, with name resources/assets/atlas.png: Failed to load asset with name "resources/assets/atlas.png"
caused by: Failed to load asset with name "resources/assets/atlas.png"
Error { inner: Inner { source: Some(Error { inner: Inner { source: Some(Error { inner: Inner { source: None, backtrace: None, error: Compat { error: UnsupportedError("Unsupported image format") } } }), backtrace: None, error: Format("IMAGE") } }), backtrace: None, error: Asset("resources/assets/atlas.png") } }
caused by: Format "IMAGE" could not load asset
Error { inner: Inner { source: Some(Error { inner: Inner { source: None, backtrace: None, error: Compat { error: UnsupportedError("Unsupported image format") } } }), backtrace: None, error: Format("IMAGE") } }
caused by: The Decoder does not support the image format `Unsupported image format`
Error { inner: Inner { source: None, backtrace: None, error: Compat { error: UnsupportedError("Unsupported image format") } } }
[ERROR][amethyst_assets::prefab::system] Failed loading sub asset: [AssetErrorMeta { error: Error { inner: Inner { source: Some(Error { inner: Inner { source: Some(Error { inner: Inner { source: None, backtrace: None, error: Compat { error: UnsupportedError("Unsupported image format") } } }), backtrace: None, error: Format("IMAGE") } }), backtrace: None, error: Asset("resources/assets/atlas.png") } }, handle_id: 9, asset_type_name: "Mesh", asset_name: "resources/assets/atlas.png" }]
[ERROR][amethyst_assets::storage] "PREFAB": Asset "resources/prefabs/dummy.ron" (handle id: Handle { id: 0 }) could not be loaded: Failed to load asset with name "resources/prefabs/dummy.ron"
[ERROR][amethyst_assets::progress] Error loading handle 0, PREFAB, with name resources/prefabs/dummy.ron: Failed to load asset with name "resources/prefabs/dummy.ron"
caused by: Failed to load asset with name "resources/prefabs/dummy.ron"
Error { inner: Inner { source: Some(Error { inner: Inner { source: None, backtrace: None, error: StringError("Failed loading sub asset") } }), backtrace: None, error: Asset("resources/prefabs/dummy.ron") } }
caused by: Failed loading sub asset
Error { inner: Inner { source: None, backtrace: None, error: StringError("Failed loading sub asset") } }

Am I missing a library that would lend support to loading the PNG image format?

Typo in Building section of README.md

The second command in the Building section is:

cargo -Z features=itarget build -p gb_client

The last parameter should be gv_client. I attempted to build the project for the first time and got an error that was alleviated by fixing this typo.

P.S. Awesome project! I intend to contribute as I gain more experience with Rust and Amethyst.

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.