Head2Head play

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

Yexo
Tycoon
Tycoon
Posts: 3653
Joined: 20 Dec 2007 12:49

Head2Head play

Post 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/
Last edited by Yexo on 29 Mar 2009 19:58, edited 1 time in total.

andyp
Engineer
Engineer
Posts: 13
Joined: 11 May 2008 00:07

Re: Head2Head play

Post 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:
Attachments
Yex0 Transport, 13th Mar 1954.png
(122.19 KiB) Downloaded 541 times
Last edited by andyp on 29 Mar 2009 02:00, edited 2 times in total.

taisteluorava
Engineer
Engineer
Posts: 19
Joined: 15 Mar 2009 11:41

Re: Head2Head play

Post 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 :).

User avatar
Benny
Tycoon
Tycoon
Posts: 2185
Joined: 25 Aug 2007 17:03
Location: ~/

Re: Head2Head play

Post 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. :)
Image

User avatar
FooBar
Tycoon
Tycoon
Posts: 6559
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Head2Head play

Post 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?

Roujin
Tycoon
Tycoon
Posts: 1884
Joined: 08 Apr 2007 04:07

Re: Head2Head play

Post 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 ;)
* @Belugas wonders what is worst... a mom or a wife...
<Lakie> Well, they do the same thing but the code is different.

______________
My patches
check my wiki page (sticky button) for a complete list

ImageImage
ImageImageImageImageImageImageImage

User avatar
FooBar
Tycoon
Tycoon
Posts: 6559
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Head2Head play

Post 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!

Yexo
Tycoon
Tycoon
Posts: 3653
Joined: 20 Dec 2007 12:49

Re: Head2Head play

Post 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.

Yexo
Tycoon
Tycoon
Posts: 3653
Joined: 20 Dec 2007 12:49

Re: Head2Head play

Post 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.

2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: Head2Head play

Post by 2007Alain2007 »

hi will you be bring out a patch file for this
For Community Integrated Version http://code.google.com/p/civopenttd/

Eddi
Tycoon
Tycoon
Posts: 7426
Joined: 17 Jan 2007 00:14

Re: Head2Head play

Post 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.
You might not exactly be interested in Ferion, but if you are, have fun :)

2007Alain2007
Chief Executive
Chief Executive
Posts: 658
Joined: 11 Nov 2007 12:06
Contact:

Re: Head2Head play

Post by 2007Alain2007 »

so to make a patch on this i have to add them bits all togiver and it should work :)
For Community Integrated Version http://code.google.com/p/civopenttd/

Eddi
Tycoon
Tycoon
Posts: 7426
Joined: 17 Jan 2007 00:14

Re: Head2Head play

Post 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.
You might not exactly be interested in Ferion, but if you are, have fun :)

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4554
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Head2Head play

Post 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.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)

Eddi
Tycoon
Tycoon
Posts: 7426
Joined: 17 Jan 2007 00:14

Re: Head2Head play

Post 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?
You might not exactly be interested in Ferion, but if you are, have fun :)

User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4554
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Head2Head play

Post 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.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9393
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Head2Head play

Post 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!

User avatar
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: Head2Head play

Post 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.

User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9393
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Head2Head play

Post 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!

Timmaexx
Transport Coordinator
Transport Coordinator
Posts: 301
Joined: 03 Jan 2009 17:55

Re: Head2Head play

Post 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:

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Dirtysquiryl, JGR and 3 guests