a multiplayer game of parenting and civilization building
You are not logged in.
A friend wanted to fiddle with a custom server, so to help out, I created a VirtualBox image with the test server pre-installed on it.
The username and password are both "ohol", and the build directories are in /home/ohol/ohol-build.
To get started, you'll need to download and install VirtualBox. It runs on both Mac and Windows, though I only tested these instructions on Windows. No reason it wouldn't work fine on a Mac (or even Linux, if you want to run in a VM on there for some reason).
In theory, you should be able to run the pullAndBuildTestSystem.sh script located in the ohol-build directory to rebuild the server when the code updates.
When you have VirtualBox installed, you can use the following (overly detailed) steps to set up the VM, launch the server, and set up the networking to let you connect to the server with a client on the host machine. It's not as involved a process as it looks, I'm just used to thorough documentation.
1. In VirtualBox, Click New.
2. Give the new machine a name (like "Ubuntu-OHOL"), set Type to Linux, and Version to Ubuntu (either 64-bit or 32-bit, depending on the image you downloaded).
3. Allocate memory to the virtual machine. I have no idea what's good, I used 1024MB to test a single local login. It might work fine with as little as 512MB in a pinch.
4. For the Hard disk, select "Use an existing virtual hard disk file". Click the folder icon to the right and you'll get a file selection dialog. Navigate to the VDI file you downloaded and extracted.
5. Click Create.
6. Double-click the new VM to launch it.
7. You'll eventually see a login page with "ohol" listed as a user. Click it. For the password, enter "ohol".
8. In the barebones desktop that comes up, double-click the Terminal icon on the desktop (the one that looks like a black screen with a $ on it) to open a terminal in the OHOL build directory.
9. Type:
ip a
10. Buried in all that gobbledygook, in the second group, the third or so line should start with "inet". You want the IP address in that line - if it were to start with "inet 10.0.2.15/24", then the part you would need is "10.0.2.15". Make a note of it.
11. While you're here, let's have the server get the latest code and build it, in case it's updated since I created the image. Assuming you're still in the build directory (if not, run
cd ~/ohol-build
), run:
sh refreshBuildScript.sh
sh pullAndBuildTestSystem.sh
The first script gets the latest version of the build script, and the second script is the actual build script. The build will take a minute.
12. When it's done, start the OHOL server. Run:
cd OneLife/server
./OneLifeServer
The server will start, and that terminal window will now be dedicated to running it. You can quit the server by typing Ctrl+Z or by closing the terminal window.
13. Now, go back to the VirtualBox main window, select the new VM, and click the Settings button.
14. Go to the Network section and click the arrow next to "Advanced".
15. Click the Port Forwarding button.
16. Click the little green "Add new port forwarding rule" button. Use the following settings, using the VM's IP address for the Guest IP.
Name: OHOL (or whatever you like)
Protocol: TCP
Host IP: 127.0.0.1
Host Port: 8005
Guest IP: (the IP address from earlier, like 10.0.2.15)
Guest Port: 8005
Note: You can leave the "Host IP" and "Guest IP" fields blank if you want to be able to connect to the VM from another computer (thanks, llap!). If you don't want to connect from another computer, I'd recommend using the settings above to restrict access to the VM's server, just in case.
17. Click OK, then OK again to get out of Settings.
18. Almost there! Go to the OHOL game directory on the host computer (i.e. Windows or Mac), go into the settings folder, and edit "useCustomServer.ini". Change the 0 to a 1, and save. If you haven't changed the custom server files before, that's all you need - if you have, change them to point to "localhost" and port "8005".
19. Launch your OHOL client. Enter anything for the email address and password, the test server won't care. If you get a login error, either use Temp Login, or change the email address to something else to force it to re-authenticate.
That should be that.
The pre-installed server uses a rough little test map I made in the editor, created following Jason's instructions here:
https://onehouronelife.com/forums/viewtopic.php?id=112
Those instructions also point out where the editor is located and how to make a test map of your own.
Note that the Guest Addition for VirtualBox are installed on the image, so you can enable the shared clipboard by going to the Devices menu, then Shared Clipboard, then Bidirectional. That will let you copy text on the host or in the VM and paste it in the other environment.
For quick reference, a section on updating the server later:
You can update the server to the latest code by going into a terminal and running:
cd ~/ohol-build
sh pullAndBuildTestSystem.sh
To update the client to the latest version, go into the client's "Settings" directory and change the contents of the useCustomServer.ini file from "1" to "0" and save it. Run the client and and log in to automatically update. Then quit the client, go back to useCustomServer.ini, and change the contents back to "1" to use the client with your local server again.
If you have problems like weird crashes, try updating the server and client using the instructions above.
If you still have problems, or if you try to launch the server and get a "Bad socket bind" error, then the old version of the server might still be running in the background. The easiest way to resolve this would be to reboot the VM by running the command:
reboot
Or if you want to do it like a Linux pro, run:
ps -ef | grep OneLife
If there's a line with "./OneLifeServer" in it, check the left-most number on the line and kill that process number. If the number were "12345", you would run:
kill -1 12345
Then you should be able to start the game server again.
You can also try going to the build directory, running the refreshBuildScript.sh script in case the build process has been changed, and then running the pullAndBuildTestSystem.sh script again.
sh refreshBuildScript.sh
sh pullAndBuildTestSystem.sh
If you have an older version of the image that doesn't have the refreshBuildScript.sh script, go to the build directory and run this instead:
wget -N https://raw.githubusercontent.com/jasonrohrer/OneLife/master/scripts/pullAndBuildTestSystem.sh
That's all the refreshBuildScript.sh script does.
Last edited by Bimble (2018-04-12 18:11:55)
Offline
Very nice.
Offline
Would there be any chance that you would make one for 32-bit?
Offline
Sure, I'll try to build a 32-bit version soon.
Offline
Thanks for sharing this!
Offline
thank you very much! it all works fine for me! unfortunately the game stops if I am eating a gooseberry ... can I do something about that?
thx for help!
llap Olli
llap Olli
Offline
... I guessed .. OK than I don´t eat anything ... but after 5 deaths the game doesn´t work anymore
any suggestions? is that a knowing problem?
thx for help again!
llap Olli
llap Olli
Offline
it says:
"cause: socket write failed"
llap Olli
llap Olli
Offline
Thanks for sharing this, Bimble!
I have a problem, thou. The cliente starts, I log into the game, but I'm stuck in the "Waiting to be born" screen.
Anyone knows what can I do?
Thanks
Offline
I'll update the instructions, but basically I'd imagine the problems come from the update. If you use the latest client with the server on the image there are probably Issues.
I'd suggest stopping the server with control-Z (in the terminal you're running it in), then cd your way to the ohol-build directory, then run the pullAndBuildTestSystem.sh. Basically, that looks like:
cd ~/ohol-build
sh pullAndBuildTestSystem.sh
That will download the latest server code and compile it. When it's done, try running the server and see if it works any better.
If you need to update the client to the latest version, change the value in useCustomServer.ini in the client's Settings directory to "0", then launch the client and log in to the game to auto-update, then quit and set that back to "1" to connect to your local server again.
Note that if you see a socket error or the like trying to launch the server, then the old server might still be running (that can happen if you double-click the server in a file browser window). To fix that, go into the terminal and type:
ps -ef | grep OneLife
If you see a line with "./OneLifeServer" in it, then it's running. Make a note of the first number in the line so you can kill it. If that number were 12345, for example, run:
kill -1 12345
That should tell the server to shut down, then you can start the newly-updated server in its place.
Last edited by Bimble (2018-03-19 03:46:35)
Offline
I wonder if it would be useful to build a docker image instead. The advantage would be that you can automate all the setup more easily. If I get some time, I'll try to do it, but anyone feel free to beat me to the punch because I'm notoriously unreliable ;-)
Offline
Sounds good to me, but I won't be the one to do it.
I haven't messed with Docker a lot but have been using VirtualBox for a new job, so I ran with that. I imagine problems will arise less from the image or container than from new server admins needing to get used to the game update cycle.
Offline
@Bimble:
thank you very much for help and explaining perfectly! I will try it later!
I have one question yet, is there a possibilty to play it in LAN? I have tried to change the networksettings of the VM, but it doesn+´t worked as well.
llap Olli
llap Olli
Offline
The port forwarding I set up in the instructions only accepts connections to localhost (127.0.0.1). You could try adding another port forwarding rule similar to that, but using the main IP address of your computer for the "Host IP" (with everything else the same).
Another approach would be to shut down the VM, then go to its Network Settings, then enable a second network adapter and set it to "Bridged" mode. That should let the VM get its own IP address on the local network. You can check it by starting the VM back up again and running "ip a" to see if there's a new IP address that matches your LAN.
Note that you might need to open port 8005 in your computer's firewall to let the connection through as well.
Offline
Update: I added a 32-bit version of the image, and also tweaked the 64-bit image a bit.
The main changes are the addition of a GUI text editor (Mousepad) and installing the Guest Additions in the image. The Guest Additions let you share your clipboard with the VM (handy for copying and pasting) and should let you resize the VM window and have the VM's desktop adjust accordingly.
You can install Mousepad on an existing VM (so you don't have to download a new image) with:
sudo apt-get install mousepad
And the Guest Additions can be installed on an existing VM by going to the Devices menu and selecting the last item (Insert Guest Additions CD image), then going into a terminal and running these commands:
sudo mount /dev/cdrom /media
/media/VBoxLinuxAdditions.run
When it's done, reboot the VM and you should be able to enable the shared clipboard via the Devices menu.
I doubt I'll have occasion to make more changes to the images, from here it should just be a matter of running the pullAndBuildTestSystem.sh script when the game updates.
Offline
That's actually really neat. I might spin up a Ubuntu VM in VMWare (what I normally use) for server testing and post it.
Offline
The port forwarding I set up in the instructions only accepts connections to localhost (127.0.0.1). You could try adding another port forwarding rule similar to that, but using the main IP address of your computer for the "Host IP" (with everything else the same).
Another approach would be to shut down the VM, then go to its Network Settings, then enable a second network adapter and set it to "Bridged" mode. That should let the VM get its own IP address on the local network. You can check it by starting the VM back up again and running "ip a" to see if there's a new IP address that matches your LAN.
Note that you might need to open port 8005 in your computer's firewall to let the connection through as well.
At first, updating the server in the VM helped with the problems of eating the berries thx, now I understood!
But unfortunately I don´t get the connecting in my LAN. I tried both ways , I even deactivated the firewalls of both computers, but if I type "ip a" it doen´t show me the actual IP of the windows-computer. It is 192.168.178.64 (with the VM) and the second has 192.168.178.50 ... the ports are open via firewall. After typing "ip a" it shows me always the same, but if I open a second or a third network-adapter it only opens a new number (3, 4 ...) but without the IP ..
Do you have an idea for help? Thx for your time!
llap Olli
llap Olli
Offline
Nice, i was too lazy to do a guide like this.
(I have been to lazy to do any mods too, we need an artist that can draw mods materials with the style of the game)
Thanks you very much for your contribution, this will help the community/mods/servers grow.
Offline
The "ip a" command should show you the network adapters configured on the VM, so it won't show your computer's IP address there - just the addresses being used by the VM. The adapter in "bridged" mode should be asking your router for its own IP address on the LAN, which is why that's different.
If you have more than one network adapter on your computer (a wired connection and a wireless adapter, for example), you might make sure the bridged adapter is using the right adapter (click the name to see a drop-down menu).
If you haven't already, I'd try pinging one computer from the other, or seeing if you can mount a share from the other, just to make sure that the computers can actually connect to each other on the LAN.
Otherwise...yeah, I'm not sure what else could be going on. You can try searching for "virtualbox LAN connection" to see what you can find in the way of tutorials or explanations on StackExchange. You might find answers from people with more experience troubleshooting it than I do.
Offline
I got it !!!!!!! The problem was that I wanted to be too good
Here is the solution (show at your point 16)
16. Click the little green "Add new port forwarding rule" button. Use the following settings, using the VM's IP address for the Guest IP.
Name: OHOL (or whatever you like)
Protocol: TCP
Host IP:
Host Port: 8005
Guest IP:
Guest Port: 8005
Thats it. You have to leave "Host IP:" and "Guest IP" blank, than it works fine! I already have connected 3 computers via LAN with the VM-Server.
Thanks a lot !!!!!
llap Olli
llap Olli
Offline
I'll add a note about that. Thanks!
Offline
I also are able to connect from the VM-host computer with these settings
and I have more to thank you than you to me
llap Olli
llap Olli
Offline
Thank you very much again for posting the server, to have the possibility to test all the things! It works fine!
llap Olli
llap Olli
Offline
After getting to step #6, I get a Kernel-Panic issue. Is that normal?
Offline
Not normal. Are you sure you got the right architecture (64-bit for a 64-bit OS, or 32-bit for a 32-bit OS)?
Offline