Neither one nor Many
Software engineering blog about my projects, geometry, visualization and music.
Smash Battle is a really cool game made by Bert Hekman and Jeroen Groeneweg. Of which Jeroen is now a collegue of mine at Tweakers.net. It supports up to four players, you can use gamepads and the multiplayer is best out of five. You can get powerups in the game like extra damage, health pack, armor etc. :) (I see that in the codebase also a single player is under development!)
I decided to add a network multiplayer gametype to it, and I develop that in a separate branch. It supports more than four players.
Currently the network multiplayer supports only bullets and mines (your default equipment). Powerups do not yet appear. All damage to players or tiles is determined on the server. The clients are trusted though, to send their correct player positions, shots fired etc. You could theoretically cheat (up to a certain level) by modifying and compiling your own client, but it is far easier to implement a network multiplayer if I can trust clients somewhat. This can easily be rewritten though, and if you play with low lags you will probably not notice any difference. But I think you will notice if someone is cheating.
It's a pre-alpha because the gametype is not completely finished yet, if there are more than two players a normal best out of five multiplayer starts. Once the game has started, you cannot join the server anymore. You can already test it out simply install the current release of Smashbattle.
Put this line in your /etc/apt/sources.list: deb http://repository.condor.tv lucid main
Note that the update command might give you this if you are running 64 bit:
Ign http://us.archive.ubuntu.com quantal-backports/universe Translation-en_US Fetched 1,032 kB in 30s (33.7 kB/s) W: Failed to fetch http://repository.condor.tv/dists/lucid/main/binary-amd64/Packages 404 Not Found E: Some index files failed to download. They have been ignored, or old ones used instead.
You can ignore this error and continue installing the 32 bit version.
The game should now run, but to use the pre-alpha, you have to replace the 'battle' binary with mine:
You can start your server with these parameters:
Battle.exe -s Example: Battle.exe -s Battle.exe -s <listen port> Example: Battle.exe -s 1100 Battle.exe -s <levelname> <listen port> Example: Battle.exe -s "TRAINING DOJO" 1100
In case no level is given as a parameter, the server will start with level selector. In case no port is given, default will be used (1100).
To connect to a client, you need to have registered the .reg file. You can click links like:
smashbattle://<domain.tld>:<port> Example: smashbattle://cppse.nl:1100
You could type such an url in your WINDOWS+R (Run command) or in command prompt start <url>.
If you do not like to register the .reg file, you can also give it to Battle.exe as a parameter:
Battle.exe <url> Example: Battle.exe smashbattle://cppse.nl:1100
After you have set a server on your machine, you should be able to connect using ---> smashbattle://localhost:1100
"TRAINING DOJO" "PLATFORM ALLEY" "PITTFALL" "DUCK'N'HUNT" "COMMON GROUNDS" "POGOSTICK" "LA MOUSTACHE" "THE FUNNEL" "BLAST BOWL" "PIT OF DEATH" "RABBIT HOLE" "STAY HIGH" "PIE PIT" "SLIP'N'SLIDE" "BOULDERDASH" "SNOW FIGHT"
Default your keyboard controls are
While developing I sometimes put #include's above the function where I use stuff from it. This is when I feel like I might refactor the code, I can easily remove the #include again. Works for me, but it results in some stray #include's. Also I'm not sure about my design choice of making server and client singleton's (basically global classes). It was easy so I could weave the client/server code into the game rapidly, but I think it may need to integrate with the existing classes better, and use polymorphism a bit more here and there. Example: I have a few places in the code where I do different stuff based on Main::runmode static global, for server do this, for client do this..