Network of the Damned! (Multiplayer mod for Catacombs of the Damned!)

I have made a 2 player networked multiplayer mod for Catacombs of the Damned!

The game is co-op and you can explore the dungeons with a friend. If either of the players are killed, you start back on level 1

You will need:

  • 2 Arduboys flashed with the sketch

  • A computer with 2xUSB ports with Python installed to act as the server

To play:

  • Flash the 2 Arduboys with the sketch (flash Arduboy3D.hex binary or alternatively build from source: Source/Arduboy3D/Arduboy3D.ino)

  • On the server computer, make sure that you have Python installed

  • Ensure you have installed the pyserial and keyboard Python modules by running:

    • python -m pip install pyserial keyboard
  • Start the relay script

    • python Relay/relay.py
  • Switch on both Arduboys, the game should start automatically once they have found each other

If you don’t have 2 Arduboys but are using a Windows PC for the host, you can also use the Windows client (make sure you start the relay first)

You can download the binaries, source and view the full details here:

Disclaimer: I haven’t got two Arduboys to actually test this on! I can confirm it works when playing with an Arduboy and the Windows client though :slight_smile:

14 Likes

Yes, i was dreaming of it. To be top, it’s would be amazing to play with only Buetooth or Wifi direct but it’s already extra to be able to do multiplayers. Do you think that it’s could be realistic to go up to 4 (With the system, i don’t imagine a 8 players version as it’s would say too many USB free ports but 4 with an USB Hub is realistic)

You think to port system to some other games like car races ?

1 Like

This is a very simple implementation so is currently limited to only 2 players. It works using the standard Arduino Serial.read() / Serial.write() functions and the Python relay script just passes the serial stream between the two Arduboys. No special game specific logic runs in the Python script so it could be used for other 2 player games without any modifications.

I designed it this way so that potentially if @bateske adds link cable functionality to the Arduboy FX then it could probably be supported with minimal changes.

If you wanted to have more that 2 players then you would need to have some additional logic in the Python script so that you could address each Arduboy individually.

1 Like

Oh, I need to test this in the office… maybe with something like https://www.flexihub.com/

3 Likes

If you pass via the PC it’s not impossible to link them via internet to pass the serial informations and so the limit of 8 players could be easy to reach but all the complexity will be deported on the PC program to communicate via internet.

3 Likes

It would start to get very complex very quickly if you start thinking about internet multiplayer (e.g. you would need custom net code for handling internet latency)

1 Like

Only problem I see is that you always need something in the middle so link cable doesn’t seem really possible unless you use something like a raspberry pi zero in the middle as part or the cable…

2 Likes

Not necessarily. You could still have a “universal” Python script. You just send anything received on one port to all the other ports with an Arduboy attached. It’s then up to the Arduboy game itself to define the protocol used, knowing that everything sent will be received by all other attached units.

For example, if you wanted to be able to send messages to specific units, the game could add a unit number to the start of every message (and possibly use a specific number, such as 0, to mean “broadcast” to all units). Every unit receives all messages but it ignores any message that doesn’t start with its unit number (or the broadcast number).

Note that the Arduoby2 library defines and has functions to support a unit ID intended for this purpose, stored in the reserved system EEPROM area. See functions writeUnitID() and readUnitID(). If you don’t want to add code to your game to allow setting the Unit ID, The SetSystemEEPROM example sketch included in the library allows you to do this.

1 Like

@jhhoward This looks amazing! Out of interest, what do you mean by the ‘Windows Client’? I only have one Arduboy and would like to give this a go.

Edit: Apologies. I have just looked on the GitHub and it is clearly there. :sweat_smile:

If you take a look at the script it is possible to do this by changing MAX_CONNECTIONS to something larger to support this behaviour. Like you said, you would need to design a more complex protocol.

Currently in the ‘handshake’ stage, the 2 clients send each other a random number and the one with the lower one is player 1 and the other player 2 (if they pick the same number then they try again).

1 Like

Nice work! :grinning: Made me think of:

1 Like

Actually, speaking of, this would be perfect on the midiboy:

https://blokas.io/midiboy/

…but no-one would have more than one of those!

EDIT: there are solutions for MIDI over the 'net though!

1 Like

:confused: multiple dll errors

image

1 Like

Try installing Visual C++ Redistributable for Visual Studio 2015:
https://www.microsoft.com/en-gb/download/details.aspx?id=48145

1 Like

Yeah, I tried but there is some conflicts with another version

image

Anyhow, do not worry

1 Like

Just realised that the .exe I included was built with Debug configuration. I’ve uploaded new binaries here:

1 Like

Thanks, I think your file is corrupt (the SDL.dll is broken), but using the dll from the debug package, it works!

2 Likes

How strange! I uploaded a new ZIP for anyone else wanting to try it out.

Glad to see it is working for you now :slight_smile:

1 Like

In case it’s of any use or relevance, a small reminder that I made this a while back:

I can’t remember whether or not it works as a serial relay,
but modifying it to work as such shouldn’t be difficult if it doesn’t.

(Windows only I’m afraid, purely becuase of how DeviceChangeWatcher is implemented - via WMI.)

2 Likes

So, we got it working in the office lan with a very shitty relay:

9 Likes