Infrastructure Sharing

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

zombie
Traffic Manager
Traffic Manager
Posts: 153
Joined: 19 May 2005 22:19
Location: Germany

Re: Infrastructure Sharing

Post by zombie »

Hi.
Anunnaki wrote:I was trying to patch your r12983_infrastructure_sharing_v0.2_fixed.patch to official clean openttd svn r12983 and r12991 too and then make win32 build (with MS VS2008), but the same problems in both cases. Can you look on that ?

...
I was able to build revision 12972 with the patch on VS2008 Pro. If i remember correctly I had to add the two new files (sharedinfrastructure.cpp and sharedinfrastructure.h in the SRC directory) to the Visual Studio project file. The patch includes the modified project file for Visual Studio 2005 but the project file for Visual Studio 2008 is untouched.

And you really should select "Release" as build target because the debug version is very hard on system resources.

EDIT: To compile the most recent svn revision you have to modifiy two method calls in player_gui.cpp (near lines 1331 and 1372). The calls "DeleteWindow(w);" have to be replaced by "delete w;" (according to SVN log revision 12975).

Kind regards

Zombie
Last edited by zombie on 08 May 2008 00:04, edited 1 time in total.
Anunnaki
Engineer
Engineer
Posts: 64
Joined: 16 Aug 2005 16:09
Location: Prague, Czech Republic

Re: Infrastructure Sharing

Post by Anunnaki »

zombie wrote:Hi.


I was able to build revision 12972 with the patch on VS2008 Pro. If i remember correctly I had to add the two new files (sharedinfrastructure.cpp and sharedinfrastructure.h in the SRC directory) to the Visual Studio project file. The patch includes the modified project file for Visual Studio 2005 but the project file for Visual Studio 2008 is untouched.

And you really should select "Release" as build target because the debug version is very hard on system resources.
zombie wrote: EDIT: To compile the most recent svn revision you have to modifiy two method calls in player_gui.cpp (near lines 1331 and 1372). The calls "DeleteWindow(w);" have to be replaced by "delete w;" (according to SVN log revision 12975).
Yes, i was changing that too, but why was previous error there was mystery for me. But you was right,,, this two files wasnt there, in the patch file is addition for projects/openttd_vs80.vcproj (VS2005) but not for projects/openttd_vs90.vcproj (VS2008).

THANKS LOT...now looks that all works ! I post here in few momments updated patch file to SVN rev 13002.
r13002_infrastructure_sharing_v0.2.patch
(96.57 KiB) Downloaded 159 times
Last edited by Anunnaki on 08 May 2008 00:11, edited 1 time in total.
zombie
Traffic Manager
Traffic Manager
Posts: 153
Joined: 19 May 2005 22:19
Location: Germany

Re: Infrastructure Sharing

Post by zombie »

Hi.

I've already completed that one ;)

Here is an updated diff for revision 13002. I also updated the project files for Visual Studio 2005 and Visual Studio 2008.

EDIT: removed my patch file as it was not completely up to date

Kind regards

Zombie
TheJosh
Engineer
Engineer
Posts: 75
Joined: 17 Apr 2007 12:19
Contact:

Re: Infrastructure Sharing

Post by TheJosh »

Looks very interesting, I will have a play sometime tonight.

Tips for getting a patch in:
- Make sure your patch is really really clean.
- Dont have bugs.
- Keep the patches as small as possible and break into multiple patches as appropriate.
Want to make a real difference? Australia HOPE International - Bringing hope to African orphans and widows.
zombie
Traffic Manager
Traffic Manager
Posts: 153
Joined: 19 May 2005 22:19
Location: Germany

Re: Infrastructure Sharing

Post by zombie »

Hi Gedemon.

This patch is really great and I'd like to see it in trunk some day. It seems to work quite well. Anunnaki and I are still evaluating a problem with vehicle replacement in our patched versions. But this problem may result from a different patch we included in our versions.

To improve the patch quality a little bit I've got some comments about the modifications to the Visual Studio project files inside this patch:
  • you should move "sharedinfrastructure.h" to the "Header Files" area
  • use same path style for "sharedinfrastructure.*" as with the other files; all files in the project files are listed with a leading ".\"
  • as already mentioned: provide updated VS2008 project file
Kind regards

Zombie
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: Infrastructure Sharing

Post by Rubidium »

zombie wrote:
  • you should move "sharedinfrastructure.h" to the "Header Files" area
  • use same path style for "sharedinfrastructure.*" as with the other files; all files in the project files are listed with a leading ".\"
  • as already mentioned: provide updated VS2008 project file
Or properly update source.list and regenerate the MSVC project files using the provided generate scripts (either shell or vbs). That's so much simpler than manually messing with the MSVC project files.
User avatar
Gedemon
Traffic Manager
Traffic Manager
Posts: 150
Joined: 29 Apr 2004 21:53

