Tutorial: 2 player racing with DOSBox
#1
Prerequisites:

- 2 computers, which see each other, if a computer is behind NAT (that is behind a usual router) port forwarding is necessary. You can set it up in the router, if it supports UPnP, PortMapper (https://sourceforge.net/projects/upnp-portmapper/) could also be used.
- or a computer and a virtual machine inside, not that great for gaming, but enough for testing. Networking should be set up in a way that the VM and the host can ping each other, for the details consult the manual of your selected virtualization solution.

DOSBox setup:

Its nullmodem feature will be used, nullmodem emulates a serial cable directly connecting the 2 DOSBox instances. It can be setup inside a running DOSBox (good for testing), or written into the config file. There is a server and a client, the server should already run when the client connects. The DOSBox server and client role is completely unrelated to ICR2's host and client roles, the ICR2 host could be either DOSBox server or client.

By default nullmodem uses port 23, which works on Windows, after it was allowed on the firewall. On Linux (and probably on BSD as well) a port above 1023 should be used. In this example I have chosen port 1995.

The command on the server:

Code:
serial1 nullmodem port:1995

After the server is up, the command on the client:
Code:
serial1 nullmodem server:{IP or name of the server} port:1995

Notes:
- port can be omitted if both DOSBox runs on Windows.
- if the server is behind NAT, its outer IP is needed, use your favorite "what is my IP address" page to find it.
- in case of problems have a look at the status window (the terminal showing messages). In Windows it appears automatically, in Linux you have to start DOSBox from a terminal.
- when everything is OK, the exact same lines can be added to the config file (search for serial1, and replace it)
- if serial1 is already used for other purposes, serial2 - serial4 could also be used.

ICR2 setup:
On both DOSBox, go to the "MULTIPLAYER RACE" menu. In this go to the "SETUP" submenu, and set
- the "COM PORT" to COM1 (if serial1 was used in DOSBox, otherwise the corresponding number should be used)
- the "BAUD RATE" to maximum (38400)
- the 4th item to "DIRECT CONNECT" instead of "MODEM"
- and then DONE, IRQ setting does not matter in DOSBox.
Back in the multiplayer menu, on the host press "ANSWER", on the client press "DIAL". Note: there is no message after dial to wait before pressing answer, answer can even be pressed before client presses dial.

That's it, enjoy your 2 player game!
Born in 1979 - the same year as Bourdais, Raikkonen, Champcar and Dakar.
Reply
#2
I have a three screen setup at home. If I understand you correctly, I should be able to put one driver in the pc and one in pc and have them sit next to each other?
IIRS Driver Champion (2005-2007, 2010-2014)
IIRS Team Champion (2004-2014)
Reply
#3
You mean one computer, three screens, two players? Yes it is possible. Though for proper gaming a second controller (and maybe a second keyboard) is needed, it should be passed through to the virtual machine. I suggest USB devices, its passthrough is nowadays easily done by a few clicks.
Born in 1979 - the same year as Bourdais, Raikkonen, Champcar and Dakar.
Reply
#4
I have 8 USB ports on the desktop and just one is in use (for screen 3), so adding an extra USB device is not an issue.
IIRS Driver Champion (2005-2007, 2010-2014)
IIRS Team Champion (2004-2014)
Reply
#5
It is possible to connect two DOSBox instances on the same computer. In this case the clients command is:
serial1 nullmodem server:localhost port:1995

Tested only on lInux. Instead of localhost 127.0.01 might be required.

Disadvantage: keyboard can only be used inside the active window.

Two controllers are still needed, mapper (Ctrl + F1) should be used to map the second controller as the joystick of the second instance. Saving it is a bit tricky, mapper files name is not asked, it is always saved with the default filename. But there is a 'mapperfile' option (in commandline and in the conf file), which can load a mapper file with any filename. Something like this might work:
- configure DOSBox as the server, also map your primary conroller, save the mappings
- make a copy of your mapper and config files
- fire up DOSBox, configure and save the mapper file of the second instance
- exit DOSBox
- rename the mapperfile (for example second.map)
- copy back the previous one
- copy the configure file with a different name (for example second.conf)
- in the copied configure file change the mapperfile option to point to the renamed one (e.g. mapperfile test.map); and add the "server:localhost" option to your serial1 line, save it
- copy the DOSBox starter icon to your desktop as e.g. "DOSBox second instance"
- in this edit the commandline, add the "-conf second.conf" option to load your alternative config file. The full path might be needed.
- enjoy racing

Note: not tested, as I do not have a second controller.
Born in 1979 - the same year as Bourdais, Raikkonen, Champcar and Dakar.
Reply
#6
I know a lot of this guidance is meant for two computers side by side. Is there anything else to think about, if two people in different locations were to try to do multiplayer over the Internet today using DOSBox?
Reply
#7
(01-15-2022, 05:38 AM)checkpoint10 Wrote: I know a lot of this guidance is meant for two computers side by side. Is there anything else to think about, if two people in different locations were to try to do multiplayer over the Internet today using DOSBox?
The NAT thing, port forwarding and outer IP is important in this case (when behind a router, that is most people).
Lag might be an issue, but I guess the game can deal with it, as lag was there in 1995 as well.
Born in 1979 - the same year as Bourdais, Raikkonen, Champcar and Dakar.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)