Author Topic: Factory Locations: Ports, Mills, Mines  (Read 21400 times)

0 Members and 1 Guest are viewing this topic.

Offline The Hood

Re: Factory Locations: Ports, Mills, Mines
« Reply #35 on: January 19, 2014, 03:23:21 PM »
This looks great - plenty of industries only get placed on shores or rivers. I'll look to include this into pak128.Britain soon with the new industries that I'm working on. Is this in the nightlies yet?

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4274
  • Total likes: 195
  • Helpful: 149
  • Languages: EN, DE, AT
Re: Factory Locations: Ports, Mills, Mines
« Reply #36 on: January 19, 2014, 05:57:52 PM »
Not committed yet.

There is one question: if factory builder does not find a suitable spot (climates + position constraint), then what should be done? Ignore all constraints (climate and position) or only climate?
Parsley, sage, rosemary, and maggikraut.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: Factory Locations: Ports, Mills, Mines
« Reply #37 on: January 19, 2014, 06:09:53 PM »
I think factories will most likely look out of place if location is violated, than when climate is violated.

Offline wlindley

Re: Factory Locations: Ports, Mills, Mines
« Reply #38 on: January 19, 2014, 06:49:34 PM »
Agree, location is more important than climate.

Building a fishing port anywhere but on a shore would look wrong, but building a sawmill in a forest-and-tree-less network game might not be so bad. 

For the special case of the sawmill, would it be sufficient for a pakset to supply both a "forest-only" sawmill (presumably just the buildings) as well as a "doesn't-care-about-forest" version (presumably with its own 'fields' of trees)...?

If supplying two variations of the industries (one with, one without the location restriction) in a pakset is sufficient, then the solution is surely to ignore climates but not location when failing to find good locations.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 16086
  • Total likes: 438
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Factory Locations: Ports, Mills, Mines
« Reply #39 on: January 19, 2014, 07:28:20 PM »
I agree with Ters and W. Lindley for the reasons given.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline The Hood

Re: Factory Locations: Ports, Mills, Mines
« Reply #40 on: January 19, 2014, 07:37:23 PM »
+1 to that.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: Factory Locations: Ports, Mills, Mines
« Reply #41 on: January 19, 2014, 09:03:13 PM »
The recently renovated version of the factory builder first tries to build for every factory (obeying the distribution counter) with all restrictions. Then, if no suitable place was found for any of them, the climate restriction is lifted in the second round. It is easy to add a third round, that would lift the locations restriction too.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 16086
  • Total likes: 438
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Factory Locations: Ports, Mills, Mines
« Reply #42 on: January 19, 2014, 09:09:34 PM »
It may be better to have fewer industries than the player asked for than to have industries in silly places.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: Factory Locations: Ports, Mills, Mines
« Reply #43 on: January 19, 2014, 09:14:41 PM »
The builder should rather try to build a different factory chain if location can't be satisfied.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: Factory Locations: Ports, Mills, Mines
« Reply #44 on: January 19, 2014, 09:58:19 PM »
Well, then you may up with almost no industries in many game, especially when the factory radius is set to 50 or so.

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • Total likes: 7
  • Helpful: 91
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Factory Locations: Ports, Mills, Mines
« Reply #45 on: January 19, 2014, 10:02:32 PM »
And why not to lift the radius instead in this case?


Sent from my iPhone using Tapatalk

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 16086
  • Total likes: 438
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Factory Locations: Ports, Mills, Mines
« Reply #46 on: January 19, 2014, 11:16:41 PM »
If the player is notified about this, the player will understand what is wrong and be able to have another go with different settings.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: Factory Locations: Ports, Mills, Mines
« Reply #47 on: January 20, 2014, 04:03:36 PM »
Searching locations is very cpu intensive. Hence if during seeding of a new industry the computer grinds to a halt for several seconds, people may be confused or even suspect a crash. But you can already set the radius to whatever you like.

