Code Monkey home page Code Monkey logo

pleasedontblockireallywouldappreciateit.github.io's Introduction

Mk48.io Game

Build Mk48.io Discord

Logo

Mk48.io is an online multiplayer naval combat game, in which you take command of a ship and sail your way to victory. Watch out for torpedoes!

Building

Tools

  1. Install rustup (see instructions here)
  2. Install Rust Nightly (rustup override set nightly-2022-08-14)
  3. Add WebAssembly target (rustup target add wasm32-unknown-unknown)
  4. Install trunk (cargo install --locked trunk, install gcc first if it complains about missing cc)
  5. Optionally, install the make command

You may use any version of Rust that works, but only nightly-2022-08-14 is known to be compatible.

Client

  1. Enter /client
  2. make or, equivalently, trunk build --release
  3. Deploy the server to host the client

Server

  1. Enter /server
  2. make to build and run a test server
  3. Navigate to localhost:8081 (or whatever port is printed in the console)

HTTPS

If you build the server in --release mode, it will force HTTPS using a self-signed certificate.

Optionally, specify --certificate-path and --private-key-path to use a trusted CA certificate (e.g. acquired via Let's Encrypt). The server will periodically check for and load renewed certificates.

Developing

If you follow the Building steps, you have a fully functioning game (could be used to host a private server). If your goal is to modify the game, you may want to read more :)

Entity data

Entities (ships, weapons, aircraft, collectibles, obstacles, decoys, etc.) are defined at the bottom of common/src/entity/_type.rs.

Entity textures

Each entity type must be accompanied by a texture of the same name in the spritesheet, which comes with the repository. If entity textures need to be changed, see instructions in the sprite_sheet_packer directory.

Engine

Both client and server rely on our custom game engine (which is present in the engine directory).

Admin interface (optional)

One notable feature of the engine is an (optional) admin interface. To build it:

  1. Install NodeJS 14 or higher (here)
  2. Enter /engine/js
  3. make
  4. Deploy the server to host the admin interface
  5. Go to localhost:8080/admin
  6. Paste the contents of engine/game_server/src/auth.txt, generated randomly by a build script, into the alert dialog

Macros

Many macros are utilized by the codebase. Mk48-specific macros can be found in the macros directory, and game engine macros can be found in the engine/engine_macros directory. A few notable macros are:

  • Mk48 entity loader (generates EntityData for all entity types, used by both client and server)
  • Game engine audio loader (generates Audio enum for client, with a variant per sound)
  • Game engine settings (generates Javascript bindings for settings structs)
  • Game engine renderer layer (for composable rendering layers)

Contributing

See Contributing Wiki page.

pleasedontblockireallywouldappreciateit.github.io's People

Contributors

finnbear avatar caibear avatar plally avatar sheumais avatar thatretrodev avatar

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.