You are browsing as a guest. Sign up (or log in) to start making projects!

Stardance Shooter

  • 4 Devlogs
  • 9 Total hours

Top down 2D Multiplayer Shooter made in Godot with WebRTC

Ship #1

I made a Multiplayer 2d top down arena shooter made with Godot and WEBRTC. Figuring out multiplayer was challenging and migrating host for auto matchmaking to work properly. I'm proud of how simple the game is but complete. If you want to test the project hit up a friend to 1v1 since there most likely won't be any players or DM me on discord(splattab)

  • 4 devlogs
  • 9h
Try project → See source code →
Open comments for this post

1h 19m 54s logged

Getting ready to ship got a health bar and some damage labels so that you actually know how much damage you’re doing to other players

Also added damage fall off to the bullets given that it’s a shotgun it should do more damage close up rewarding more risky game play pushing other players

The formula for that is actually pretty simple we can get a falloff factor is multiply by damage using a range end minus start

we then get the excess distance from the start min(distance-start, falloff_range) and use that to get a factor we can multiply our damage by

Getting ready to ship got a health bar and some damage labels so that you actually know how much damage you’re doing to other players

Also added damage fall off to the bullets given that it’s a shotgun it should do more damage close up rewarding more risky game play pushing other players

The formula for that is actually pretty simple we can get a falloff factor is multiply by damage using a range end minus start

we then get the excess distance from the start min(distance-start, falloff_range) and use that to get a factor we can multiply our damage by

Replying to @SplatTab

0
4
Open comments for this post

1h 38m 47s logged

For the server pointed server to an IP via noip and reverse-proxy with caddy for secure wss now too!

For the client built out an arena map and added random spawn points

Look at this beautiful map i’ve designed wowww

For the server pointed server to an IP via noip and reverse-proxy with caddy for secure wss now too!

For the client built out an arena map and added random spawn points

Look at this beautiful map i’ve designed wowww

Replying to @SplatTab

0
1
Open comments for this post

3h 42m 1s logged

Host Migration…

Godot hard codes remote ID 1 to be the server so whenever the signalling server detects that the host leaves it can just send a packet with a new lobby id to switch to

Now a good host migration system might find an optimal new host butttt, we can send this packet to everyone and they will all close their connection and re open to the new server the first player to restart their connection becomes the host! (which would also be the oldest peer connected unless there computer is extremely slow)

Okay cool everyone’s reconnected to the new server with a host and the old lobby is deleted since everyone closed their connection but now they all have different remote id’s…

But this is luckily a simple fix as long as we delete all other players but keep our own everyone will reconnect anyway and have their played re-added

Once the client gets back into the server we can find their old player and reassign it to them instead of adding a new player for local client and then the multiplayer synchronizer will do the heavy lifting and update everyone’s players to their old positions etc.

Host Migration…

Godot hard codes remote ID 1 to be the server so whenever the signalling server detects that the host leaves it can just send a packet with a new lobby id to switch to

Now a good host migration system might find an optimal new host butttt, we can send this packet to everyone and they will all close their connection and re open to the new server the first player to restart their connection becomes the host! (which would also be the oldest peer connected unless there computer is extremely slow)

Okay cool everyone’s reconnected to the new server with a host and the old lobby is deleted since everyone closed their connection but now they all have different remote id’s…

But this is luckily a simple fix as long as we delete all other players but keep our own everyone will reconnect anyway and have their played re-added

Once the client gets back into the server we can find their old player and reassign it to them instead of adding a new player for local client and then the multiplayer synchronizer will do the heavy lifting and update everyone’s players to their old positions etc.

Replying to @SplatTab

0
1
Open comments for this post

1h 50m 8s logged

Got two players with guns equipped and implemented in multiplayer with node.js WebRTC server

Features implemented so far:

  • Player has hit effects, stunning, movement and animation all synced to multiplayer

  • Shotgun with shoot sound, muzzle flash and customizable fire rate and kickback

  • Bullets have impact effects, knockback, and damage dealt

  • RPCs for spawning projectiles bullets ray cast in front of bullet for accurate hit detection

Multiplayer lets you either host a lobby or finds the first open lobby if none available then hosts one.

Got two players with guns equipped and implemented in multiplayer with node.js WebRTC server

Features implemented so far:

  • Player has hit effects, stunning, movement and animation all synced to multiplayer

  • Shotgun with shoot sound, muzzle flash and customizable fire rate and kickback

  • Bullets have impact effects, knockback, and damage dealt

  • RPCs for spawning projectiles bullets ray cast in front of bullet for accurate hit detection

Multiplayer lets you either host a lobby or finds the first open lobby if none available then hosts one.

Replying to @SplatTab

0
1

Followers

Loading…