IRC logs for #openttd on OFTC at 2025-11-11
⏴ go to previous day
00:08:57 *** toktik has quit IRC (Remote host closed the connection)
00:24:55 *** lobster has quit IRC (Ping timeout: 480 seconds)
00:29:42 *** lobster has joined #openttd
00:39:50 *** Beer has quit IRC (Quit: Leaving)
00:44:17 *** Zathras_4 has joined #openttd
02:25:12 *** Wormnest has quit IRC (Quit: Leaving)
03:00:51 *** tokai|noir has joined #openttd
03:00:51 *** ChanServ sets mode: +v tokai|noir
03:07:41 *** tokai has quit IRC (Ping timeout: 480 seconds)
03:47:39 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
03:55:33 *** Flygon has quit IRC (Read error: Connection reset by peer)
04:26:02 *** Zathras_1 has joined #openttd
04:26:12 *** Zathras_11 has joined #openttd
04:29:31 *** Zathras has quit IRC (Ping timeout: 480 seconds)
04:29:51 *** Zathras_4 has quit IRC (Ping timeout: 480 seconds)
04:40:48 <DorpsGek> - Update: Translations from eints (by translators)
04:53:28 *** toktik has quit IRC (Remote host closed the connection)
04:56:04 *** toktik is now known as Guest30912
04:58:00 *** Guest30912 has quit IRC (Remote host closed the connection)
05:20:20 *** toktik is now known as Guest30913
05:23:28 *** Guest30913 has quit IRC (Remote host closed the connection)
05:29:50 *** toktik has quit IRC (Remote host closed the connection)
05:42:45 *** toktik is now known as Guest30916
05:46:17 *** Guest30916 has quit IRC (Remote host closed the connection)
05:50:31 *** toktik is now known as Guest30917
05:54:18 *** Guest30917 has quit IRC (Remote host closed the connection)
07:17:25 *** WormnestAndroid has quit IRC (Read error: Connection reset by peer)
08:09:03 *** qwebirc83710 has joined #openttd
08:12:46 *** Zathras_4 has joined #openttd
08:15:00 *** qwebirc83710 has left #openttd
09:51:05 <locosage> _glx_: settings aren't stable api though
10:18:41 <xarick> hmm right, how do i make it so that only ScriptInstance can set it up?
11:58:44 <xarick> holy crap, copilot is scary good
11:59:17 <xarick> i asked about that page and it described what the whole commit was doing
12:00:09 <xarick> i haven't asked before
12:00:59 <xarick> for it to know in just a right click, ask copilot in the browser and for it to coming up with such details... so scary
12:02:18 <_glx_> Waste of memory, it's a global setting and you duplicate it 15 times
12:04:11 <xarick> I'm gonna need it for my variable opcodes branch likely
12:04:51 <peter1138> Variable op-codes is like having some players play at 1x, some at 2x, others at 0.5x speed...
12:12:07 <xarick> on second thought, this is gonna make variable opcodes break Valuate
12:12:58 <xarick> have to code my way in to test it
12:20:22 <peter1138> Should we change the API to say items may be evalulated multiple times? Or some how try to fix it so that the valuate function can also be suspended and resumed at the same place...
12:51:52 <_glx_> It's impossible to suspend a valuator
12:52:45 <_glx_> But it might be possible to estimate how much ops a valuator needs
13:31:03 *** gelignite has joined #openttd
14:15:47 *** Wormnest has joined #openttd
14:16:46 *** WormnestAndroid has joined #openttd
14:46:44 <xarick> variable opcodes ruining valuate with item repeating
14:48:51 <xarick> oh well, I suspected such a thing would happen
15:02:38 <xarick> dang, gotta move it to
15:04:50 <_glx_> can't remember if there's any script calling Valuate in valuators
15:05:21 <_glx_> they most likely won't like the suspendable
15:09:54 *** kuka_lie has joined #openttd
15:23:30 <xarick> visual studio 17.14.20 is out
15:24:19 <_glx_> but no info about the changes
15:24:45 <xarick> gonna try build with clang
15:29:20 <_glx_> hmm the failure is not because Valuate in valuator, but the valuator does a 2 for loops inside a for loop for 15x15 tiles list
15:31:19 <xarick> clang still gives me manifest file error
15:50:24 *** Zathras_4 has joined #openttd
15:55:45 <_glx_> indeed a single valuation needs more than 10k
16:06:14 <_glx_> ok I have an idea which should also solve the double valuation
16:15:50 <xarick> i have problems trying to link all this together
16:16:15 <xarick> I need GetMaxOpsTillSuspend called from Valuate
16:16:33 <xarick> I need GetMaxOpsTillSuspend called from framerate gui
16:16:47 <xarick> and I need GetMaxOpsTillSuspend called from ScriptInstance
16:18:08 <xarick> for the framerate gui, i guess i can just use c->ai_instance->GetMaxOpsTillSuspend()
16:18:33 <xarick> from scriptinstance it's just this->GetMaxOpsTillSuspend
16:18:45 <xarick> but Valuate... I don't know what to do
16:29:36 <_glx_> ScriptObject::GetActiveInstance()
17:37:14 <_glx_> better, but doesn't support Valuate inside valuator
18:14:29 <xarick> `const uint opcodes = this->elem == PFE_GAMESCRIPT ? Game::GetInstance()->GetMaxOpsTillSuspend() : Company::Get(static_cast<CompanyID>(this->elem - PFE_AI0))->ai_instance.get()->GetMaxOpsTillSuspend();`
19:29:16 *** gelignite is now known as Guest30947
19:29:20 *** gelignite has joined #openttd
19:35:29 *** Guest30947 has quit IRC (Ping timeout: 480 seconds)
19:40:58 <xarick> can i combine 2 stashes into one if their changes don't overlap?
20:07:47 <andythenorth> dunno, maybe I missed something 🙂
20:23:34 *** humanfish451 has joined #openttd
20:55:23 *** Borg has quit IRC (Quit: leaving)
21:15:34 *** wallabra has quit IRC (Read error: Connection reset by peer)
21:16:24 *** wallabra has joined #openttd
21:33:49 <_glx_> now the only missing piece is a way to properly benchmark
22:11:53 <xarick> added a bit more details
22:14:28 <_glx_> I did a basic test using `-G 0 -g` and FastPTP, and in master I can clearly see 40ms peaks in the graph, while in suspendable it never goes above 10ms
22:15:30 <_glx_> average ms might be lower in master though (hard to tell)
22:17:39 <xarick> yay, i can now merge your PR into my variable max op codes without conflict!
22:18:02 *** kuka_lie has quit IRC (Quit: Lost terminal)
22:20:07 <xarick> `SQOpsLimiter limiter(vm, MAX_VALUATE_OPS, "valuator function");` oh you reverted it
22:21:33 <_glx_> yes it's the hard limit per Valuate call, but it's only useful to detect infinite loops
22:21:58 <_glx_> and for not suspendable Valuate calls (inside valuator)
22:23:19 <_glx_> typical Valuate calls will just suspend if they reached the op code limit at begining of the loop
22:23:56 <_glx_> but it will always valuate at least 1 item per call
22:29:10 <xarick> nice, variable opcodes and no repeatings
22:33:59 <xarick> a smaller array of lists
22:34:36 <xarick> but you can still see the number of ticks in valuate
22:37:14 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
22:38:12 <_glx_> the 397ms peak and the some over 200ms peaks kinda defeat the suspendable goal
22:38:28 <xarick> that's the clear + clone
22:40:19 <xarick> let me take a small snapshot of valuate only
22:42:05 *** keikoz has quit IRC (Ping timeout: 480 seconds)
22:51:58 <xarick> first part of the video is "cloning" lists hiccups
22:52:16 <xarick> the valuate part starts when i click continue after a break
22:53:30 <xarick> it's smooth for this function i use
22:53:50 <xarick> ```function CustomValuatorFunction(item, instance)
22:53:50 <xarick> return instance.valuate_counter++;
22:54:05 <xarick> gotta go now, take care
continue to next day ⏵