Blockwars is a multiplayer tetris games with special attacks.
Everyone knows tetris, but not so many know about multiplayer tetris with special attacks. Blockwars is inspired by the original Blockwars made by Certus.
When two or more rows are removed at the same time, a bonus block appears somewhere on the board.
When the bonus block is removed, the player gets a special attack. Special attacks can then be used when the player wants to.
Currently implemented attacks are:
- Add Row
- Remove Row
- Shotgun
- Earthquake
- Bonus Clear
- Clear Board
- Switch Board
No offical servers are running, so players need to host a game themselves. Game is hosted on port 7070 (dedicated server).
Each attack can be used on any player (also themselves).
A offline mode is also avialable where the player can play against an AI opponent. The AI moves with the speed of around 2 moves/second.
The AI is capable of using attacks when they think it is good to use them. For instance, it will not use remove row on itself if it haven't
built high enough, likewise it will not use a strong attack like earthquake when the player isn't high enough.
The AI works by simulating all moves it can make, then calculate a score based on four factors: Height, Removing lines, Holes and Bumpiness.
Inspiration was taken from CodeMyRoad, here you
can read more about how the AI works and also read about a genetic algorithm that was used in creating the "Near Perfect Player".
I was not able to completely copy everything from there, since I wanted my AI to take into account that removing two rows were much better
than removing one row after another, I had to change some things in the score calculation.
I made it so that removing just one row would give negative score, while removing two or more would give positive score. This worked well until
I noticed that the AI would rather build high and lose than remove just one row. This is clearly not desired and I went to tweak the numbers for
the score when removing one row. It resulted in a just multiplier just above the height multiplier, which resulted in that it prefers to not
remove one row, but it would rather remove one row than build too high.
For the attacking algorithm, it calculates the score for the player and if that score is below a certain threshold, attack. The same goes for
the defensive attacks, but it calculates the score for the AI instead.
The switch board attack is only used by the AI if the player is in a better state than the AI (which is calulated based on score difference) as
well as the AI beeing in a such a bad state that it would be hard to get back from.
In future updates I want to add functionality to let the AI hold a piece if it does not fit good enough in any position.
Controls:
Left: Left arrow
Right: Right arrow
Rotate: Up arrow
Place: Space
Attack Player: 1-4
Hold Piece: Shift
Blockwars 0.1 download (06-Oct-16) Patch notes
Known issues
- Lags when using Remove Row