Page 1 of 2

Head2Head play

Posted: 29 Mar 2009 01:14
by Yexo
Based on an old patch by TrueBrain, I present you (again) head2head play. I'll write a more detailed explanation later. What this patch does:
If you start a new game the world is copied and pasted to the SE side of the map. You now have two exact same halves. The first company can play on the NW half, the second company on the SE half. This way you can play competitive without industry stealing/blocking etc. Just get two teams ready and see who can make the most money.

Download here: http://www.openttd.org/en/download-head-to-head
Repository here: http://hg.openttd.org/developers/yexo/head-to-head.hg/

Re: Head2Head play

Posted: 29 Mar 2009 01:25
by andyp
Only the first two companies are restricted in which map they can build in. Companies beyond #2 can build in both.

Nice patch, was fun playing. :D

Also, helicopters can fly to oil rigs in the opposite map.

Screenshot at the break between maps:

Re: Head2Head play

Posted: 29 Mar 2009 07:27
by taisteluorava
This is cool. Hopefully in future there should be able to play up to 4 players against, and a options to enable/disable this in advance settings or in map generator. Thx :).

Re: Head2Head play

Posted: 29 Mar 2009 10:46
by Benny
I've just made my own Head2Head server.
It is 512x512 and uses a few ingame content download newGRFs. :)

Edit: Oh, crap.. I think that I have got some technical problems here.. Does anyone see it in the list?
Edit2: No you can't.. I also found openttdcoop's server, so there is no need for mine anyway. :)

Re: Head2Head play

Posted: 29 Mar 2009 15:36
by FooBar
Nice multiplayer approach! And very suitable for an idea I came up with a long time ago: Allow each player to have exactly one train. Every player starts at town X and the first who gets his train to town Y wins. These seperate maps make the challenge a little more fair without players obstructing one another.
(Ofcourse, for this challenge to work, you should have far less money than the amount needed to buy a train and construct a railway between X and Y.)

Yexo wrote:It's possible to 'steal' goods if an industry is near the edge where the two halves connect, this shouldn't be possible.
Maybe add a few extra tiles of water between each halve?

Re: Head2Head play

Posted: 29 Mar 2009 15:43
by Roujin
FooBar wrote:
Yexo wrote:It's possible to 'steal' goods if an industry is near the edge where the two halves connect, this shouldn't be possible.
Maybe add a few extra tiles of water between each halve?
Judging from the commit logs, this problem is already solved now ;)

Re: Head2Head play

Posted: 29 Mar 2009 15:47
by FooBar
Come to think of it, water might be a bit odd in case of a map with land at all edges...
So better ignore that suggestion!

Re: Head2Head play

Posted: 29 Mar 2009 15:55
by Yexo
Roujin wrote:Judging from the commit logs, this problem is already solved now ;)
The logs can be deceiving :p
I thought I fixed it, but the problem is still there.

Re: Head2Head play

Posted: 29 Mar 2009 19:58
by Yexo
Ok, most know bugs fixed.
Download here: http://www.openttd.org/en/download-head-to-head
Repository here: http://hg.openttd.org/developers/yexo/head-to-head.hg/

There is a setting under constructions->number of head-to-head ares. This must be set to a multiple of 2! Valid values are thus: 1, 2, 4, 8, 16. Failure to do so will result in a crash during map generation. Also make sure that mapsize_y * number-of-areas <= 2048. Again, failure will result in a crash.

Todo / known bugs:
Don't crash but handle the above cases nicely.
Make AIs aware that not all towns/industries/tiles are valid.
Make it possible to have the areas not only in NE<>SW direction, but also inthe NW<>SE direction.

Re: Head2Head play

Posted: 31 Mar 2009 13:39
by 2007Alain2007
hi will you be bring out a patch file for this

Re: Head2Head play

Posted: 31 Mar 2009 13:46
by Eddi
why make a patch when you have the repository right there? it's just unnecessary time spent for the developer that he could spend much more usefully.

Re: Head2Head play

Posted: 31 Mar 2009 14:07
by 2007Alain2007
so to make a patch on this i have to add them bits all togiver and it should work :)

Re: Head2Head play

Posted: 31 Mar 2009 14:45
by Eddi
no, you check out the repository and tell it to make a diff between "tip" and the last "sync from trunk" commit. you can find out which revision that is by using the log.

Re: Head2Head play

Posted: 31 Mar 2009 17:12
by Zuu
Really cool idea. I see you use the OpenTTD binaries server, so I've added Last Head-to-head as a target option in OpenTTD Auto Update.

To users (who are not aware of how Cargodest was hacked into OpenTTD Auto Update): The OpenTTD Auto Update client don't know how hg versions look like, so it will look like nothing is installed in "more info", but the server side knows how to interpret the raw version string from openttd.exe. And it is the OTTDAU server that decides if there is an update available or not, so it will work, just don't look as pretty as it could do.

Re: Head2Head play

Posted: 31 Mar 2009 17:28
by Eddi
Zuu wrote:so I've added Last Head-to-head as a target option in OpenTTD Auto Update.
sounds like you have to do that manually, can't you autodetect any added lines in the finger output?

Re: Head2Head play

Posted: 31 Mar 2009 17:58
by Zuu
Eddi wrote:
Zuu wrote:so I've added Last Head-to-head as a target option in OpenTTD Auto Update.
sounds like you have to do that manually, can't you autodetect any added lines in the finger output?
Sure with a bunch of work I could do that. But that would need me to autodetect hg-versioning too, which I don't at them moment. Also I would probably need to restrict it to nightlies/* and custom/*, but what if in future there will be something using */* that is interesting to have, while extra/openttd-usefull is not really interesting to have. In addition there is some additional information I keep that is not on fingers. Such as which letters should be upper case in the GUI etc. (this could be made good enough by an algorithm, but would require a design change)

So yes, not impossible, but would require quite some changes here and three to make it automatic.

Re: Head2Head play

Posted: 02 Apr 2009 11:03
by planetmaker
In the hope of the availability of updated binaries (nudge @ truebrain) we're planning a tournament on Friday night, starting at 20h CEST (= 18h UT). The map will be 128 x 512 tiles per company with 15 company slots available. Have a look at our blog for more information and join us on [url=irc://irc.oftc.net/coopetition]#coopetition[/url] where also the competition server will be based.

Download links will be the usual branch download links; they will also be available within the IRC channel.

Hope to see you this Friday!

Re: Head2Head play

Posted: 02 Apr 2009 17:48
by Ammler
We are currently "BETA" testing for tomorrow evening:

on h518233e5 (svn r15907M)

quite many desyncs, which we can't reproduce and following assert:

After try to prospect a industry:
src/industry_cmd.cpp:1470: void DoCreateNewIndustry(Industry*, TileIndex, int, const IndustryTileTable*, byte, const Town*, Owner, Owner): Assertion `founder == OWNER_NONE || GetAreaByTile(tile) == founder + 1' failed.

Re: Head2Head play

Posted: 02 Apr 2009 20:32
by planetmaker
The output in my xterm was when desyncing:

Code: Select all

dbg: [misc] Nested widgets give different results
dbg: [net] Sync error detected!

Re: Head2Head play

Posted: 02 Apr 2009 20:49
by Timmaexx
Yes, I played on #OpenTTDCOOP Coopetition Server and there were unnormal much desyncs...
...but i really love this way to play! No one who blocks your industries ;)

I hope in the next H2H release is less desync. :bow: