Skip to content

How to set up a Live Coding compo

thenewdays edited this page Mar 27, 2023 · 25 revisions

Here's how you can set up a live coding competition at your party, regardless of any size.

The methods

There's two ways you can go about setting a compo up: the hardware method will transmit the video signals through HDMI and will need extra hardware, the network method will transmit the video signals via software through LAN, which will put a bit more load on the computers.

Start by picking the one you can afford.

The ingredients

  • Two computers for the contestants - these can be laptops, just make sure they're muscular enough to take complex shaders. Also make sure they have a way to receive audio input from the music.
  • A main computer that serves as a video mixer - this is usually your compo machine connected to the bigscreen.
  • For the hardware method: Two capture cards (internal or external) that can take the video output from the contestants' PC-s, and cables to connect them. Considering the cost of a capture card starts at $150, you should probably only pick this method if you already have those cards at hand.
  • For the network method: At least a Gigabit Ethernet network (1000Mbps) that connects the three computers. This method is cheaper since all it requires is setting up a standard IP network, but puts a bit more load on the contestants' PC-s as it uses software video compression.

Notes

  • All of the software used below is platform-independent, so it's theoretically possible to do this in both non-Windows and mixed-OS environments. However, most of it only has Windows builds and we only really tested this with Windows, so use anything else at your own risk. If you manage, though, let us know.
  • It's also possible to mix-and-match the two methods if you don't have enough capture cards.
  • In this guide we'll be referring to two PC-s, but if you want to have a competition with three or more, there's no theoretical limit to how many you can have at the same time.

Basic installation steps

  • Get Bonzomatic and install it on the contestants' PC-s. Make sure it runs on both machines. Edit the config.json to your needs (see README.md)
  • Get OBS Studio and install it on the mixer PC
  • Set your mixer PC to expanded desktop - NOT clone mode!

Variation 1: The hardware method

  • Install the capture cards you have on the mixer PC
  • Connect the video coming out from the contestants' PC-s to the capture cards.
  • Verify that they both receive signal - you can usually do this via capturing apps like Skype; the capture cards generally have their own apps as well where you can verify they're working.

Variation 2: The network method

  • Get OBS-NDI and install it.
  • Configure Bonzomatic's config.json (again, see README.md) to enable NDI - make sure to give the two PC-s distinct names in the "identifier" field so you can tell which is which.
  • Connect the three machines on a LAN - make sure the machines can ping each other. Generally a good idea to have this network separate from any other network you may have at your party unless you want to risk someone messing with it.

Set up OBS

  • In the main screen of OBS, add three scenes (lower left list) - you'll need one for each PC and one split-screen. Name them accordingly ("Left PC", "Right PC", "Split")
  • Add sources to each scene accordingly: with capture cards, you'll need "Video Capture Device", with NDI you'll need "NDI Source". Double-click the source to edit which capture card / NDI source it uses.
  • Click/drag/resize the sources in the preview window so that they look nice.
  • Right click the main preview window of OBS and open "Fullscreen Projector (preview)", then select the screen that's your bigscreen.

If you got this far, it means you have three sources, you can toggle between them by selecting the respective scenes, and it is displayed on the bigscreen in a fancy manner. The hard part is done.

Tips and tricks

  • Don't rely on system fonts! Courier New is a nice font, but it's so thin it becomes harder to read with a background effect, especially when you're using NDI or the compo is livestreamed, and the image reaches the viewer heavily compressed. Consider using something like http://input.fontbureau.com/ instead.
  • Always a good idea to have a fourth scene with a static image you can cut to if you have to do some maintenance.
  • If you're using NDI, quitting Bonzomatic might require you to reset the NDI source. Usually it doesn't, but be prepared.
  • If you want to put overlays on, use the "Image" source type.
  • You can right click any source, select "Filters", and add a "Chroma Key" filter to do a green-screen trick. This is particularly useful if you want to have realtime updating things like a clock or live scores on screen. You can use the "Window Capture" source type to e.g. capture the contents of a browser, where you've created a green-screened overlay that does a countdown.
  • It's good practice to save and publish the shaders after the compo is done; use the automatic backup option to copy the shader to a safe place once the round is over. If the machines are network connected, it's a good idea to copy into a network accessible or cloud-synced folder so that you can grab the shader to a "safe place" from another machine while the next round is ongoing.