Page 2 of 3
Re: NFO: Industry plants arbitrary custom tiles
Posted: 06 Apr 2009 19:00
by Zephyris
Tis true! I hope this happens...
*edit* is this a feature request on bugspray? It would be good to get it up there...
Re: NFO: Industry plants arbitrary custom tiles
Posted: 06 Apr 2009 21:56
by Wolf01
Zephyris wrote:Tis true! I hope this happens...
*edit* is this a feature request on bugspray? It would be good to get it up there...
eheh, the first time I used it I red "flipray", but "bugspray" is a rather different from "flyspray" (even if bugs and flies are both insects)

Re: NFO: Industry plants arbitrary custom tiles
Posted: 06 Apr 2009 21:58
by Zephyris
lol, oops, but you know what I mean!
Re: NFO: Industry plants arbitrary custom tiles
Posted: 23 Jun 2009 12:44
by Ammler
PhilSophus made a patch for modifing tree cutting:
http://www.tt-forums.net/viewtopic.php?p=745610
instead of cutting the trees, maybe, it could be replaced by a custom field...
Re: NFO: Industry plants arbitrary custom tiles
Posted: 27 Jun 2009 11:11
by Korenn
I support this suggestion!
Re: NFO: Industry plants arbitrary custom tiles
Posted: 28 Jun 2009 14:42
by andythenorth
Korenn wrote:I support this suggestion!
Thanks
However to actually get this done, one of us is going to need to either
- provide a patch for it ourselves
- or entice another dev to do so
*And* the patch needs to be to a standard that is sufficient for acceptance into trunk!

