Farmlike production forests

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

NFO: Industry plants arbitrary custom tiles

Post by andythenorth »

So, currently an industry can be instructed to plant fields around it using Industry Property 1A with bit 6 set.

The 'field' tiles are useful because they expand and enhance the visual presence of the industry, but can be built upon by players (albeit at higher cost). In my view it's important and beneficial that they don't prevent route building (industry tiles cannot be built upon, or navigated through by ships).

The 'field' tiles are limited because they are only appropriate to certain kinds of arable farm.

It would be useful if an industry could plant arbitrary tiles around it, using custom newgrf graphics. Example cases:
- sheep farm (sheep), dairy farm / ranch (cows)
- plantations of various kinds
- non-farm industries, such as certain kinds of mine which would 'plant' rocks, waste heaps etc

These would be customisable per industry via newgrf. I do not know what the implementation ease or limitations might be for this. I am not proposing to implement it myself, but I would make use of it for newgrf projects, specifically the FIRS industry set: http://www.tt-forums.net/viewtopic.php?f=36&t=41607

As a first guess, I would imagine the graphics would be provided to the tiles through a varaction 2 chain. This would probably be relatively complex in implementation to allow animation support, and specify layouts. It is however conceptually easy to understand from the nfo point of view. Of course, there may be a better way.

I would welcome advice or discussion from devs on this. I probably won't reply to specific points or suggestions from non-devs, nor on the example cases - they are just examples.

cheers,

Andy
Last edited by andythenorth on 19 Mar 2009 12:05, edited 1 time in total.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: NFO: Industry plants arbitrary custom tiles

Post by PikkaBird »

Custom fields have certainly been suggested/thought about before. And let me say I heartily endorse this idea. ;)

Since this is eye-candy and would be rather complex, I imagine it's not something the "trunk devs" would be much interested in.. rather, it's something that someone enthusiastic could explore, and then present as a finished patch.. :P
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: NFO: Industry plants arbitrary custom tiles

Post by andythenorth »

PikkaBird wrote:Since this is eye-candy and would be rather complex, I imagine it's not something the "trunk devs" would be much interested in.. rather, it's something that someone enthusiastic could explore, and then present as a finished patch.. :P
Amended my post - removed the word 'trunk' :) I was trying to operate a 'people who actually know' filter...
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: NFO: Industry plants arbitrary custom tiles

Post by Zephyris »

See also:
http://www.tt-forums.net/viewtopic.php? ... rest+field

I would still like to see this feature in trunk :)
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: NFO: Industry plants arbitrary custom tiles

Post by michael blunck »

PikkaBird wrote:Custom fields have certainly been suggested/thought about before.
Indeed, e.g. I remember the "rice paddy discussion". O/c, all the different ideas immediately sprang to mind when Csaba first introduced newindustries. But from discussions with him about this particular feature I had to learn that it would be rather complex to implement, at least in TTDPatch. :?

Nevertheless, me too would endorse the idea. There would be countless applications. 8)

regards
Michael
Image
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: NFO: Industry plants arbitrary custom tiles

Post by Eddi »

from my abstract view of the code, which i not actually had any look at, such a feature would need these things:
  1. farm fields need a newgrf-definable storage of their type in the map array, and some kind of label-translation-table
  2. farm fields need a callback in the tileloop, which defines the next animation frame when growing the plants
  3. industries need a callback, which type of fields should be planted around it
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1732
Joined: 30 Mar 2005 09:43

Re: NFO: Industry plants arbitrary custom tiles

Post by peter1138 »

In OpenTTD, fields already refer to their owning industry; this is used to let fields 'die-off' after a farm is closed.
Therefore it is trivial to use the industry information to look up what to display. Add in an additional callback (of the industry) to affect the properties of fields being planted, and you're there.
He's like, some kind of OpenTTD developer.
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: NFO: Industry plants arbitrary custom tiles

Post by Rubidium »

It might be tricky to reference an industry once it has been closed and the fields aren't gone yet.
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1732
Joined: 30 Mar 2005 09:43

Re: NFO: Industry plants arbitrary custom tiles

Post by peter1138 »

Drat, a cunning plan foiled again!
He's like, some kind of OpenTTD developer.
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: NFO: Industry plants arbitrary custom tiles

Post by Eddi »

andythenorth wrote:
Rubidium wrote:It might be tricky to reference an industry once it has been closed and the fields aren't gone yet.
If the reference fails, draw nothing? Or a default tile?
the idea behind this reference was that fields without industry finish their growth cycle and then slowly disappear, instead of disappearing instantly when the industry closes. (or staying on the map indefinitely) likewise, it should not spontaneously switch graphics upon industry closure.
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 988
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: NFO: Industry plants arbitrary custom tiles

