Config
Log for #openttdcoop.devzone on 5th May 2011:
Times are UTC Toggle Colours
00:26:29  *** KenjiE20 has quit IRC
06:17:03  *** Brot6 has quit IRC
06:17:49  *** Brot6 has joined #openttdcoop.devzone
07:21:00  *** ODM has joined #openttdcoop.devzone
07:28:26  <Terkhen> planetmaker: how should we deal with acceptance of Food in temperate? I'm thinking about a new town industry just for accepting Food
07:28:45  <planetmaker> oh hum...
07:29:32  <Terkhen> yes, it is an issue I completely forgot about :)
07:30:22  <planetmaker> so did I
07:32:21  <planetmaker> Yes, a new industry might be one option. The other might be to modify the acceptance of (some) houses
07:32:29  <planetmaker> And have the player choose via parameter?
07:32:59  <Terkhen> but then if opengfx+ houses is created later, both sets will conflict
07:33:26  <planetmaker> that's what the parameter is for ;-)
07:33:32  <Terkhen> and you will not be able to use opengfx+ industries with other house sets
07:33:48  <Terkhen> IMO the parameter should just disable the new industry
07:33:56  <planetmaker> parameter like : "use industry", "modify houses" "do nothing"
07:34:03  <planetmaker> as three-choice
07:34:20  <Terkhen> I think that defining food acceptance is job for a house set
07:34:31  <planetmaker> well, principally yes
07:34:41  <Terkhen> if I have to redefine all temperate houses in opengfx+ industries, I might as well create opengfx+ houses just for that :P
07:34:50  <planetmaker> :-P
07:35:01  <planetmaker> it's one action0 only
07:36:14  <planetmaker> it's the same dilemma which FIRS faces: how to ensure town acceptance of certain cargos
07:36:27  <Terkhen> hmm... can you do item() in big ranges in nml?
07:36:35  <planetmaker> and probably the reason for Pikka to choose TownsAndIndustries for TAI
07:36:44  <planetmaker> in nml, I think, not (yet)
07:38:06  <Terkhen> I'm not sure if it is appropiate for nml, as it hides numerical IDs to the coder in most cases
07:38:28  <planetmaker> I don't see a good syntax for that either
07:38:32  <Terkhen> numerical IDs are useful for stuff you don't plan to use (such as disable_item), but not on this case
07:40:13  <Terkhen> I was thinking on copying one of FIRS industries for the sprite
07:40:31  <planetmaker> that's what I suggest for the industry solution, too
07:41:16  <Terkhen> for the houses... I think it will be duplicated code with opengfx+ houses, unless there is no reason to plan for such newgrf in the future
07:41:45  <planetmaker> There is reason :-P - we just found one
07:42:03  <planetmaker> and better snow-awareness is another
07:42:09  <planetmaker> or ground-awareness in general
07:42:41  <planetmaker> and actually the option to accept other cargo(s) optionally
07:42:49  <Terkhen> so only "use industry" and "do nothing" in opengfx+ industries, and a "make temperate houses accept food" option in opengfx+ houses?
07:42:57  <planetmaker> e.g. via parameter to have early ones accept coal or alike
07:43:14  <Terkhen> that sounds as complicated as custom industry chains :)
07:44:03  <planetmaker> well... Personally I'd not yet rule out completely to add a 3rd option of "have some temperate houses accept food", but that needs not be done now (if at all)
07:44:55  <planetmaker> only I'd make that parameter not a boolean but a multiple choice
07:45:19  <planetmaker> thus we could also offer different industries as food sink
07:45:35  <planetmaker> like "use restaurant" "use supermarket"
07:47:53  <Terkhen> makes sense :)
07:48:37  <planetmaker> Is there a good general work for "food accepting industry"?
07:48:54  <planetmaker> Then both could be one and ... just named differently ;-)
07:49:02  <planetmaker> two layouts, one name.
07:49:10  <planetmaker> s/work/word/
07:49:59  <planetmaker> The layouts then could use different placement rules
07:50:06  <planetmaker> hm... I like that idea ;-)
07:50:06  <Terkhen> if both of them are single tiled you don't even need different layouts
07:50:17  <planetmaker> A super market usually is larger ;-)
07:50:26  <planetmaker> thinking of default houses supermarkets
07:50:30  <planetmaker> 2x2
07:51:18  <planetmaker> And... a country-side restaurant near roads?
07:51:53  <planetmaker> lalala... can be arbitrarily conplicated
07:52:50  <planetmaker> one simple solution shall be enough for a starter
07:52:59  <planetmaker> without choices etc
07:53:16  <Terkhen> yes :P
07:53:40  <Terkhen> once the feature is well tested, we can think on adding new types
07:57:01  <planetmaker> quite :-)
07:57:18  <planetmaker> It's easy to get carried away with possibilities ;-)
07:58:24  <Terkhen> :)
07:59:23  <Terkhen> I should give the power plant bug more priority, though... I know it is not really true, but they seem to close sooner if they are serviced
08:12:40  <planetmaker> hm
08:13:05  <planetmaker> that's of course when it is obvious only
08:13:10  <planetmaker> otherwise you simply don't notice
08:16:46  <Terkhen> I know :P
08:47:05  <Terkhen> hmm... is there a way to check regression automatically on nml?
08:48:06  <planetmaker> in what way?
08:48:47  <Terkhen> something like "make regression" in OpenTTD
08:49:00  <planetmaker> nml has that
08:49:14  <Terkhen> how can I call it?
08:49:15  <planetmaker> regressions/
08:49:19  <planetmaker> and then make
08:49:59  <Terkhen> oh, thanks, I did not see the Makefile :)
08:52:08  <Brot6> NewGRF Meta Language - Revision 1324:31cee10a975d: Fix: Typo. (Terkhen) @ http://dev.openttdcoop.org/projects/nml/repository/revisions/31cee10a975d
08:57:47  <Terkhen> http://wiki.ttdpatch.net/tiki-index.php?page=VarAction2Industries <--- var B4 does what I want but it only counts days since 1920...
08:58:12  <Terkhen> I wonder how andy did this :P
08:59:55  <Terkhen> I could code a new variable for industries, but then this fix would not be compatible with 1.1.0
09:01:32  <planetmaker> what 'this'?
09:01:57  <planetmaker> ah, closure prevention?
09:02:05  <Terkhen> close power plants after X months without delivery
09:03:59  <planetmaker> if no production last month: var += 1
09:04:11  <planetmaker> if production last month: var = 0
09:04:32  <Terkhen> hmm... a counter, I see
09:05:02  <planetmaker> firs/templates/industry_clusre_check.pnfo
09:05:05  <Terkhen> where can I store that var?
09:05:12  <planetmaker> industry persistant storage
09:05:26  <planetmaker> how in NML? I don't know at the moment
09:05:31  <planetmaker> I've never used that either so far
09:05:39  <Terkhen> I'm checking that file, but the only thing I managed to understand were the callback numbers :P
09:06:03  <Terkhen> thanks, I'll look into this
09:07:08  <Terkhen> http://devs.openttd.org/~terkhen/patches/index.php?source=var_47.diff <--- at first glance a patch for OpenTTD seems trivial, though
09:11:38  <planetmaker> well... yes
09:12:33  <planetmaker> I wonder slightly whether the 'better' approach would not be to somehow re-base all 1920 vars to year 0 by means of a grf-local switch
09:13:00  <Terkhen> wouldn't that break some newgrfs?
09:13:01  <planetmaker> but I guess that might not easily work as the var size better changes, too
09:13:13  <planetmaker> it would not, if the switch has to be set by the newgrf
09:13:29  <planetmaker> like adding a GrfMiscBit
09:13:47  <planetmaker> but it would, if var sizes need to change
09:13:57  <planetmaker> @calc 65000 / 365
09:13:57  <Webster> planetmaker: 178.082191781
09:14:11  <planetmaker> hm... currently they can return differences as bit as 178 years
09:14:37  <planetmaker> var 47 might be way easier
09:15:36  <Terkhen> unless the change is backported it is not an option, though
09:15:47  <Terkhen> but maybe it is small enough to be backported
09:16:10  <planetmaker> well... if closure prevention works with trunk only... I'd not die from that
09:17:04  <Terkhen> neither would I, but many players would have to suffer this bug then
09:17:52  <planetmaker> hm, B4 returns always 0 for years < 1920, right?
09:18:32  <planetmaker> and always MAX_UINT16 for years > 2100 or so
09:18:43  <Terkhen> case 0xB4: return Clamp(industry->last_cargo_accepted_at - DAYS_TILL_ORIGINAL_BASE_YEAR, 0, 65535); <--- looks like that, yes
09:19:55  <Terkhen> hmm... in OpenTTD source I see a lot of variables that are not documented in the specs
09:20:21  <planetmaker> LOTS, yes
09:21:14  <Terkhen> I was looking for the "cargo produced last month variable" at both nml and newgrf specs and failing :)
09:22:37  <planetmaker> though a bit is documented at http://marcin.ttdpatch.net/sv1codec/TTD-locations.html#_VehicleArray
09:23:42  <planetmaker> which is somewhat part of the specs
09:24:58  <planetmaker> but extracting from openttd source is WAY easier
09:25:47  <Terkhen> now I only need to find information about persistent storage :)
09:26:11  <Terkhen> I only found global persistent storage, nothing about storage local to a given entity
09:27:58  <Terkhen> hmm... I think I got it
09:29:14  <planetmaker> 		/* Get a variable from the persistent storage */
09:29:16  <planetmaker> 		case 0x7C: return industry->psa.Get(parameter);
09:29:19  *** ODM has quit IRC
09:29:29  <Terkhen> yes, and andy uses 0x10 to store
09:29:41  <Terkhen> let's see if I can translate it to nml :P
09:39:41  <Terkhen> I don't see any way of introducing an assignment to a variable in a switch, I guess this is not implemented
09:40:41  <planetmaker> it is. Quite hidden. Let me search
09:40:59  <Terkhen> ok, thanks :)
09:41:57  <Terkhen> I was trying to overuse the decision expression of the switch, but it does not like assignments :P
09:47:41  <planetmaker> look at ogfx-trains, r150, file templates_engine_shunting.pnml
09:48:00  <planetmaker> lines 106 and following
09:48:16  <planetmaker> that logic meanwhile doesn't exist anymore, but I once had it there
09:48:58  <planetmaker> you probably don't want STORE_TEMP, but possibly there's a STORE_PERM or STORE_PERSISTENT
09:50:29  <planetmaker> hm... or NML regression test 019
09:50:48  <planetmaker> it's STORE_PERM
09:51:31  <planetmaker> I guess it's also a mostly undocumented feature so far ;-)
09:52:20  <Terkhen> thanks for the examples :)
09:52:27  <planetmaker> my pleasure
09:58:57  * planetmaker goes documenting that a bit...
10:00:33  <Terkhen> from the description of switch: Instead of a single expression this may also be an array of expressions. In that case all of the array elements are evaluated in order and the last one is used to make a decision. <--- this might look nicer than all of those & 0 | ...
10:01:28  <Terkhen> it also hints that you can use them for assignments but a real documentation and an example would be quite helpful :)
10:02:18  <planetmaker> yep, agreed
10:02:36  <planetmaker> But I don't quite know whether that works ;-)
10:02:40  <planetmaker> But I guess
10:03:21  <planetmaker> regression test will need expansion there, too
10:04:07  <Terkhen> http://paste.openttdcoop.org/show/176/ <-- currently I'm trying if STORE_PERM also returns the value; nml did not complain with this
10:05:52  <Terkhen> now they don't close at all so at least I'm doing something :)
10:07:22  <planetmaker> LOAD_PERM
10:08:35  <planetmaker> use it as a usual variable
10:08:38  <Terkhen> yes, now I'm switching to that
10:08:43  <planetmaker> rather LOAD_PERM(register)
10:50:02  *** KenjiE20 has joined #openttdcoop.devzone
11:25:32  <planetmaker> http://devs.openttd.org/~planetmaker/patches/doc_storage.diff <-- documentation and expanded regression test for the temp / perm storage
11:28:02  <planetmaker> ^ Yexo, can you verify that only airports, stations and industries have permanent storage? It's those where my search in OpenTTD's source returned something in that direction, but I might have missed something
11:30:12  <Terkhen> I would write "permanent storage" instead of shorting it
11:31:15  <Terkhen> An example for variable use could look like <--- shouldn't it have ":" at the end of the sentence?
11:33:37  <Terkhen> hmm... I was trying to use var 0x9E as andy does but using IND_CB_PROD_CB_CARGO_ARRIVE as you do in the example looks simpler :)
11:34:10  <planetmaker> my example might not be comprehensive. Not sure whether the random and 256 tick prod. changes intefere
11:36:22  <Terkhen> I'm thinking on increasing a second counter at IND_CB_PROD_CB_CARGO_ARRIVE
11:36:53  <Terkhen> and then, on the monthly check, if the secound counter has something the first counter is set to zero, otherwise the first counter is increased
11:36:56  <Terkhen> that should work
11:38:20  <planetmaker> probably, yes
11:40:14  <planetmaker> hm, where do I shorten permanent storage?
11:40:42  <Terkhen> at the header of the switch table (perm. storage)
11:41:16  <planetmaker> ah. It makes the table HUGE for a very short entry. Maybe two lines will solve it, yes
11:41:31  <Terkhen> ok :)
11:41:58  <planetmaker> yes, looks ok that way :-)
11:48:40  <Terkhen> switch (FEAT_INDUSTRIES, SELF, industry_cargo_arrive_switch, [STORE_PERM(0, 0x00), waiting_cargo_1 + waiting_cargo_2 + waiting_cargo_3)] { <---- should be waiting_cargo_3])
11:50:33  <planetmaker> oh, thx, yes
11:52:08  <Terkhen> hmmm... I wonder why I did not understand that your example code is exactly what I wanted to implement :)
11:52:47  <planetmaker> :-D
11:53:18  <planetmaker> I needed something sensible as example... it's not tested at all, so it might be buggy or not sensible after all
11:53:34  <Terkhen> I'm testing it right now :)
11:55:09  <planetmaker> I didn't intend to make your work obsolete, nor do I think it is... the other callbacks will certainly interact with it
11:55:44  *** ODM has joined #openttdcoop.devzone
11:55:48  <Terkhen> IND_CB_PROD_CB_CARGO_ARRIVE <--- this is not defined
11:56:12  <planetmaker> hm
11:56:13  <Terkhen> IND_CBF_PROD_CB_CARGO_ARRIVE and IND_CBF_PROD_CB_CARGO_ARRIVE do not have a corresponding callback defined in global_constants.py
11:58:34  <Terkhen> the specs make reference to the industry production callback (http://wiki.ttdpatch.net/tiki-index.php?page=Action2Industries)
12:01:46  <planetmaker> there's CBs 0x29 and 0x35
12:04:35  <Terkhen> those callbacks have their own flags, IND_CBF_RANDOM_PROD_CHANGE and IND_CBF_RANDOM_PROD_CHANGE
12:04:39  <Terkhen> so they must be different
12:05:01  <Terkhen> http://wiki.ttdpatch.net/tiki-index.php?page=Action2Industries <-- since I don't understand much of this, I don't know how much exactly
12:05:09  <Terkhen> but it looks like an old special case
12:05:19  <planetmaker> ah, I think it's 2E
12:05:55  <Terkhen> isn't 2E for houses?
12:06:08  <planetmaker> hm... probably only and yes
12:16:15  <planetmaker> I *think* that IND_CB_PROD_CB_CARGO_ARRIVE should be defined as 0x01
12:16:37  <planetmaker> could you try if that works, Terkhen ?
12:21:34  <Terkhen> s/return CB_FAILED/CB_FAILED/
12:21:40  <Terkhen> let's se
12:21:42  <Terkhen> see*
12:22:20  <planetmaker> http://devs.openttd.org/~planetmaker/patches/additional_constants.diff <-- you could use that diff, though, too
12:23:10  <Terkhen> planetmaker: with 0x01 it compiles, but no power stations close in a period of 20 years
12:24:01  <planetmaker> hm... and 0x00 instead of 0x01?
12:24:44  <planetmaker> or maybe that change as the default result to current_callback switch
12:24:54  <planetmaker> like always use that switch, if nothing else is used
12:25:33  <planetmaker> it's a CB which is active by default...
12:25:45  <Terkhen> no closures with 0x00 either
12:26:05  <Terkhen> hmmm ok, I'll check that too
12:27:30  <Terkhen> still no closures
12:40:06  <planetmaker> hm :-(
12:58:38  <Terkhen> I'm back to my previous code... now I get closures, but they are just the random normal closures :P
13:12:51  <planetmaker> he
13:17:34  <Terkhen> oh, it had closures because IND_CBF_RANDOM_PROD_CHANGE can trigger them too
13:17:52  <Terkhen> if I always return 0 with that callback there are no closures at all
13:17:59  <Terkhen> at least now I can debug :)
13:21:21  <planetmaker> :-)
13:29:12  <Terkhen> hmm... I was checking the wrong code in FIRS, the real code for power plants uses that strange "industry production callback"
13:29:30  <planetmaker> firs has no power plants
13:30:02  <Terkhen> I know, but the code is still there
13:30:17  <Terkhen> firs/templates/template_accept_only_action23_A.pnfo
15:22:24  *** Doorslammer has joined #openttdcoop.devzone
15:52:16  *** Doorslammer has quit IRC
15:58:27  *** Lakie has joined #openttdcoop.devzone
16:13:46  *** Lakie has quit IRC
16:14:07  *** Lakie has joined #openttdcoop.devzone
17:10:14  <Brot6> nml: update from r1323 to r1324 done - http://bundles.openttdcoop.org/nml/nightlies/r1324
17:18:50  <Brot6> opengfx: update from r658 to r660 done - http://bundles.openttdcoop.org/opengfx/nightlies/r660
17:18:56  <Brot6> Following repos didn't need a nightlies update: 2cctrainset (r750), 32bpp-extra (r40), ai-admiralai (r75), ai-aroai (r33), ailib-common (r21), ailib-direction (r17), ailib-list (r32), ailib-string (r29), ailib-tile (r16), airportsplus (r73), basecosts (r25), belarusiantowns (r8), bros (r52), chips (r138), comic-houses (r71), firs (r1989), fish (r619), frenchtowns (r6), german-townnames (r33), grfcodec (r828), grfpack (r279), heqs
17:18:56  <Brot6> (r605), indonesiantowns (r41), manindu (r7), metrotrackset (r56), narvs (r37), newgrf_makefile (r285), nml (r1324), nutracks (r186), ogfx-industries (r53), ogfx-landscape (r62), ogfx-rv (r80), ogfx-trains (r239), ogfx-trees (r42), openmsx (r97), opensfx (r97), smts (r19), snowlinemod (r49), spanishtowns (r10), swedishrails (r202), swisstowns (r22), transrapidtrackset (r15), ttdviewer (r31), ttrs (r36), worldairlinersset (r671)
17:23:15  <Brot6> Following repos rebuilds successful without any difference to earlier nightlies builds: airportsplus (Diffsize: 1), belarusiantowns (Diffsize: 30), frenchtowns, german-townnames, indonesiantowns (1 errors) (Diffsize: 1), manindu (Diffsize: 1), narvs, newgrf_makefile, ogfx-industries, ogfx-landscape, ogfx-rv (Diffsize: 7), ogfx-trains, spanishtowns (Diffsize: 1), swedishrails, swisstowns (Diffsize: 156)
17:52:37  *** frosch123 has joined #openttdcoop.devzone
18:13:18  *** andythenorth has joined #openttdcoop.devzone
19:55:09  *** KenjiE20 has quit IRC
19:56:09  *** KenjiE20 has joined #openttdcoop.devzone
20:02:27  *** andythenorth is now known as andythenorth_is_weird_people
20:22:35  <Yexo> planetmaker: stations don't have permanent storage
20:24:00  <planetmaker> oh, ok. Thx
20:27:38  <planetmaker> anything else?
20:27:55  <Yexo> sorry, I've had a very busy day and I'm tired
20:28:06  <Yexo> just reacted to the highlight, haven't read any of the other backlog yet
20:29:33  <planetmaker> ok, no worries then :-)
20:50:05  *** frosch123 has quit IRC
21:06:37  *** andythenorth_is_weird_people is now known as andythenorth
21:16:03  <planetmaker> Yexo: could you explain terkhen and me briefly how the syntax for the production callback for industries works (nml/action2production.py)?
21:19:10  <Yexo> I can try
21:19:34  <planetmaker> but I don't want to stress you now after a tiring day...
21:19:46  <planetmaker> defer it to another day, if you like
21:20:04  <Yexo> syntax is in ast/produce.py
21:20:53  <planetmaker> ah...
21:21:16  <Yexo> I don't I'll be able to explain much more than that
21:22:40  <Yexo> produce(<expression subtract from input 1>, <expression subtract from input 2>, <same for input 3>, <output for cargo type 1>, <output for cargo type 2> [<run this callback again?>])
21:22:48  <Yexo> that's it
21:22:55  <planetmaker> so: produce( my_industry_production_name, cargo1_subtract, cargo2_subtract, cargo3_subtract, cargo1_add, cargo2_add, try_again)
21:23:09  <planetmaker> sounds easy enough :-)
21:23:12  <Yexo> yes :)
21:23:17  <planetmaker> thanks :-)
21:23:19  <Yexo> I forgot the name indeed
21:23:33  <planetmaker> I didn't find that in the sources
21:23:44  <planetmaker> this file I mean
21:24:22  <planetmaker> ok, but this needs definitely separate documentation :-)
21:24:23  <Yexo> when I don't know the syntax of something I start in nml/parser.py, than go to the appropriate ast/*.py file
21:24:37  <planetmaker> hm, ok :-) I should remember that
21:24:39  <Yexo> #2331 has existed for a long time
21:24:39  <Brot6> Yexo: #2331 is http://dev.openttdcoop.org/issues/show/2331 "NewGRF Meta Language - Feature Request #2331: document 'produce'-block - #openttdcoop Development Zone"
21:25:22  <planetmaker> I'll add first the rest of the industry CB documentation before I add this
21:25:54  <Yexo> perhaps I'll find some time to work on the documentation this weekend
21:26:06  <planetmaker> I did most of the other CBs for industries today
21:26:06  <Yexo> also the release of version 0.1 is long overdue already
21:26:22  <planetmaker> and added a few constants for CB values
21:26:38  <Yexo> is that also pushed?
21:26:39  <planetmaker> I'll just add the hint to the (missing) produce block and call that a day
21:26:43  <planetmaker> not yet
21:26:48  <Yexo> ok
21:27:00  <Yexo> oh, and I shouldn't forget #2577
21:27:00  <Brot6> Yexo: oh: #2577 is http://dev.openttdcoop.org/issues/show/2577 "NewGRF Meta Language - Feature Request #2577: autoconvert palette if possible - #openttdcoop Development Zone"
21:27:04  <Yexo> anyway, good night
21:27:15  <planetmaker> good night. No rush either :-)
21:28:15  *** andythenorth has left #openttdcoop.devzone
21:31:56  <planetmaker> now it is :-)
21:32:21  <Brot6> NewGRF Meta Language - Revision 1325:00f3e96220b4: Doc: Industry callbacks (planetmaker) @ http://dev.openttdcoop.org/projects/nml/repository/revisions/00f3e96220b4
21:32:21  <Brot6> NewGRF Meta Language - Revision 1326:c0cab559884a: Doc: Briefly mention the use of temporary and ... (planetmaker) @ http://dev.openttdcoop.org/projects/nml/repository/revisions/c0cab559884a
21:52:32  <Terkhen> thank you Yexo :)
21:55:17  <planetmaker> indeed ^ :-)
21:55:29  <planetmaker> for now good night from here, though :-)
21:58:51  *** KenjiE20 has quit IRC
21:59:53  *** KenjiE20 has joined #openttdcoop.devzone
22:09:35  *** KenjiE20 has quit IRC
22:10:36  *** KenjiE20 has joined #openttdcoop.devzone
22:18:18  *** KenjiE20 has quit IRC
22:19:19  *** KenjiE20 has joined #openttdcoop.devzone
22:22:09  *** ODM has quit IRC
22:30:07  *** KenjiE20 has quit IRC
22:31:08  *** KenjiE20 has joined #openttdcoop.devzone
22:39:50  *** KenjiE20 has quit IRC
22:40:56  *** KenjiE20 has joined #openttdcoop.devzone
23:02:37  *** KenjiE20 has quit IRC
23:03:38  *** KenjiE20 has joined #openttdcoop.devzone
23:09:39  *** Lakie has quit IRC
23:57:13  *** KenjiE20 has quit IRC

Powered by YARRSTE version: svn-trunk