IRC logs for #openttd on OFTC at 2018-12-22
            
00:01:49 <Samu> if(result!=RoadBuilder.CONNECT_SUCCEEDED) return false;
00:02:32 <Zuu> I notice that I init RoadBuilder with max_loops = 5000 in CluelessPlus while RoadAI have it at 500.
00:03:53 <Zuu> Among the things that 40 fixes compared to 39 is "Fix: Road pathfinder doas not timeout (yorg)" (commit log)
00:04:43 *** Wormnest has quit IRC
00:05:03 <Zuu> So with SuperLib 40, I'd say raise max_loops in call to RoadBuilder.Init(). The default value in SuperLib is 4000.
00:06:51 <Samu> gonna try 5000
00:06:56 <Samu> and import 40 this time
00:07:02 <Zuu> But I also found a silly tihng in CluelessPlus code in conjuction with SuperLib. If PF fails it will try again. RoadAI doesn't do this because it doesn't manually call the pathfinder and relies on ConnectTiles to call it.
00:07:09 *** Flygon has joined #openttd
00:08:40 <Samu> rb.Init(newStation,newStation2);
00:09:14 <Samu> where is the 500?
00:09:18 <Zuu> pathfinder.Init(point1,point2,false,500); <-- RoadAI 5
00:09:32 <Zuu> In network.nut
00:09:59 <Samu> oh i found this in main.nut
00:10:04 <Samu> yeah, network.nut
00:10:07 <Samu> let's edit
00:10:48 <Zuu> rb.Init() in main.nut is commented out.
00:12:23 <Samu> oh i see, couldn't tell
00:12:25 *** frosch123 has quit IRC
00:12:32 <Samu> dont have a nice editor for this
00:14:24 <Samu> if i dont put a number there, what happens? defaults to 5000?
00:14:35 <Samu> or never stops finding?
00:14:42 <Samu> or ... hmm :(
00:14:53 *** Chrill has joined #openttd
00:16:37 *** Chrill has quit IRC
00:19:28 <Samu> nvm i found it
00:19:29 <Samu> function Init(tile1, tile2, repair_existing = false, max_loops = 4000, forbidden_tiles = []);
00:19:35 <Samu> 4000
00:19:49 <Zuu> SuperLib is not TypeScript or so with fancy IDE docs. You have to open the SuperLib tar and read the docs there as you probably just did. :-)
00:19:59 *** Wacko1976 has quit IRC
00:20:50 <Zuu> I use vim to edit .nut files with a squirrel syntax file I found so I get colors at least.
00:21:22 <Zuu> But these days perhaps Visual Studio Code have something useful for squirrel?
00:24:38 <Samu> with 5000 it's doing alright
00:27:32 *** lugo has quit IRC
00:29:20 <Samu> must do a battle of RoadAIs
00:29:46 <Samu> RoadAI v5 with SuperLib 39 vs RoadAI v5 with SuperLib 40 and 5000 loops
00:30:50 <Samu> 5000 may be too much? gonna leave it at default
00:32:34 <Zuu> I don't know. I don't remember why I have 4000 as default in the library but then 5000 in clueless plus. :-)
00:33:14 <Zuu> Maybe I did some playing around after publishing the library or I just had some reason for it.
00:34:09 *** Compu has joined #openttd
00:38:58 <Samu> superlib 39 is winning
00:39:01 <Samu> atm
00:40:09 <Samu> superlib 40 catches up
00:40:17 <Samu> well this just started, gonna wait 10 mins or so
00:40:55 <Zuu> Did you start all at the same time using startai and did you use more than just two AIs?
00:41:30 *** Progman has quit IRC
00:41:51 <Samu> startai with the main.nut and network.nut edited in one way, then edited the files, and then startai again
00:42:12 <Samu> they're in the same map
00:42:50 <Samu> superlib 40 with default loops is winning
00:43:04 <Samu> map has many water, so i guess timing out is helpful
00:43:30 <Samu> not sure what 39 do? doesn't timeout?
00:43:47 <Zuu> 39 doesn't time out. It is one of the things that 40 fixes.
00:44:02 <Zuu> Which is why the low limit of 500 in RoadAI-4 is not a problem.
00:44:03 <Samu> ah, took 2 years to get a Failed to find path
00:45:03 <Samu> https://imgur.com/CN2VkOH
00:47:39 <Zuu> Yep that is what 40 fixes :-)
00:48:34 <Samu> they started building in the same places for their network
00:48:43 <Zuu> I diged a bit and found it will use 100 loops to find out if one of the points is an island and then start over from the other end.
00:48:46 <Samu> there's many water around
00:49:10 <Zuu> This 100 is hard coded into the library and cannot be configured by the AI.
00:49:42 <Zuu> But you can of course roll your own if you don't like it.
00:54:44 *** Wacko1976 has joined #openttd
00:57:40 <Samu> https://imgur.com/xWGt91F
00:57:54 <Samu> green is 39
00:58:08 <Samu> red is 40 with default loops
00:59:52 <Samu> https://imgur.com/B5mADTj the log of SuperLib 40 showing up
01:00:23 <Zuu> I run 2x RoadAI-5 with 5000 loops against two CluelessPlus-38. Both RoadAIs are struggling but this map is using some NewGRFs including FIRS.
01:00:59 <Samu> i using eGVRVTS by mistake
01:01:07 <Samu> should've been using defaults
01:01:11 <Samu> vanilla
01:01:29 <Samu> eGRVTS
01:01:37 <Zuu> I shall revert to vanilia too and compare. More fair as it is lot of work to support all NewGRF quirks.
01:03:16 <Samu> oh, have you tried my AI? haven't heard from anyone yet trying it
01:03:33 <Zuu> Which one is yours?
01:03:44 <Samu> LuDiAI AfterFix
01:04:22 <Samu> my pathfinder is slow :(
01:04:29 <Samu> but oh well
01:04:32 <Samu> i like it still
01:05:24 <Zuu> I'll throw it in the mix. :-)
01:05:37 <Samu> I didn't like the way bridges were being handled in Road.pathfinder 4
01:05:56 <Samu> the change made it super slow
01:06:05 <Samu> but at least it builds bridges properly
01:06:13 <Samu> and not in weird places
01:08:59 <Zuu> Do you have random elements in the AI? I have two instances and they seem to go for the same things.
01:09:01 *** Wacko1976 has quit IRC
01:09:31 <Samu> no, unless you use random picks
01:10:21 <Samu> random picks, picks towns at random
01:10:28 <Samu> so, they should do different
01:11:01 <Zuu> It doesn't have to be 100% random. Filter out say 10 good solutions and take one of them by random.
01:11:37 <Zuu> Or add some randomness in the scoring of solutions.
01:12:33 <Zuu> Your AI is currently still doing better than Road-AI 5 on this dessert map. But only at year 1955 (starting on 53) so far.
01:13:06 <Samu> never really tested it with NewGRFs
01:13:21 <Zuu> I restarted a map without NewGRFs now.
01:13:43 <Samu> i still tried to make it handle articulated road vehs
01:13:50 <Samu> not sure if I made it well though
01:13:56 <Zuu> https://imgur.com/a/aQKCkyZ
01:16:26 <Samu> it's funny, I'm now on the other side of the game
01:16:33 <Samu> someone is judging me :p
01:17:43 <Zuu> We'll if I would toss in say AIAI it tend to outperform CluelessPlus more often than not. But each game is unique and lot of random factors.
01:19:18 <Zuu> A few more years: https://imgur.com/a/8gefScU
01:19:22 <Samu> oh, that's v5, i didn't upload v6 yet :(
01:19:29 <Samu> but i have v6 almost ready
01:19:57 *** Progman has joined #openttd
01:20:08 <Samu> looks like it's underperforming
01:21:04 <Samu> it's strictly handling passengers, hmm in desert tileset, I guess that's kinda expected
01:27:14 <Zuu> Is it only doing mail and passengers? No other cargo?
01:29:30 <Samu> ya
01:29:50 <Samu> it's what LuDiAI was doing
01:30:08 <Samu> the original
01:31:03 <Samu> I suppose I could make it handle more than just 1 cargo
01:31:21 <Samu> not really motivated for that atm
01:32:20 <Samu> i've thought of making it handle pass and mail at the same time, not just either pass or either mail
01:32:22 <Zuu> Well it at least your AI is making higher profit per vehicle than CLUP so it looks promising in that way.
01:33:48 <Samu> it station spreads, it's kind of cheating
01:33:53 <Zuu> https://imgur.com/a/J3jiqtp
01:33:54 <Samu> if you have that enabled
01:34:31 <Zuu> I use the default settings from hard profile.
01:34:54 <Samu> oh, i see, then it's station spreading, it's cheating, just like LuDiAI does
01:35:42 <Samu> if the town is large enough, that is
01:36:44 <Samu> that company value looks scary
01:37:27 <Samu> it's a bad sign
01:38:28 <Zuu> Poor RoadAI invested in too many busses on a connection and looks like it is on the way to go bankrupt.
01:39:07 *** Fuco has quit IRC
01:40:26 <Zuu> Looks like LuDiAI has started to cheat.. :-)
01:41:09 <Zuu> It has a quite high station tile per vehicle ratio compared to the other AIs.
01:41:35 <Samu> on v5, it maxes out at 25 per route
01:41:45 <Samu> on v6, i have 3 different modes
01:42:05 <Samu> the 25 per route, the "estimated number per route"
01:42:51 <Samu> and the one that keeps adding indefinitely as long as vehicles aren't moving at 0 speed
01:42:56 <Samu> if they are, it removes instead
01:43:12 <Samu> some kind of jam management/capacity 2-in-1
01:43:29 <Samu> i shall upload v6
01:43:49 <Samu> not sure if it's bug free though, it's what I'm hunting atm before i post it
01:45:11 <Zuu> Yep cluelessPlus toss in quite many vehicles but also have jam management to not have more vehicles than the road can handle.
01:45:46 <Zuu> LuDiAI is raising above with station spread: https://imgur.com/a/nuHJsLi
01:46:26 <Samu> woah, those towns must be in grass land, they're growing, aren't they?
01:48:14 <Zuu> That one is grass land, but there is also CluelessPlus transporting pretty much all cargo and I wouldn't be surprised if some town by accident get both food and water.
01:49:50 <Zuu> Hmm.. actually there is only one food plant producing and it is not transported to any town.
01:52:44 <Zuu> The problem with capacity management in CluelessPlus is that with aircraft it tend to sell and buy back aircraft at an unhealthy ratio. For road vehicles it is not so much of a problem to sell and buy back a truck here and there but for aircraft bad decisions early on can make you go bankrupt.
01:53:11 <Samu> meanwhile https://imgur.com/20pRno5
01:53:12 <Zuu> unhealthy ratio => unhealthy rate
01:53:34 <Samu> timing out too much allowed Superlib 39 to catch up
01:54:18 <Samu> the graph however is favouring superlib 40 atm
01:54:31 *** lugo has joined #openttd
01:55:36 <Samu> aircraft is where I coded most
01:55:37 <Zuu> Timing out means the AI get the opportunity to manage the existing fleet more. Which if it does clever decisions is good, but it also allow it to make the wrong decisions where a frozen path finder would have stopped it from making any decissions. :-)
01:56:36 <Samu> i've noticed 39 completing more routes, albeit slowly
01:56:40 <Samu> than red
01:56:47 <Zuu> I've coded quite a bit on aircraft and have code for upgrading fleet and airports. Which involves establishing an airport for the sole purpose of sending aircraft there while upgrading the airport in a town.
01:57:16 <Samu> ah, ya, that is one weird thing
01:57:40 <Samu> when the airport got to manage 2000+ vehicles or so, it's so bottlenecked
01:57:55 <Zuu> But now there is the close airport feature which didn't exsist when I started.
01:58:25 <Samu> it's like a centralized depot
01:58:39 <Zuu> So I should better use that and ditch the 3rd airport solution that I still keep for nostalgica. :-)
01:59:30 <Samu> yes, you better, I tend to test with 5000 vehicles as limits, and clueless was the weirdest
02:00:17 <Samu> so many aircraft floating the airport it was like playing snake, big tails of aircraft
02:00:22 <Zuu> I like being a bit weird at times but yes when other AIs use station walking, it should probably up its game. :-)
02:01:33 <Zuu> But then if I would close airports instead you wouldn't enjoy the snake game and I think AIs should not just try to go for maximum profit but also be entertaining to play against or along.
02:01:58 <Samu> profits were affected
02:02:04 <Samu> it was a really really slow upgrade
02:02:53 <Samu> I don't manage airport upgrades
02:03:32 <Samu> but i also don't add more vehicles on airports that expire
02:03:56 <Samu> once they're old, they're sold, and once the airport is empty, it is removed
02:04:14 <Samu> the chance of "upgrade" is there
02:04:34 <Samu> it will add that town again to the list of unserviced towns
02:04:36 <Zuu> Yes not as organized but get you there in a less fragile and bumpy way. .-)
02:04:40 <Samu> and might build a larger airport
02:05:09 <Samu> or a heliport, which is what happens anyway... not really what I want
02:05:10 <Zuu> Caos often is a good thing.
02:06:38 *** Progman has quit IRC
02:07:19 <Zuu> But going for AIStation.OpenCloseAirport is probably a middle way that CluelessPlus could take. Still doing upgrades like a human may do it, but without playing snake game. :-)
02:08:12 <Samu> i think my code is chaos
02:08:33 <Samu> wrightai.nut file is total chaos
02:09:15 <Samu> the other files not so much, it's still pratically the same code that was in LuDiAI
02:15:18 <Zuu> "DistanceRealFake" <-- interesting method name
02:16:11 <Samu> aha
02:24:30 <Zuu> Airport code easily get a bit messy as the API is not having generic support for airport types. I mean you have to somewhere hard code facts about different airport types.
02:25:25 <Zuu> I had some work on improvements for the API and it is possible that some reached the trunk but others didn't as it was tied with the new airport work that didn't get off ground :-)
02:29:57 <Zuu> It involved some of the stuff found in SuperLib.Airport such as if a small aircraft can land on airport type Y etc. to allow writing AIs that would be more robust at handling new airport types.
02:30:56 <Zuu> GetNumTerminals, GetNumHangars etc. was there as I see you have hard coded into your AI.
02:32:16 <Samu> :9
02:33:43 <Samu> https://noai.openttd.org/api/trunk/classAIAirport.html
02:33:49 <Samu> doesn't have :(
02:34:02 <Samu> GetNumTerminals :(
02:35:54 <Zuu> I don't think I will get this into trunk, but I put up the patch queue from .hg/patches here: http://devs.openttd.org/~zuu/noai-airport/
02:37:04 <Zuu> And unfortunately this was before I learned to name my patches in the queue with ".patch" suffix.
02:50:13 <Zuu> Oh well renamed them so it is easier to read them online.
02:52:05 <Samu> there is no trunk anymore
02:52:18 <Samu> they call it master now :(
02:53:36 <Zuu> Well, but similar function. I use git mostly these days anyway and feels a bit wierd to remember how to use hg again. :-p
02:55:16 <Samu> https://imgur.com/KqPWxWu
02:55:57 <Samu> seems like superlib 40 is gonna end better
02:57:37 *** chomwitt has quit IRC
02:57:42 <Samu> admiralai is such a strong ai for its age
02:57:54 <Zuu> And so is LuDiAI: https://imgur.com/a/w9KTleU
02:58:58 <Samu> admiralai does best regarding buses and airplanes
02:59:03 <Samu> can't beat him lol
03:01:51 <Samu> what happened to RoadAI?
03:03:28 <Samu> oh, while you're here
03:03:34 *** HerzogDeXtEr has quit IRC
03:03:43 <Samu> i've also made a GS
03:03:53 <Samu> Company Value GS
03:04:18 <Samu> I wondered how i'd make the communication between ai and gs :(
03:04:28 <Samu> couldn't understand jack
03:06:57 <Samu> that one was made from scratch
03:07:12 *** glx has quit IRC
03:30:44 <Zuu> Well it's 03:30 am here so I better get some sleep :-p But for short I only used SCP for ai <-> gs communication.
03:31:01 *** Zuu has quit IRC
03:42:09 *** Samu has quit IRC
03:49:04 *** lugo has quit IRC
07:41:57 *** chomwitt has joined #openttd
07:56:08 *** sla_ro|master has joined #openttd
08:40:04 *** andythenorth has joined #openttd
08:40:41 <andythenorth> o/
08:55:15 *** Progman has joined #openttd
08:55:22 *** nielsm has joined #openttd
09:00:19 *** lugo has joined #openttd
09:05:55 *** erratic has quit IRC
09:07:28 *** tokai has joined #openttd
09:07:28 *** ChanServ sets mode: +v tokai
09:12:24 *** sla_ro|master has quit IRC
09:14:09 *** tokai|noir has quit IRC
09:25:04 *** Wacko1976 has joined #openttd
09:38:12 *** cHawk has quit IRC
09:38:34 *** cHawk has joined #openttd
09:42:15 <andythenorth> nielsm: I'm guessing that the industry fund texts are handled here https://github.com/OpenTTD/OpenTTD/blob/master/src/industry_gui.cpp#L507
09:42:33 <andythenorth> both 'requires' and 'produces' are borked :)
09:44:06 <nielsm> huh
09:44:18 <nielsm> I'll look in to it a bit later
09:44:25 <nielsm> my stomach is rumbling
09:44:31 <andythenorth> breakfast is wise
09:44:36 * andythenorth hasn't yet
10:32:45 *** synchris has joined #openttd
10:37:25 *** Wacko1976 has quit IRC
10:48:24 <TrueBrain> I am so annoyed I removed the Windows release script I had .. it had everything I needed .. and I hate figuring out Powershell again :(
10:48:26 <TrueBrain> *sad panda*
10:49:38 <andythenorth> TruePanda
10:50:01 <TrueBrain> is the Azure Docker Registry free to use, I wonder ..
10:53:06 <TrueBrain> far from it .. too bad :P
11:02:07 <TrueBrain> lets see if I can build a Windows container ..
11:10:47 <nielsm> andythenorth, I'm looking at the new industry vars and I don't understand the table in nml defining the vars at all
11:11:01 <andythenorth> let's see
11:11:04 <nielsm> action2var_variables.py line 563+
11:11:15 <nielsm> especially the start and size elements
11:12:19 <andythenorth> many vars are specific bits of a word or dword
11:12:26 <andythenorth> so they have to be shifted / sliced etc
11:13:14 <planetmaker> moin
11:13:25 <planetmaker> nielsm, which file you mean?
11:13:38 <planetmaker> nvm... more tea
11:13:39 <nielsm> okay so it means, named variable means query index in 'var' and extract the bits specified from 'start' and 'size' count, and call 'param_function' to set up the parameters for the call
11:13:51 <andythenorth> e.g. https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/Vehicles#Consist_cargo_.2842.29
11:13:52 <planetmaker> yes
11:13:54 <andythenorth> is one of the more obvious
11:14:06 <andythenorth> coding nfo was....such fun :P
11:14:55 <andythenorth> planetmaker: if you want to help an nml project...we are adding industry vars 69-6F https://newgrf-specs.tt-wiki.net/wiki/VariationalAction2/Industries#Variables
11:15:14 <andythenorth> they need a 60+ parameter which, afaict, is a cargo label
11:15:17 <nielsm> so will need a new parameter function for cargo names
11:15:24 <andythenorth> although I don't really understand how that works
11:15:43 <andythenorth> industries can have arbitrary cargos, so having vars to check specific cargos seems...interesting
11:16:08 <andythenorth> anyway, that ship has sailed now :)
11:16:53 <nielsm> well instead of querying "how much of first cargo did we produce", you query "how much wood did we produce"
11:17:44 <andythenorth> yup
11:18:17 <andythenorth> it's fine, it just means a rewrite of FIRS production code
11:18:42 <planetmaker> so... the nfo documentation is also missing? :D
11:18:51 <andythenorth> the nfo documentation is...present
11:18:59 <andythenorth> but maybe not 100% easy to understand
11:19:15 <planetmaker> oh. under A7 and B3
11:19:20 <andythenorth> it's written for factual accuracy, but not as any tutorial
11:19:44 <planetmaker> the order of topics doesn't match expected orders :)
11:19:45 <andythenorth> I was going to improve it, but then I figured, who's using nfo for this?
11:20:03 <andythenorth> oh yes, it's been appended to the end, good spot
11:20:25 <andythenorth> and there's a stray 'Example' at the end
11:20:32 <planetmaker> I'll fix it
11:20:45 <nielsm> uh okay, I have no idea how cargo names/translations work in NML, internally or externally
11:22:53 <planetmaker> hm... i gotta read-up on how some things are done, too. Before I can substantially comment. it might be interesting to look at the production code. That's special... but there are already other vars which consume a 60+ var ... so we probably want to look there
11:24:09 <nielsm> okay may just be able to get away with the default function
11:24:32 <nielsm> so you'd call produced_cargo_waiting(cargotype("WOOD")) or however it would look exactly
11:24:32 <andythenorth> nielsm: TL;DR there's a cargo translation table (ctt) and the string for cargos names are just indexes in that
11:24:47 * andythenorth gives the simple version :P
11:25:04 <andythenorth> nielsm: I'd expection it to look approximately like that yes
11:25:08 <nielsm> the alternative would be building the translation in to the variable call, produced_cargo_waiting("WOOD")
11:26:23 <andythenorth> that is preferable
11:26:36 <andythenorth> houses seems to do something like this already
11:26:54 <andythenorth> cargo_accepted_nearby_watched or so
11:26:56 * andythenorth reading more
11:27:26 <planetmaker> 'cargo_allow_refit' : [{'custom_function': lambda value: ctt_list(0x2C, value)}, zero_refit_mask(0x1D)],
11:28:08 <planetmaker> so yes, I like the syntax as suggested by niels just 2 lines above
11:28:10 * andythenorth lost in the spec
11:28:21 <andythenorth> oh so I can animate houses if goods arrives at a nearby station? :o
11:28:25 * andythenorth has never made a house set
11:28:30 <andythenorth> clearly unexplored potential
11:32:07 <nielsm> def industry_cargotype(name, args, pos, info):
11:32:07 <nielsm> from nml.expression.functioncall import builtin_cargotype
11:32:07 <nielsm> return (builtin_cargotype(name, args, pos), [])
11:32:11 <nielsm> probably good enough? :)
11:35:36 <nielsm> pushed, untested, but at least the regression tests aren't failing :D
11:38:14 <andythenorth> such tests :)
11:38:29 * andythenorth wonders what test case to construct for these :P
11:39:12 <planetmaker> an... example industry
11:39:16 <nielsm> and now you have last_accept_date and last_cargo_accepted_at
11:39:26 <nielsm> first does not take parameter, second does
11:39:28 <andythenorth> should we extend the in-game newgrf debug window for vars 69-6F?
11:39:52 <planetmaker> good point about that
11:39:57 <andythenorth> I think we should deprecate some of the old vars also, there are rather a lot
11:40:04 <andythenorth> nml version bump?
11:40:16 * andythenorth doesn't know how these things are handled :)
11:40:32 <planetmaker> yes... there is little point to support two ways to handle production for industries
11:41:07 <andythenorth> ok well it's a nice christmas project :)
11:43:52 <planetmaker> ok... so the new vars are for continuity's sake production_rate, produced_this_month and transported_this_month... And I'd call it deprecated and remove on next major release
11:44:09 <planetmaker> and that's the nice way to do it... not necessarily how we did do it in the past :)
11:44:22 <nielsm> would it be okay to change the example_industry.nml to have this? https://0x0.st/sdap.txt
11:44:23 <andythenorth> \o/
11:44:28 <planetmaker> sure
11:44:34 <andythenorth> nielsm: totally yes
11:44:47 <andythenorth> so I am going to just test the vars crudely by dumping into extra_text_industry
11:44:48 <andythenorth> somehow
11:44:57 * andythenorth forgotten how to do that :P
11:45:01 <andythenorth> I don't write nml much
11:45:20 <planetmaker> but... those lists should be cargo labels instead of numbers, no?
11:45:41 <andythenorth> nah that's the input multipliers for the simple production option
11:45:46 <andythenorth> which nobody should ever use :D
11:45:52 <planetmaker> well, multipliere surely not
11:46:07 <andythenorth> oh I see
11:46:11 <andythenorth> you mean accept / produce
11:46:13 <planetmaker> though... actually yes, it should be tuples
11:46:26 <andythenorth> I didn't define a cargo table yet, so they're just default cargo nums currently
11:46:34 <andythenorth> that can be added
11:46:34 <planetmaker> or dicts
11:46:50 <planetmaker> ['WOOD': 1, 'FRUT':2]
11:46:51 <nielsm> hmm accept_cargo_types and prod_cargo_types should maybe have strings instead of numbers yes
11:47:10 <andythenorth> that's trivial
11:47:21 * andythenorth assumes
11:47:59 <nielsm> dunno if it's better to be explicit having to call cargotype() on each element there too
11:48:25 <planetmaker> actually... ['GOOD':{'WOOD':2, 'FRUT':1}, 'MAIL':{'WOOD':1, 'FRUT':0}]
11:49:13 <nielsm> planetmaker problem with that, I think, is that you would need to parse the entire industry block first before you know how the cargo labels map to the in/out slots
11:49:24 <nielsm> which sounds like a huge pain
11:49:26 <andythenorth> FWIW, https://dev.openttdcoop.org/projects/firs/repository/entry/src/industries/blast_furnace.py#L3
11:49:38 <andythenorth> obviously FIRS is living behind a whole layer of python abstraction :P
11:50:10 *** Fuco has joined #openttd
11:50:27 <planetmaker> nielsm, currently the numbers are entries in the ctt, aren't they?
11:50:33 <planetmaker> and you know the ctt before
11:50:40 <andythenorth> let me add the ctt now
11:50:46 <andythenorth> so we are all looking at same thing
11:51:22 <planetmaker> and for input_multipier... yes, NML needs to know the accept_cargo_types and prod_cargo_types
11:51:31 <nielsm> yes, but the output from the input_multipliers property must be a matrix of multipliers, for the cargoes in the order they were specified in accept_cargo_types and prod_cargo_types
11:51:38 <planetmaker> (shouldn't it be 'accepted_cargo_types'?)
11:51:58 <andythenorth> I wouldn't overthink prop 28
11:51:59 <planetmaker> nielsm, NML should re-arrange that for you behind the scenes, I think
11:52:03 <andythenorth> we got stuck on prop 28 last time :P
11:52:09 <andythenorth> and nobody is going to use it anyway :P
11:53:13 <planetmaker> and - if the property is set - set everything NOT mentioned in it to 0
11:53:20 <planetmaker> (or 1?)
11:53:33 <nielsm> 0 is the default for missing values
11:54:00 <planetmaker> more thinking in terms of "what would a NewGRF author like more?"
11:54:22 <planetmaker> not define output, when he doesn't want it produced. Or when it is produced 1:1. What happens more often?
11:54:29 <planetmaker> probably 'not produced'
11:54:54 *** Wolf01 has joined #openttd
11:56:30 <nielsm> looking at the stuff in action0properties.py I just don't see a way to query the total industry definition at either parse time or output time
11:59:09 <planetmaker> can't its evaluation be deferred until its input and output cargoes are available (or require that those are defined prior to it)?
11:59:32 <planetmaker> which would be fine for me to say "first define cargoes we deal with, then their relation"
11:59:40 <nielsm> no, the property doesn't get any context at all at any stage
11:59:59 <nielsm> you'd have to define it as a single huge property then
12:00:16 <planetmaker> honestly: if you defin the production matrix, there would be no point to define the input and output cargoes anymore
12:00:25 <planetmaker> just define the production matrix - and infer the rest
12:00:29 <planetmaker> yes
12:00:39 <planetmaker> one list of dicts. or list of lists
12:01:16 <andythenorth> https://paste.openttdcoop.org/pntip1imo/3yebdl/raw
12:01:17 <nielsm> cargo: [ inputs: ["WOOD","COAL"], outputs: ["GOOD,"FOOD"], ratios: ["WOOD": ["FOOD":1], "COAL": ["GOOD":1] ] ]
12:01:19 <nielsm> or something
12:01:23 <andythenorth> nmlc ERROR: "example_industry.nml", line 47: Parameter for cargotype() must be a string literal that is also in your cargo table
12:01:29 <andythenorth> I miss something :P
12:01:34 <planetmaker> it suffices to define ratios
12:01:40 <planetmaker> the rest can be inferred
12:01:50 <planetmaker> as ratios define already implicitly input and output
12:02:25 <planetmaker> or actually explicitly even
12:02:35 <planetmaker> it mentions every cargo needed and its purpose
12:02:39 <andythenorth> the ratios thing is weird anyway
12:02:57 <andythenorth> it's utterly baffling if steel produces 2t goods and 6t machinery
12:03:05 <andythenorth> but plastic produces 6t goods and 2t machinery
12:03:10 <andythenorth> at the same industry
12:03:13 <planetmaker> even more weired if it produces fruits ;)
12:03:48 <andythenorth> FIRS kept all outputs 1:1 to each other, until last year
12:03:53 <andythenorth> when I allowed splitting some
12:04:10 <nielsm> planetmaker, problem with having a cargo property with _only_ production ratios would be primary industries, they accept nothing so there is nowhere to place outputs
12:04:12 <andythenorth> but still, there is no specific ratio of input-x: output-y
12:04:48 <planetmaker> cargo_matrix: ['GOOD':{'WOOD': 1, 'FRUT': 2, 'COAL': 1}, ...]
12:05:11 <nielsm> then you'd have to allow either a cargo matrix, or two lists of inputs and outputs, but not both at the same time
12:05:15 <andythenorth> nielsm: that's why FIRS has two different keyword args for props, one for primary and one for secondary :( https://dev.openttdcoop.org/projects/firs/repository/entry/src/industries/arable_farm.py
12:05:17 <nielsm> which afaik also can't be prevented
12:05:28 <planetmaker> why can't it be prevented?
12:05:37 <nielsm> in the current framework
12:07:41 <nielsm> would have to add a flag for "exclusive_with": ["other_property"] on the property def and extend somehing to check those
12:07:57 <andythenorth> meanwhile :) why does my nml fail? o_O
12:08:40 <andythenorth> I have a cargotable :P
12:10:55 <planetmaker> or we allow for this one property two ways to define it:
12:11:36 <planetmaker> a) cargo_production = ['WOOD': 5] // for a primary industry, starting production 5 (whatever that means)
12:12:18 <planetmaker> b) cargo_production = ['WOOD': {'FMSP':1, 'PAX_':1}] // secondary industry which requires PAX and FMSP
12:13:03 <planetmaker> then we have all info in one place. Did I miss sth essential?
12:13:42 <nielsm> might work
12:13:53 <nielsm> as long as it can express all the stuff the nfo format has
12:14:14 <planetmaker> I've to do a quick trip to town and will be back in ~3h or so. Love to continue this
12:14:20 <andythenorth> similar here
12:14:32 <andythenorth> trying to debug this cargotype() failure right now :)
12:14:35 <andythenorth> but I should go out
12:14:38 <andythenorth> and buy presents
12:15:11 <planetmaker> ^^
12:15:14 <nielsm> I should do that too, really
12:18:06 <andythenorth> reconvene later then :)
12:27:37 <andythenorth> ha ha
12:27:47 <andythenorth> two shells, one had the virtualenv active, one didn't :P
12:28:13 <andythenorth> so they weren't seeing same nmlc :P
12:31:48 <andythenorth> ok
12:32:04 <andythenorth> so we'll just close the unclosed */ comment that makes the ctt inactive :P
12:34:13 <andythenorth> and also fix the transposed W and G
12:34:21 <andythenorth> WOOD twice does not make GOOD
12:44:14 *** andythenorth has quit IRC
12:57:15 <TrueBrain> holy crap .. VS2017 in a container is 8GB in size .. lol
13:10:15 <TrueBrain> wow .... Windows really has to catch up ... takes 10 minutes to download a windows image ...
13:10:33 <TrueBrain> it is almost quicker to just install vcpkg and co every time
13:16:21 *** frosch123 has joined #openttd
13:16:50 <TrueBrain> I am guessing Windows Containers are just currently not a viable option .. which is a bit annoying :D But not terrible :)
13:33:16 <Eddi|zuHause> just get a windows vm?
13:33:56 <Eddi|zuHause> or are we at "if containers aren't solving your problem, you're not using enough of them yet"
13:44:55 *** andythenorth has joined #openttd
13:47:57 <andythenorth> nielsm: seems nml can't handle floats in input_multiplier :)
13:47:58 <andythenorth> Error: (TypeError) "unsupported operand type(s) for &: 'float' and 'int'".
13:48:12 <andythenorth> output_base.py", line 314, in print_word
14:12:09 *** synchris has quit IRC
14:15:31 * andythenorth wonders how those are working in nfo
14:15:34 <andythenorth> with integer maths
14:16:36 <andythenorth> it's 1/256 in prop 28 https://newgrf-specs.tt-wiki.net/wiki/Action0/Industries#Input_cargo_multiplier_list_.2828.29
14:18:42 *** HerzogDeXtEr has joined #openttd
14:24:52 <Eddi|zuHause> i think i'm going crazy trying to build this https://steamuserimages-a.akamaihd.net/ugc/947343832957231128/FD2835BA155525532A10F3C81DBA6697D374EE18/
14:28:58 <Eddi|zuHause> and the worst thing, i need to build the same kind of thing on the other side again
14:31:10 <Eddi|zuHause> especially the bridge is still a pain in TF
14:50:39 *** Fuco has quit IRC
14:56:44 <nielsm> andythenorth, fixed, that was a silly little bug
14:57:21 <andythenorth> he
14:58:09 <nielsm> TrueBrain, so just stick to a manually maintained dependency package for now? at least it's fast in setup each time
14:59:35 *** Zuu has joined #openttd
15:03:23 <andythenorth> nielsm: did you push the fix? :)
15:03:28 <nielsm> yes
15:03:55 <nielsm> oh, no
15:04:07 <nielsm> no I did
15:04:13 <nielsm> now
15:11:11 <TrueBrain> nielsm: yeah; but it is a bit disapointing :D The part that should help to do these things, is on Windows ... far from working :D
15:11:24 <TrueBrain> it appears disk IO is the biggest issue
15:11:37 <TrueBrain> but with 8GB that might not be surprising, I guess
15:18:39 *** Wacko1976 has joined #openttd
15:21:01 * andythenorth has done some violence with git
15:21:03 <andythenorth> 'probably fine'
15:21:27 <andythenorth> learnt how to remove commits and force push them
15:26:34 <Zuu> I try to find the documentation on how the git topology is set up with OpenTTD. My local config has origin pointing on my clone on github and a remote "upstream" pointing on OpenTTD. But the local master is following origin, and now I want to update it to last form upstream.
15:27:12 <nielsm> "git pull upstream master"
15:27:33 <Zuu> Ok
15:28:00 <andythenorth> contributing.md has instructions
15:28:09 <Zuu> Ah.. there it is.
15:28:21 <andythenorth> if you don't follow them, TrueBrain will be angry or funny, depending on mood
15:28:26 <andythenorth> dunno which is worse :P
15:28:36 <andythenorth> nielsm: so I pushed
15:28:42 <andythenorth> https://github.com/andythenorth/nml/commits/16-industry-cargos-in-out
15:28:50 <andythenorth> I think all industry props are done
15:29:07 <nielsm> so the updated cbs now
15:29:11 <andythenorth> yup
15:29:17 <nielsm> did you do some force pushing?
15:29:44 <nielsm> nm I just did a merge pull
15:30:01 <andythenorth> I did some horrors
15:30:05 <andythenorth> it's best not to ask :P
15:30:22 <andythenorth> I have been doing basic git successfully for years, but anything advanced....oof
15:30:29 <nielsm> history can be cleaned up later, first to get it all working
15:30:40 <nielsm> (may as well put it all in a single squash commit)
15:30:53 <andythenorth> the nice thing is that I have learnt how to erase my mistakes
15:30:58 <andythenorth> using force push
15:31:03 <andythenorth> but that is bad in a team game :D
15:31:26 <andythenorth> and yes, I figured we'd squash this into one commit "Feature: support 16 cargos in / out"
15:31:27 <andythenorth> or so
15:35:05 <Zuu> Not surpisingly rebasing a patch queue from 2011 caused some conflicts. :-)
15:35:20 <andythenorth> ha ha
15:35:23 <andythenorth> more than 255?
15:35:46 <Zuu> Nope, just 8-10 files or so.
15:36:09 <Zuu> But I think this is only for the first patch in the queue. :-)
15:36:43 <andythenorth> nielsm: I'm going to just print out var 69-6F results in industry window extra text
15:36:47 <andythenorth> I've pushed the start of that
15:36:54 <peter1138> Hi
15:37:18 * andythenorth trying to remember how the text stack works
15:38:14 <Zuu> But I don't know if I want to resolve the conflicts. The queue maybe made sense back then, but was not entering trunk because it was maybe causing too large API changes, so I think I'm better of just picking the best parts of it. :-)
15:40:05 *** Flygon has quit IRC
15:48:07 <Zuu> But at the same time, all it does is a generic way of gathering number of helipads, terminals, large/small airport etc. which is relevant if you want to add more airport types. But if not, then AIs can keep hard coding opinions of different airport types.
15:48:12 <andythenorth> oof, need to bitstuff
15:48:18 * andythenorth can't really be bothered :P
15:49:05 <Zuu> The only real new thing it provides is for AIs to build rotated airports.
15:49:16 <andythenorth> text stack only has limited registers
15:49:47 <andythenorth> hmm
15:50:04 <andythenorth> I wonder if text stack will need more registers with 16 in / out cargos
15:50:13 <andythenorth> we increased persistent storage already
15:59:06 *** Alberth has joined #openttd
15:59:06 *** ChanServ sets mode: +o Alberth
16:00:12 *** Progman has quit IRC
16:05:13 <nielsm> hmm, how about a syntax like this? https://0x0.st/sdBe.txt
16:05:42 <nielsm> would need some new builtin functions producing new intermediate types
16:09:13 <nielsm> ping andythenorth, planetmaker :)
16:10:25 <andythenorth> it makes sense
16:10:35 <andythenorth> I have to put aside my prejudices :P
16:10:44 <andythenorth> nobody should ever do this
16:10:45 <andythenorth> accept_cargo("COAL", [produce_cargo("MAIL", 1), produce_cargo("GOOD", 0.5), produce_cargo("STEL", 1)]),
16:10:56 <andythenorth> and authors should be using prod. cb anyway in most cases
16:12:00 <nielsm> "// accepts IORE, produces nothing in return" --- unless ordered to by a production cb
16:14:38 <nielsm> also there's absolutely nothing wrong with coal being used to produce mail, the letters could be written using charcoal! and goods could definitely be presents for naughty kids
16:18:23 *** Samu has joined #openttd
16:18:45 <Samu> hi
16:19:06 <Alberth> simplest may be to just do behavior like default set, and for anything else, use a cb
16:19:37 <Alberth> btw don't know what the current behavior is
16:21:12 <Alberth> syntax looks pretty horrible, but nml syntax is horrible, so it fits right in :p
16:22:58 <nielsm> the NFO format is that you specify one property with a list of cargo types accepted, one property with a list of cargo types produced, one of production rates with no input for all produced cargo types, and one property with a matrix of production-to-input ratios for all inputs x outputs
16:23:10 <nielsm> which is how the built in industries work
16:23:50 <nielsm> (secondary industries have basically just a matrix of all 1's for the prod-to-input ratios)
16:36:41 <Zuu> Samu: If you want to AI <-> GS communication, I'd propose an API where GS can publish bits of information that the AI can read. Make it as generic as possible. Perhaps just standardize that AIs can query shortName, name and version of GS and then the general-purpose data being eg. key-value pairs. But perhaps it may grow into global and per company key-value data.
16:41:43 <Zuu> I'd probably ignore AI -> GS initially.
16:42:20 <nielsm> a message passing system would be the reasonable way to do it, you register for message names you understand, and can then send messages to either GS, a single company, or broadcast to all companies. if you send a message the recipient hasn't registered for you get a null return, and otherwise you get a message serial number back, which the recipient can include if they want to respond
16:42:48 <nielsm> (for broadcasts you would get an array of serials for every company it was delivered to)
16:43:18 <nielsm> and messages would just arrive as any other event in the event loop
16:44:02 <nielsm> and should obviously be kept in a format that could be stored in savegames until they are processed
16:44:41 <Zuu> For many GSes you just want to put a poster on the wall with the rules that the AIs can read. But a message queue type is also possible, but relies on the GS to be responsive enough to send out the rules when a new company starts.
16:44:42 <nielsm> could even allow AI-AI comms, might be perceived as unfair ;)
16:46:33 <Zuu> With SCP (script communication protocol), I've used it to make CluelessPlus faviour the three goal cargoes set by NoCarGoals when building new connections.
16:47:14 <Zuu> But some people seem to get offended by AI/GS using signs to communicate. :-p
16:47:30 <andythenorth> 'invisible signs'
16:48:05 <Zuu> Yes it was around then that the hide competitior sign option arrived.
16:49:19 <Zuu> But then also people somehow got offended by the station names of CluelessPlus too. :-)
16:50:50 <Zuu> Not the actual content I think, but that the AI store data in the station sign names.
17:00:49 <Alberth> if you make make it look like a normal name, it would likely work :)
17:02:21 <nielsm> encoded in 2-3 letter phonemes
17:02:44 <nielsm> (with risk of generating bad words)
17:05:33 <Samu> hmm, the AI needs to know if Company Value GS is in goal mode or ranking mode, I guess that's as basic it can be
17:06:10 <Samu> if in goal mode, the AI is expected to make the biggest company value it can
17:06:14 *** Wormnest has joined #openttd
17:06:41 <Samu> if in ranking mode, well... do whatever it wants
17:06:52 <Samu> or just compete for company value anyway
17:08:50 <Samu> SCP, let me look at it again
17:13:37 <Zuu> For NoCarGoal I've published an AI Library called SCPClient_NoCarGoal which AIs can use to support NoCarGoal. It provides some APIs that the AI can use to gather information about the goals while all it has to do is to call SCP arrival message checks in their main loop.
17:21:10 * Zuu is too used with git staging area to use hg now.
17:23:03 <Samu> i'm a bit lost, let me look at nocargoal
17:24:10 <Zuu> https://dev.openttdcoop.org/projects/gs-nocargoal/repository
17:25:47 <Samu> it downloaded SuperLib_for_NoGo-40.tar 39 38 36 27 24 19.1 tar files
17:27:27 <Samu> https://dev.openttdcoop.org/projects/gs-nocargoal/repository/entry/main.nut#L35
17:27:36 <Samu> ok, on the GS i use that import, right?
17:27:53 <Zuu> Yes
17:29:55 <Zuu> And then all usage of SCPLib looks like it is in scp.nut
17:34:40 <Samu> Script_Communication_for_GS-45.tar ah, here it is
17:35:52 <Zuu> Yes, that is SCP. NoCarGoal is just a GS that implements advertising of its goals via SCP.
17:36:30 <Samu> well i'm lost again :(
17:38:53 <Zuu> https://wiki.openttd.org/Script_communication_protocol <-- some docs
17:39:19 <Zuu> Thought that was of the actual sign based protocol...
17:39:27 <Zuu> Here is for SCPLib: https://wiki.openttd.org/SCPLib_doc
17:48:22 <Samu> SCPManager is confusing me, i don't need that, or do I?
17:48:32 <Samu> i must create my own manager?
17:48:40 <Zuu> Which SCPManager?
17:48:42 <Samu> i want something simple
17:48:57 <Samu> at NoCarGoal
17:49:15 <Samu> NoCarGoal has much higher complexity i think
17:49:42 <Zuu> Ah yes. Copy scp.nut and edit to your liking.
17:50:09 <Zuu> And then call the methods it expose from your main logic.
17:50:28 <planetmaker> pong
17:50:34 <Zuu> bong
17:50:37 <Xaroth> BANG
17:50:58 <Zuu> Hello planetmaker
17:51:29 <Samu> I'm currently trying something like this, pseudo-code, from the AI side: "if Company Value GS is running, change my behaviour to maximize company value"
17:51:41 <Samu> i think the GS doesn't need to communicate anything to the AI
17:51:57 <planetmaker> hey :) so many familiar faces from 'back then'
17:52:03 <Zuu> It could probably be enough to register an empty comand set then.
17:52:36 <Zuu> The AI could handshake and check if the GS support the "CompanyValueGS" command set or similar.
17:52:57 <Xaroth> planetmaker: you calling me old?
17:53:34 <Samu> alright, let me copy scp.nut to my folder, brb
17:53:43 <nielsm> planetmaker: any opinions on this syntax idea? https://0x0.st/sdBe.txt
17:54:15 <planetmaker> Xaroth, indeed ;)
17:54:22 <Xaroth> Hey!
17:54:25 <Xaroth> I resemble that remark!
17:54:39 <planetmaker> exactly :P So do I. So I may
17:54:46 <Xaroth> fair enough
17:54:49 <Xaroth> plus, TrueBrain is older.
17:54:58 <planetmaker> not than me
17:55:07 <Xaroth> Well that's not my problem :P
17:55:24 <planetmaker> nielsm, can we actually deal with fractional production values there?
17:55:34 <nielsm> sure
17:55:49 <nielsm> should be possible
17:55:51 <planetmaker> and why does it have to be 'produce_cargo' there everytime. Isn't it clear that it produces cargo?
17:55:59 <nielsm> working on implementing it now
17:56:06 <planetmaker> but maybe it makes it clearer
17:56:28 <planetmaker> though I still like a more concise one with less boilerplate more... but it's 52:48 only
17:56:51 <nielsm> because there isn't any simple-to-use dictionary syntax
17:56:54 <nielsm> as far as I can tell
17:57:04 <nielsm> so may as well just make it a list of objects
17:57:29 <nielsm> just like I learned to do with StandardML in 1st year CS
17:58:59 <planetmaker> what do the values actually exactly tell me?
17:59:27 <planetmaker> the one in the produce_cargo? It's the units produced, yes?
17:59:30 <planetmaker> per single input
17:59:38 <nielsm> yes
17:59:49 <planetmaker> so one usually would use fractional values
18:00:06 <nielsm> actually the value has different meaning for produce_cargo() inside an accept_cargo() list and standalone
18:00:08 *** Wacko1976 has quit IRC
18:00:15 <planetmaker> urgs
18:00:29 <nielsm> standalone it's the production amount per production tick
18:00:48 <nielsm> inside an accept_cargo() it's production multiplier per unit of accepted cargo
18:00:55 <planetmaker> yes. ok. So it is still units (whatever that is for that cargo)
18:01:07 <nielsm> it's a multiplier regardless
18:01:35 <Samu> SELF_SHORTNAME is CVGS in my case?
18:02:08 <planetmaker> that is totally fine.
18:03:08 <Zuu> SELF_SHORTNAME is what you registered as shortname in info.nut
18:04:02 <Samu> local dummy = SCPLib(GSInfo.GetShortName(), GSInfo.GetVersion(), null);
18:04:28 <Zuu> I keep a very simple verison.nut thet define SELF_VERSION and SELF_SHORTNAME and use it in both info.nut and in scp.info.
18:04:53 <Zuu> Not sure if that is something you can do.
18:05:16 <Samu> GSInfo.GetShortName() should do what it asks
18:05:17 <Zuu> But if it is allowed now, go for it.
18:05:47 <Zuu> I mean I think AIInfo was not available to the scripts when they are run in the beginning, but may have changed since 0.7.
18:08:25 <Zuu> Oh.. looks like it was only in 0.7 to 0.7.2 it was not available to AIs, ever since then it seem to be in the API docs. :-)
18:08:44 <Zuu> So I need to update my knowledge then :p
18:09:12 <Samu> your logging system :( ...
18:09:16 <Samu> i dont have a system
18:09:26 <Zuu> You don't have to have one.
18:10:24 <Zuu> Just tell SCP if it should print to your debug log.
18:10:31 <Zuu> SCPLib.SCPLogging_Info(true or false)
18:10:57 <Samu> true
18:16:12 <Alberth> not false
18:17:13 <Samu> the index GSInfo does not exist :(
18:17:17 <Samu> t.t
18:17:54 <andythenorth> remind me, the nml example industry, it doesn't need to show all of vars 69-6F at once? :P
18:18:03 * andythenorth trying to avoid too much text stack fun
18:18:46 <Zuu> Samu: Then you either have to duplicate it or put it in a third file eg. version.nut and include it from both info.nut and scp.nut.
18:18:48 <andythenorth> I got as far as https://paste.openttdcoop.org/psrm6pufi/fo2i9v/raw
18:18:55 <andythenorth> but then I ran out of text stack registers
18:19:09 <andythenorth> I'm one short :P
18:24:01 <Zuu> But if I'm not wrong, SCP then actually is not expsing the script name/version to the other end and instead rely on command sets for identification. (as a means to support the possibility of GS packs)
18:25:49 <Zuu> But it could still do something with it internally. I don't know/remember. The implementation was made by krinn.
18:26:05 <Samu> ok, finally got it to run something
18:26:39 <Samu> https://imgur.com/fMOmk7L
18:28:39 <Zuu> *thumbs up* or *unicorn* whichever you prefer :-)
18:30:09 <Samu> cargocomplete goal, hmm i guess i need to remove that
18:30:33 <Samu> AI -> GS commands
18:30:46 <Zuu> Yep I suggest you remove the commands from NoCarGoal that are irrelevant for you.
18:30:52 <Samu> what do AI needs to know
18:30:58 <Samu> the value, perhaps
18:30:59 *** Progman has joined #openttd
18:31:08 <Zuu> Are there parameters of your script that are useful for it?
18:31:44 <Samu> i think it needs to know goal_mode
18:31:55 <Zuu> Also either you just broadcast GS -> AI the rules (if any) or you also provide AI -> GS so AIs can initiate a query.
18:32:27 <Zuu> But if you want to keep it as simple as possible, then only provide GS -> AI.
18:33:29 <Zuu> and when you find a new company, send them a package with goal_mode.
18:33:33 <Samu> if (this.goal_mode != false) { GSLog.Warning("Company Value GS is in Goal mode."); } else { GSLog.Warning("Company Value GS is in Ranking mode."); }
18:34:17 <Samu> either modes have a value
18:34:55 <Samu> ranking mode value is the best company value of all companies, it's constantly changing
18:35:21 <Samu> goal mode value is a fixed value, a target which companies need to reach
18:35:35 <Samu> goal mode switches to ranking mode once the goal is completed
18:35:57 <Zuu> That said.. it looks like NoCarGoal took the other approach. It provide an AI -> GS command to get the current goal "CurrentGoal" command.
18:37:18 <Samu> goal_mode is a tri-bool
18:37:29 <Samu> can be false, null or true
18:38:09 <Zuu> You cound respond with goal_mode in Data[0] and then either pass along the rank list in Data[1..15] (as company IDs) or just provide the rank of the AI in Data[1] as its rank number.
18:38:46 <Zuu> I'm not sure if you can send null values in SCP. But you could send 0, 1 or 2.
18:40:48 *** sla_ro|master has joined #openttd
18:46:11 *** HerzogDeXtEr has quit IRC
19:02:43 *** Wormnest has quit IRC
19:12:23 <nielsm> hm the nml test suite can't test for expected errors...
19:13:28 <Samu> if(setting == "goal_mode") { response_value = CompanyValue.goal_mode; }
19:13:56 <Samu> the value could be null, which happens when transitioning to ranking mode
19:14:34 <Samu> hmm
19:17:35 <andythenorth> well
19:18:14 <andythenorth> the test suite just tests if anything fails
19:18:20 <andythenorth> afaik
19:18:59 <nielsm> yeah tests for correct output from well-formed inputs
19:19:26 <nielsm> I guess it has been decided unimportant to test for expected errors from malformed inputs
19:21:29 <Eddi|zuHause> what would you want to test there? whether it still fails? or that the error message is meaningful?
19:21:48 <Alberth> with multiple problems in an input, I am not sure you should expect one particular error
19:27:19 *** gelignite has joined #openttd
19:36:11 *** Gja has joined #openttd
19:43:40 <andythenorth> so what's left to do? o_O
19:44:21 <nielsm> nml?
19:44:26 <nielsm> callbacks
19:52:31 *** Alberth has left #openttd
19:52:35 <andythenorth> vars?
19:53:48 <nielsm> I haven't tested them
19:58:07 <Samu> what is the SCP Check supposed to do? :(
19:58:38 <Samu> for (local s = 0; s < 20 && scp_manager.Check(); s++) {};
19:59:09 <Samu> return SCPLib.Check();
19:59:17 <Samu> bah, got to open up the library files
19:59:17 <nielsm> reading the source for it will probably answer your question
19:59:34 <andythenorth> ok I'll test the vars
19:59:43 <andythenorth> I missed the commit, oops :)
20:01:03 *** Progman has quit IRC
20:05:06 *** Wacko1976 has joined #openttd
20:05:27 *** HerzogDeXtEr has joined #openttd
20:06:25 <Samu> function _SCPLib_Command::GetCommnandName(commandID)
20:06:28 <Samu> is that a typo?
20:19:55 <nielsm> that does indeed look like a typo, the probability of it being one is greater than zero
20:21:51 <Samu> meanwhile, i'm testing my AI founding towns, to see what happens
20:22:18 <nielsm> (TypeError) "unorderable types: int() <= ConstantNumeric()".
20:22:19 <nielsm> File "/mnt/c/Users/nielsm/Dev/OpenTTD-newgrf/nml/nml/output_base.py", line 129, in prepare_byte
20:22:26 <nielsm> annoying errors to trace down...
20:22:33 <nielsm> where did I forget to "unpack" a constant
20:23:03 <Samu> is Zuu around?
20:24:19 <Samu> I'm lost :(
20:24:19 <Zuu> Could be so yes
20:24:31 <Samu> ah, ok let me post something
20:24:37 <TrueBrain> hmm .. is freetype/fontconfig still needed for Windows btw?
20:24:42 <nielsm> yes
20:24:44 <Zuu> SCP Check will check for incomming messages.
20:25:06 <nielsm> TrueBrain: https://github.com/OpenTTD/OpenTTD/pull/6980
20:25:25 <Zuu> SCP is fully script side and has to actually look on signs at a specific tile on the map and see if there are arriving messages to parse and then map to and call the callback that you registered when you register a command.
20:25:33 <Samu> https://paste.openttdcoop.org/ppdvctj9y
20:25:50 <Samu> i'm unsure what the "Setting" works
20:25:51 <Samu> how*
20:25:53 <TrueBrain> tnx nielsm :)
20:26:26 <Samu> haven't done anything on the AI side yet
20:27:10 <Samu> haven't updated comments :(
20:28:08 <Samu> and somewhere in my main.nut, I got
20:28:10 <Samu> scp_manager.SendGoalReached(c_id, this.goal_company.c_id, this.goal_company.goal_value, this.goal_company.days_taken);
20:29:01 <Zuu> The paste looks good. There is some comments of methods that you want to change and delete code you commented out.
20:29:41 <Samu> have to change Log.Info into GSLog.Info
20:29:48 <Zuu> A note is that SettingCommand returns null when a setting is unknown. But you also have null as a vaild setting value. Not a big issue, but may be worth pointing out in your docs.
20:30:11 <Zuu> Log.Info => GSLog.Info is needed if you don't use SuperLib.Log.
20:31:06 <Zuu> If you don't need a pointer to your main class instance, you can remove the _main_ptr stuff.
20:31:10 <andythenorth> industry cargo 'transported' tells how much was moved to station, not actually moved by vehicles?
20:31:18 <nielsm> andythenorth yes
20:31:25 <andythenorth> ok
20:31:33 <Samu> this comment Data[0] => string to pass to GSController.GetSetting(setting)
20:31:55 <Samu> is it really getting the value from GSController?
20:32:00 <Zuu> In your main.nut you do scp_manager.SendGoalReached. But you also have to do scp_manager.Check() in your main loop.
20:32:18 <Samu> i have it spamming SCP Check, yes
20:32:29 <Samu> so much spam i disabled the log message
20:33:06 <Zuu> Yes NoCarGoal offer AIs to read some of its GS settings. One is what the goal target is. Eg. number of cargo items to transport.
20:33:21 <Samu> while (this.Sleep(1)) { // Check for incoming SCP messages // GSLog.Info("SCP.Check"); for (local s = 0; s < 20 && scp_manager.Check(); s++) {};
20:34:42 <Zuu> Good. And you probably have more in the loop to call your goal scanner or similar.
20:35:42 <Samu> goal scanner?
20:36:02 <andythenorth> nielsm: I am not 100% convinced by the results from produced_cargo_waiting or incoming_cargo_waiting
20:36:08 <andythenorth> but I am 99% convinced
20:36:10 <andythenorth> the rest are good
20:36:24 <andythenorth> those two are fiddly to test, and I might be doing the text stack wrong
20:36:33 <andythenorth> I get values, but eh, who knows if they're correct :P
20:36:34 <Zuu> Samu: your business logic that keep track of how well the companies perform.
20:36:42 <andythenorth> I am declaring vars done though
20:37:22 <Samu> does the SCPLib require the goal_id at some point?
20:37:39 <Zuu> https://dev.openttdcoop.org/projects/gs-nocargoal/repository/revisions/79cb564feda0/entry/main.nut#L93 <-- my main loop on line 104 to 155.
20:38:45 <Samu> this.ScanGoals()
20:39:07 <Zuu> if you mean goal_id as in GSGoal? No. SCP doesn't care which data you communicate. Just set up your command set and register commands and you can communicate whach you want.
20:40:56 <Samu> my main loop is basically the whole script
20:41:09 <Samu> except the load/save/init part stuff
20:41:29 <Samu> have you looked at it?
20:41:34 <Zuu> Nope
20:41:49 <Samu> plz don't be scared
20:42:19 <Zuu> But just put the Check() somewhere so it gets called at some reasonable rate. It is when you call it that your callback for receaived messages from AIs may get called.
20:42:46 <Zuu> Okay let see if I dare to look :-D
20:44:06 <Zuu> well it is not that long at least. :-)
20:44:07 <Samu> I code horizontally
20:44:15 <Samu> forgive me about long lines
20:44:30 <Zuu> I'm not that good at keeping 80 chars either.
20:46:30 <Zuu> So just before IsEVentWaiting() or after that while block or after "if (this.goal_reached == null) { .. } add a call to SCPManager .Check
20:47:28 <nielsm> andythenorth: I pushed two changes that adds the cargo_types combined table syntax and removes support for the new property numbers in the old property names in nml
20:47:39 <nielsm> feel free to rage ;)
20:47:49 <Zuu> You probably want to construct an instance like NoCarGoal does. And also as you refer to this. ... in your main script that means that your main logic is an instance and you want to have a pointer to it inside the SCPManager eg. _main_ptr.goal_value rather than CompanyGoal.goal_value.
20:48:23 <Zuu> Or just put the SCPManager stuff in the bottom of your one and only class if dealing with instances is above your level.
20:49:29 <andythenorth> nielsm: appears to work :)
20:49:38 <Zuu> But if you use _main_ptr, then when you consturt SCPManager you do eg. this.scp_manager = SCPManager(this)
20:50:29 <Zuu> Init: https://dev.openttdcoop.org/projects/gs-nocargoal/repository/revisions/79cb564feda0/entry/main.nut#L160
20:52:25 <andythenorth> nielsm: format seems obvious to me
20:52:26 <Samu> response_value = _main_ptr.goal_mode;
20:52:31 <Samu> like this?
20:52:59 <Samu> and in my Init
20:53:06 <Samu> this.scp_manager = SCPManager(this)
20:53:23 <TrueBrain> lol @ Azure: enter the ID of the pipeline .. so .. are you going to tell me how to find those? :D
20:56:51 <Wolf01> Mmmh, why did I had to do this again? Found an interesting video on the sidebar and only after starting it I found it's from numberphile
20:57:46 <Samu> do i put scp_manager = null; inside CompanyValue class?
20:57:57 <Samu> or scp_manager <- null outside
20:58:39 <Samu> https://paste.openttdcoop.org/p3jacqznc line 16?
20:59:02 <Samu> and then inside my Init
20:59:07 <Samu> function CompanyValue::Initialize()
20:59:13 <Samu> this.scp_manager = SCPManager(this);
21:00:44 <Zuu> put scp_manager = null alongside goal_mode etc.
21:01:19 <Zuu> and then this.scp_manager = SCPManager(this);
21:01:19 <Samu> alright, i did that, line 16
21:01:28 <Zuu> Yep
21:01:42 <Zuu> Then it is all good.
21:02:42 <Samu> when the goal is reached, SCP is supposed to send a message to all companies or only AI companies?
21:03:13 <Samu> or it only sends after some handshake thingy?
21:03:21 <Samu> i don't have my AI ready
21:03:34 <Zuu> Call SCP for all companies. SCP will sort that out I think.
21:03:58 <Samu> SCPLib.TellCompany("GoalReached", COMMAND_SET, to_company, [c_id, goal_value, days_taken]);
21:04:06 <Zuu> Yep
21:04:14 <Samu> it builds a sign in the map?
21:04:24 <Zuu> Yes
21:04:31 <Samu> ok let me have an AI reach 500k
21:04:33 <Zuu> Almost top corner in the map.
21:04:41 <Zuu> 0,1 or 1,0
21:06:02 <Samu> no sign was built, i must be doing something wrong
21:06:32 <Zuu> It might be that SCP works such that the AI must initiate the handshake.
21:06:51 <Samu> ahm, i need to work on the AI now
21:06:53 <Zuu> Which is logical, but I don't remember such implementation details.
21:07:17 *** Zuu has quit IRC
21:08:21 *** Zuu has joined #openttd
21:09:27 <Samu> well ai files are open, hmm must import something
21:09:42 <Zuu> Let see if updating hg from 1.9.1 to 4... solves my issue :-)
21:10:05 <Zuu> The AI version of SCP I suppose. :-)
21:10:40 <Samu> have to extract cluelessplus for examples
21:10:45 <Samu> brb
21:10:58 <Zuu> I had a file scp_manager.nut in CluelessPlus which is similar to the one on the GS side but then moved that into a library so other AI authors could easier support NoCarGoal.
21:11:21 <Zuu> And it is removal of this file from hg that has already taken me 1+ hour to figure out how to make hg remove a file. :-p
21:13:17 *** ekcja has joined #openttd
21:13:46 <Samu> LuDiAI AfterFix doesn't have a initialize function
21:13:57 <Samu> must think
21:20:08 *** HerzogDeXtEr has quit IRC
21:20:19 <Zuu> Wow... in git you do: git commit -m "bla bla". In hg having a space between -m and " causes the commit to fail if the message text starts with -R as it will use that as -R argument then...
21:27:49 <Samu> before i break my ai, i rather upload it as is
21:28:29 <Zuu> Good idea. An other good idea is to use git. :-)
21:29:27 <Samu> didn't really test it if it's founding towns the right way
21:29:30 <Samu> but k
21:32:18 <andythenorth> nielsm: so maybe the production cb format needs updating?
21:32:24 * andythenorth looking at what changed
21:33:59 <andythenorth> original is https://newgrf-specs.tt-wiki.net/wiki/NML:Produce
21:35:33 <Samu> uploaded
21:35:42 <Samu> hope it works
21:36:31 <Samu> afk dinner
21:37:16 *** Progman has joined #openttd
21:40:26 <andythenorth> seems like the produce block 'just' needs to be extended to handle 16 cargos in / out
21:41:01 <andythenorth> action2production.py
21:44:13 *** sla_ro|master has quit IRC
21:46:12 <Zuu> Hmm after updating hg I can no longer push to devzone. Probably nuked some key config.
21:46:50 <Zuu> Maybe I should just change to git. :-)
21:47:06 <Zuu> (and github)
21:50:17 <frosch123> devzone is flooded by spambots
21:50:32 <planetmaker> hm... I think devzone... might need certificate update so that hg doesn't complain
21:50:50 <andythenorth> what have they done?
21:50:57 <planetmaker> though... ssh key ... it shouldn't care
21:51:22 <frosch123> if the ssh key is old enough, newer ssh may not accept it
21:51:39 <planetmaker> that, too
21:52:14 <planetmaker> but concerning spam bots: is there an issue more than an occasional spam bot commenting an issue?
21:53:14 <frosch123> except for the occassional translator, all new users are spam bots
21:53:30 <andythenorth> oof
21:55:24 <Zuu> In this case I think I may have had some config in the installation folder of Mercurial that I lost upon uninstall. I tried with my different keys I have but none of them worked with devzone and new hg. But it could be that I have one more key somewhere that devzone wants. :-)
21:55:26 <frosch123> so, if i get eints to work with openid connect, i may suggest to disable devzone registration
21:56:00 <andythenorth> seems reasonable
21:56:44 *** glx has joined #openttd
21:56:44 *** ChanServ sets mode: +v glx
21:56:58 <Zuu> Is the path to keep using devzone or move stuff to github?
21:57:38 <Zuu> For active projects at least.
21:58:37 <frosch123> i guess it depends on the project
21:58:55 <frosch123> devzone has repositories, issues, redmine stuff... and compile farm and eints
21:59:02 <andythenorth> I am hoping to move to github + compile farm
21:59:16 <frosch123> for the first 3 there is no reason to keep devzone
21:59:31 <frosch123> maybe i can get eints to work on gh, no idea yet
21:59:40 <frosch123> no idea about compile farm and bundle hosting
22:00:56 <andythenorth> TB said wait until OpenTTD CF is figured out
22:01:04 <andythenorth> bundles might just be a variation on that
22:02:22 <Zuu> I mainly use repository for my projects.
22:02:38 <Zuu> Hmm.. but yes there is eints too. hmm
22:02:52 <Zuu> Not for AI, but for GS.
22:03:32 <frosch123> i have the hg2git script configured, so that one only needs to add more username->email conversions
22:03:42 <planetmaker> I'm in no rush with anything of that, and it can "just keep running". But... maintenance is a bit of an issue
22:03:53 <frosch123> the issue script works for small amounts of issues, i did not bother yet switching to the real api
22:06:00 <andythenorth> could it move the nml issues?
22:06:07 <andythenorth> then we could lock the devzone nml project
22:06:37 <planetmaker> NewGRFs will likely always need their own CF. And as such... I would like to keep it
22:06:47 <frosch123> andythenorth: https://github.com/frosch123/nml/issues?q=is%3Aissue+is%3Aclosed
22:07:16 <andythenorth> o_O
22:07:16 <frosch123> tb said i used the wrong api, and the account would be disabled/blocked for some time if i tried to add all
22:08:08 <planetmaker> aha... there is a right and a wrong API for importing stuff? oO
22:08:41 <frosch123> i used the user api, which does email notifications and current date and stuff, just like a normal user
22:08:51 <frosch123> there is an import api which allows setting any date
22:09:04 <frosch123> compare those nml issues with the ottd issues by dorpsgek
22:09:28 <frosch123> however, the redmine->xml script i found works fine
22:09:59 <frosch123> one needs to link that output to tb's gh import script or so
22:10:25 <frosch123> probably no much work, but i didn't do it in the past 6 month :)
22:12:02 <planetmaker> :)
22:17:29 <TrueBrain> https://dev.azure.com/truebrain/OpenTTD/_build%2Fresults?buildId=30&_a=summary <- hmm .. when I compile OpenTTD with vcpkg, I get this error .. annoying :D
22:17:37 <TrueBrain> otherwise it seems to work :D
22:17:50 <TrueBrain> nielsm: I created a job that builds the dependencies for OpenTTD via vcpkg .. less black magic :D
22:19:14 <Samu> damn it, my ai crasshed
22:19:38 <Samu> i knew i shouldn't have uploaded blindly
22:19:47 <glx> TrueBrain: weird
22:20:45 <glx> incomplete vcpkg set up ?
22:20:57 <TrueBrain> read the error :) I don't think it is vcpkg doing something wrong :D
22:21:08 <TrueBrain> seems lzma is doing something right now, and we 'fixed' the wrong :P
22:21:40 <nielsm> TrueBrain: I like that approach
22:21:46 <TrueBrain> we set LZMA_API_STATIC, which is now done in the header if it was compiled static
22:21:48 <TrueBrain> (which I did)
22:22:11 <TrueBrain> well, guess I have to patch up OpenTTD a bit to work with vcpkg :D
22:22:41 <glx> wrong filename maybe
22:23:22 <TrueBrain> sed -i 's/;LZMA_API_STATIC;/;/' projects/*
22:23:24 <TrueBrain> lets see what that does :D
22:24:38 <glx> indeed wrong filename
22:24:49 <glx> it's libpng16.lib in my vcpkg dirs
22:24:49 <TrueBrain> wrong filename?
22:25:51 <planetmaker> it used to be libpng12...
22:25:57 <glx> so of course libpng.lib can't be open
22:26:12 <TrueBrain> we have many 'wrong' library names
22:26:27 <TrueBrain> zlibstat.lib is also no longer produced
22:26:32 <TrueBrain> liblzma.lib is now lzma.lib
22:26:39 <TrueBrain> libfreetype2.lib is now freetype.lib
22:26:52 <TrueBrain> I might make a PR to switch to vcpkg completely, if this works :P
22:27:25 <glx> I have zlib.lib in x64-static
22:27:42 *** Progman has quit IRC
22:27:55 <TrueBrain> and OpenTTD wants zlibstat.lib
22:28:24 <glx> yes when I tried vcpkg I remember editing project
22:28:52 <glx> but I think there's a way to magically not need to even specify the libs
22:29:48 <TrueBrain> I dont think the VC projects had any decent cleanup in years :P
22:30:11 <glx> we removed the older versions recently :)
22:30:53 <glx> https://github.com/Microsoft/vcpkg/blob/master/docs/examples/installing-and-using-packages.md#vsmsbuild-project-user-wide-integration
22:31:14 <glx> "All C++ projects can now #include any installed libraries.
22:31:14 <glx> Linking will be handled automatically.
22:31:14 <glx> Installing new libraries will make them instantly available."
22:31:28 <glx> it can link magically :)
22:32:30 *** Zuu has quit IRC
22:34:10 <TrueBrain> so I will await a PR from you :D
22:34:14 <TrueBrain> -Remove: openttd-useful.zip bla
22:34:17 <TrueBrain> -Add: vcpkg support
22:34:23 <TrueBrain> -Fix: no longer link libraries ourself
22:34:24 <TrueBrain> :D
22:34:28 <TrueBrain> yes? :D :D
22:36:38 *** Zuu has joined #openttd
22:36:51 <planetmaker> s/Fix/Change/g
22:39:12 <TrueBrain> hmm, unresolved external symbols now
22:39:18 <TrueBrain> that was not what I expected
22:40:24 <TrueBrain> something for another day :)
22:41:17 <TrueBrain> I like Azure pipelines nielsm :D Really nice and fast and freeeeee :D
22:42:03 <nielsm> I just saw someone mentioning them a little while ago in a random discussion somewhere
22:42:09 <nielsm> and decided to read a bit on it
22:42:20 <nielsm> and then I saw there was some free options
22:47:35 <Samu> zuu, I loaded a savegame and crashed https://imgur.com/ullkD2R
22:48:47 <Zuu> Looking at the error message, you shouldn't init SCP in Load().
22:49:08 <Samu> :(
22:49:21 <Zuu> Load() shouldn't do much work genreally as OpenTTD cannot suspend Load().
22:49:37 <Samu> gonna put it at Start then
22:49:50 <Zuu> The general practice is to just store the data you get in Load() in your instance and then return. Then in Start() check if there is any stored load-data and use that.
22:50:10 <Zuu> Start is better and is called both on new games and on loaded games.
22:51:18 <Samu> also a typo
22:51:24 <Samu> Script Comumncation
22:51:43 <Zuu> In scp library?
22:51:48 <Samu> Script Comumncation Protocol
22:51:53 <Samu> in the screenshot
22:52:15 <Samu> communcation damn
22:52:19 <Samu> communication
22:52:31 <Zuu> Yep that string is printed by the library as far as I know. You get to find krinn to fix that one.
22:52:47 <Zuu> Or fork scp, which is hardly worth for just a typo in a string.
22:53:54 <Samu> back to my AI, gonna try add the SCP
22:56:18 *** acklen_ has quit IRC
23:00:13 *** acklen has joined #openttd
23:02:09 <andythenorth> hmm
23:02:21 <andythenorth> updating prod cb needs brain
23:02:23 <andythenorth> too late for brain
23:03:45 <nielsm> yeah, it looks like it's rather tightly coupled to some syntax elements
23:04:01 <nielsm> something external also needs to change
23:04:51 <nielsm> ah yes nml/ast/produce.py
23:07:38 <nielsm> first step is figuring out how the new syntax should look :)
23:14:36 <nielsm> it might not be possible to retrofit in a neat way, might need to introduce a new keyword, or otherwise break the old syntax
23:16:49 <nielsm> hmm, maybe reuse the accept_cargo and produce_cargo functions, have accept_cargo also allow a numeric second parameter instead of just a list of outputs
23:18:29 <nielsm> so you'd write: produce(name, accept_cargo("IORE", 2), accept_cargo("COAL", 1), produce_cargo("STEL", 2), 1)
23:18:34 <nielsm> or something to that effect
23:18:54 *** chomwitt has quit IRC
23:19:01 <andythenorth> iirc it's already versioned for 1 and 0
23:19:03 * andythenorth looks
23:19:34 <andythenorth> not sure where it's picking the version up from
23:19:46 <planetmaker> hm
23:20:10 <nielsm> if all(x.supported_by_actionD(False) for x in produce.param_list):
23:20:10 <nielsm> version = 0
23:20:14 <nielsm> else version = 1
23:20:30 <nielsm> not sure what that means :P
23:20:34 <andythenorth> me neither :)
23:20:40 <nielsm> (for an x to be supported by action D)
23:21:07 <andythenorth> my assumption for syntax was to keep the current, and just extend the number of cargos
23:21:07 <andythenorth> https://newgrf-specs.tt-wiki.net/wiki/NML:Produce
23:21:28 <andythenorth> seems like it's just extending from 3 to 16
23:21:48 <nielsm> you'd need 64 parameters every time then
23:22:25 <andythenorth> nah 34
23:22:39 <andythenorth> well, in the nml syntax 34
23:23:21 <andythenorth> it's quite a lot more than the current 7 :P
23:23:32 <nielsm> the GRF format is (num-inputs, input-cargoid-1, input-value-1, input-cargoid-x, input-value-x, ...)
23:23:48 <nielsm> you actually need to specify the cargo for each parameter
23:23:53 <andythenorth> yeah the nml format drops the cargo ID and relies on list positions
23:24:08 <andythenorth> it might be reading those internally from the industry
23:24:57 <andythenorth> it's still potentially a lot of 0s to set, for the common case of <16 cargos
23:25:36 * andythenorth wonders if arrays can be used as parameters in nml
23:25:41 <nielsm> they can
23:25:48 <andythenorth> so instead of produce (<ID>, <consume_1>, <consume_2>, <consume_3>, <produce_1>, <produce_2> [, run_again]);
23:26:11 <andythenorth> produce (<ID>, [<consume_1>, <consume_2>...<consume_n>], [<produce_1>, <produce_2>...<produce_n>], [, run_again]);
23:26:24 <planetmaker> yeah... ID, [cons1, cons2,...], [prod1, prod2, ...], run_again
23:26:29 <nielsm> but the syntax needs to include the cargotypes
23:26:51 <planetmaker> as they are not defined anymore...
23:26:54 <nielsm> there isn't any way to derive those
23:26:58 <andythenorth> oh because version 2 changes those
23:27:08 <nielsm> https://newgrf-specs.tt-wiki.net/wiki/Action2/Industries#Format_version_02
23:27:16 <andythenorth> nml must have a representation of the industry in the parse tree it builds?
23:27:29 * andythenorth assumes :P
23:29:44 <andythenorth> I understand the suggestion now for produce(name, accept_cargo("IORE", 2), accept_cargo("COAL", 1), produce_cargo("STEL", 2), 1)
23:29:53 <andythenorth> FIRS is going to get horrible :)
23:30:00 <andythenorth> already the compile is slow due to loops
23:30:07 <andythenorth> this will get a lot worse
23:30:24 <andythenorth> maybe I buy a fast PC and compile on it remotely :P
23:30:35 <nielsm> are you generating NML text and then compiling that, or generating an internal parse tree or such?
23:30:47 <andythenorth> in FIRS I'm generating NML and compiling it
23:30:50 <nielsm> you can set it up on azure devops for free :D
23:30:53 <andythenorth> and the NML is very slow
23:31:47 * andythenorth times it
23:32:26 <andythenorth> hmm, for version 2 it really does have to specify the cargo labels
23:32:38 <andythenorth> nml can't magic it away, the industry cargos might have changed
23:33:29 <andythenorth> nielsm: I am +1 to your format suggestion then
23:33:44 <nielsm> yes, and the definition isn't actually bound to any specific industry as far as I can tell
23:39:59 <planetmaker> produce(name, accept_cargo("IORE", 2), accept_cargo("COAL", 1), produce_cargo("STEL", 2), 1) <--- that?
23:40:03 <planetmaker> ooks ok
23:40:05 <planetmaker> +l
23:44:47 <nielsm> potential issue is that the accept/produce expressions need to take register-producing expressions, I don't know what implications that might have
23:45:05 <nielsm> for the amounts
23:45:17 <nielsm> (rather than direct values)
23:45:43 <Samu> this is hard
23:45:58 <Samu> im trying to interact LuDiAI with NoCarGoal instead
23:46:09 <Samu> at least i know part of the work is done correctly
23:49:31 <Samu> they are communicating! but i have no idea wtf they're saying
23:51:23 <Samu> https://imgur.com/XNtRwEW - chinese
23:52:03 <Samu> the GS is NoCarGoal, Zuu any ideas what's happening?
23:52:16 <andythenorth> I suspect NML is detecting whether a param is a literal value, or an expresion already
23:52:43 <andythenorth> dunno how though, it's quite magical to me :)
23:52:46 * andythenorth must to bed
23:52:49 <andythenorth> bye
23:52:53 *** andythenorth has quit IRC
23:58:53 <Samu> If you want an example, you can check out CluelessPlus which is an AI that uses this library.
23:59:00 <Samu> somehow it uses, but how
23:59:04 <Samu> can't find where
23:59:16 <Samu> terrible code digger
23:59:34 <Samu> gonna run cluelessplus side by side too