Page 8 of 18
Re: Infrastructure Sharing
Posted: 21 Jul 2008 18:03
by planetmaker
Chico008 wrote:
je fait transfert de marchandise de A vers B, puis un gros trains de B vers C.
dans tout les cas, les trains font aucun bénef, alors qu'avec le transfert de marchandise, ca devrait en faire.
en ordre j'ai essayer 'décharger et laissé vide' et 'transférer et laissé vide', mais dans les 2 cas, pas de benef, meme virtuel pour le transfert, du coup perte seche enorme.
A savegame will help to understand your example better and much appreciated. My French is not good enough to follow in detail. Also please state which patch (version) you've been using, there're around already a few

Re: Infrastructure Sharing
Posted: 21 Jul 2008 18:10
by Chico008
Playing on r13704 with Tib's patch on multiplayer game.
there is numerous GRF used (George ECS and other for stations, truck, ships, aircraft and trains).
i'm making a save and posting it.
Re: Infrastructure Sharing
Posted: 21 Jul 2008 20:09
by Chico008
ok, here is the save
Save_chico.sav
the deal is.
train 7/10/13/14/23 and 24 don't make money when they transfert their cargo.
next, train 11/12/15/21 and 22 don't make money either when they sell their cargo.
in both case, first group should make 'virtual' money when transfering cargo.
2nd group should make money when selling their cargo.
if you need, a gamepack is available
Here (win32) for testing.
it includes all GRF used.
Re: Infrastructure Sharing
Posted: 26 Jul 2008 07:34
by planetmaker
Chico008 wrote:ok, here is the save
Save_chico.sav
the deal is.
train 7/10/13/14/23 and 24 don't make money when they transfert their cargo.
next, train 11/12/15/21 and 22 don't make money either when they sell their cargo.
in both case, first group should make 'virtual' money when transfering cargo.
2nd group should make money when selling their cargo.
if you need, a gamepack is available
Here (win32) for testing.
it includes all GRF used.
I tried to reproduce this with a infrastructure sharing patch alone, but failed. Unfortunately I cannot load the savegame as the diff isn't available anymore and I'd need a Mac binary. But I understood correctly, that you take cargo from a station which belongs to another company and transfer it to your own station. From there you pick it up again and transport it to a station of that other company again, right?
Anyway, here's an update of the patch to current trunk as some header file includes changed.
Re: Infrastructure Sharing
Posted: 31 Jul 2008 12:11
by Chico008
Tib's made un update of his patch pack on r13810,
the bug described before didn't appeared, but another one is still present and hasn't been fixed, i think it is part of infrastructure sharing, but not shure.
Code: Select all
openttd: /srv/r13810-HFR_src/src/tile_map.h:135: Owner GetTileOwner(TileIndex):
Assertion `!IsTileType(tile, MP_HOUSE)' failed.
the savegame =>
HERE
if you need a windows clients, use
this one (packed with all GRF needed)
Re: Infrastructure Sharing
Posted: 16 Aug 2008 11:10
by Chico008
Hi, we'vejust notice something pretty annoying with Infrastructure Sharing.
when i make a train in a depot that is not mine, i can't launch the train.
only the owner of the depot can launch the train.
it's pretty borring to have to wait for the owner to launch our trains.
could you fix this ?
Thx.
Re: Infrastructure Sharing
Posted: 16 Aug 2008 16:11
by jaybud4
I'd like to be able to connect my rails to other people's. But it doesn't work like that yet.
Any chance?
Re: Infrastructure Sharing
Posted: 17 Aug 2008 10:57
by planetmaker
Chico008 wrote:it's pretty boring to have to wait for the owner to launch our trains.
could you fix this ?
It's not a bug, it's a feature

The idea behind this is to allow the track owner control over what happens on his tracks in order to allow him to fix issues with his network. Allowing people to launch trains from the depot would basically render this futile. Might be an idea to introduce just another patch option

. Allow owner control [yes/no]
jaybud4 wrote:I'd like to be able to connect my rails to other people's. But it doesn't work like that yet.
Any chance?
I'm not sure what you mean. If you mean that you cannot alter the tracks on a tile which belongs to another company (also just adding a branch) - sure, you're right. But that's nothing which needs fixing. After all, you don't want another company wreaking havoc on your rail system. It would open the possibility for all kind of sabotage.
Currently I'm having unfortunately trouble to get this patch working with recent trunk. There's some incompatibility with PBS which I so far haven't figured out where it is :S
Re: Infrastructure Sharing
Posted: 17 Aug 2008 14:35
by jaybud4
planetmaker wrote:I'm not sure what you mean. If you mean that you cannot alter the tracks on a tile which belongs to another company (also just adding a branch) - sure, you're right. But that's nothing which needs fixing. After all, you don't want another company wreaking havoc on your rail system. It would open the possibility for all kind of sabotage.
See, but this patch itself opens up all sorts of sabotage options anyway.
For instance, you can stop your train/rv/plane on top of the station (or junction before station depending on the type of station used)/loading bay/runway...
Could always make it a toggleable option for those who want literal infrastructure sharing...
Re: Infrastructure Sharing
Posted: 18 Aug 2008 09:06
by planetmaker
jaybud4 wrote:See, but this patch itself opens up all sorts of sabotage options anyway.
For instance, you can stop your train/rv/plane on top of the station (or junction before station depending on the type of station used)/loading bay/runway...
Could always make it a toggleable option for those who want literal infrastructure sharing...
The point is: the latest patch does not allow you to stop or start vehicles on the infrastructure of other companies. Previously all control was by the vehicle owner and we had a lengthy discussion over how to handle it best. We decided to change it so that now control over a train is always given to the owner of the infrastructure. With planes, I've got to test, I'm not sure now.
Of course that allows for sabotage, too, e.g. like trapping a vehicle in an eternal circle. But the possibility to sort out jams is more important IMO. I may consider to allow both, track and vehicle owner to start and stop vehicles via patch option.
Re: Infrastructure Sharing
Posted: 18 Aug 2008 17:19
by Snuk the Great
I just looked into the progress of OpenTTD, which I do every few months. Now I see you have PBS
and this patch. Briliant! I did not get to test it in a LAN game yet though, but I probably will later tonight.
planetmaker wrote:Currently I'm having unfortunately trouble to get this patch working with recent trunk. There's some incompatibility with PBS which I so far haven't figured out where it is :S
If you mean merging it with the trunk and getting it to compile, use the one added to the post. You probably had a bit of trouble with a variable that seems to have been moved. I at least had that trouble, but it was nothing a search and replace could not fix. It compiles fine, but I have not tested it in action yet. Only saw the GUI and figured it would probably work. So, for as far as I know I might have broken it

. Let me know if it works out for you.
Re: Infrastructure Sharing
Posted: 18 Aug 2008 20:22
by planetmaker
Snuk the Great wrote:If you mean merging it with the trunk and getting it to compile
I actually meant "works" as in "does not crash on title screen". Obviously I was missing something which I had also been missing before when I tried to merge back then YAPP and IS... Me goes investigating.
Thanks a bunch
EDIT: testing it, I found that starting & stopping of trains only works for the train owner (again). Another piece of motivation to fix this some time soon with just another patch option

Re: Infrastructure Sharing
Posted: 19 Aug 2008 13:34
by jaybud4
If you're going to put all these different ideas as a patch option, why not have actual infrastructure sharing (as I mentioned earlier) as one as well? It only makes sense.. There's some times you want to play cooperative but separate companies.. Or in some cases the other player won't allow you to join their company but is fine with sharing...
Patch option just seems the best way to go. Disable it by default and have a warning or something about the sabotage possibility.
Re: Infrastructure Sharing
Posted: 19 Aug 2008 17:56
by planetmaker
jaybud4 wrote:If you're going to put all these different ideas as a patch option, why not have actual infrastructure sharing (as I mentioned earlier) as one as well?
Go and actually look at the patch.
Each company can configure what (or if at all) it shares and for what royalty. Host can turn it off completely.
EDIT: without bump another update to trunk
Re: Infrastructure Sharing
Posted: 28 Aug 2008 07:23
by Kristjan993
in microsoft express c++ with the latest diff that i could find (14152), when compiling trunk r14152, i get an error
Code: Select all
4>...\open\src\yapf\follow_track.hpp(11) : fatal error C1083: Cannot open include file: '../sharedinfrastructure.h': No such file or directory
what am i doing wrong?
the installation guidelines were followed step by step.
Re: Infrastructure Sharing
Posted: 28 Aug 2008 10:08
by Yexo
Kristjan993 wrote:in microsoft express c++ with the latest diff that i could find (14152), when compiling trunk r14152, i get an error
Code: Select all
4>...\open\src\yapf\follow_track.hpp(11) : fatal error C1083: Cannot open include file: '../sharedinfrastructure.h': No such file or directory
what am i doing wrong?
the installation guidelines were followed step by step.
Probably nothing: the latest patch by planetmaker doesn't include infrastructure.h, so he should fix it.
Re: Infrastructure Sharing
Posted: 28 Aug 2008 11:55
by planetmaker
Kristjan993 wrote:in microsoft express c++ with the latest diff that i could find (14152), when compiling trunk r14152 (...)
what am i doing wrong?
You're doing nothing wrong. The error is on my side that I forgot to add two crucial files to this patch :S.
I'll add them tonight, so check in 9h after this posting

. Thx for notification.
EDIT: updated patch files attached
Re: Infrastructure Sharing
Posted: 01 Sep 2008 20:20
by Nappe1
hmmh... I first thought it would be my own patches, but no...
latest patch (r14180) does merge nicely to latest revision and it builds without warnings as well, but crashes right away when any of the industries changes their production (right on the moment when news should be displayed... gives an assert from oldpool.h, but something else cause the misbehave, as it tries to display vechile info window, with index being around 50000 bigger than count of the pool...)
Same happened with latest revision being 14180 as well... anyone up to task to check what goes wrong?
I tried but it goes too down in the core.
Re: Infrastructure Sharing
Posted: 01 Sep 2008 20:35
by SmatZ
Fixed bug with news causing crash + updated to current trunk
Re: Infrastructure Sharing
Posted: 02 Sep 2008 11:41
by Celestar
Ok I've read through the patch (didn't play it yet). Overall it looks very nice, but I have a few comments if I may

:
EASY STUFF:
1) There are many many many places with something like (thing1->owner == thing2->owner || SharedThings(thing1)). Methinks that should end up in some inline function, because some of the if-expressions are just not really human readable anymore.
2) "SharedTracksPaiement" ... english function names please
3) Some magic numbers: Money route_profit[8]
4) /**** CHANGE HERE ****/ <= dunno what that is
5) The array of the two values for the settings (current and next month or whatever) might want to have some static const int for the index instead of using "0" and "1"
Code: Select all
enum {
IS_CURRENT,
IS_FUTURE,
IS_END
6) There are some printfs in the code left
7) in station_cmd.cpp you set the feeder share for player 0, why not for the player that the station belongs to?

please use ton_tiles instead of tontiles if possible somehow
HARD STUFF:
Something more general: OpenTTD is C++ (OOP) meanwhile. Maybe there could be a "SharedInfrastructure" Class and each player has one instance of that class? Then the global variables could be static members and the whole code would be a bit more readable.
Hope this helps
Celestar