Re: Infrastructure Sharing

Post by Gedemon »

Rubidium wrote:
zombie wrote:
  • you should move "sharedinfrastructure.h" to the "Header Files" area
  • use same path style for "sharedinfrastructure.*" as with the other files; all files in the project files are listed with a leading ".\"
  • as already mentioned: provide updated VS2008 project file
Or properly update source.list and regenerate the MSVC project files using the provided generate scripts (either shell or vbs). That's so much simpler than manually messing with the MSVC project files.
when using the VBS, thread_none.cpp is added to vcproj which seems to conflict with thread_win32.cpp and fiber_win32.cpp.

I don't know if it's a problem with source.list, generate.vbs (or just me) :O
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Infrastructure Sharing

Post by planetmaker »

Just a small update to current trunk (r13027), mostly Annunaki's update of v0.2 to r13015.
Attachments
r13027IS.diff
r13027_IS.diff
(79.18 KiB) Downloaded 156 times
User avatar
Gedemon
Traffic Manager
Traffic Manager
Posts: 150
Joined: 29 Apr 2004 21:53

Re: Infrastructure Sharing

Post by Gedemon »

héhé sorry, I was about to update :mrgreen:

so here is v0.3

not many change this time, some small code change and added comments

Changelog v0.3 :
- added : show cost or income animation above HQ when calculating tracks payments
- added : send news message when changing sharing settings
- fixed : Visual Studio project files
- update to r13031
- warning : savegame from 0.1 can't be loaded (0.2 to 0.3 should be ok)
r13031_infrastructure_sharing_v0.3.patch
Infrastructure sharing v0.3 r13031
(99.87 KiB) Downloaded 463 times

Now I'll start looking at the bankrupcy problem...

What have been suggested so far :

1- track changes owner to the train currently occupying it (and stop train)
pb : on diag tracks, could be 2 veh, and there is 1 owner per tile max

2- immediatly send train (with a big catapult ?) to nearest available depot (sell it if no depot available ?)

3- close tracks at first sign of banckrupcy (send train to nearest available depot via railway)
pb : there may be no path to such depot

4- pause game, set an auction to force buying of company
pb : what if nobody want to buy it
pb : big patch

5- change owner to NONE for all shared infrastructure
pb : large impact on other parts of the game ?


after that, the TODO :
- remove the warning : "cannot pass objects of non-POD type through ‘...’" (MSVC didn't warn :? )
- disable some trains buttons on shared tracks (ie ignore signals...) or enable them for tracks owner.
- split in small parts, starting with tracksharing
- do not block train in middle of tracks on sharing change
- disable plane stop button on shared airports (or enable it for airport owner)
- pathfinder based on tontile cost (No use of TS -> cheaper -> fastest)


and again,thanks for your comments :D
User avatar
Ammler
President
President
Posts: 953
Joined: 18 Jun 2006 18:18
Location: Switzerland
Contact:

Re: Infrastructure Sharing

Post by Ammler »

Ok, here is the patch merged with move for our devserver. Binaries will follow. ;-)
Attachments
r13031IS0.3m.diff
IS0.3 and move
(108.12 KiB) Downloaded 842 times
r13031IS0.3m.winlin32.zip
Windows and Linux 32Bit binary.
(3.83 MiB) Downloaded 873 times
OTTD-r13031M-IS0.3.tar.bz2
Linux package just for a test ;-)
(2.34 MiB) Downloaded 170 times
Last edited by Ammler on 11 May 2008 21:54, edited 3 times in total.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Infrastructure Sharing

Post by planetmaker »

Nice. So let's get this version up to our dev server - again merged with the move patch by dih. Here it is: ^
Attachments
r13031IS-osx.tgz
os-x binary (intel?)
(2.92 MiB) Downloaded 809 times
Last edited by planetmaker on 10 May 2008 18:08, edited 2 times in total.
Volatar
Engineer
Engineer
Posts: 8
Joined: 15 Dec 2007 17:34

Re: Infrastructure Sharing

Post by Volatar »

I am excited. This patch has me playing a lot of OpenTTD recently.
Image
zombie
Traffic Manager
Traffic Manager
Posts: 153
Joined: 19 May 2005 22:19
Location: Germany

Re: Infrastructure Sharing

Post by zombie »

Hi.

Just another suggestion to include in this patch:

As vehicles from different companies can travel the same routes it would be nice if you can clone a vehicle from an opponent's. At the moment it's not allowed.

Kind regards

Zombie
OpenTTD: OpenTTD-Wiki
OpenTTDCoop: Blog, Wiki
My favorite patches: cargo destinations, shared infrastructure
Volatar
Engineer
Engineer
Posts: 8
Joined: 15 Dec 2007 17:34