Even an industry at the waterside will still have its foundations. So the visuals are not 100% convincing. (And there are places like the Aral lake where the lighthouses are now surrounded by miles of desert.

to me, I think this should be rather a setting, if you want incomplete chains or non-matching graphics. (Especially remembering the many error reports about the game building incomplete industry chains when climates were introduced.)

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: Factory Locations: Ports, Mills, Mines
« Reply #48 on: January 20, 2014, 04:22:48 PM »
(And there are places like the Aral lake where the lighthouses are now surrounded by miles of desert.

True, but I don't think they are still operating. If a fish farm ended up in the middle of the desert because the lake dried up, the fish farm would become a monument to the disaster that had taken place and not something that produced fish.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 16086
  • Total likes: 438
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Factory Locations: Ports, Mills, Mines
« Reply #49 on: January 20, 2014, 07:59:41 PM »
to me, I think this should be rather a setting, if you want incomplete chains or non-matching graphics. (Especially remembering the many error reports about the game building incomplete industry chains when climates were introduced.)

This seems sensible to me.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4274
  • Total likes: 195
  • Helpful: 149
  • Languages: EN, DE, AT
Re: Factory Locations: Ports, Mills, Mines
« Reply #50 on: January 24, 2014, 07:56:24 PM »
here is an update.

How should this setting be implemented to force location constraint to always be respected? a global pakset-wide setting? or per factory?
Parsley, sage, rosemary, and maggikraut.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: Factory Locations: Ports, Mills, Mines
« Reply #51 on: January 24, 2014, 09:19:34 PM »
Probably a pakset setting: force_factory_maxradius, force_factory_cllimate, force_factory_location

The latter might also be used to prevent city industries outside of the city limits.

Offline wlindley

Re: Factory Locations: Ports, Mills, Mines
« Reply #52 on: January 24, 2014, 11:26:29 PM »
For "city" factories, shouldn't the search zone be the boundaries of the city-limits?  So after picking a random location, determine which city it's in, and use the city-limits rectangle for the search zone.

It would be awfully nice if we could code for "shops" which would select their city as above, then find all shops (factories with no output goods) within those city limits, and build immediately adjacent to an existing shop (if there is one).  In the case of no free tiles next to an existing shop, demolish and replace an existing building less-than-or-equal-to the new shop's passenger level.  That would give us the long-desired "high street" effect especially in pak128.Britain.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4895
  • Total likes: 215
  • Helpful: 108
  • Languages: EN, NO
Re: Factory Locations: Ports, Mills, Mines
« Reply #53 on: January 25, 2014, 08:14:11 AM »
Not all city industries are of the kind that naturally flock around existing stops at the core of the city. In pak64, most of them are of the type usually (at least where I live) built at the edge of cities.

Offline The Hood

Re: Factory Locations: Ports, Mills, Mines
« Reply #54 on: January 25, 2014, 09:52:52 AM »
I like wlindley's suggestion but as Ters points out it doesn't suit all city factories. Perhaps an additional location parameter - "central" or "highstreet" or similar?

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • Total likes: 7
  • Helpful: 91
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: Factory Locations: Ports, Mills, Mines
« Reply #55 on: January 25, 2014, 09:55:47 AM »
I second The Hood's idea. And if it's not too far fetched, also apply this location improvement to attractions.


Sent from my iPhone using Tapatalk

Offline kierongreen

Re: Factory Locations: Ports, Mills, Mines
« Reply #56 on: January 25, 2014, 10:43:53 AM »
So maybe a city centre industry location as well... (edit other people got there first!)

Offline wlindley

Re: Factory Locations: Ports, Mills, Mines
« Reply #57 on: January 25, 2014, 02:48:21 PM »
Can we use the clusters= parameter to group factories?  In besch/writer/building_writer.cc:

Code: [Select]
        if (!STRICMP(type_name, "res")) {
                extra_data = get_cluster_data(obj);
                gtyp = gebaeude_t::wohnung;
        } else if (!STRICMP(type_name, "com")) {
                extra_data = get_cluster_data(obj);
                gtyp = gebaeude_t::gewerbe;
...
        } else if (!STRICMP(type_name, "fac")) {
                utype    = haus_besch_t::fabrik;
                enables |= 4;
        } else { ...

Make a copy of the extra_data = get_cluster_data(obj); line just before enables |= 4 and ... well, then we just need to handle that flag in the factory creation code.  extra_data isn't used by factories currently; this would make it parallel res,com,ind.

Happily, this way, we could force certain shops in Pak128.Britain to cluster with the row-houses that look the same way.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 8830
  • Total likes: 324
  • Helpful: 229
  • Languages: De,EN,JP
Re: Factory Locations: Ports, Mills, Mines
« Reply #58 on: March 29, 2017, 03:34:24 AM »
@Dwachs: Did you incorporated this patch? Or do you have it still somewhere?

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4274
  • Total likes: 195
  • Helpful: 149
  • Languages: EN, DE, AT
Re: Factory Locations: Ports, Mills, Mines
« Reply #59 on: March 29, 2017, 07:01:02 AM »
I did not incorporate it. Have to look for it.
Parsley, sage, rosemary, and maggikraut.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4274
  • Total likes: 195
  • Helpful: 149
  • Languages: EN, DE, AT
Re: Factory Locations: Ports, Mills, Mines
« Reply #60 on: September 01, 2017, 04:41:54 PM »
Here is an updated patch. Feel free to modify etc.
Parsley, sage, rosemary, and maggikraut.

Offline Yona-TYT

Re: Factory Locations: Ports, Mills, Mines
« Reply #61 on: September 01, 2017, 11:18:49 PM »
I really like this, I hope it will be implemented soon. ;D ;D ;D

Regards.! ;)

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 16086
  • Total likes: 438
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Factory Locations: Ports, Mills, Mines
« Reply #62 on: September 11, 2017, 05:13:44 PM »
Interesting! I am not sure whether this patch enables something that I mentioned back in 2009, which is a constraint forcing attractions to be built on the shore, allowing for specific attractions such as pleasure piers and beaches that were important to the 19th century tourist industry?

This will certainly be useful for water mills, however (although does this force the alignment so that it is possible to make sure that the mill wheel always faces the river?).
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Online Leartin

Re: Factory Locations: Ports, Mills, Mines
« Reply #63 on: September 12, 2017, 05:08:01 AM »
Interesting! I am not sure whether this patch enables something that I mentioned back in 2009, which is a constraint forcing attractions to be built on the shore, allowing for specific attractions such as pleasure piers and beaches that were important to the 19th century tourist industry?

This will certainly be useful for water mills, however (although does this force the alignment so that it is possible to make sure that the mill wheel always faces the river?).

Sadly, I don't think that works as such:

here is a quick patch. it adds the following options to the location parameter:

river: one tile of factory adjacent to river tile
shore: one tile of factory on a sloped shore tile
forest: more than X trees on the tiles covered by the factory, X=area of factory

The full factory would be on land, not in the sea, there is no hint that rotation would apply, and probably worse - since it needs to be a sloped shore tile, the building will not be at water level, but above.
This patch can not be used to tie building graphics to the surroundings, I'd say it's mostly a gameplay thing - eg. you can have a fish farm in water and the fish-canning-factory at a shore, that way you have a high chance that you can connect the two directly via fishing boat (if they are at the same body of water)

Though if you think of it as a step by step process, this patch is the step about location. Rotation towards things other than roads could be a second step. If then there was a way to have things on shore without building a basement, pleasure piers would be doable - even though every part in water would not actually be in water but offset-shenanigans.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 16086
  • Total likes: 438
  • Helpful: 177
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Factory Locations: Ports, Mills, Mines
« Reply #64 on: September 12, 2017, 09:49:28 PM »
Sadly, I don't think that works as such:

The full factory would be on land, not in the sea, there is no hint that rotation would apply, and probably worse - since it needs to be a sloped shore tile, the building will not be at water level, but above.
This patch can not be used to tie building graphics to the surroundings, I'd say it's mostly a gameplay thing - eg. you can have a fish farm in water and the fish-canning-factory at a shore, that way you have a high chance that you can connect the two directly via fishing boat (if they are at the same body of water)

This is already possible without this patch, and it is done in Pak128.Britain.

Quote
Though if you think of it as a step by step process, this patch is the step about location. Rotation towards things other than roads could be a second step. If then there was a way to have things on shore without building a basement, pleasure piers would be doable - even though every part in water would not actually be in water but offset-shenanigans.

This would certainly be a useful thing.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.