IRC logs for #openttd on OFTC at 2018-09-05
⏴ go to previous day
00:02:20 *** Thedarkb has joined #openttd
00:09:03 <Samu> i think I figured it out
00:09:54 <Samu> the AI must be selected from the pool of Random AIs
00:20:12 *** snail_UES_ has joined #openttd
00:21:06 <Samu> guys, your pseudo random number generator always returns 0
00:23:05 <Samu> this->SetSetting((*it).name, InteractiveRandomRange((*it).max_value - (*it).min_value) + (*it).min_value);
00:23:40 <Samu> InteractiveRandomRange dude has always returned 0
00:25:08 <Samu> line 39 of script_config.cpp
00:28:39 <Samu> peter1138: can u look into this?
00:31:09 <Samu> out of 42 times, always 0
00:41:42 <Samu> this->SetSetting((*it).name, InteractiveRandomRange((*it).max_value + 1 - (*it).min_value) + (*it).min_value);
00:42:01 <Samu> change max_value to max_value + 1
00:42:14 <Samu> because max_value is exclusive
00:44:41 <acklen> I was waiting for your 43rd try
00:46:13 <acklen> so, 1-0 doesn't work, but 2-0 does?
00:50:04 <Samu> Pick a random number between 0 and \a limit - 1, inclusive.
00:50:30 <Samu> no wonder it was always returning 0
00:51:23 <Samu> plz fix :) i wanna use this feature in the AI
01:07:55 *** sim-al2 has joined #openttd
03:10:19 *** Supercheese has joined #openttd
03:27:57 *** WWacko1976-work has joined #openttd
03:33:27 *** Supercheese has joined #openttd
04:21:59 *** sim-al2 has joined #openttd
05:22:42 *** snail_UES_ has joined #openttd
05:34:20 *** haudrauf has joined #openttd
05:38:52 *** Hobbyboy has joined #openttd
06:52:50 *** Wacko1976 has joined #openttd
08:03:34 *** Supercheese has joined #openttd
08:03:39 *** andythenorth has joined #openttd
08:05:01 *** Supercheese has joined #openttd
08:48:46 *** andythenorth has joined #openttd
08:51:38 *** andythenorth has left #openttd
09:06:48 *** sim-al2 is now known as Guest2432
09:06:49 *** sim-al2 has joined #openttd
09:37:16 *** sla_ro|master has joined #openttd
09:43:58 *** Progman has joined #openttd
10:36:40 *** snail_UES_ has joined #openttd
12:08:20 *** WWacko1976-work has quit IRC
12:13:04 *** WWacko1976-work has joined #openttd
12:54:41 *** Wacko1976 has joined #openttd
13:14:15 *** WWacko1976-work has quit IRC
13:15:26 *** WWacko1976-work has joined #openttd
14:35:31 *** Thedarkb has joined #openttd
14:58:10 *** [1]sim-al2 has joined #openttd
14:58:10 *** sim-al2 is now known as Guest2451
14:58:11 *** [1]sim-al2 is now known as sim-al2
15:46:54 *** Thedarkb has joined #openttd
16:13:53 *** Alberth has joined #openttd
16:13:53 *** ChanServ sets mode: +o Alberth
16:20:29 <Samu> Alberth: can you fix a bug I reported last night?
16:21:15 <Samu> trying to persuade someone to fix it :p
16:23:24 <LordAro> Samu: did you report it on github?
16:24:08 <Samu> uh i dont have an account
16:36:48 <peter1138> 23:28 < Samu> peter1138: can u look into this?
16:37:06 <peter1138> no, not when i'm driving in London at that time.
16:37:18 <peter1138> Just create a github account already, fucking hell.
16:37:37 <nielsm> "if it's not in a ticket it's not a bug"
16:38:52 <nielsm> (the contrary is not true by the way, just because it is in a ticket doesn't mean it's certainly a bug, tickets can contain non-bugs, but bugs can never be considered if they are not covered by a ticket!)
16:40:21 <peter1138> And if you have a fix you can just file a PR.
16:40:47 *** Wormnest has joined #openttd
16:44:52 <Samu> ok, registered an account let's see what i can do
16:52:59 <peter1138> Might need your own fork for that, I suppose.
16:53:21 <peter1138> But at least the issue tracker will be simple.
16:54:25 <Samu> no idea what's a pull request for or forks
16:54:32 <Samu> bah i knew i shouldn't have registere
16:54:42 <peter1138> Don't worry about them then.
16:55:49 <LordAro> the horror, you don't understand everything immediately
17:03:39 <Samu> btw there is no single AI that uses CONFIG_RANDOM
17:05:40 <Samu> so... if u wanna test it
17:05:45 <Samu> i guess i gotta submit my ai?
17:09:03 *** quiznilo has joined #openttd
17:11:49 *** andythenorth has joined #openttd
17:18:09 <Alberth> lots of ideas, apparently!
17:20:14 <andythenorth> mumble mumble strategies
17:20:35 <andythenorth> only specifying where the player must build is quite boring
17:20:56 <andythenorth> restricting the build, but offering strategic and tactical choices is interesting
17:21:01 <Alberth> Samu: just a script that performs 20 random draw things is sufficient
17:21:27 <Alberth> I never heard of RANDOM_CONFIG at all btw, no idea what you're talking about
17:24:16 <Alberth> problem is somewhat I have sufficient distractions currently
17:27:47 <Samu> the AI has to be randomly chosen from a pool of AIs
17:30:18 <andythenorth> Alberth: I wondered about composing this GS from different components
17:30:46 <andythenorth> so a Connection Builder component, which sets connection goals, in a similar player interface to Busy Bee
17:31:12 <andythenorth> and a separate Industry Constructor component which rewards goal completion by building industries, against a pattern
17:31:42 <andythenorth> and an option for the industry constructor to also control map at game start
17:31:49 <andythenorth> 'have a new industry' could incidentally be a reward in Busy Bee
17:34:27 <Alberth> make each component a class, and forward all events from the main loop (possibly using knowledge what events the component wants to have)
17:34:46 <andythenorth> I'm kind of curious about testing GS
17:34:52 <andythenorth> sitting playing them is one valid approach
17:34:54 <andythenorth> but time consuming
17:35:05 <andythenorth> I wonder if they could be 'tested' by logged output
17:35:31 <Alberth> not sure how you make progress in a component, likely you call it from some other point
17:35:52 * andythenorth wonders about a self-test mode :P
17:36:26 <Alberth> I typically test by printing what it decides while building the code
17:37:20 <Alberth> but you could make a separate object that performs game operations, and replace that while testing
17:37:53 <Alberth> then you don't even need openttd, you can just run the bare squirrel interpreter
17:38:11 <Alberth> perhaps with a few mock objects
17:46:31 <Samu> damn it, i thought i had 7-zip installed
17:50:38 <Samu> we can't support that file type?
17:56:10 <LordAro> not to github, it only accepts a few types
17:56:43 <LordAro> it'll accept a zip or a tar.gz though
17:57:25 <LordAro> (*it).max_value - (*it).min_value) + (*it).min_value
17:57:31 <LordAro> that is rather suspicious, isn't it? :)
17:57:56 *** frosch123 has joined #openttd
18:04:49 <Samu> it's only InteractiveRandomRange((*it).max_value - (*it).min_value)
18:05:52 <Samu> the result of that is then + (*it).min_value
18:06:44 <nielsm> why is it written like that and not it->min_value etc...
18:07:06 <Samu> no idea, it's not my code
18:07:26 <frosch123> nielsm: actually very few people know that
18:08:00 <frosch123> people read about *iterator, and use it like that
18:12:56 <LordAro> i guess in some ways it's clearer that it's an iterator rather than a pointer?
18:13:21 <nielsm> the entire point of iterators is to look almost exactly like a pointer, though
18:14:02 <frosch123> everyone i met who uses the (*). syntax got huge eyes when i told them that -> also works, so I doubt it is intentional
18:14:45 <LordAro> Samu: i'm pretty sure there's no situation in which "(a + b) - b" is different to "a + b - b"
18:14:56 <LordAro> (which is the same as "a"
18:16:00 <LordAro> even accounting for overflows and what not
18:16:53 <Samu> it is setting a value for a setting
18:17:54 <Samu> min_value = 0, max_value = 1
18:19:01 <Samu> the randomizer dude randomizes between its own 0 and the limit -1
18:19:59 <LordAro> Samu: you can stop now
18:20:03 <LordAro> go work on something else
19:00:59 *** gelignite has joined #openttd
19:18:40 *** HerzogDeXtEr has joined #openttd
19:29:16 *** chomwitt has joined #openttd
19:53:55 *** Progman has joined #openttd
20:06:53 *** tokai|noir has joined #openttd
20:06:53 *** ChanServ sets mode: +v tokai|noir
20:15:58 <Samu> oh, the optimalfakedist function missing
20:19:01 <Samu> what's the newgrf with the most aircraft engines?
20:19:04 *** wodencafe has joined #openttd
20:19:11 <Samu> must put the valuator into some stress test
20:27:02 <Samu> i better make a separate function to act as valuator
20:46:11 *** Wacko1976 has joined #openttd
21:00:06 *** Thedarkb has joined #openttd
21:05:01 <Alberth> the early STL implementations didn't do it->
21:09:40 *** Supercheese has joined #openttd
21:16:25 <Samu> much lighter valuator now
22:22:07 *** andythenorth has left #openttd
22:30:49 *** Thedarkb has joined #openttd
continue to next day ⏵