Re: Infrastructure Sharing

Post by Volatar »

I also would like to do so.
Image
zombie
Traffic Manager
Traffic Manager
Posts: 153
Joined: 19 May 2005 22:19
Location: Germany

Re: Infrastructure Sharing

Post by zombie »

Hi.

I guess I just came across a problem. I have a "multiplayer" game running (I'm running both companies). The first company does all the track building the second serves all stations with trains. The depots belong to the infrastructure company. Everything works fine.

After a while new trains were available and I enabled autoreplace for all trains. I selected a new train and new trailers. both trailers can be refitted to coal and as I only have coal routes I did not expect any problems. Additionally I set the minimum amount of reserve money for autoreplace to 0.

After a while a train entered the depot to get replaced and the server crashed. There was an error message that the train could not be replaced and refitted. Unfortunately I don't have any save game, log files or crash dumps. I guess that the train got replaced but there was not enough money left to pay the sharing fees. If I encounter this problem again I'll try to provide more information.

Kind regards

Zombie
OpenTTD: OpenTTD-Wiki
OpenTTDCoop: Blog, Wiki
My favorite patches: cargo destinations, shared infrastructure
User avatar
Gedemon
Traffic Manager
Traffic Manager
Posts: 150
Joined: 29 Apr 2004 21:53

Re: Infrastructure Sharing

Post by Gedemon »

yes save or error message may help :mrgreen:

I've started to code solution 2 for the bankrupcy issue, and thought of a gameplay problem.

So far, I've dealt with road vehicule (simpliest case - err, no, ships were :O ) but here's the problem :

you may have a lot of vehicles in the game, if each vehicule is sent to it's nearest available depot, that may results in a lot of depots, and I won't use the news system to inform the player of each location, cause it would flood the queue.

other solution is to stock all vehicle in the same depot and send a global news message. but then, vehicles could be far away from the area they were used...

or maybe a mix : nearest depot, global message, and up to the player to browse his/her vehicles list after that ?
zombie
Traffic Manager
Traffic Manager
Posts: 153
Joined: 19 May 2005 22:19
Location: Germany

Re: Infrastructure Sharing

Post by zombie »

Hi.

What happens if all depots belong to the company that is bankrupt?

Kind regards

Zombie
OpenTTD: OpenTTD-Wiki
OpenTTDCoop: Blog, Wiki
My favorite patches: cargo destinations, shared infrastructure
User avatar
Gedemon
Traffic Manager
Traffic Manager
Posts: 150
Joined: 29 Apr 2004 21:53

Re: Infrastructure Sharing

Post by Gedemon »

1/ try to sell the vehicle
2/ delete the vehicle
zombie
Traffic Manager
Traffic Manager
Posts: 153
Joined: 19 May 2005 22:19
Location: Germany

Re: Infrastructure Sharing

Post by zombie »

Hi.

I was not yet able to reproduce the problem but I found another one. This time I can provide a save game ;)

The situation is the same as with my provious problem. I activated autoreplace of my trains and send all trains to depots. When they reach the depot (owned by a different company) and if enough money is available the train is replaced. If not enough money is available the owner of the trains is awarded with money.

The savegame is a multiplayer game with two companies. The first company owns all infrastructure, the second company services all coal stations. At the time the savegame is taken the train replacement is activated and all trains are heading to the depot. There only two depots are close to the station " COAL DROP". As all trains are heading for a depot the second company can't make any profits. But the bank account gets constantly filled up when a train enters a depot. The finance window does not show these "revenues".

I attached a multipart RAR archive (single ZIP is too large) with necessary files: savegame, linux x86 binary, windows x86 binary, openttd.cfg of server and client, ECS grfs I used, patch file. Additionally the OpenTTDCoop GRF Pack v7 is required.

Kind regards

Zombie
Attachments
advanced_multiplayer.part1.rar
First part of the multipart RAR archive
(3 MiB) Downloaded 165 times
advanced_multiplayer.part2.rar
Second part of the multipart RAR archive
(810.93 KiB) Downloaded 165 times
OpenTTD: OpenTTD-Wiki
OpenTTDCoop: Blog, Wiki
My favorite patches: cargo destinations, shared infrastructure
Anunnaki
Engineer
Engineer
Posts: 64
Joined: 16 Aug 2005 16:09
Location: Prague, Czech Republic

Re: Infrastructure Sharing

Post by Anunnaki »

Gedemon wrote:...so here is v0.3...
Can you update your Infrastructure Sharing mod to be compatible with SVN 13087 ? There was lot of changes in one file depot_gui.cpp, others files/changes are ok.

Can you check that ? THX.
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 39 guests