The International Simutrans Forum

 

Author Topic: Improving the building and factory creation tool  (Read 2290 times)

0 Members and 1 Guest are viewing this topic.

Offline wlindley us

  • Devotee
  • *
  • Posts: 970
    • Hacking for fun and profit since 1977
  • Languages: EN, DE
Improving the building and factory creation tool
« on: August 19, 2013, 12:55:49 PM »
Is it true that these should require no new "core" algorithms, just some new UI bits?
  • In the building creation tool, you can choose orientations "Random" and 0,1,2,... -- could we have a choice "Auto" which uses the internal "prefer to rotate a building to face the street" please?  This would make it much easier to add nice-looking buildings and industries in cities -- and also when making datfiles, being sure that your buildings are rotated the right way.
  • In the Build Industries tool, could we have additional check-boxes for "Producers" (if enabled, only shows factories with output goods) and "Consumers" (if enabled, only shows factories with input goods) -- this would make it easy when adding shops in a city, when building raw materials areas.  When both are checked, this would show only factories that have both input and output goods (e.g., steel mills); when both are unchecked, it would display all factories (i.e., not exclude any factory).
  • There is a button "Increase industry density" and while you can manually connect two industries together, it would be quite useful to have a button "Automatically expand this industry's chain" so you could create a factory and click on it to get it connected, using the existing internal algorithm.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5525
  • Languages: EN, NO
Re: Improving the building and factory creation tool
« Reply #1 on: August 19, 2013, 02:28:56 PM »
What if there are streets on many sides? What if many of the factory's sides should face a street?

Offline wlindley us

  • Devotee
  • *
  • Posts: 970
    • Hacking for fun and profit since 1977
  • Languages: EN, DE
Re: Improving the building and factory creation tool
« Reply #2 on: August 19, 2013, 03:04:26 PM »
The same thing would happen, as already does with the existing algorithm.  The "auto" button would be wonderful when building several shops and especially useful when testing pakset modifications to be sure everything works as you intend.  It merely exposes what the game already does when building things automatically. Yes?

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5525
  • Languages: EN, NO
Re: Improving the building and factory creation tool
« Reply #3 on: August 19, 2013, 03:52:23 PM »
I apparently read your post too fast and didn't notice that you mentioned that the algorithm already exists. I assume for auto-spawned factories?

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: Improving the building and factory creation tool
« Reply #4 on: August 19, 2013, 05:39:09 PM »
Auto direction sounds reasonable will probably add that later. Creating an industry chain for a particular factory sounds interesting. Having check boxes for producers and consumers, well the principle sounds alright but think we need to look at the GUI for this, don't want windows turning into masses of boxes and options really.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: Improving the building and factory creation tool
« Reply #5 on: August 21, 2013, 07:36:46 AM »
Just a quick update on this, attached patch allows for city buildings to have auto rotation when placing. Not tried for other buildings yet. I'm not committing this to trunk yet as the code for auto rotation code is duplicated several times already so I'm thinking how to best tidy this code together to avoid adding more duplication.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9514
  • Languages: De,EN,JP
Re: Improving the building and factory creation tool
« Reply #6 on: August 28, 2013, 07:48:35 PM »
About building factory chains: That is possible using the existing dialoge. If you place and end consumer, and select the chain option, then a chain is built with all intermediate factories. However, obviously without control on their placement but the end consumer. So how would first building the end consumer and then the chain be any different?

Offline wlindley us

  • Devotee
  • *
  • Posts: 970
    • Hacking for fun and profit since 1977
  • Languages: EN, DE
Re: Improving the building and factory creation tool
« Reply #7 on: August 29, 2013, 09:12:23 AM »
If you place and end consumer, and select the chain option...

Chain option? Ohhhh... at least on Experimental that has been labeled "Only city chains" which is pretty meaningless. I never thought it would mean "Build a city chain" -- although I see now on the latest Standard that's what the label reads. 

Having tried it, the "chain" check-box on one hand builds several industries automatically, but my unfulfilled expectation is that the consumer industry would be placed where I click -- it isn't; although it seems often nearby... a bit confusing how that actually works?

Thanks prissi for enlightening us on that function!
« Last Edit: August 29, 2013, 09:21:31 AM by wlindley »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9514
  • Languages: De,EN,JP
Re: Improving the building and factory creation tool
« Reply #8 on: August 29, 2013, 09:49:30 PM »
It searched the next suitable place close to your click; it may be as well the next city.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: Improving the building and factory creation tool
« Reply #9 on: October 25, 2013, 10:51:49 PM »
Couldn't think of a reasonable tidier way of rotations so have just committed auto rotations for city building tool as above.