IRC logs for #openttd on OFTC at 2022-05-21
            
00:21:03 *** arikover` has quit IRC (Quit: ERC 5.4 (IRC client for GNU Emacs 28.1))
01:35:11 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
02:27:57 *** Wormnest has quit IRC (Quit: Leaving)
02:42:15 *** D-HUND has joined #openttd
02:45:36 *** debdog has quit IRC (Ping timeout: 480 seconds)
02:56:44 *** D-HUND is now known as debdog
02:56:56 *** glx has quit IRC ()
05:43:26 *** bryjen has joined #openttd
05:48:24 *** Flygon has joined #openttd
06:21:09 *** bryjen has quit IRC (Quit: Leaving)
06:27:20 *** andythenorth has joined #openttd
06:28:38 *** Speedy` has quit IRC (Ping timeout: 480 seconds)
06:43:53 <andythenorth> _dp_ I wonder what random varact2 does when the choices aren't power of 2
07:50:12 *** sla_ro|master has joined #openttd
08:26:46 *** nielsm has joined #openttd
08:52:19 *** sla_ro|master has quit IRC ()
09:09:12 *** WormnestAndroid has quit IRC (Remote host closed the connection)
09:29:53 *** snail_UES_ has joined #openttd
09:46:02 *** snail_UES_ has quit IRC (Quit: snail_UES_)
09:50:11 *** HerzogDeXtEr has joined #openttd
09:55:18 <_dp_> andythenorth, afaict it prints a warning when loading and segfaults when resolving
09:55:30 <andythenorth> 'nice'
09:57:52 <_dp_> can regular va2 just read random bits and do its own math?
10:04:02 <andythenorth> don't see why not
10:04:11 <andythenorth> I read random bits for stuff
10:04:25 <andythenorth> nml random_switch is a PITA
10:04:28 <andythenorth> it's very magical
10:07:39 <_dp_> yeah, I already found it
10:08:14 <_dp_> took some time though as it's not in feature vars but a special case in va2 0x5f
10:09:16 <_dp_> with a kludge to read it via 0x61 for vehicles xD
10:12:58 <andythenorth> some of us are...creative about this :P https://github.com/andythenorth/iron-horse/blob/master/src/templates/procedures_alternative_var_random_bits.pynml
10:15:10 <_dp_> yeah, found that already
10:15:34 <_dp_> but if you don't do random switch anyway why you still need to bother with powers of 2?
10:15:39 <_dp_> you can just do % length
10:16:23 <_dp_> and more bits you take more equal will be probabilities
10:44:58 *** Smedles has quit IRC (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
10:45:01 *** Smedles has joined #openttd
11:02:09 *** aperezdc__ has joined #openttd
11:28:22 *** sla_ro|master has joined #openttd
11:34:52 *** WormnestAndroid has joined #openttd
12:17:00 <andythenorth> got bored choosing random types :P
12:34:30 <andythenorth> also I might run out of random bits on vehicles
12:34:33 <andythenorth> pls, can have more? :P
13:11:39 *** glx has joined #openttd
13:11:39 *** ChanServ sets mode: +v glx
13:22:29 *** virtualrandomnumber has joined #openttd
13:27:11 *** virtualrandomnumber has quit IRC ()
13:28:02 <peter1138> 21 changed files
13:28:02 <peter1138> with
13:28:02 <peter1138> 252 additions
13:28:02 <peter1138> and
13:28:04 <peter1138> 172 deletions
13:28:12 <peter1138> Oh thanks for the line-breaks, copy & paste...
13:28:27 <peter1138> Such little changes, so many time.
13:31:18 <andythenorth> are these lyrics?
13:33:51 <peter1138> That might work.
13:43:46 <glx> you have 8 bits so 256 values, should be more than enough
13:43:58 <glx> (plus 8 from parent)
13:58:33 <andythenorth> something something independent choices
13:59:47 <Eddi|zuHause> you could do dependent choices and hide them with clever masks
14:05:28 <peter1138> Also means it changes when shuffle wagons around...
14:05:39 <peter1138> But that might be a "feature"
14:09:29 <Eddi|zuHause> a big part of "engineering" is using limited ressources creatively to maximise outcome
14:10:32 <Eddi|zuHause> you have to learn to discard the thought of "what if i had more <X>?"
14:11:23 <Eddi|zuHause> and only if that gets you nowhere you go back to asking for more <X>
14:11:45 <peter1138> Back in the day we had 32KB, shared with the screen...
14:11:48 <peter1138> Should be fine.
14:12:15 <peter1138> Just use palette tricks to hide code in the screen area.
14:30:45 <andythenorth> I am considering what happens when IDs > 16k
14:30:50 <andythenorth> articulated stuff is going to break
14:31:07 <andythenorth> I'm considering just adding 16000 to all non-articulated IDs, then repeating :P
14:31:19 <andythenorth> better than manually changing them, right?
14:36:05 <Eddi|zuHause> sure...
14:36:47 <Eddi|zuHause> you'll get horrible nightmares when you want to move a vehicle from the non-articulated to the articulated block
14:37:20 <Eddi|zuHause> which, by the frequency you completely revamp things will be in a week or two
14:38:01 <andythenorth> nah it will just subtract 16k
14:38:05 <andythenorth> I'll make a list of special cases
14:38:12 <andythenorth> and then a list of special case special cases
14:38:18 <andythenorth> everything is just configuration
14:38:21 <andythenorth> like the cloud
14:39:16 <Eddi|zuHause> solving problems by adding layers of indirection is the equivalence of cleaning up by sweeping things under the sofa
14:42:01 <andythenorth> I see no problem https://m.media-amazon.com/images/I/71n9kAuvKNL._AC_SL1200_.jpg
14:56:39 <peter1138> https://www.askvg.com/firefox-tip-restore-classic-dotted-outline-focus-indicator-for-links/ ... is this real? o_O
14:56:57 <peter1138> I was trying to work out why a blue outline appeared recently...
15:00:55 <andythenorth> think webkit has done that for a while
15:05:14 <FLHerne> Eddi|zuHause: I'd say the outcome of 'creative' ways to exceed resource limits in OTTD has been mostly negative :-/
15:06:10 <peter1138> andythenorth, nope, this only shows in Firefox.
15:06:30 <andythenorth> FLHerne but the livery callback is so great!
15:06:51 <FLHerne> so many grfs have massive varaction2 chains that get evaluated constantly to work around the limited number of tiles or views or whatever
15:13:02 <peter1138> The entire point of varaction2 is to provide variety.
15:13:15 * andythenorth provides variety
15:13:49 *** Wormnest has joined #openttd
15:14:29 <peter1138> andythenorth, I pinged you in #off-topic on Discord, because I'm rood.
15:14:39 <peter1138> And now here :D
15:14:53 <peter1138> But I can't lazily post images here.
15:15:16 <andythenorth> lol
15:15:26 <andythenorth> "I didn't do it"
15:15:42 <andythenorth> but I have the same problem with focus outlines getting clipped in something I maintain
15:17:59 <andythenorth> such Horse https://media.discordapp.net/attachments/337701432230805505/977586000819806218/unknown.png
15:18:16 <andythenorth> took me so long to paint all those buy menu images :P
15:18:27 <andythenorth> every single one carefully blended by hand
15:18:56 <peter1138> Okay what. Now it's stopped doing it.
15:19:43 <_dp_> I would just merge two halves with PIL and call it done xD
15:21:54 <andythenorth> odd that :)
15:22:14 <andythenorth> such humour
15:22:22 <andythenorth> ok so if I want to make a choice from 13 items
15:22:29 <andythenorth> and I have to pick bits in powers of 2
15:22:35 <andythenorth> how do I modulo to drop the excess?
15:23:17 <Eddi|zuHause> FLHerne: well... i disagree with that statement. if we had made openttd without those design limitations, we would've got simutrans
15:29:41 <andythenorth> `getbits(0, 4) % 13` or something?
15:29:50 <andythenorth> no that gets me the remainder
15:30:30 <peter1138> andythenorth, to be unbiased, and give 'equal fairness', you need to either loop and call random until the value is < 13 (which is not going to work here) or come up with a multiple of 13 that is also a power of 2.
15:31:01 <_dp_> or just pick some more bits and call it good enough
15:31:01 <andythenorth> currently I just stuff the candidates list by copying items from the start
15:31:06 <andythenorth> until it reaches power of 2
15:31:16 <peter1138> (I don't think there is one)
15:31:26 <_dp_> andythenorth, that's the same as doing %
15:31:38 <peter1138> ^^
15:31:49 <peter1138> remainder is what you want.
15:32:18 <peter1138> But can't you just have 13 options and let openttd do the rest? Can't remember...
15:32:35 <andythenorth> I can use random_switch in nml but it's a pain in the arse
15:32:45 <andythenorth> it seems to over-write random bits and breaks other things
15:32:49 <peter1138> Oh, maybe that's only the original style of random reading.
15:32:57 <andythenorth> I just pick some bits out when I want them
15:33:31 <andythenorth> maybe I just keep stuffing the list
15:33:36 <andythenorth> seems to work fine :P
15:33:53 <peter1138> random_switch causes rerandomization depending on triggers and how it's used.
15:35:13 <andythenorth> fits the observed behaviour :P
15:35:59 <_dp_> andythenorth, you can pre-compute modulo into switch for same effect
15:36:11 <peter1138> That is it's purpose.
15:36:15 <peter1138> its
15:36:18 <andythenorth> its'
15:36:27 <_dp_> for i in range(1<<used_bits): option_i = choices[i%len(choices)]
15:36:28 <andythenorth> its poipoise
15:37:07 <peter1138> To do things like graphical changes after unloading all cargo so you get different visuals on the next load.
15:37:31 <peter1138> And also to confuse MB when he puts them branches that aren't executed during the trigger.
15:37:40 <andythenorth> :)
15:38:34 <andythenorth> _dp_ what does the shift do?
15:38:44 <_dp_> pow(2, used_bits)
15:39:39 <_dp_> well, I guess you can just do 2**used_bits in python
15:39:50 <_dp_> got too used to C lately xD
15:40:31 <andythenorth> I should really learn what this does :P
15:40:40 <andythenorth> but meanwhile I extended my stupid list extender
15:40:49 <andythenorth> didn't even use a loop
15:41:50 <andythenorth> https://github.com/andythenorth/iron-horse/blob/8d1aa03960a04e1315a39e789adad51d68a6d42c/src/roster.py#L112
15:42:12 <andythenorth> 'ever heard of "while"?' :P
15:43:12 <_dp_> andythenorth, if len(result) > 8 result += result[:16-len(result)]
15:43:40 <andythenorth> one line python
15:51:50 <_dp_> I got a bit carried away xD
15:51:52 <_dp_> result += result[:2**(len(result) - 1).bit_length() - len(result)]
15:53:19 <andythenorth> not going to play golf :P
16:11:13 * andythenorth might be doing bad things
16:11:24 <andythenorth> how many random bits do I need to pick for 16 choices?
16:11:27 <andythenorth> I thought it was 4
16:11:38 <andythenorth> 2^4
16:11:46 <andythenorth> but bin(16) gives me 5 bits in python
16:12:14 <_dp_> 16 choices is 0-15
16:12:35 <_dp_> 16 is 17th choice so it's 5 bits
16:14:05 * andythenorth confused :P
16:14:29 <andythenorth> https://gist.github.com/andythenorth/c2772b55f0b48ade1a4b83c067392c2e
16:14:59 <andythenorth> CABBAGE 5 is the result of calling bit_length() on the list that also builds the switch options
16:15:18 <_dp_> that's why I had -1 there
16:15:21 <_dp_> 2**(len(result) - 1).bit_length(
16:15:46 <andythenorth> ok
16:16:11 <_dp_> basically, you need bit length of last choice which is 15, not 16
16:16:35 <andythenorth> thanks
16:16:48 <andythenorth> going to delete my stupid dict
16:17:03 <andythenorth> {2: 1, 4: 2, 8: 3, 16: 4}[len(choice_list)] is funny
16:17:04 <andythenorth> but stupid
16:22:57 *** wallabra has quit IRC (Quit: ZNC 1.8.2 - https://znc.in - Stopping for maintenance... Leave messages at my XMPP (gustavo6046@anonym.im), or my Discord (Gustavo6046#9009), or possibly )
16:25:16 <andythenorth> thanks
16:25:22 <andythenorth> all the random now
16:34:41 *** Smedles has quit IRC (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
16:34:44 *** Smedles has joined #openttd
16:52:54 *** tokai has joined #openttd
16:52:54 *** ChanServ sets mode: +v tokai
16:59:42 *** tokai|noir has quit IRC (Ping timeout: 480 seconds)
17:06:17 *** esselfe has quit IRC (Quit: brb)
17:17:35 *** esselfe has joined #openttd
18:48:53 <DorpsGek> [OpenTTD/OpenTTD] DorpsGek pushed 1 commits to master https://github.com/OpenTTD/OpenTTD/commit/3a2c0531b689fc84e9bef55a2dc22a075f0fecfb
18:48:54 <DorpsGek> - Update: Translations from eints (by translators)
19:03:06 *** Etua has joined #openttd
19:04:47 *** Etua has quit IRC ()
19:12:54 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
20:07:22 *** virtualrandomnumber has joined #openttd
20:07:37 *** virtualrandomnumber has quit IRC ()
20:10:54 *** arikover has joined #openttd
20:12:52 <arikover> Good evening everyone.
20:13:16 <DorpsGek> [OpenTTD/OpenTTD] diekmann opened issue #9896: [Feature]: Demo of browser version on openttd.org https://github.com/OpenTTD/OpenTTD/issues/9896
20:16:41 *** Xaroth has joined #openttd
20:16:49 <andythenorth> hi
20:17:17 <Xaroth> hi.
20:19:29 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain commented on issue #9896: [Feature]: Demo of browser version on openttd.org https://github.com/OpenTTD/OpenTTD/issues/9896
20:23:37 *** arikover has quit IRC (Remote host closed the connection)
20:23:39 *** gelignite has joined #openttd
20:25:22 *** arikover has joined #openttd
20:40:39 <DorpsGek> [OpenTTD/OpenTTD] diekmann commented on issue #9896: [Feature]: Demo of browser version on openttd.org https://github.com/OpenTTD/OpenTTD/issues/9896
20:51:02 <andythenorth> I broke Train Whack! :D
20:51:25 <michi_cc> Oh no! Abort, abort, abort :p
20:53:17 *** gelignite has quit IRC (Quit: Stay safe!)
20:56:47 <andythenorth> yes, I broke the silly train randomiser by adding randomised trains
20:56:48 <andythenorth> https://grf.farm/iron-horse/2.47.0/html/train_whack.html
20:56:50 <andythenorth> inception
20:59:55 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain commented on issue #9896: [Feature]: Demo of browser version on openttd.org https://github.com/OpenTTD/OpenTTD/issues/9896
20:59:58 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain closed issue #9896: [Feature]: Demo of browser version on openttd.org https://github.com/OpenTTD/OpenTTD/issues/9896
21:07:12 * andythenorth fixed Train Whack!
21:07:14 <andythenorth> breathe out :P
21:14:39 *** arikover has quit IRC (Quit: ERC 5.4 (IRC client for GNU Emacs 28.1))
21:40:42 *** nielsm has quit IRC (Ping timeout: 480 seconds)
21:54:05 <DorpsGek> [OpenTTD/team] egor-bayandin opened issue #313: [ru_RU] Translator access request https://github.com/OpenTTD/team/issues/313
22:10:37 *** virtualrandomnumber has joined #openttd
22:10:39 *** virtualrandomnumber has quit IRC ()
22:28:57 *** sla_ro|master has quit IRC ()
22:32:37 *** andythenorth has quit IRC (Quit: andythenorth)
22:42:12 *** snail_UES_ has joined #openttd
23:23:28 *** snail_UES_ has quit IRC (Quit: snail_UES_)
23:33:47 *** WormnestAndroid has quit IRC (Ping timeout: 480 seconds)
23:52:44 *** Tirili has joined #openttd