The International Simutrans Forum

 

Author Topic: incomplete industry chains  (Read 4898 times)

0 Members and 1 Guest are viewing this topic.

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
incomplete industry chains
« on: September 17, 2009, 10:35:26 AM »
The factory builder [...] has problems finding proper locations for all the factories in a chain, leading to incomplete (and therefore dysfunctional) chains, a problem still waiting for a solution.

For this problem I see two alternative solutions:

1) OPEN ECONOMY (already proposed here)
we could import goods when no suitable place for a producer is found

2) IMPORT/EXPORT COMPANY
when no producer is built, this kind of factory could be built: there could be one for every good type or one which changes its output according to the needed goods. They only need to be resudual: built only when the "normal" producers cannot be built.

Offline Spike

  • *
  • Posts: 1361
  • First Simutrans Developer and Graphics Artist
Re: incomplete industry chains
« Reply #1 on: September 17, 2009, 12:25:15 PM »
I think the factory builder should ignore all constraints in a final pass, and place the missing factories anywhere - there ought to be space for them somewhere on the map.

If there is no space for a factory, very likely an import/export shop has no space, too. We'd need to feed the factories directly with imported goods.

Offline wlindley us

  • Devotee
  • *
  • Posts: 979
    • Hacking for fun and profit since 1977
  • Languages: EN, DE
Re: incomplete industry chains
« Reply #2 on: September 17, 2009, 02:06:04 PM »
Under what conditions does the factory builder fail?  I am trying to make sense of the half-German/half-English factory builder code in conjunction with the Ports and Rivers suggestion; this would be easier if I knew what I was looking for.

Offline Spike

  • *
  • Posts: 1361
  • First Simutrans Developer and Graphics Artist
Re: incomplete industry chains
« Reply #3 on: September 17, 2009, 02:09:21 PM »
A known reason is no suitable place in the climate required for the factory. In this case I'd advice to lift the climate constraint and build the factory even in a wrong climate to complete the chain.

Other constraints are distances between the factories, but those look lenient enough to allow building in almost all cases. But if they would cause a failure in building location lookup, I'd suggest to drop those, too, in a final searching pass.


Offline whoami

  • Devotees (Inactive)
  • *
  • Posts: 693
Re: incomplete industry chains
« Reply #4 on: September 17, 2009, 11:08:49 PM »
Another reason is that factories (in the sense of ST) require a large area of rather flat space. Especially the farms with fields are limited in location choice because (IIRC) the fields have to be at the same level as the central building(s). Some time ago, the factory builder was equipped with the ability to put normal factories on artificial foundations, which helps a lot.

EDIT: required building space and chain complexity depend on the pak-set, of course.

I think the factory builder should ignore all constraints in a final pass, and place the missing factories anywhere - there ought to be space for them somewhere on the map.
Support for this. It may be useful to also check if a failed branch is vital for the whole chain (e.g. for shops that order several different goods, and sell them independently), and if it isn't, don't build this branch at all (EDIT:), that is, remove its parts again. As those can be used (cross-linked) to existing chains, this will need to be checked, too
« Last Edit: September 18, 2009, 12:11:01 AM by whoami »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9584
  • Languages: De,EN,JP
Re: incomplete industry chains
« Reply #5 on: September 18, 2009, 09:07:21 PM »
The main problem with the factory builder giving up is, that is takes a very long time to find a random place, which brings the game near a complete halt. This is also to be taken into account.

Offline Spike

  • *
  • Posts: 1361
  • First Simutrans Developer and Graphics Artist
Re: incomplete industry chains
« Reply #6 on: September 18, 2009, 09:21:01 PM »
Wouldn't a linear scan of the map from top left do the job to find empty spots of sufficient size? In this case I'd not insist on the locations being very random. It's an emergency case.

Offline colonyan

  • Devotee
  • *
  • Posts: 526
  • Full and Warm
Re: incomplete industry chains
« Reply #7 on: September 19, 2009, 03:15:10 AM »
From one of end user point of view.
As mentioned, even if requirements are not met, chain should be completed no matter what.
Climate should be complementary element and should not interfere with game core mechanics.

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
Re: incomplete industry chains
« Reply #8 on: September 19, 2009, 04:57:20 AM »
Additionally, the things people often complain and request are...

1. People want to determine the distance from supplier and consumer by user settings.
2. People want to determine the area of worker by user settings.

Current system doesn't match with large maps.

Offline neroden

  • Devotees (Inactive)
  • *
  • Posts: 831
  • Nathanael Nerode
Re: incomplete industry chains
« Reply #9 on: October 23, 2009, 06:55:35 AM »

Current system doesn't match with large maps.


Quite true.  In simutrans-experimental, playing with huge 1536x1536 tile maps, I end up with horribly clustered factories.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9584
  • Languages: De,EN,JP
Re: incomplete industry chains
« Reply #10 on: October 23, 2009, 10:05:16 AM »
INcomplete chains should no longer happen as long as there is any place at all, because climates will be ignored in a last attempt. Searching the whole map is not very good, because on a 4000x4000 map it takes ages (or nearly a month). So random has to be used. The details can be find in fabrikbauer_t near the bottom. ANy person can happily try there to improve the locations. I personally never play larger maps, so I do not care.