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

Overview

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!

Developing

Tools

  1. Install Rust Nightly (install rustup, then rustup override set nightly-2021-10-28)
  2. Install NodeJS 14 or higher (here)

You may use any version of Rust that works, but we use some nightly features and nightly-2021-10-28 is known to work, whereas some newer versions produce internal compiler errors.

Client

  1. Enter /js
  2. npm install
  3. make
  4. Deploy the server to host the client

Server

  1. Enter /server
  2. make to build and run a test server
  3. Navigate to localhost:8000

Contributing

See Contributing Wiki page.

Comments
  • Ship switching abused

    Ship switching abused

    Its pretty obvious that some players have figured out a way to switch between ships at will. Not just by saving a level and switching right before sinking to a larger ship, but switching several times in a row. I witnessed a switch from level 3 to level 4 warship to level 10 Nimitz to stop from being sunk by me. Not just one time but several times.

    Expected behavior

    You cannot switch period to stop a sinking. A timer should be set from last damage to prevent abuse of ship upgrading. Figure out how they are accessing the ship upgrade menu like that would also be a suggestion.

    If this is allowed, I would like to know how they do it.

    bug 
    opened by mitm001 12
  • Shrink Entity Struct

    Shrink Entity Struct

    For the possibility of performance we can shrink the world.Entity struct to 32 bytes from 64 bytes (1/2 the size and still power of 2). The point of this issue is to discuss if we should implement this to test it or if the cons would outweigh any estimated pros.

    // The current struct (64 bytes):
    type Entity struct {
    	Transform                // 16 bytes (8 bytes pos + 4 bytes vel + 4 bytes dir)
    	Guidance                 // 8 bytes (4 bytes vel + 4 bytes dir)
    	EntityType               // 1 byte (eventually may be 2 bytes once entity count > 255)
    	Damage   float32         // 4 bytes
    	Distance float32         // 4 bytes
    	Lifespan float32         // 4 bytes
    	Owner    *Player         // 8 bytes
    	ext      unsafeExtension // 8 bytes
            // EntityID EntityID     // 4 bytes
            // _ [4]byte             // 4 bytes struct padding
    }
    

    Required changes:

    • [x] Convert world.Angle from float32 to uint16 with 0 meaning 0.0 and 65535 being 2 Pi * 65535 / 65536.
    • [x] Move world.Extension (unsafeExtension) to world.Player.
    • [x] Move Entity.Damage to world.Extension.
    • [x] Remove Entity.Distance as it can be estimated from lifespan.
    • [x] Change lifespan and velocity(Target) to uint16 and int16 (Lifespan measured in 100/ms increments).
    // The new struct (32 bytes):
    type Entity struct {
    	Transform                // 12 bytes (8 bytes pos + 2 bytes vel + 2 bytes dir)
    	Guidance                 // 4 bytes (2 bytes vel + 2 bytes dir)
            Owner    *Player         // 8 bytes
    	EntityType               // 1 byte (eventually may be 2 bytes once entity count > 255)
    	Lifespan uint16          // 2 bytes
            // EntityID EntityID     // 4 bytes
    }
    

    Possible Pros:

    • Entities use 1/2 the memory.
    • Better locality of reference for iterating entities (speculating ~5-10% performance improvement of world functions from previous optimization). *Angles can be added/subtracted together without expensive math32.Mod.
    • Allows us to do further optimizations with less copying like AOS vs SOA.

    Cons:

    • Player can't have more than 1 boat in the future (unless we make []Extension).
    • More complex math and marshaling for angles, velocities, and lifespans.
    • Entity.Distance() is just an estimate and may not be accurate.
    • If we want to add more fields we will need to be more creative in the future.

    Note that this is just an idea and may not be worth the added complexity.

    performance server 
    opened by caibear 10
  • Sub stealth

    Sub stealth

    I am not certain but either there is a bug in stealth or there is a trick I am missing.

    The issue is with one certain player they are never visible to me until my sub sinks. This happened half a dozen times last night. They would be almost within the sea wolf speed ring and I couldn't see them. This is with both of us not using sonar and with them using ships or subs. They can see me though as they are firing on me when we are 1 to 2 inches apart. Their torpedoes don't show red triangles either until the very last moment. He says its working that way for him against me also but he obviously sees me every time before I see them as they are firing on me first.

    One particular battle I attacked a destroyer close range at a dock, sinking it, I immediately attacked a sub right next to that ship, sinking it. I turned on sonar, saw nothing and surfaced. As soon as I surfaced, his ship turned visible, I was right at his bow but never saw them yet I was so close I could see docks without sonar, just not his ship.

    On another occasion, I had attacked a ship but as I was out of ammo so I decided to move under the ice around an large ice island and circle around to allow ammo to restore. This trip took about 45 seconds to a minute. The entire time I was doing this I kept seeing torpedoes appear without the red triangle every 10 seconds or so. I thought at first it was from the sea side being fired by others in a battle and it was just coincidence they were tracking on me. After about the fourth decoy, realized it was this same person chasing me the whole way. I only saw who it was after they were almost on top of me, which was weird as we both had the same sub yet they caught up to me and they could see me the whole time obviously as they were firing away.

    This same pattern repeated itself a few other times where I would never see their sub until after I was sunk. Even the torpedoes would stay masked until right before impact.

    You cannot defend against what you don't see so I figure there must be some trick to doing this type of strong stealth where they can fire away and I never even see them. I questioned them on this and they said they were using no sonar also and the sub itself was stealthy. Whats weird is I could see them perfectly fine half a screen away with a golf submarine. This makes no sense that a golf sub could see them but my sea wolfs vs sea wolfs couldn't.

    I can tell that others can see me when attacking without sonar a little over two inches away most ships as they start evasive maneuvers before I fire torpedoes.

    opened by mitm001 5
  • Game modes

    Game modes

    Ideas:

    • Arcade/casual vs. realistic/pro
    • FFA vs. teams (suggested by 8151382425 among others)
    • Freeplay vs. Conquest (suggested by Cris)
    • Large 50/50 team battle (suggested by Admiral)
    • No points required to upgrade (Hang)
    • Domination: start as Skipjack and capture majority of 5 points (Suggested by Type)
    • Capture the flag (suggested by SS NERO)
    • Base wars (suggested by SS NERO)
    • Peaceful/sandbox mode (suggested by Jake)
    • Classic, WW2, Modern etc. (suggested by Capt Grey)
    • Pearl Harbor / Carriers vs. Battleships (suggested by Awesome)
    • 1v1 (suggested by Camo)
    feature request 
    opened by finnbear 5
  • sub to ship switch

    sub to ship switch

    Looks like a new abuse is now happening. The latest is to attack with a sub and move towards target then switch to carrier if its obvious they are toast. The carrier is under water so you get sunk as it moves to surface. Second time today.

    Expected behavior would be make it so you must surface to switch from sub to ship.

    bug 
    opened by mitm001 4
  • High Performance Particles

    High Performance Particles

    There are currently only wake particles that are created on the client behind boats. The particles are updated in JS and aren't very fast (~500/ns per update on my computer). This limits the amount of particles that we can spawn and also impacts frame rate on lower end devices. If we can reach at least 100/ns per particle update I think it will meet our goals.

    Proposed solutions:

    1. Optimize the update code on the CPU by using Web Assembly.
    2. Rewrite the particles to be only updated on the GPU with a vertex shader.
    3. Reduce the number of particles based on computer specs/frame rate.

    Once the particles have high enough performance we can add more effects such as smoke/fire.

    performance client 
    opened by caibear 4
  • High level Sub torpedos too weak

    High level Sub torpedos too weak

    Sub torpedoes are to weak by about 15%. At higher levels a sub cannot defeat another ship by unleashing all its available payload into any other ship of the same level.

    I unloaded entire payload of Sea Wolf into a Nimitz and still had to follow up with 3 more torpedo's. Its even worse against the other ships with same level. Even the next lower level sub, unloading every weapon it has cannot sink a max level ship.

    Expected behavior

    There is no ship ever built that could sustain that many hits from an advanced torpedo or 10 missiles and remain floating. Its not physically possible.

    This unbalance means in one on one situations its nearly impossible to sink a max level ship with a sub. You will on almost every occasion be sunk with their counter attacks, which are way to powerful in their own right.

    I do succeed occasionally but it takes some stupid mistake on their part or catching them with low health for it to happen. If they don't panic and simply counter attack they win every battle.

    Tweaking the torpedoes so that firing a maxed out payload sinks any ship of the same level would be more appropriate. Evidently, others feel the same way as I have seen it discussed on the Radio.

    bug 
    opened by mitm001 3
  • Recovering Sunken Ships

    Recovering Sunken Ships

    I think that being able to Recover Sunken Ships might be something great for Mk48.io. Here's my (simple) idea on how that would work:

    • Sunken Ship gets Found and Recovered (Maybe using an item, or maybe using a Ship designed for Recovering other Ships)
    • Recovered Ship parts get collected (Maybe this could give the player XP points?)

    As for implementing it, I'm not sure about how the player would actually recover a sunken ship on the client-side but on the server-side sunken ships could be stored for a couple minutes to give other players time to recover the ships.

    feature request 
    opened by thatretrodev 3
  • Access extension of non-boat

    Access extension of non-boat

    panic: access extension of non-boat [recovered]
    panic: access extension of non-boat
    goroutine 44 [running]:
    github.com/SoftbearStudios/mk48/server.(*Hub).Run.func1()
    

    Crashed server today.

    bug server 
    opened by finnbear 3
  • Ship with single weapon deselected weapon

    Ship with single weapon deselected weapon

    Describe the bug

    1. Be G-5 (freshly logged in)
    2. Attack Zubr with both torpedoes (held down space)
    3. Zubr doesn't sink, waiting for reload
    4. Torpedoes reloaded (2/2)
    5. New torpedoes won't launch!

    I tried space, E, clicking, any launch angle - no luck. Browser console had nothing except FPS messages. Eventually noticed that the single entry in the weapon list left-bottom does not have a gray box around it! Clicked on it, it was selected and I was able to launch torpedoes again! For some reason it was deselected, even though I was not able to deselect it again manually neither by clicking or pressing tab. I cannot reliably reproduce it. Maybe it didn't like that I held down space all the time?

    This is admittedly a very minor bug, but might still be useful to have a reference

    Expected behavior

    Weapon is never deselected.

    Additional context (optional)

    Used Chromium Edge 91.0.864.48 directly in mk48.io

    bug 
    opened by Ohmugin 3
  • North ice pack and subs

    North ice pack and subs

    Subs need a way to discern more easily the terrain or whatever it is that sinks you up there when moving. Three times now I lost level 9 sea wolf to something invisible. The ice pack hides something, whatever it is and a high level sub should be able to detect it.

    Additional context

    bug duplicate feature request 
    opened by mitm001 2
  • Sprite Packer Issues

    Sprite Packer Issues

    Upon running the sprite packer file as listed in the (outdated) instructions, it gives two errors:

    error[E0063]: missing field `loop_start` in initializer of `AudioSprite`
       --> src/audio.rs:357:26
        |
    357 |             let sprite = AudioSprite {
        |                          ^^^^^^^^^^^ missing `loop_start`
    
    error[E0599]: no method named `log2` found for type `u32` in the current scope
       --> src/texture.rs:188:39
        |
    188 |         Box::new((min_size..=MAX_SIZE.log2()).into_iter().flat_map(|power| {
        |                                       ^^^^ help: there is an associated function with a similar name: `ilog2`
    
    

    It seems both the README and the audio.rs files are over a year out of date.

    bug 
    opened by Sheumais 1
  • Possible script error browser

    Possible script error browser

    The situation is that on occasion the game will lock you out from selecting buttons like upgrading ships.

    The two times I had it occur were over these last two days.

    Torpedoes and decoys also start acting funny like in my previous posts on the subject where my decoys get ignored but opponents become super duper strong as in way out of range and behind my sub nose yet torpedoes go right through opponent to them, they make extreme turns like U turns at point blank range, torpedoes lock onto target and then unlock and wander off into the world somewhere when no decoys or ships around or all but one torpedo or missile hits target and the last fired just goes through target. Even missiles are affected as in they may go opposite direction like 180 behind rather than forward.

    May be a script interfering not as in cheat script but like somethings running infinitely causing other scripts not to run.

    It takes a refresh to fix it.

    Other player reported he got word null when firing torpedoes. Not sure what that was on so I will ask him to clarify.

    Win 7, Firefox browser with private browsing and clear history settings on close.

    bug 
    opened by mitm001 2
  • Destroyer stealth overpowered vs sub

    Destroyer stealth overpowered vs sub

    Subs cannot see a destroyer just on the other side of an oil rig or just past one sub length. Thats ridiculously overpowered. In real world, its exactly the opposite. No ship can easily detect a sub unless surfaced. To make an even bolder statement, there isn't a ship on the sea that can hide from sub detection ability much less survive a full payload being emptied into them, even from a diesel engine one.

    bug 
    opened by mitm001 2
  • Rocket torpedo is totally worthless

    Rocket torpedo is totally worthless

    As the title states the rocket torpedo fails to even submerge 99% of the time.

    We are talking broadside on an Iowa or Nimitz and all it does is crash into the side, never submerges. distance seems to make 0 difference.

    They make no sense when aiming either. Its like they choose some random direction every time.

    They are already extremely weak as a weapon so why make them not even submerge?

    Ive spent literally HOURS trying to get them to work, no exaggeration.

    If there's some trick to them it needs to become more obvious because I have failed to figure it out and I tried everything I could to make them work. On surface and submerged.

    On occasion, whats extremely frustrating is they will ALL work, I mean they will all launch perfectly same direction, all submerge perfectly and all HIT the target. However there is absolutely no rhyme or reason they do work as its not repeatable.

    Fix them or give us something else as its very frustrating losing 10% of your firepower. I say 10% only because they are so weak even if all 4 hit it only equals a normal torpedo from a Sea Wolf.

    Edit: Subs take so dam long to reload we can't afford to lose even 10% of the firepower.

    bug 
    opened by mitm001 4
  • Sub and exp suggestions

    Sub and exp suggestions

    1. Subs reload way to slow in comparison to ships. At minimum a 10 to 20 % boost in reload capabilities is called for. Ships regain fire power and health at a significantly faster pace due to being on the surface since chests boost health and float.
    2. All ships should collect exp based off each hit to the target and the amount of damage it does. I cant count the number of times I beat a high level ship down to almost sunk and someone else just one hits them for all the exp. Not to mention all the times you sink the ship and someone else sucks up all the chests. Especially when attacking a fleet. You sink their team mates and the fleet just gets stronger based off your efforts as they suck up all the chests for exp, health gains and quicker reloads. Theirs no logic in a fleets gaining strength from losing battles but that's what happens.

    Having each hit give exp based off damage done will distribute the exp fairly. This requires striping exp gain from chests which would also keep exp campers off the leader board as they would have to actually attack something to get exp.

    feature request 
    opened by mitm001 6
Releases(svelte)
Owner
Softbear Studios
Softbear Studios
Planetoid is a toy project to demonstrate and learn several technologies. The goal is to create a little multiplayer asteriod game clone.

Planetoid is a toy project to demonstrate and learn several technologies. The goal is to create a little multiplayer asteriod game clone.

René Ribaud 8 Aug 23, 2022
Minesweeper game where you only lose if the move is certainly wrong.

Non-deterministic Minesweeper Tired of having to guess in a game of minesweeper? Worry no more! This is a variation of Minesweeper game where you only

Lucas Clemente Vella 8 Aug 18, 2022
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

null 25 Dec 23, 2022
Red Light, Green Light is a traditional Korean children's game, popularised by the Squid Game TV series.

Red Light, Green Light Red Light, Green Light is a traditional Korean children's game, popularised by the Squid Game TV series. This project is the di

Cedric Chee 1 Jan 10, 2022
A game inspired by the classic atari game: demon attack

rusty_demon_attack A game inspired by the classic atari game: demon attack You can play the game in the web!

null 58 Jan 4, 2023
Extensible open world rogue like game with pixel art. Players can explore the wilderness and ruins.

Rusted Ruins Extensible open world rogue like game with pixel art. Players can explore the wilderness and ruins. This game is written in Rust. Screens

T. Okubo 427 Dec 13, 2022
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

Amethyst Engine 7.9k Dec 31, 2022
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

Karthik Nedunchezhiyan 23 Dec 28, 2022
A minesweeper game with a terminal and graphical interface

Mine A minesweeper game with a terminal and graphical interface created by Koen Westendorp. Installation Go ahead and try out for yourself! :) git clo

Koen Westendorp 3 Dec 22, 2022
A block game made in Rust and SFML

septadrop A block game made in Rust and SFML. For packaging instructions, see the build folder. Game Controls ??/?? arrow keys: horizontal movement ??

Elnu 1 Dec 19, 2022
A space shooter game made with Amethyst and Rust.

Theta Wave Project Introduction This game was made with the Amethyst engine. It is inspired by games like Raiden and The Binding of Isaac. Game Introd

Theta Wave 192 Oct 7, 2022
A work-in-progress, open-source, multi-player city simulation game.

Citybound is a city building game with a focus on realism, collaborative planning and simulation of microscopic details. It is independently developed

Citybound 7.2k Jan 3, 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
😠⚔️😈 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
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

Bevy Engine 21.1k Jan 3, 2023
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

null 3.6k Jan 4, 2023