Mk48.io - Online Multiplayer Naval Combat Game

Mk48.io is an exciting online multiplayer naval combat game where players take command of ships to engage in intense maritime battles. Developed by Softbear Studios, the game offers a blend of strategy and action as players navigate their ships and avoid deadly torpedoes to secure victory.

Mk48.io Logo Mk48.io Logo

Overview

In Mk48.io, players enter a dynamic naval combat environment where strategic movement and timely actions are key to dominating the seas. The game supports multiplayer mode, allowing players to compete against each other in real-time. The immersive gameplay is complemented by a robust engine and detailed entity management, ensuring a rich and engaging experience.

Building the Game

To build Mk48.io, follow these steps:

Tools Required

  1. Rustup: Install via rustup.rs
  2. Rust Nightly: Set with rustup override set nightly-2022-08-14
  3. WebAssembly Target: Add with rustup target add wasm32-unknown-unknown
  4. Trunk: Install with cargo install --locked trunk (ensure gcc is installed if there are complaints about missing cc)
  5. Make: Optionally, install the make command

Client Setup

  1. Navigate to the /client directory.
  2. Run make or trunk build --release to build the client.
  3. Deploy the server to host the client.

Server Setup

  1. Navigate to the /server directory.
  2. Run make to build and start a test server.
  3. Access the game at localhost:8081 (or the port specified in the console).

Development Insights

For those interested in modifying or contributing to the game, understanding the entity data and textures is crucial.

Entity Data

Entities such as ships, weapons, and obstacles are defined in common/src/entity/_type.rs. This file is central to managing the various components within the game.

Entity Textures

Each entity type must have a corresponding texture in the spritesheet provided with the repository. For changes to entity textures, refer to the instructions in the sprite_sheet_packer directory.

Custom Game Engine

Mk48.io's client and server both utilize a custom game engine located in the engine directory. This engine is integral to the game's performance and features.

Admin Interface (Optional)

An optional admin interface can be built with the following steps:

  1. Install NodeJS 14 or higher from NodeJS.org.
  2. Navigate to the /engine/js directory.
  3. Run make.
  4. Deploy the server to host the admin interface.
  5. Access it at localhost:8081/admin/ and authenticate using the contents of engine/game_server/src/auth.txt.

Macros

Mk48.io employs several macros to streamline development:

  • Entity Loader Macro: Generates EntityData for all entity types.
  • Audio Loader Macro: Generates Audio enum for the client with a variant for each sound.
  • Settings Macro: Generates JavaScript bindings for settings structs.
  • Renderer Layer Macro: Facilitates composable rendering layers.

Similar Projects