Page 1 of 1
Multicompany via Virtual Machines?
Posted: 26 Sep 2016 00:24
by AntoninKyrene
Hello!
Can two or more virtual machines on the same host be connected to act as separate companies in a multiplayer game? I have a continental map that is separated from some smaller "nations" by water, and I'd like to have control over how those nations evolve so they can feed goods into the continental empire as I see fit. I'm trying to avoid any AI use - the feeders will only have one or two services, so for most of the game, they can be built and left to run their course.
I have been doing some reading on the multiplayer capabilities, but all of what I'm reading seems to apply to multiple physical machines on the same network. If this option already exists as a self-contained "thing" in OpenTTD, then I'm just plain missing it. 99% of my OpenTTD games are single-player/no-competitor, so this is new ground for me.
-Marc
Re: Multicompany via Virtual Machines?
Posted: 26 Sep 2016 00:33
by Sylf
A single copy of openttd can run simultaneously multiple times on a single PC, no need for any virtualization. One instance should act as a server, and use other instances as clients.
You should also check out
this thread regarding to running multiple company by yourself.
Re: Multicompany via Virtual Machines?
Posted: 26 Sep 2016 00:56
by AntoninKyrene
Multiple instances on a Mac means a script. Thinking...remembering...scripting.
Well, they are running, but they can't see each other. But I have a better grasp now of what I'm trying to do. A little more reading may be in order.
(Edit for Spelling)
Re: Multicompany via Virtual Machines?
Posted: 26 Sep 2016 04:23
by Alberth
AntoninKyrene wrote:Multiple instances on a Mac means a script. Thinking...remembering...scripting.
Can't just open 2 terminals and start openttd in each of them?
AntoninKyrene wrote:Well, they are running, but they can't see each other. But I have a better grasp now of what I'm trying to do. A little more reading may be in order.
Assuming you connect through localhost, there might be a firewall blocking the tcp/udp connection to access the server.
Re: Multicompany via Virtual Machines?
Posted: 27 Sep 2016 01:52
by AntoninKyrene
I could use multiple Terminals, but the AppleScript is a one-click solution, and it was super-easy to write. Write once, click many!
The fundamental problem here is Antonin (that's me) didn't do enough research before posting. Had he done a little more research on this fine forum, he'd have discovered he needs a refresher in networking, which was never his strong point to begin with, along with some reading on new features that have appeared over the last...oh I don't know, three years?...so as to better understand how he should get from Point A to Point B. Then, after doing some homework, he should be able to return with some intelligent questions, or at least some helpful information as to why it's not working, so others can help him.
Right now, the best I can tell you is "I have a server and two clients running and they won't talk to each other and I don't know why and I want my binky!"
Running multiple instances of OpenTTD? Not a problem.
Initiating a non-advertised server? Not a problem.
Next step: how to point one of the clients to the server.
Re: Multicompany via Virtual Machines?
Posted: 27 Sep 2016 02:10
by AntoninKyrene
OK, someone needs to send me to my room to think about my actions.
1) Nothing is going to happen when the firewall shows OpenTTD with a "block all connections" option enabled.
2) That "Find Server" button is a true miracle of network programming.
It's working exactly as I hoped.
I am so embarrassed.

Re: Multicompany via Virtual Machines?
Posted: 27 Sep 2016 12:36
by Pilot
Are you not basically wanting the same thing as in
this thread?
Because if all you want is multiple companies working on the same map, then all you need is the Cheat Menu (accessed through Control + Alt + C) and multiple instances of the IdleMore AI. This is an AI that will not build anything on it's own, but you can build stuff for it. Whilst you stated in the first post that you don't wish to use AIs, I feel this particular option is much easier to implement than getting multiple instances of OTTD set up in a multiplayer game.
Re: Multicompany via Virtual Machines?
Posted: 27 Sep 2016 23:33
by AntoninKyrene
That was the thread that got me thinking about this whole idea. Tonight, I'm going to fire up two separate machines and fiddle with multiple instances of OpenTTD versus a single instance with the companies cheat. Right off the bat I liked the multiple instances option last night because I could put each company on its own monitor, but I know that can be done in another form in a single instance.
I have discovered another possible issue for consideration: station sharing. If the nations are going to provide goods and services as separate entities, there has to be a place where those goods and services can be exchanged. If Moldova is going to send iron ore to Russia so Russia can make steel, and Russia wants to export that steel to Mongolia for final processing...
This game has evolved way beyond what I realized. I've always played my way, using my D&D Randomizing Rules to dictate what my limits were in a single-player game, and never got bored or looked for something different. I'm not even sure exactly what version I'm using - probably an RC, knowing me and how I do things. But now that I dig deep...wow.
Re: Multicompany via Virtual Machines?
Posted: 28 Sep 2016 04:32
by Alberth
Oil rigs can be used to exchange cargoes between companies.
Re: Multicompany via Virtual Machines?
Posted: 28 Sep 2016 05:28
by AntoninKyrene
That might work, depending on where they can be placed.
Pilot wrote:Are you not basically wanting the same thing as in
this thread?
Looks like it, except the cargo handoff becomes the problem. Oil Rigs would work. Something more realistic might be IS. Going to look at both and see if my compiling skills are still up to snuff. I really like running separate companies as separate instances. That is working nicely so far. I'm going to re-read that thread and see if I missed anything that might facilitate.
Re: Multicompany via Virtual Machines?
Posted: 06 Oct 2016 02:15
by AntoninKyrene
Well, after much studying and experimenting, I believe I found my solution: JGR's Patch Pack.
It took several tries to compile, and after finally realizing I needed to update the compiler, I produced a working nightly with the patch pack. Red is now sharing stations with Blue. Mission accomplished. Now...we start the process of finding a good configuration, cloning the VM for historical purposes (in case JGR stops updating the .diff) and beginning our story.
Way cool.