Re: NFO: Industry plants arbitrary custom tiles
Posted: 02 Jan 2010 21:18
by George
Korenn wrote:I support this suggestion!
I support it too. The simple trees planting was suggested long ago when new industries were just introduced for TTDPatch.
Re: NFO: Industry plants arbitrary custom tiles
Posted: 18 Jun 2010 20:41
by George
http://devs.openttd.org/~frosch/texts/farmtiles.txt wrote:1) Industries get callback 0x155, which is called when the game decides to plant a new field.
Input:
Var 10: 0xrrrrYYXX Relative position of the field towards the north tile of the industry. (signed words)
Var 18: 32 random bits
Usual industry and town variables, except all landinfo variables are relative to the desired field position instead of the industry.
Result:
failed Plant regular field
0x0000 Plant no field.
0x0tYX Plant a rectangular field of size X * Y using the IndustryTile from register 0x100 for every tile.
Would it be possible to create normal industry tile that way? For example t may mean (0 - field, 1 - normal tile)
If the callback succeeds the desired field is planted. No further checks are done wrt. planting the tiles (e.g. no callback 2F).
Would it be possible to allow CB 2F (in case t = 1)
If the majority of tiles in the rectangular area is blocked, the whole field is not planted.
I'd suggest to control it with t (add 2 to skip such check)
If the IndustryTile returned is not suitable for farmtiles (see below) an NewGRF error is displayed.
If register 0x100 is 0xFFFF then a regular field with the returned size is planted.
why not to use CB result? What is the profit to use the register here?
TODO: Maybe the landshape property should be checked? Callback looks too troublesome though.
2) The lifetime of the fields is independant from the industry.
Field tiles can be removed by the player any time like regular field.
Field are cleared per tile and not as a whole.
Field can remove theirself whenever they want. (using callback 25 or 26 special result 0xFC)
Field are not removed when the industry closes. They may remove themself after some time, or leave the mess to the player.
Field can tell whether their industry still exists (variable 43 is 0xFFFFFFFF if industry does no longer exist), and in that case also access/write industry variables/storage.
And what should happen if a field tries to access industry storage when it is closed?
4) There is no synchronised animation trigger.
Industry var AA can be used for synchronisation?
5) Fieldtiles are stored as industrytiles on the map.
Do current fields are industry tiles?
6) Fieldtiles do not produce or accept cargo.
If they are industry tiles - why not?
Conclusion:
if this mechanism allows to create tiles on map - it would be nice to make it to allow industry grow (adding tiles to the industry)
Re: NFO: Industry plants arbitrary custom tiles
Posted: 18 Jun 2010 22:20
by Zephyris
George wrote:if this mechanism allows to create tiles on map - it would be nice to make it to allow industry grow (adding tiles to the industry)
TBH I think slowly expanding industries are a very different feature to fields...
Re: NFO: Industry plants arbitrary custom tiles
Posted: 18 Jun 2010 23:43
by Yexo
George wrote: If the IndustryTile returned is not suitable for farmtiles (see below) an NewGRF error is displayed.
If register 0x100 is 0xFFFF then a regular field with the returned size is planted.
why not to use CB result? What is the profit to use the register here?
Because the CB result is already used for width/height/t information.
Re: NFO: Industry plants arbitrary custom tiles
Posted: 19 Jun 2010 16:59
by George
Yexo wrote:George wrote: If the IndustryTile returned is not suitable for farmtiles (see below) an NewGRF error is displayed.
If register 0x100 is 0xFFFF then a regular field with the returned size is planted.
why not to use CB result? What is the profit to use the register here?
Because the CB result is already used for width/height/t information.
There are three bits left in third byte (t), imho it would be easier to use them instead of the register.
Re: NFO: Industry plants arbitrary custom tiles
Posted: 21 Jun 2010 20:32
by frosch
I also think that expanding industries are very different from fields.
Industry tiles have different restrictions than fields. E.g. industry tiles need to be in a rectangle < 16x16 from a fixed north tile.
Farm tiles OTOH can be more far away. (This has implications on tile acceptance and synchronised animation).
Farm tiles can also be removed per tile by a player, and they are even planted partially if only some tiles are blocked.
Variable AA can be accessed as long as the industry exists. If the industry closes, no industry variables are accessible anymore. The tiles also loose track of each other. That is as a long as the industry exists tiles can also recognise neighboured tiles as part of the same industry.
Once the industry closes, every tile is on its own. No industry variables are available. But some industrytile variables still are.
Not available variables are treated specially inside OTTD, but I do not know the behaviour of TTDP. So best is to just not access them
About slope checks I have no proper plan.
Also questionable is in which cases field tiles report as "clear land" (like current fields do), and when they report as "industry tiles" (so NewGrf could also identify them and read their nearby-tile-information).
(For AIs they report as "field" in any case.)
Conclusion:
This is really only about fields. Usual industry tiles have different requirements and also other restrictions.
Fields are mostly eyecandy, though they can communicate to some extent with the industry, so industry behaviour can depend on the presence of fields.
Re: NFO: Industry plants arbitrary custom tiles
Posted: 21 Jun 2010 21:42
by George
frosch wrote:Fields are mostly eyecandy, though they can communicate to some extent with the industry, so industry behaviour can depend on the presence of fields.
Would it be possible to do the following:
every field adds 1 unit of production of industry. So, when the player would remove all the fields, production drops to 0?
Re: NFO: Industry plants arbitrary custom tiles
Posted: 21 Jun 2010 22:08
by Yexo
George wrote:frosch wrote:Fields are mostly eyecandy, though they can communicate to some extent with the industry, so industry behaviour can depend on the presence of fields.
Would it be possible to do the following:
every field adds 1 unit of production of industry. So, when the player would remove all the fields, production drops to 0?
Field can tell whether their industry still exists (variable 43 is 0xFFFFFFFF if industry does no longer exist), and in that case also access/write industry variables/storage.
You could add 1 to a specific var in the industry permanent storage during the tileloop of the field tiles for example, then query that variable to see how much you're going to produce.
Re: NFO: Industry plants arbitrary custom tiles
Posted: 22 Jun 2010 06:35
by andythenorth
There might be some multiplayer gameplay implications if production was dependent on fields....
Re: NFO: Industry plants arbitrary custom tiles
Posted: 22 Jun 2010 06:39
by Ammler
andythenorth wrote:There might be some multiplayer gameplay implications if production was dependent on fields....
You mean, if an opponent does "destroy" your fields? Well, that could already be done with the Tropic Lumber Mill too, nobody complained about that. So might not be a really big issue, imo.
How long is the planned tileloop cicle time?
Re: NFO: Industry plants arbitrary custom tiles
Posted: 22 Jun 2010 09:01
by Eddi
the tileloop touches every tile every 256 ticks. the larger the map, the more tiles get touched at the same time.
Farmlike production forests
Posted: 30 Apr 2012 19:35
by Hyronymus
I think we all agree that the current way of depicting production forests is highly unrealistic. Real production forests are far more larger. Is it possible to make production forests like farmfields: spread out on a map (possibly against a slope) and demolishable to put a route through it?
Re: Farmlike production forests
Posted: 30 Apr 2012 19:45
by FooBar
See
http://www.tt-forums.net/viewtopic.php?f=32&t=42440
But to answer your question: no, it's not possible at the moment. Otherwise FIRS would've had it

Re: Farmlike production forests
Posted: 30 Apr 2012 20:01
by Hyronymus
Thanks, I merged the topics.
Since it was determined to be difficult, has anything changed by chance

.