Intro
I'm not particularly known for my creativity or ability to generate interesting game ideas; usually I start with a clone, tweak things a bit, and see how it goes.
This is the case with the multiplayer bomberman clone. It was created in a month while I was still in college; the main reason was I wanted to not only talk about game development but also be able to show something.
It has quite a few differences from the original, just to name some: procedural map generation, multiplayer, power-ups and player and bomb customization.
Procedural map generation
The map in the original game has two types of walls - destructible and non-destructible
They are placed in a grid pattern, while the whole map is surrounded by indestructible walls.
The wall in the center was replaced with a health power-up to motivate players to meet at the center of the map.
Multiplayer area of interest
Because the game features a procedural map generation instead of a predefined set of maps, I had to implement an area of interest algorithm.
Basically, instead of loading the whole map for each player, it allows only loading the visible part, which results in faster loading times and higher frame rates.
The host still loads the whole map, though.
Can't find the code, not in the original nor in the remake repository, so you'll have to take my word for it.
private void Update()
{
if (!IsServer) return;
gameobject.SetActive(Vector3.Distance >= VisibilityThreshold); //or it was .SetVisible()?
}
I think I've remembered, because there were lots of tiles, it may have caused more issues than it solved, so I had to remove it.
Powerups
The game features 5 power-ups:
- Speed - increases speed
- Shovel - allows to dig a destructible wall and place it later (stackable)
- Shield - blocks one incoming damage, expires after 30 seconds since pickup
- Health - increases health
- Bomb - increases bomb amount
Customization
It's possible to change player and bomb appearances using predefined skins.
Bombs also change the sound of explosions.
How bombs work
Bombs have an explosion distance that increases every X seconds.
When the bomb's timer runs out, it casts rays from the center to the four perpendicular directions.
If the ray hits a bomb, the bomb would explode; if a player is hit, the player would take damage.
What can be improved
First of all, it's a competitive game, not in the sense of ranking, but in the sense of PvP. The last thing you want in a PvP game is cheating. Since game uses client-authoritarian model for movement, cheating is as easy as reading process RAM and changing position values.
It allows teleportation; to mitigate this issues, a server-authoritarian model can be used alongside with client-side prediction and reconciliation to deal with latency imposed by it.
Because the host is also the server, it's possible for the host to do whatever it wants. Something like changing health and speed, not only for the host but also for other players, is not possible from the client side but quite easy from the host side.
By separating view, logic, and data it would be possible to create not only rectangular but also circular or even multi-dimensional maps.
Notes
Some of the issues mentioned above were addressed in the remake repository.
The remake also has more features, like falling blocks from the sky that instantly kill players, CSP, playfab and more.
But it was never finished because of the event-based architecture that drives me insane every time I look at it.
Hooray I have found the videos of the remake!