Post by frosch »

Well, obviously you have to extend the time an industry takes to close down (IIRC currently in average a half month). You could also show some ruins, or remove some/all industry tiles, while the close industry itself is still present - just without tiles.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: NFO: Industry plants arbitrary custom tiles

Post by andythenorth »

frosch wrote:Well, obviously you have to extend the time an industry takes to close down (IIRC currently in average a half month). You could also show some ruins, or remove some/all industry tiles, while the close industry itself is still present - just without tiles.
It would seem sensible that if the fields are shown slowly disappearing *and* industries have construction states, then there should equally be a demolition state?

Thoughts:
- This would have a gameplay effect for players using magic bulldozer to remove industries (they have to wait for industry to get demolished - that could be good or bad for gameplay)
- How would demolition state be drawn? I don't think drawing sprites for demolition is worthwhile. In a typical game they won't be seen very often. There could be random generic 'ruins' tiles with bulldozers, rubble etc?

I think it's worth a question here: is it so important to slowly remove the fields? It's a nice visual touch. However I believe that industry designers gain useful options if it's possible to add custom 'planted' tiles which can be built over by players. If it was a question of one feature versus the other I'd pick the custom 'planted' tiles over the slow removal.

Custom 'planted' tiles would provide the visual impression of large industries, but allowing transportation routes to be built into them easily; it will also remove some complexity around industry placement, as 'planted' tiles don't build foundations and so can be sloped across the underlying topography.
For FIRS this would enable improved:
- large scale quarries and open pit mines (7 industries)
- non-arable farms (6 industries)
- forest (1 industry)
- rubbish dump / landfill (2 industries)
I'd hope that this was a worthwhile gain :) I guess other designers will have suggestions too.

Sorry for the excessive use of 'planted', but I'm not sure of the best way to refer to these tiles, assuming they'd be used for more than 'fields'. Industry greeble tiles? Build-over-eye-candy tiles?

cheers,

Andy
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: NFO: Industry plants arbitrary custom tiles

Post by Eddi »

andythenorth wrote: I think it's worth a question here: is it so important to slowly remove the fields?
fields are removed in the global tile loop. if they are supposed to be removed upon closing the industry instead, there would have to be an additional tile loop there, and a reliable way to ckeck if an industry planted additional fields.

on a completely different matter, who says that custom "fields" have to be limited to agriculture, someone could get the idea and implement "power lines" as "fields" (without gameplay purpose, except removing them being expensive). this would require a customisable placement method (instead of random rectangles) for "fields", and a method to reference non-adjacent field tiles (to draw appropriate "wire" sprites. this can be done by animation states, but in the placement routine this state must be initalised)
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: NFO: Industry plants arbitrary custom tiles

Post by FooBar »

After a little chat we decided that this is a key feature to FIRS. Well, it would be a key feature if it was possible to use it :)

Some more advanced ideas have been ventilated in this topic, but I think that a very basic implementation would be a very good start for both this feature and FIRS. And by basic I mean really basic: a way to redefine the current farm tile graphics per industry would be sufficient for now. Throw in a bit to set whether or not to draw fences around the fields and we're golden! More advanced features can be added as needed later on.

Unfortunately neither one of us FIRS developers knows anything about writing patches for the game, so we have to rely on the interest of other people in such a feature. I suppose we can help with defining the NFO structure in order to keep that in line with the existing specs and making sure that the feature can be expanded later on without having to redifine it altogether.


Let me throw in a reward: Full alpha test privileges before we release a public beta of FIRS! Anyone? :wink:
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: NFO: Industry plants arbitrary custom tiles

Post by Zephyris »

^ wot he said

But seriously this feature would be amazing, you could even hack together proper forests if this was made possible, and how cool would that be!?
User avatar
Wolf01
Tycoon
Tycoon
Posts: 2016
Joined: 24 Apr 2004 10:43
Location: Venezia - Italia
Contact:

Re: NFO: Industry plants arbitrary custom tiles

Post by Wolf01 »

Do you mean a mountain partly covered by a forest which is an industry tile like crop fields? That would be fantastic :D
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2890
Joined: 16 May 2007 16:59

Re: NFO: Industry plants arbitrary custom tiles

Post by Zephyris »

(though you would get glitches when the edge of the forest comes up against buildings or vehicles which would try to drive over the tops of the trees at the edge of the tiles)
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: NFO: Industry plants arbitrary custom tiles

Post by Eddi »

who said the trees wouldn't be able to have a bounding box?
Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: No registered users and 23 guests