IRC logs for #openttd on OFTC at 2025-02-08
β΄ go to previous day
01:20:06 *** gelignite has quit IRC (Quit: Stay safe!)
03:00:05 *** herms has quit IRC (Quit: bye)
03:07:10 *** Wormnest has quit IRC (Quit: Leaving)
03:54:31 *** godbed_ has joined #openttd
03:57:54 *** D-HUND has quit IRC (Ping timeout: 480 seconds)
03:57:54 *** debdog has quit IRC (Ping timeout: 480 seconds)
04:06:27 *** godbed_ is now known as debdog
04:41:14 <DorpsGek> - Update: Translations from eints (by translators)
05:22:41 *** godbed is now known as debdog
06:01:56 <Rubidium> nice... if CDN upload fails to upload one file, you can't rerun it because it'll fail on the files that already exist
08:16:24 <peter1138> Hurrah, coffee is coming.
08:24:05 <andythenorth> is my coffee coming too?
08:27:02 <kuhnovic> Why am I drinking tea?
08:28:48 <Rubidium> because you don't like coffee?
08:34:15 <peter1138> Because tea is good as well.
08:34:31 <peter1138> I appear to have chickened out of doing the outside thing.
08:34:34 <Rubidium> peter1138: you're not working on making CompanyMask an EnumBitSet, right? I'm thinking of converting that to EnumBitSet now, and later try to make EnumBitSet work with PoolID (specifically CompanyID). Potentially by just defining `to_underlying` for CompanyID.
08:36:13 <peter1138> I haven't touched CompanyMask. Company is a bit weird :)
08:36:58 <peter1138> But also, I'm not sure things that are full Enums should become EnumBitSets.
08:37:18 <peter1138> Such typos resulting in opposite meaning.
08:43:23 <Rubidium> good point, some superclassing will probably solve that ;)
09:15:01 <andythenorth> time to make coffee π
09:15:35 <peter1138> I made one for you but it was intercepted.
09:15:57 <peter1138> I probably need food.
09:41:39 <andythenorth> is scrambled eggs food?
09:57:36 <Rubidium> owh... having to rebase it to master to make it pass the commit checker
10:04:34 *** mindlesstux has joined #openttd
10:21:44 <xarick> omg, what is the point of this
10:24:25 <peter1138> > 1,335,645 Commits.
10:24:34 <peter1138> We're a bit behind "some other" projects.
10:24:58 <peter1138> It's an AI that does nothing.
10:25:57 <xarick> there was already 3 Idle AIs
10:27:16 <peter1138> Now you can run one of each and compare how well they behave.
10:30:14 <xarick> it would be more exciting to get another competing ai though
10:32:10 <xarick> i can't imagine how openttd would be like if it was a popular game
10:32:40 <xarick> content download would be a very very bad place
10:34:22 <peter1138> As opposed to just a very bad place? :)
10:36:17 <xarick> it would be miserable to get through the mess just to find something remotely good
10:45:31 <Rubidium> if it were really popular, there likely would be more people scratching the itch of improving that part... making it potentially less miserable
10:49:56 <xarick> peter, weren't there more cargo classes introduced recently?
10:50:30 <xarick> script_cargo.hpp is missing the new ones
10:51:21 <andythenorth> I thought they had to be backed out?
10:52:09 <peter1138> We haven't backed it out, but we haven't added them to the script API yet either.
10:52:38 <andythenorth> did it break grfs?
10:52:43 <andythenorth> maybe we had a ticket π
11:20:50 <andythenorth> I mean...who even made that grf?
11:20:52 <andythenorth> don't they maintain it
11:24:05 *** tokai has quit IRC (Quit: c('~' )o)
11:29:48 <peter1138> Yeah, I did think about adding empty .Any() and .None().
11:36:29 <peter1138> RailTypes and RoadTypes also fall into this category.
11:37:51 <peter1138> And CargoTypes. I have plans for that which also involve a custom BitSet but they're a bit more experimental.
11:43:55 <xarick> im getting warnings while building?
11:45:48 <peter1138> Probably, but: saying you have warnings does not help anyone.
11:46:33 <peter1138> You must be aware by now that we run everything through a CI/CD that alerts us to general warnings which we have to fix.
11:46:35 <xarick> nop, i didn't touch this part
11:46:35 <xarick> > 11:43:28:277 In file included from E:\OpenTTD Visual Studio\SamuXarick\OpenTTD\out\build\x64-Clang-Release\CMakeFiles\openttd_lib.dir\cmake_pch.hxx:5:
11:46:35 <xarick> > 11:43:28:277 In file included from E:\OpenTTD Visual Studio\SamuXarick\OpenTTD\src\stdafx.h:64:
11:46:35 <xarick> > 11:43:28:277 C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\memory(3302,9): warning : delete called on non-final 'StreamingVoiceContext' that has virtual functions but non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor]
11:46:35 <xarick> > 11:43:28:277 3302 | delete _Ptr;
11:46:36 <xarick> > 11:43:28:277 C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\memory(3412,13): note: in instantiation of member function 'std::default_delete<StreamingVoiceContext>::operator()' requested here
11:46:38 <xarick> > 11:43:28:278 3412 | _Mypair._Get_first()(_Mypair._Myval2);
11:46:40 <xarick> > 11:43:29:123 E:\OpenTTD Visual Studio\SamuXarick\OpenTTD\src\sound\xaudio2_s.cpp(110,47): note: in instantiation of member function 'std::unique_ptr<StreamingVoiceContext>::~unique_ptr' requested here
11:46:40 <xarick> > 11:43:29:123 110 | static std::unique_ptr<StreamingVoiceContext> _voice_context;
11:46:42 <xarick> > 11:43:29:123 1 warning generated.
11:46:57 <xarick> derp, i'll post in a gist
11:48:16 <peter1138> Inheriting from API classes is probably not a good idea.
11:48:50 <peter1138> But they call it an interface, which suggests it's designed to be.
11:53:19 <peter1138> Add `~StreamingVoiceContext() {}` to xaudio2_s.cpp:59
11:53:37 <peter1138> Not sure if it'll do anything of course.
11:53:56 <_glx_> Anyway this might be a recent change about malloc/free
11:54:18 <peter1138> Yes, it's because of malloc/free to unique_ptr.
11:54:59 <peter1138> Hopefully xarick will be able to read and add that line to see if it fixes i.t
11:55:46 <peter1138> Hopefully I'll be able to write "it".
11:59:59 <xarick> building with ~StreamingVoiceContext() {}, 3 minutes
12:02:21 <xarick> let me check if it says something different
12:03:59 <peter1138> (Also, what's all the STDMETHOD_() for...)
12:04:20 <peter1138> Yeah, checking if it's the same warning would be useful :p
12:05:25 *** virtualrandomnumber has joined #openttd
12:05:45 *** virtualrandomnumber has quit IRC ()
12:06:17 <xarick> did I place it in the right location
12:07:22 <xarick> building release with clang takes more time than msvc
12:07:31 <peter1138> Anywhere in the class is good enough.
12:07:47 <xarick> send me a 16 core cpu plz
12:07:49 <peter1138> So build with MVSC then?
12:08:15 <LordAro> could be something only clang picks up
12:08:20 <LordAro> xaudio won't get compiled with clang normally
12:13:54 <peter1138> With or without that addition?
12:16:06 <peter1138> Okay, using the `STDMETHOD_` stuff is a coding mistake, that's intended for defining an interface.
12:16:14 <peter1138> (That won't affect this issue though)
12:18:12 <xarick> no warning with msvc either with the addition
12:19:24 <peter1138> If the base class doesn't have a virtual destructor, clang is correct.
12:19:40 <peter1138> But also, if the base class doesn't have a virtual destructor, not much can be done about it.
12:20:14 <xarick> testing x64-clang-debug see if it's any different
12:23:31 <xarick> yeh, still same warning, without the addition
12:24:48 <peter1138> Weird shit behind the scenes.
12:25:04 <peter1138> > The `__declspec(novtable)` specifier tells the compiler not to bother setting up the vtable for this class during construction and destruction
12:25:38 <LordAro> clang false positive then!
12:27:03 <peter1138> And this one has a different set of macros for the implementation.
12:36:56 <peter1138> Maybe we should do pull requests via email.
12:39:58 <peter1138> Just to make everything more awkward.
12:40:12 <peter1138> Weed out the cruft. Stifle development. Etc.
12:40:24 <peter1138> (No, it was not a serious suggestion.)
12:51:34 *** SigHunter has joined #openttd
13:17:23 <michi_cc> But it's distributed! And nobody needs somebod to host anything! (Except the whole e-mail servers, git infrasturcture, websites etc, but who counts that?) π
13:27:10 *** kuka_lie has joined #openttd
13:33:07 *** gelignite has joined #openttd
13:35:19 <xarick> I wanna rebase this so much
13:49:10 *** yiffgirl has joined #openttd
13:49:10 <yiffgirl> has anyone built openttd on windows with just clang before?
13:49:10 <yiffgirl> i have zero interest in using visual studio.
13:54:03 <xarick> glx implemented a few of my suggestions
13:55:00 <xarick> but i still can't configure 15 ais from main menu
13:55:19 <xarick> there's still no spectator mode
13:56:25 <xarick> there's now a bug I recently discovered of configurations resetting too much
13:56:39 <xarick> like... it was only for savegame purposes
13:56:49 <xarick> not for in-game purposes
13:58:36 <xarick> the whole Company storing the config thing feels a bit too much
13:59:16 <xarick> but it was a difficult situation to deal with
14:00:11 <xarick> then some random stuff was eliminated
14:00:58 <xarick> start date was reworked for the better at least
14:02:43 <xarick> selecting a version of an AI was implemented, I like this feature
14:03:20 <xarick> multiple ai debug windows implemented, i like it
14:04:32 <xarick> so... yeah, i have to rebase over all these new features
14:15:00 <peter1138> That was shortlived.
14:15:38 <Rubidium> small-and-simple steps, right?
14:17:04 <Rubidium> hmm... why is GCC12 so fracking forgiving?
14:18:44 <peter1138> Yeah... I just finished rebasing to the Source that just got changed again :D
14:18:54 <peter1138> Not complaining. Amused.
14:19:47 <Rubidium> now you know how I felt about the news changes recently :D
14:23:13 <xarick> and of course it involves NWidgets
14:23:49 <_glx_> just reading the error message tells what to do π
14:25:28 <xarick> i wasn't told to write virtual
14:26:09 <_glx_> "delete called on non-final 'StreamingVoiceContext' that has virtual functions but non-virtual destructor" seems explicit enough
14:26:11 <truebrain> "chance Source .." or "change Source"? Hihi, sorry Rb π
14:31:29 <_glx_> hmm the other option could be to make the class final
14:32:33 <_glx_> yup works too, I'll do that instead
14:32:38 <peter1138> Hmm, doesn't the virtual destructor have to be on the base class?
14:33:21 <peter1138> xarick, I didn't ask you to, as the example I looked at didn't have it either.
14:33:31 <_glx_> base class is an interface
14:41:37 <peter1138> Why is it a unique_ptr anyway?
14:41:44 <_glx_> peter1138: well the example didn't use `override`
14:42:36 <_glx_> and it probably always used `cl` only
14:43:12 <_glx_> it is unique_ptr to remove malloc/free
14:49:42 <_glx_> hmm but since we use `#define STDMETHOD_(type,method) virtual COM_DECLSPEC_NOTHROW type STDMETHODCALLTYPE method` maybe the virtual destructor is a better solution
14:54:57 <andythenorth> sidequests multiply
15:10:20 <peter1138> Hmm, perhaps I should rename things.
15:11:30 <peter1138> Also fix string encoding.
15:12:31 <peter1138> Raw strings are written as `:"x"`
15:12:40 <peter1138> What if x contains a "...
15:13:43 <peter1138> (This should also be a problem for GS strings, I think.)
15:16:33 <peter1138> `GetEncodedString(STR_JUST_RAW_STRING, "\":04:\"")`
15:26:00 *** Wormnest has joined #openttd
15:43:14 <andythenorth> Is there even a main quest?
15:43:45 <_glx_> peter1138: should be fine, we handle `\"` as it should
16:00:40 *** rotterdxm has joined #openttd
16:00:40 <rotterdxm> If I may make a suggestion for GUI QoL; can we make the pause button more visually obvious (like red/black) because it's hard to see on my new 34" monitor
16:02:19 <rotterdxm> this is what I mean, it's too subtle
16:09:14 <LordAro> i'm not sure i've seen a 'button shading not dark enough' complaint before
16:09:36 <LordAro> (which isn't to indicate that it's not valid)
16:10:07 <LordAro> we have dark grey/black shading for currently selected drop down, perhaps that could be used?
16:12:05 <gwyd4016> I have to say I wouldn't mind having some more contrast when paused
16:13:05 <gwyd4016> Might be more conspicuous if the pause icon blinked, the background is quite obscured by the sprite itself
16:20:45 <xarick> how do i detect a config is random now?
16:27:40 <_glx_> it's a useless info for a running script
16:28:31 <andythenorth> Think ttd graphics pause is more obvious
16:33:13 <xarick> it was important enough for me
16:33:26 <xarick> i could tell which AIs were started as random
16:33:40 <_glx_> ``` if ((_game_mode != GM_NORMAL && i == 0) || (_game_mode == GM_NORMAL && Company::IsValidHumanID(i))) {
16:33:40 <_glx_> text = STR_AI_CONFIG_HUMAN_PLAYER;
16:33:40 <_glx_> } else if (AIConfig::GetConfig((CompanyID)i)->GetInfo() != nullptr) {
16:33:40 <_glx_> SetDParamStr(0, AIConfig::GetConfig((CompanyID)i)->GetInfo()->GetName());
16:33:40 <_glx_> text = STR_JUST_RAW_STRING;
16:33:41 <_glx_> text = STR_AI_CONFIG_RANDOM_AI;
16:35:25 <xarick> im printing more than just text
16:35:50 <_glx_> this code detects random or not
16:37:20 <_zephyris> rotterdxm: Try using opengfx2 with a larger ui scale instead of opengfx+ big gui? (making quite a few guesses about your setup)
16:40:49 <_zephyris> The ogfx+ big gui isn't great icon design, and forcing larger icons with bigger sprites doesn't scale the bevels, which is what gives the visual feedback.
16:46:27 <peter1138> _glx_, well, I don't, apparently.
16:46:40 <peter1138> `STR_ENCODED_STRING :Test test {RAW_STRING} -- {COMMA} -- {RAW_STRING}`
16:47:02 <peter1138> `GetEncodedString(STR_ENCODED_STRING, "Oh\":0x100:\"Pants");`
16:47:37 <peter1138> > Test test Oh -- 256 -- Pants
16:48:22 <peter1138> Maybe something on the GS side handles ", but my EncodedString does not.
16:49:27 <_glx_> FormatString has code to handle `\"` as a normal char, while `"` itself is a marker for begin/end
16:49:43 <andythenorth> peter1138: Happens π
16:50:16 <peter1138> _glx_, FormatString is the decoding, which relies on being encoded correctly.
16:50:18 <_zephyris> rotterdxm: It's on bananas too
16:51:08 <peter1138> `void operator()(const std::string &arg) { fmt::format_to(this->output, ":\"{}\"", arg); }`
16:51:33 <peter1138> Is obviously not going to be treating any `"` characters in `arg` specially.
16:52:20 <_glx_> but to have `"` in arg it needs to be escaped or squirrel will error
16:52:55 <_glx_> the language itself takes care of strings
16:52:59 <rotterdxm> _zephyris: do I need to uninstall opengfx bigGui?
16:53:33 <_glx_> `Squirrel's strings, behave like C or C++, are delimited by quotation marks(") and can contain escape sequences(\t,\a,\b,\n,\r,\v,\f,\\,\",\',\0,\xhhhh). `
16:54:12 <_glx_> so you can't actually have unquoted `"` comming from squirrel
16:54:27 <_zephyris> rotterdxm: Yeah, that overrides the base set
16:55:19 *** kuka_lie has quit IRC (Quit: Lost terminal)
16:55:40 <rotterdxm> Another thing, filter for *active* newGRFs would be welcome? it's there for the active ones.
16:56:19 <_glx_> if you need a filter you have too many active ones π
16:58:01 <_glx_> you can resize the window so it shows two huge columns
16:58:48 <_glx_> and CTRL clic on one of the buttons on top to save the new size as default
17:00:05 <rotterdxm> ironically the first thing that caught my eye was this: best of both worlds
17:00:20 <peter1138> _glx_, are you saying that if I have, in Squirrel, a raw string "Test \" String", the representation of that string on the OpenTTD side will be "Test \\\" String"?
17:01:15 <_glx_> in squirrel you'll need to write it as "Test \" String" for it to be a valid squirrel string
17:02:03 <_glx_> hmm I need to check how it works with all the indirection though
17:05:26 <peter1138> Of course you have to write it like that in Squirrel.
17:05:38 <peter1138> That does not mean that that it's still like that when it in C++.
17:06:02 <peter1138> `STR_TEST :Test {RAW_STRING} -- {COMMA} -- {RAW_STRING} String
17:06:14 <peter1138> GSTown.SetText(this.town, GSText(GSText.STR_TEST, "What \":100:\"Is this"));
17:07:29 <_glx_> GSTown.SetText(0, GSText(GSText.STR_RAW, "Test \" String")); with STR_RAW :{RAW_STRING}
17:07:57 <_glx_> something doesn't work indeed
17:08:08 <peter1138> It's not encoded correctly.
17:08:17 <peter1138> There's no escaping.
17:08:25 <_glx_> yeah the escape is lost
17:09:04 <xarick> none of the AIs were started as random
17:09:13 <peter1138> The escape worked as it should, there is no reason to assume the the escape would still exist once it's been parsed by Squirrel.
17:09:47 <xarick> and im still missing the start/stop toggle button
17:09:49 <peter1138> This is fine. It just means I was correct in thinking this code is buggy and I need to fix it before I go further with EncodedStrings :-)
17:09:49 <_glx_> with GSTown.SetText(0, GSText(GSText.STR_RAW, "\t\tTest \" String"));
17:11:05 <_glx_> ScriptText uses StrMakeValid
17:11:17 <_glx_> which doesn't add quotes
17:13:11 <peter1138> Damn, I was hoping fmt's `{:?}` would do the job, but no :)
17:13:50 <peter1138> _glx_, no reason it should. `"` is a valid character inside a string.
17:14:09 <peter1138> It's only string encoding that needs to do special things with it.
17:14:13 <xarick> when i click Reload AI on a randomly started AI, it starts a random script, so this information is still stored somewhere, where did u put it at
17:14:44 <peter1138> `value.replace("\"", "\\\"")`. but of course that isn't valid C++ :)
17:18:16 <peter1138> I think we're past the point of trying to avoid string copies now :S
17:18:43 *** gelignite has quit IRC (Quit: Stay safe!)
17:19:07 *** aperezdc has quit IRC (Remote host closed the connection)
17:20:13 *** aperezdc has joined #openttd
17:21:36 <peter1138> I think we can do this more efficiently.
17:21:59 <_glx_> fmt::format will copy anyway
17:23:01 <peter1138> The decoder doesn't handle `\"` either.
17:23:06 <peter1138> But still, this is less broken.
17:23:36 <peter1138> Basically outputing char by char, not using fmt:: at all.
17:24:04 <peter1138> It skips it, but it needs to handle it as ".
17:24:06 <_glx_> ie left it untouched in the string
17:24:28 <peter1138> Or rather, output it as.
17:25:04 <peter1138> Anyway, what I meant with string copying was using a generic function to replace " with \" first.
17:25:11 <peter1138> Which would be even more copies.
17:25:26 <peter1138> At least this way is just output char by char and not making extra copies everywhere.
17:26:36 <peter1138> Replacing `void operator()(const std::monostate &) { fmt::format_to(this->output, ":"); }` with `void operator()(const std::monostate &) { *this->output = ':'; }` is a bit more efficient.
17:28:48 <peter1138> But still, even with the decoding not working correctly, this is better because it now handle break the in-band encoding.
17:31:28 <peter1138> Instead of band-aiding this, maybe we can use a more robust method to encode strings.
17:31:49 <peter1138> Although these strings can be stored in save games, so that's a bit awkward.
17:33:53 <peter1138> Like, EndianBuffer is more robust, but that doesn't encode the argument types into the buffer.
17:36:42 <_glx_> using something other than `""` to enclose rawstring could help
17:38:17 <_glx_> will require conversion when loading saves
17:38:23 <peter1138> That just means you need to escape (or filter) a different character.
17:38:54 <peter1138> And makes detection harder because it's no longer a single byte character. (Unless you go with something < 32)
17:39:08 <peter1138> And yes, ASCII does have the FS code.
17:39:55 <peter1138> 28 - file separator, 29 - group separator, 30 - record separator, 31 - unit separator.
17:42:08 <peter1138> Doesn't help with encoding the parameter type mind you.
17:44:14 <_glx_> STX and ETX for raw strings ?
17:45:07 <peter1138> With EncodedString I'd like to have more options for encoding different types.
17:45:52 <peter1138> StringParameterData only takes number or string right now, but given Rubidium's work, I could forsee it handling things like number, string, depotid, stationid ...
17:46:18 <_glx_> STX(byte for type)valueRTX
17:46:33 <peter1138> Not saying that it would be done, but better to keep options open.
17:47:17 <peter1138> I have a patch that puts a vector in the StringParameterData variant. Encoding that could be a problem anyway :D
17:48:29 <peter1138> Hmm, but then if the data to be encoded is binary then it still has collision problems.
17:49:20 <_glx_> like `:<SCC_ENCODED><StringID>` could become `STX<SCC_ENCODED><StringID>ETX`
17:50:03 <peter1138> Hmm, interesting point.
17:50:20 <peter1138> Ah, it's UTF-8, not interesting :)
17:51:04 <_glx_> integers would go from `:<number>` to `STX<number_type><number>ETX`
17:51:47 <peter1138> Imagine for some reason I had a string parameter that is an array, containing the values 0x00 through to 0x3F.
17:52:34 <peter1138> STX/ETX would conflict there.
17:52:45 <peter1138> Hmm, unless it's just encoded as hex numbers.
17:53:01 <peter1138> Uses more space but is in keeping with the concept of an encoded *string*
17:53:48 <_glx_> and we could split the string before parsing
17:53:49 <peter1138> `:0,1,2,...,3D,3E,3F`
17:54:14 <peter1138> Or equally, `<RS>0,1,2,...,3D,3E,3F`
17:54:27 <peter1138> I think I prefer the idea of RS rather than STX/ETX though.
17:54:37 <peter1138> There's then only one character to search for.
17:55:02 <_glx_> yeah, but still <RS><type marker>...
17:55:56 <peter1138> Also, about the SCC codes.
17:56:08 <peter1138> Sometimes we add them, and thus the numbers change.
17:56:19 *** Flygon has quit IRC (Read error: Connection reset by peer)
17:56:27 <peter1138> Are they ever stored in savegames, or is SCC_ENCODED the only one that ever matters?
17:56:52 <_glx_> SCC_ENCODED is followed by a StringID
17:57:06 <peter1138> That is the answer to a completely different question.
17:57:12 <_glx_> all other SCC are in the pointed string itself
17:57:27 <_glx_> and GSString are compiled at runtime
17:57:54 <_glx_> saved encoded string come from a specific GS
17:58:18 <peter1138> I *think* it's not intended for a saved string to contain any SCC codes (other than SCC_ENCODED)
17:58:23 <_glx_> we assume it doesn't reorder its strings
17:58:54 <peter1138> Yeah, well, that's an incorrect assumption, but not much we can do about that.
17:59:26 <_glx_> it will show "(invalid...)" on use
17:59:38 <peter1138> A bit more than just that.
18:00:40 <_glx_> it's part of the "don't change addons in a running game"
18:01:23 <andythenorth> Unless developing π
18:01:45 <_glx_> yeah but then you expect things to break
18:02:48 <peter1138> Well, in this case it's "don't save a game from a multiplayer server when you don't have the exact version of the script locally"
18:03:40 <_glx_> nothing we can do about that
18:05:37 *** gelignite has joined #openttd
18:05:37 <xarick> save the scripts in the savegame
18:07:22 <_glx_> hmm how does GSTown.SetText() work over network, since it's an encoded string, but the GS is only on the server
18:14:05 <Rubidium> using the GSTR chunk in the savegame I guess
18:14:17 <peter1138> >Error: Assertion failed at line 152 of /home/petern/src/openttd/src/script/script_instance.cpp: this->suspend < 0
18:14:38 <Rubidium> i.e. the clients have the complete language files that the server has
18:15:41 <peter1138> Whatever andythenorth's FIRS gs does, it prevents starting a server.
18:16:36 <peter1138> I know it's only experimental, but causing the game to assert is probably bad :D
18:18:23 <_glx_> oh indeed we put all GS strings in the save
18:21:07 <_glx_> and if there's a GS to start it happens at the end of loading and it will reset the loaded strings
18:21:33 <andythenorth> peter1138: βExcitingβ
18:22:59 <_glx_> it forget to sleep at the end of constructor ?
18:23:39 <_glx_> hmm no it's not mandatory
18:25:12 <_glx_> hmm this assert is triggered via command callback
18:27:37 <_glx_> ` Tret res = ::Command<Tcmd>::Unsafe((StringID)0, networking ? ScriptObject::GetDoCommandCallback() : nullptr, false, estimate_only, tile, args);`
18:28:02 <_glx_> yeah, not sure we properly tested async mode in network
18:35:03 <_glx_> confirmed it's asyncmode
18:39:57 <xarick> glx, problem i have... the AIInfo is present, it's not nullptr, (the AI is started as random and alive), however it used to be possible to know if a running AI company has started as random
18:40:28 <_glx_> it's started so config is not random at this point
18:41:12 <xarick> i need to restore IsRandom somehow
18:41:37 <xarick> will look at the history, see when it was removed
18:43:07 <peter1138> Let's see if this "just works"
18:43:18 <peter1138> If so, then it's probably worth doing, with a bit of saveload conversion.
18:43:18 <_glx_> AIConfig::GetConfig((CompanyID)i, SSS_FORCE_GAME)->GetInfo()
18:43:51 <_glx_> you don't need IsRandom(), you need to look at the correct info
18:46:45 <peter1138> (std::string) "ξ2\U0000001eξWhat \":100:\"Is this\U0000001eξ32\U0000001eξPass"
18:47:40 <peter1138> So the \U0000001e is the RS, and despite lldb displays is only a byte.
18:48:23 <peter1138> The other characters are SCC_ENCODED_GS, SCC_ENCODED_STRING, SCC_ENCODED_NUMERIC and SCC_ENCODED_STRING again.
18:48:55 <peter1138> They are utf-8 encoded, so are... I think 3 bytes each.
18:49:05 <peter1138> `for (; *p != '\0' && *p != SCC_RECORD_SEPARATOR; ++p) {}`
18:49:14 <peter1138> That is the code for extraction the next parameter.
18:49:38 <peter1138> So it's a lot simpler.
18:51:02 <peter1138> Adding more parameter types is possible now.
19:08:59 <peter1138> `(invalid SCC_ENCODED)`
19:09:07 <peter1138> Right, sorting that is next.
19:10:27 <peter1138> Hmm, conversion of `SLE_STR | SLF_ALLOW_CONTROL` I suppose.
19:40:05 <xarick> an important piece of the puzzle is missing
19:53:52 <peter1138> Alright, conversion is converting.
20:11:27 <xarick> well.. time to drop the random indicator feature
20:13:01 <_glx_> really `AIConfig::GetConfig((CompanyID)i, AIConfig::SSS_FORCE_GAME)->GetInfo() == nullptr` should indicate the slot is random
20:13:48 <xarick> gonna try one more time
20:14:23 <_glx_> it's not using the company but the config in the slot
20:17:49 <xarick> works, nearly as I'd like
20:18:56 <xarick> need to fix something in ai_core.cpp, not sure how
20:24:25 <Rubidium> with great alacrity?
20:42:06 <Rubidium> ... and that's another side-quest
20:47:12 <xarick> that assert... could it be a script crash instead?
20:51:42 <Rubidium> What's the benefit of a script crash?
20:51:59 <xarick> it's not an openttd crash
20:52:27 <xarick> the script is forced death
20:55:29 <Rubidium> so, because some OpenTTD-developer forgot 'ResolveCompanyID' in the API implementation, the script is killed and as a result the AI-developer does not use the function. And that continues for essentially all AI-developers. Instead of crashing, and fixing the bug in OpenTTD.
20:57:05 <Rubidium> basically with crashing the script you're sweeping the issue under the rug and blaming the AI-developer for doing something wrong, when they haven't done anything wrong!
20:57:21 <peter1138> Oh, is #13500 related to the crash I saw?
20:57:38 <peter1138> Or are talking about different things.
20:58:04 <peter1138> But yes, the game should crash if it's a bug in the game.
20:58:13 <peter1138> If it's a bug in the script, no, of course.
20:58:35 <Rubidium> I doubt your crash is related to #13500
20:58:53 <peter1138> Okay, it was just coincidence then.
20:59:31 <Rubidium> I reckon xarick saw `assert` in the PR and thought... no, please crash the script for the game bug!
21:00:10 <xarick> `assert(company != ScriptCompany::COMPANY_SELF && company != ScriptCompany::COMPANY_SPECTATOR);` this one
21:00:56 <xarick> seeing asserts inside the API is ... strange
21:00:58 <peter1138> Yes. That is deliberate.
21:01:07 <peter1138> There's even a comment to explain it.
21:02:09 <_glx_> it's an assert scripts can't trigger
21:02:36 <_glx_> (if openttd does the right thing)
21:02:40 <peter1138> Hmm, the SCC_ENCODED_STRING/_NUMERIC codes add 3 bytes per parameter. I guess that's okay.
21:03:02 <peter1138> Could cheat and use another low-ascii character :D
21:03:07 <Rubidium> though, xarick... please try to trigger that assert :)
21:10:00 <frosch123> Hmm, I recall GS langfiles were only stored in the save for joining clients, not for disk saves, so no savegame conversion would be needed. But looks like that is no longer the case. Or I just imagined it
21:12:57 <peter1138> frosch123, more complex than that.
21:13:34 <peter1138> This is strings which are saved for something like Town.SetText and Industry.SetText.
21:13:54 <peter1138> So they're not part of the GSTR chunk, but they are saved with towns/industries.
21:14:02 <peter1138> There's potentially other places, I'm not sure.
21:14:59 <peter1138> These saved strings to depend on the GSTR chunk.
21:15:00 <_glx_> GSTR contains raw data to be compiled
21:15:14 <peter1138> (But exist even if that's not present, I suppose.)
21:15:15 <_glx_> so no control code at all in that
21:16:17 <frosch123> Oh, right. I forgot those texts existed as well
21:16:20 <_glx_> but some fields of Town and Industry, for instance, can contain SCC_ENCODED data
21:16:43 <_glx_> and that needs conversion
21:18:19 <peter1138> At least we don't have to be 7-bit clean.
21:27:56 *** kuka_lie has joined #openttd
21:35:42 <_glx_> strange nobody reported the issue before today π
21:41:05 <_glx_> #13501 is for your crash peter1138[d]
21:42:34 <peter1138> Yeah I'm just compiling it :)
21:43:30 <_glx_> my test GS stopped crashing
21:45:33 <_glx_> the sleep loop is to wait for another client to join before modifying the towns (to check it worked fine)
21:46:52 <peter1138> I tested with the FIRS gs, it no longer crashes, so good enough for me :)
22:40:38 *** keikoz has quit IRC (Ping timeout: 480 seconds)
22:40:43 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
22:48:39 *** nielsm has quit IRC (Ping timeout: 480 seconds)
22:49:58 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
23:02:03 <peter1138> Yeah, my conversion is bad.
23:06:45 <Rubidium> that might be the fastest way to test-and-fix that issue
23:21:26 <peter1138> I think there's no point in testing the escaped case that the old decoder tried to handle, because strings were never escaped properly in the first place.
23:22:34 <xarick> meanwhile... AdmiralAI is leading!
23:22:57 <xarick> NoCAB 2nd and AAAHogEx 3rd
23:54:41 <peter1138> Something using `<< SCC_ENCODED << "0"` style syntax is probably better, but it's just a test...
23:55:22 <peter1138> Or there's some way to embed constants as unicode in a string that I don't know :)
23:59:06 *** Tirili has quit IRC (Quit: Leaving)
continue to next day β΅