IRC logs for #openttd on OFTC at 2021-11-14
⏴ go to previous day
00:01:10 *** gelignite has quit IRC (Quit: Stay safe!)
00:04:36 *** tokai|noir has joined #openttd
00:04:36 *** ChanServ sets mode: +v tokai|noir
00:11:27 *** tokai has quit IRC (Ping timeout: 480 seconds)
00:25:21 *** esselfe has joined #openttd
00:54:21 *** WormnestAndroid has joined #openttd
01:03:28 *** supermop_Home has quit IRC (Ping timeout: 480 seconds)
01:18:03 <DorpsGek> [OpenTTD/OpenTTD] ldpl commented on pull request #9002: Change cargo age to have more effect on cargo payment. https://git.io/JXjSh
01:26:24 *** snail_UES_ has joined #openttd
01:27:31 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
02:29:06 *** snail_UES_ has quit IRC (Quit: snail_UES_)
02:40:57 *** Wormnest has quit IRC (Quit: Leaving)
03:11:59 *** debdog has quit IRC (Ping timeout: 480 seconds)
04:23:40 *** _aD has quit IRC (Quit: leaving)
06:12:15 *** supermop_Home_ has joined #openttd
06:56:22 *** D-HUND is now known as debdog
07:19:15 *** sla_ro|master has joined #openttd
07:38:52 *** andythenorth has joined #openttd
07:49:58 *** WormnestAndroid has quit IRC (Remote host closed the connection)
09:04:06 <TrueBrain> "Segmentation fault (core dumped)" <- owh yeah, I DID IT ! :D
09:07:55 <TrueBrain> sometimes I amaze myself
09:21:01 <DorpsGek> [OpenTTD/OpenTTD] nchappe opened pull request #9694: Fix: Update last servicing dates when using the date cheat https://git.io/J1vhT
10:37:48 *** supermop_Home_ has quit IRC (Ping timeout: 480 seconds)
10:56:06 *** HerzogDeXtEr has joined #openttd
12:33:59 <andythenorth> CHIPS nml conversion got delayed :P
12:34:13 <andythenorth> building a Lego remote control 8 wheel offroad bus
12:48:41 <DorpsGek> [OpenTTD/OpenTTD] DonaldDuck313 opened issue #9695: [Crash]: OpenTTD crashes right after I launch it https://git.io/J1f7q
12:53:20 <DorpsGek> [OpenTTD/OpenTTD] nielsmh commented on issue #9695: [Crash]: OpenTTD crashes right after I launch it https://git.io/J1f7q
12:58:25 <peter1138> max heart rate 192, christ
12:58:53 <TrueBrain> get out of there, it is gonna explode! :P
13:15:00 <andythenorth> isn't there some age -> BPM ratio that's healthy vs. unhealthy?
13:15:06 * andythenorth doesn't know about exercise
13:18:55 <peter1138> It'd be bad if I wasn't exercising, heh
14:05:14 <LordAro> peter1138: i can count on my fingers the number of times my HR has exceeded 190
14:06:16 <DorpsGek> [OpenTTD/OpenTTD] LordAro commented on issue #9695: [Crash]: OpenTTD crashes right after I launch it https://git.io/J1f7q
14:19:08 *** frosch123 has joined #openttd
14:26:32 <TrueBrain> hmm .. how do I make a grf active in code .. I want to force one active ..
14:29:09 <peter1138> I think this is the second for me, but the first time really hurt.
14:30:26 <peter1138> Strap was playing up a bit today but I don't think it was then.
14:30:32 <frosch123> TrueBrain: what do you mean? like loading openttd.grf? like loading static newgrf? or like adding a newgrf in the gui for a specific game?
14:30:50 <TrueBrain> like loading "something.grf" on startup
14:30:52 <TrueBrain> but I found _all_grfs
14:30:54 <TrueBrain> that took me a while :D
14:31:52 <frosch123> those are the scanned newgrf, not the active ones
14:32:08 <TrueBrain> I first need to find the non-active one to make it active
14:33:15 <TrueBrain> frosch123: the _all_grfs vs _grfconfig was tricking me :P
14:36:08 <TrueBrain> I was kinda hoping we had a "MakeGRFActive(grfid, md5sum)" :P
14:36:13 <TrueBrain> but it seems we do not
14:36:25 <TrueBrain> or MakeGRFActiveForNewgame :D
14:36:26 <frosch123> i think you are looking for IsGoodGRFConfigList
14:37:21 <TrueBrain> now to make it active ...
14:37:37 <frosch123> check the console command
14:37:53 <TrueBrain> does that make it active?
14:37:53 <frosch123> ReloadNewGRFData() or something
14:38:04 <TrueBrain> I need to add it to _grfconfig_newgame first I guess?
14:38:08 <frosch123> it reloads all newgrf rom _Grfconfig
14:38:35 <spnda> Would it be ok if I update the visualstudiocode NML generator again so that it exports a plain JSON with every keyword and constant? Or should I just make a python script in my repo that I botch into nml?
14:39:52 <frosch123> TrueBrain: ResetGRFConfig, AppendToGRFConfigList, AppendStaticGRFConfigs, no idea what you need :p i just follow saveload code :)
14:40:17 <TrueBrain> and I was trying to follow the NewGRF GUI
14:40:22 <TrueBrain> which .. does all that manually for most part
14:41:01 <frosch123> sounds like a refactor PR :p
14:42:08 <TrueBrain> tnx frosch123 , that was most helpful
14:43:52 <TrueBrain> been doing a bit of C lately .. I like C++ a lot more for its strictness now :P
14:45:17 <TrueBrain> it didn't crash, but it also didn't work :D Lol
14:46:41 <frosch123> i was reading the c++23 feature list yesterday
14:47:01 <frosch123> everytime something from C23 is added for compatibilty, it looks cute
14:47:14 <frosch123> like the new #elifdef
14:47:47 <TrueBrain> they finally going to add elifdef?
14:48:24 *** gelignite has joined #openttd
14:49:50 <frosch123> adding stuff noone should really care about anymore
14:49:55 <frosch123> but apparently there are enough C people
14:50:22 <TrueBrain> doing C is fun .. you have to do void a(void) {} again .. the second void always cracks me up :)
14:50:48 <TrueBrain> ha! IT WORKS! I had my GRFID inverted
14:51:14 <frosch123> haha, yeah the grfid byteswapping :)
14:51:47 <frosch123> [15:50] <TrueBrain> doing C is fun .. you have to do void a(void) {} again .. the second void always cracks me up :) <- apparently c2x removes "k&r funtion definitions"
14:51:57 <FLHerne> spnda: Please update it upstream if it's better :-)
14:52:00 <frosch123> show maybe that "void" becomes unnecessary in future C versions
14:53:50 <spnda> FLHerne: Well it would export the file it currently does and then another json with just the constants. I use them to provide suggestions in the editor.
14:54:15 <spnda> I could also just edit my GitHub Actions run to also run a python script I have in my repo
14:54:19 <spnda> Would be fairly simple anyway lol
14:54:54 <FLHerne> Is that a normal VS thing, or some cunning hack you've invented?
14:55:30 <spnda> I don't know of any other way one would provide suggestions other than give it a list of keywords/constants
14:55:36 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain opened pull request #9696: Change: [Emscripten] update to 2.0.34 and use Release over RelWithDebInfo https://git.io/J1JR0
14:55:43 <FLHerne> I still don't see why not, if anyone else can use it too
14:55:48 <spnda> and i'd just store that list of values in a json for now
15:01:42 *** andythenorth has quit IRC (Quit: andythenorth)
15:08:04 <TrueBrain> hmm .. can you open the cheat menu without keyboard shortcut?
15:10:23 <TrueBrain> hmm, keyboard input is not working at all in emscripten, that is annoying
15:11:39 <spnda> ok actually turns out im too shit in python to figure out how to botch my script in so I guess i'll update it upstream
15:12:27 <TrueBrain> when the game runs in an iframe, keyboard is not getting there .. funny :D
15:32:52 *** gelignite has quit IRC (Quit: Stay safe!)
15:40:13 <glx> wanted to load dmp for #9695, so many symbols to download
15:41:25 <glx> (and that's just to confirm it's a duplicate)
15:42:23 <glx> and microsoft did it again, windows 11 version is 10.0
15:43:11 <TrueBrain> also, updated to 12.1 :D
15:45:30 <frosch123> how do you trigger the "reload newgrf" from the outside?
15:45:37 <TrueBrain> and of course I first made it work with Codespaces .. still not committing that stuff till we know what they plan to do with the price for it :)
15:45:43 <TrueBrain> frosch123: MAGIC! :D
15:45:52 <TrueBrain> I wrote an emscripten hook
15:46:25 <frosch123> ah, ok, i thought too complicated :p
15:46:58 <frosch123> i assumed there was no interaction, adding the grf would go via command line option, and reloading via emulating a keyboard or something :p
15:47:33 <TrueBrain> honestly, initially I wanted to do something like that .. but you cannot access the filesystem Emscripten is running in easily from the outside
15:47:37 <TrueBrain> so this was by far easier :P
15:47:52 <TrueBrain> also allows me to do these nice things, like enabling newgrf developer tools
15:47:57 <TrueBrain> using the same seed
15:49:11 <TrueBrain> so now I am at the point I wanted to start this morning .. looking into tiles :D
15:58:21 <Eddi|zuHause> that's the best time to stop working :p
15:58:51 <Eddi|zuHause> and the next morning you start over from scratch, because you forgot wtf you were doing last :p
15:58:58 *** andythenorth has joined #openttd
15:59:22 <DorpsGek> [OpenTTD/OpenTTD] glx22 approved pull request #9696: Change: [Emscripten] update to 2.0.34 and use Release over RelWithDebInfo https://git.io/J1JSn
15:59:53 <DorpsGek> [OpenTTD/OpenTTD] TrueBrain merged pull request #9696: Change: [Emscripten] update to 2.0.34 and use Release over RelWithDebInfo https://git.io/J1JR0
16:01:26 *** WormnestAndroid has joined #openttd
16:06:46 *** supermop_Home_ has joined #openttd
16:07:35 <supermop_Home_> in seems on Instagram, a lot of 43s and other ilk are being repainted into old liveries lately?
16:27:06 <frosch123> i was not aware there is train-instagram (trainstagram?), but it makes sense
16:28:36 *** gelignite has joined #openttd
16:37:44 *** Wormnest has joined #openttd
17:07:00 *** Flygon has quit IRC (Quit: A toaster's basically a soldering iron designed to toast bread)
17:26:47 *** jottyfan has joined #openttd
17:39:09 <TrueBrain> GitHub Copilot works better than I expected .. it kinda does what you expect .. lol
17:42:48 <frosch123> i am sure it was only invented to drive lawyers into insanity
17:43:26 <TrueBrain> I plan to do a bit of TrueGRF work with it, see if it is any good .. but so far it wrote a few functions for me that are kinda what I would have done myself too
17:43:54 <TrueBrain> not sure it actually helps btw
17:43:58 <TrueBrain> typing isn't the issue mostly :P
17:44:51 <frosch123> sometimes i was in the situation to fix code from coworkers
17:45:06 <frosch123> sometimes it's easier to rewrite code, than to review it
17:45:35 <frosch123> for example: when i review code, i do not notice when loop iterators are swapped, not incremented or similar copy&paste shit
17:45:51 <frosch123> when i write the code myself, my autopilot does it right
17:46:57 <frosch123> it's more obvious when people write C89, declare variables at the top, reuse them multiple times, and so on
17:47:07 <frosch123> it's easier to rewrite than to read
17:47:42 <frosch123> i do not trust gh copilot to not do the same thing: create code that looks right, but is stupidly wrong in some detail
17:49:08 <frosch123> i also need an ide, where the autocompletion never suggests things from legacy windows headers :p
17:50:04 <frosch123> sometimes at work, i slightly mistype something, and it autocompletes to some crap from some windows header, which i did not even know existed
17:50:49 <TrueBrain> guess small functions are a must with copilot :P
17:50:51 <TrueBrain> to keep things sane :D
18:30:01 *** spnda has quit IRC (Quit: Page closed)
19:27:45 *** jottyfan has quit IRC (Quit: jottyfan)
19:36:16 <frosch123> someone pressed ctrl?
19:36:32 <LordAro> TTD didn't have presignals?
19:37:22 <frosch123> oh, it's an actual ancient savegame?
19:37:31 <frosch123> but yes, we try our best to convert ttdp saves
19:41:16 <frosch123> the comment on line 85 may refer to the old pbs :p
19:55:01 *** virtualrandomnumber has joined #openttd
19:57:10 *** virtualrandomnumber has quit IRC ()
20:01:19 *** nielsm has quit IRC (Ping timeout: 480 seconds)
20:22:53 *** supermop_Home_ has quit IRC (Ping timeout: 480 seconds)
20:56:33 <TrueBrain> so for TrueGRF I would need to make a place where you can make the sprites .. so in another place you can select it
20:56:38 <TrueBrain> that is too weird for my taste
20:56:55 <TrueBrain> I wonder what happens if I approach it differently, and take care of all that stuff on the backend
20:57:12 <TrueBrain> like that you can edit the sprites of a single industry only
20:58:16 <frosch123> sharing is mostly for ground sprites
20:58:28 <frosch123> and for different layouts of the same industry
20:58:58 <TrueBrain> owh, right, every tile could have a ground sprite and an actual sprite
20:59:34 <frosch123> important for transparency :)
20:59:53 <frosch123> though ground sprites are often: grass, dirt, concrete
21:00:08 <frosch123> so, maybe a combobox is enough
21:00:13 <TrueBrain> I have to say, I forgot a lot I learned about NewGRFs already :P
21:00:19 <frosch123> select ground sprite from baseset, draw custom building on top
21:00:37 <TrueBrain> yeah, so have a "shared" spriteset you can edit in one place
21:00:50 <TrueBrain> and for an industry, you have sprites per industry (but shared between layouts)
21:01:01 <TrueBrain> you can make a new one, select the ground sprite, and draw your actual sprite
21:01:45 <frosch123> if you are planning to add an actual sprite editor: having sprites from other industries nearby is helpful for maintainnig a colorscheme
21:02:01 <TrueBrain> eventually I would like to add an actual sprite editor
21:02:45 <TrueBrain> basically with this idea you move away from the spritemaps, where a single image has multiple sprites
21:03:01 <TrueBrain> guess an editor where you can upload those, clip them up, and send them to an industry would be helpful
21:03:22 <TrueBrain> or maybe allow uploading of those multiple-sprites-on-one-image per industry
21:03:30 <TrueBrain> and with selection allow selecting where each sprite is
21:04:22 <frosch123> it is said, sprite alignment is one of the more annoying parts of doing newgrf
21:04:44 <TrueBrain> I am hoping I can visualise that in the editor
21:04:56 <frosch123> so editing/aligning the image while constantly updating the view in-game is useful
21:05:07 <TrueBrain> that is already possible :D
21:05:12 <TrueBrain> except you cannot edit alignment currently ;)
21:05:19 <frosch123> people also often use image layers, to add snow and similar
21:05:53 <TrueBrain> hmm .. not a bad idea, but maybe not for 1.0 :)
21:06:08 <frosch123> currently people have to use that, and replicate changes into the source
21:06:28 <TrueBrain> I could make that tool send data back into TrueGRF, in-game
21:06:34 <TrueBrain> so it could be bi-directional :D
21:06:58 <frosch123> or the other way around
21:07:09 <TrueBrain> why is it so difficult btw?
21:07:11 <frosch123> when editing the grf, immediately send the new alignment to the game
21:07:22 <frosch123> and update the offset on-the-fly like the in-game tool
21:07:29 <TrueBrain> yeah, that is not an issue either
21:07:51 <TrueBrain> mostly I hope I can make the TrueGRF editor already show pixel-perfect sprites, so you can fix the alignment without going in-game
21:07:53 <frosch123> what is difficult? everything? :p
21:08:07 <TrueBrain> to me alignment seems like: if you always start the sprite at bottom N
21:09:03 <frosch123> sure, you could probably have a separate image layer in the back, which has the ground sprite outline or similar
21:09:38 <frosch123> but yes, industry alignment is not the hard part
21:09:50 <frosch123> it's more difficult for vehicles
21:09:52 <TrueBrain> vehicle alignment etc is harder, I guess?
21:09:55 <TrueBrain> yeah, okay, make sense :)
21:10:04 <TrueBrain> for that I was hoping I could simulate a train going around a small track
21:10:09 <TrueBrain> so you could see how it looks, and fix what is broken
21:10:17 <TrueBrain> but .. that means replicating parts of the game :P
21:10:34 <frosch123> because people try to align vehicles by trial-and-error, to achieve something that is impossible
21:10:37 <TrueBrain> so I set a goal for myself: implement 90% of the industry specs first :)
21:10:59 <frosch123> it's particulary funny for road vehicles
21:11:29 <frosch123> people try to align them at the middle line, and then everything is wrong when they change driving side
21:11:50 <TrueBrain> okay, so the HTML canvas is always 32bpp
21:12:01 <frosch123> in the end it is impossible, unless your vehicles have a specific width, which is different for every driving direction
21:12:02 <TrueBrain> that means I need to use Rust to convert that to 8bpp-indexed, I guess
21:12:28 <frosch123> do you know rgbaeater?
21:12:31 *** gelignite has quit IRC (Quit: Stay safe!)
21:13:13 <TrueBrain> one of the few things I cannot run in a browser :)
21:13:14 <frosch123> it's insane python code from V to convert 32bpp to 8bpp, but the result is awesome
21:13:33 <frosch123> V spent days comparing different color mappings
21:13:57 <frosch123> it should be integrated into nml, but noone did yet :)
21:14:19 <TrueBrain> what palette is the most sane to use?
21:14:26 <TrueBrain> best thing about TrueGRF, I can just force one of the palettes
21:14:47 <frosch123> there is only one palette, the D (default) palette
21:15:04 <frosch123> never ever use the legacy W palette
21:15:37 <TrueBrain> so for now I guess the easiest approach is to only allow those colours on the canvas .. a bit of an issue with some ofc
21:15:45 <frosch123> the legacy palette is converted on load in ottd, so you can only lose information
21:16:10 <frosch123> TrueBrain: for pallete arrangement, also check ttdviewer :)
21:16:21 <frosch123> it has all its knowledge in some magic xml file
21:16:32 <frosch123> (i was on some weird xml
21:16:37 <frosch123> xml+xsd trip at the time)
21:17:23 <TrueBrain> we all been there :P
21:18:16 <frosch123> but there is also some livestream recording on some yt channel about it
21:18:16 <TrueBrain> tried really hard to :P
21:18:36 <TrueBrain> for industries, I guess you cannot use the company colours? :)
21:18:52 <frosch123> they are used by default
21:19:01 <frosch123> all ttd industries exist in color variations
21:19:10 <glx> you can use magic blue for industries
21:19:11 <frosch123> and they use the company color remappings for that
21:19:28 <TrueBrain> I remember why I always got lost in all of this :P
21:19:55 <glx> and you need to be careful to not use water blue :)
21:20:00 <frosch123> i think ttdp even enforced the founder's company color when funding industries :p
21:20:06 <TrueBrain> hmm .. there is a bit of an issue anyway .. I get the images copy/pasted into the browser .. I don't even know what "index 0" has as colour
21:20:36 <TrueBrain> guess I really first need to bounce it via Rust, to do a proper 8bpp analysis
21:20:36 <frosch123> another reason for rgbaeater :p
21:20:59 <TrueBrain> as people using blue for transparency is just the worst
21:21:12 <frosch123> but if copy/paste always used 32bpp, you will always use the company color information
21:21:27 <glx> so many special blue in the palette
21:21:37 <TrueBrain> index 0 is transparent, right? No matter the colour?
21:22:06 <TrueBrain> so either I enforce the palette used by external programs, so I can read the 32bpp and know what blue is transparent
21:22:21 <TrueBrain> or I need to use Rust to read it as a proper 8bpp, and do the conversion for us
21:23:00 <frosch123> in old delphi you could set images to use the color from pixel (0,0) as transparent
21:23:13 <glx> the different magic ranges
21:23:26 <TrueBrain> yeah, I never really understood that image :P
21:23:41 <frosch123> use ttdviewer, it's more accurate
21:23:53 <TrueBrain> still don't understand it :D
21:24:04 <frosch123> you can trial-and-error it :)
21:24:34 <glx> it's a 16x16 grid, with some splits
21:24:36 <TrueBrain> yeah, I found your XML .. :P
21:25:07 <frosch123> oh lol... TrueBrain: there are actually two palettes :p
21:25:14 <frosch123> water uses different colors in toyland
21:25:18 <frosch123> i always forget that
21:25:54 <frosch123> but is only affects the animated colors, which noone uses anyway, except for water
21:25:55 <glx> I always forget why there's all these pink ones
21:26:08 <frosch123> for no reason, they are unused
21:26:36 <TrueBrain> what I never got, is what the first image on the page glx linked means
21:26:46 <TrueBrain> it feels like "index 1" in a PNG is .. nothing
21:26:52 <TrueBrain> but the second image shows that is in fact near-black
21:27:06 <TrueBrain> so I never understood how to read that first image
21:27:33 <frosch123> the image contains linebreaks to separate blocks
21:27:33 <glx> basically all the white is padding
21:27:43 <TrueBrain> frosch123: owh wow ...
21:27:47 <TrueBrain> THAT I never got from it
21:27:47 <frosch123> index 0 is on row 1, index 1 is on row 1
21:28:01 <TrueBrain> that .. is an interesting way of showing things
21:28:10 <glx> and the only white in the palette is 255
21:28:42 <glx> oh and 1F should be white too I think
21:29:10 <TrueBrain> so for my understanding .. "water cycle" .. that isn't just a single pixel colour? Why are there so many? :P
21:30:16 <glx> water cycle are rotated, so a single pixel will get all these one at a time
21:30:17 <frosch123> if there was only a single water color, than all water tiles would be a single color
21:30:21 <frosch123> but you have a texture
21:30:37 <frosch123> you have N water colors to draw a texture, and those colors are then animated
21:30:40 *** sla_ro|master has quit IRC ()
21:30:42 <TrueBrain> owh, I assumed it internally remapped
21:30:59 <TrueBrain> but the index is also the remap
21:31:16 <glx> index is fixed, palette is changed on the fly
21:31:16 <TrueBrain> you keep saying that, like I have any means to run Java
21:31:19 <andythenorth> I only looked away for 10 mins :(
21:31:31 <frosch123> yeah, it's funnily hard to run java :)
21:31:39 <glx> hence the name, palette animation :)
21:31:41 <TrueBrain> not even attempting it ;)
21:31:51 <frosch123> such a failed language... it does not achieve it's primary goal
21:32:09 <TrueBrain> glx: yeah, you can say it like that. But most games have an internal remapping matrix, where a single index is changing colour
21:32:15 <TrueBrain> so water would only use 1 index
21:32:52 <TrueBrain> but here we now seemly have that the remapping is also in the same image :P
21:32:54 <glx> that's used for blinking lights I think
21:32:57 <TrueBrain> at least, that is how I read you
21:33:43 <TrueBrain> frosch123: what does __ mean in your XML? Transparent?
21:34:01 <TrueBrain> and what does that mean in this context?
21:34:03 <frosch123> "do not remap this color"
21:34:39 <TrueBrain> so for Bridge Recoloring, do I understand it correct that for sprite 796 it changes index 46 into the same colour as on index 68?
21:35:51 <frosch123> yes, all pixels with color 0x46 in the source are drawn as color 0x68
21:35:54 <glx> as a simple example you can look at "red cycle", it's only 2 colors, if you draw a pixel using the black, and next to it another pixel using the red, they will alternate during animation
21:36:36 <TrueBrain> " green" is a bit weird :P
21:36:54 <TrueBrain> 50 -> 52, 51 -> 53, till 54 .. which is CE :P
21:37:37 <frosch123> that is second company color :p
21:37:51 <TrueBrain> First has the same?
21:38:02 <TrueBrain> well, for a given sprite, ofc
21:38:12 <TrueBrain> as this world could use a bit more complexity :P
21:38:16 <frosch123> first cc has "dark blue" as "identity"
21:38:36 <TrueBrain> owh, yeah, indices are different
21:38:43 <frosch123> while second cc is just some range ttdp people considered "noone needs this in their sprites"
21:38:56 <TrueBrain> nobody needs green :D
21:39:06 <TrueBrain> the "sprite" in your XML, what is the exact meaning?
21:39:20 <frosch123> spriteid inside ottd
21:39:35 <glx> mainly because there are 3 different green ranges
21:39:40 <frosch123> spriteid in trgt1.grf or whatever it's called
21:40:02 <TrueBrain> what is that relation to the palette?
21:40:03 <TrueBrain> or is the remap in that sprite?
21:40:24 <TrueBrain> I keep forgetting "sprites" is loosely used :P
21:40:26 <frosch123> yes, recolorings are stored as "sprite"
21:40:37 <glx> actions are sprites too :)
21:40:43 *** EER has quit IRC (Remote host closed the connection)
21:40:46 <frosch123> and original mapgen templates
21:40:56 <TrueBrain> do industries have a single primary/secondary colour?
21:41:04 <TrueBrain> or can they actually change?
21:41:46 <frosch123> industries have the "first company color", which is choosen randomly by default on construction
21:42:07 <frosch123> andy prefers to modify that "randomness" to exclude colors he doesn't like
21:42:19 <frosch123> andy likes to discriminate colors
21:42:24 <TrueBrain> PALETTE_TO_STRUCT_BLUE, can that be set for industries?
21:42:46 <glx> STRUCT means builtding here I think
21:42:52 <frosch123> in the spritelayout you can specify any recoloring, including custom ones defined by the grf
21:43:06 <frosch123> but realistically, it's enough to only offer the company colors
21:43:19 * andythenorth considers using 256 fixed colours from a 32 bit palette
21:43:28 <frosch123> the other "bridge" and "church" recolorings are stupid crap, noone uses
21:43:43 <andythenorth> don't forget the important pink!
21:43:49 <andythenorth> the pink is very very useful
21:43:53 <glx> and there's crash palette, for the greyscale
21:43:59 <peter1138> I had a patch for 32 bit palette remaps somewhere.
21:44:32 <frosch123> TrueBrain: the original houses use like 4 different schemes for recoloring. so i assume sf drew some buildings with some colors, and later it was decided to recolor them
21:44:32 <peter1138> (As used by RGB company colours)
21:44:37 * andythenorth would like 256 actual colours, and the animated cycles as an appendix
21:45:12 <peter1138> If you can have different remaps when using overlays I guess you could do that.
21:45:20 <glx> oh and of course it's also possible to define custom recoloring
21:46:00 <TrueBrain> can I assume everyone who draws images uses the dos palette like on the page glx linked?
21:46:01 <peter1138> Oh yes, RGB palette remapping touched the blitters, and my patch is so old it does nothing beyond the base 32 bpp blitter.
21:46:09 <TrueBrain> so not that they mapped another company colour on it or something?
21:46:12 <andythenorth> there are 13 pinks, so I could remap it myself somewhat yes
21:46:18 <glx> yeah DOS palette is better, more colours
21:46:34 <TrueBrain> wasn't really my question glx ;)
21:46:43 <frosch123> TrueBrain: every smart person uses the dos palette, the win palette is only used by people who dig up 15 year old threads on the forums
21:46:44 <andythenorth> there is a legacy of people using windows because it sounds more modern
21:47:03 <TrueBrain> no no, using the D was clear .. I am asking what colour to expect in RGB :P
21:47:15 <TrueBrain> will the company remap stuff always be blue?
21:47:30 <glx> it's the index that matters
21:47:30 <TrueBrain> not that some people draw it with green, as they like that more?
21:47:37 <TrueBrain> I know, but I am still asking
21:47:58 <frosch123> yes CC will always be blue
21:48:12 <TrueBrain> okay, so I could also remap the RGB back to its index, I guess
21:48:20 <frosch123> i never saw anyone inventing their own palette to highlight CC differently
21:48:27 <TrueBrain> (mind you, is only about the copy/paste part)
21:48:35 <frosch123> i don't think you can map rgb to indices
21:48:40 <frosch123> there are duplicate colors
21:48:49 <TrueBrain> this is getting better and better :P :P
21:48:56 <TrueBrain> I appreciate the explanations btw :)
21:49:21 <glx> yeah the fun is in some water blue
21:49:56 <glx> opengfx had some animated snow due to that
21:50:04 <TrueBrain> okay, so I have to read the pngs as 8bpp .. okay, that should be possible
21:50:10 <frosch123> with "duplicates" i mean: same color, different indicies, one normal, the other in CC range or animated or something
21:50:38 <andythenorth> afaik the colours are unique apart from the pink
21:50:55 <andythenorth> I have done a lot of find and replace, I'm not aware of any actual colours with overlapping rgb
21:53:17 <TrueBrain> even 0F is not the same as FF
21:54:34 <dP> I have 32bpp remaps in cmclient but it's quite a hack
21:55:36 <TrueBrain> some colours are terribly close .. but a quick look indeed suggests there are no actual duplicates, except for the pink
21:56:14 <TrueBrain> 34 and 44 mostly are really close
21:57:32 <TrueBrain> why mainly that would be useful, as that would mean drawing on a canvas doesn't require shadow-bookkeeping for the actual index
21:57:35 <DorpsGek> [OpenTTD/OpenTTD] LC-Zorg opened issue #9697: [Bug]: Nonsensically wide Online Players window that cannot be reduced https://git.io/J1TkZ
21:57:40 <TrueBrain> but I can just convert the 32bpp back to the 8bpp
21:57:48 <frosch123> water cycle contains duplicates
21:58:46 <frosch123> most of the animated colors use duplicates
21:59:06 <glx> it's to introduce a delay
21:59:43 <TrueBrain> hmm .. colour picker doesn't show me any; happen to have indexes of two that are the same? Not disagreeing with you btw, just want to have an idea of how bad it is :)
22:00:59 <frosch123> 0xFC6C00 for a color that appears both in regular palette and fire cycle
22:01:01 <TrueBrain> so here is where the image glx linked differs, I guess?
22:02:03 <frosch123> i remember that grfcodec assigned different rgb colors to the pink values to make them unique
22:02:12 <frosch123> it's also possible that they altered the water colors
22:02:29 <TrueBrain> so those images aren't the exact colour as you see them in-game
22:02:29 <frosch123> so glx' image may differ from the actual colors in-game
22:02:59 <TrueBrain> "245, 0, 245, 246, 0, 246, 247, 0, 247,"
22:03:00 <frosch123> N people copied the palette from N places
22:03:11 <TrueBrain> sounds like pink isn't as pink :P
22:03:17 <TrueBrain> so no, NML uses different pinks
22:03:42 <frosch123> dos ttd uses 6-bit vga palette, while win ttd uses 8-bit super-vga palette
22:03:55 <frosch123> grfcodec and specs copy from all over the place
22:04:00 <frosch123> i would not trust nml either :p
22:04:10 <frosch123> pretty sure i copied mine from ottd
22:04:13 <TrueBrain> and we should trust your java thingy? :P :P
22:07:09 <TrueBrain> okay .. so lets go with that. It doesn't have to be exact; so that is fine I think
22:07:14 <TrueBrain> at least makes things a lot easier to deal with
22:08:24 <TrueBrain> hmm .. now for sprite-sorting ..
22:09:21 <TrueBrain> in-game has duplicated colours
22:10:45 <TrueBrain> owh, right, some silly stuff about bounding boxes etc
22:10:47 <TrueBrain> I forgot about that ..
22:10:55 <TrueBrain> well, suppressed, more correctly
22:11:07 <TrueBrain> I believe I could just forget about the "sharing bounding boxes"
22:11:21 <frosch123> forgetting about bounding boxes is not the worst thing :)
22:11:41 <TrueBrain> that is my next question .. do I need them for industries at all
22:12:07 <frosch123> you need one "building height" value
22:12:15 <frosch123> the rest you can enforce
22:12:32 <glx> at least it's simpler than vehicles or stations
22:12:42 <frosch123> 1 ground sprite, 1 bounding box from <0,0,0> to <16,16,Z>
22:13:43 <DorpsGek> [OpenTTD/OpenTTD] James103 commented on issue #9697: [Bug]: Nonsensically wide Online Players window that cannot be reduced https://git.io/J1TkZ
22:13:49 <TrueBrain> I have to say, still don't really get bounding boxes .. but okay, for now, I can park that
22:13:56 <TrueBrain> guess that brings me back to where I ran away last time ... realsprites
22:14:08 <frosch123> it was wrong to expose bounding boxes in newgrf
22:14:19 <TrueBrain> okay, that I like to hear
22:14:24 <TrueBrain> as that means I can do away with them :D
22:14:32 <glx> it's used for sprite sorting but everything can easily go wrong
22:14:43 <frosch123> building needs 1 bounding boxes, stations need 2 (one in front of the train, one behind it)
22:15:00 <frosch123> in both cases the grf compiler can enforce a fixed spritelayout
22:15:04 <frosch123> no need to expose it to the user
22:15:11 <TrueBrain> and sprite offsets ..
22:15:33 <frosch123> the "height" thingie is only needed, if you want to allow building bridges over the thing, which is only possible for objects at the moment
22:16:28 <glx> for tiles, offset can be 0,0,0
22:16:28 <TrueBrain> so fixing that for industries for now will be plenty?
22:18:02 <frosch123> what sprite offset do you mean?
22:18:03 <andythenorth> nobody gets bounding boxes :P
22:18:10 <frosch123> the one from the layout, or the one from the sprite itself
22:18:17 <TrueBrain> owh, that is in the layout ofc
22:19:07 <frosch123> reference positon for the sprites is the back-corner of the bounding box. so, if you enforce the standard bounding box layout, it is the north corner of the ground sprite
22:19:32 <TrueBrain> yeah, I was looking at some tiles that were of different width/height
22:19:42 <TrueBrain> so you need something to tell where it is in relation to the groundsprite
22:20:38 <frosch123> yes, but that is the offset in the sprite, not in the layout
22:20:44 <glx> smart people just draw the building in the right position to not need to use offset in the layout :)
22:21:09 <TrueBrain> "right position" is pretty relative ;)
22:21:39 <TrueBrain> ah, realsprites has xrel/yrel .. guess that is what I am looking for
22:22:18 <glx> well you take the ground sprite and draw over it, and then use the same cropping position
22:22:55 <TrueBrain> you still need something to tell where the same point on a tile is for every sprite ;)
22:23:12 <TrueBrain> otherwise you can never draw something sticking out on the left on one sprite, and on the right on another :)
22:23:23 <TrueBrain> but xrel/yrel seems to fit that bill fine
22:24:08 <TrueBrain> so we have sprites with a fixed "center", those are mapped on tiles with a fixed bounding box, which are mapped in industry layouts which tell what tile goes where
22:24:14 <frosch123> yes, on flat terrain xrel/yrel describe the position relative to the north corner
22:24:34 <TrueBrain> and we should use a single tile-id for each industry, right?
22:24:38 <TrueBrain> and use an action-chain to find the correct sprite
22:25:15 <glx> multiple id is possible too
22:25:19 <DorpsGek> [OpenTTD/OpenTTD] LC-Zorg commented on issue #9697: [Bug]: Nonsensically wide Online Players window that cannot be reduced https://git.io/J1TkZ
22:25:34 <TrueBrain> possible, sure, but I believe last time someone suggested to me it is better not to :P
22:25:35 <glx> original industries use multiple tile id
22:25:52 <TrueBrain> I do not really care what is possible .. I care more what is the best to do for TrueGRF :)
22:25:56 <glx> but yes the number of id is limited IIRC
22:26:11 <glx> so when possible it's better to reuse them
22:26:14 <TrueBrain> similar to: do not use RandomAction2 :P
22:26:23 <TrueBrain> so tnx for this whole circle glx ;)
22:26:43 <frosch123> you have a limit of 256 industry tiles and 128 industries
22:27:09 <frosch123> people tend to max-out the number of industry types, so would only have 2 tile ids per industry
22:27:27 <TrueBrain> well, if they all have the same bounding box, I guess that is simple enough :P
22:27:38 <frosch123> usually it's easier to use a single tile id per industry id
22:28:08 <TrueBrain> guess that means acceptance etc should also be done in an action2 chain?
22:28:39 <frosch123> tile acceptance in a123 is broken, and only supports 32 cargos
22:28:59 <frosch123> you should set the "tile accepts all cargos the industry accepts" flag, and not bother with further details
22:29:33 <glx> different acceptance for each tile is annoying for the player anyway
22:29:37 <TrueBrain> and production is also done from the industry, so only makes sense, I guess :)
22:30:06 <glx> I'm thinking about you refinery
22:30:13 <TrueBrain> okay .. so that really brings me back to: I need to learn how to encode PNGs into RealSprites .. ugh :P
22:30:29 <TrueBrain> owh, yeah .. zoom-levels
22:30:30 <frosch123> maybe it makes sense to split "tiles with animation" and "tiles without animation" into different tileids
22:31:09 <frosch123> if you care about zoom levels, you have to learn about inter-zoom-level alignment :)
22:31:21 <TrueBrain> and .. I stopped caring completely!
22:31:47 <TrueBrain> I remember looking at how it was encoded last time, and I just ... ugh .. well, guess that would be the first thing to tackle :)
22:31:56 <TrueBrain> I only have to implement 1 method
22:32:09 <glx> yeah ignore zoom, you want to make grf easily
22:33:17 <frosch123> for encoding i recommend to look at nml, don't look at grfcodec asm-in-C :)
22:33:27 <TrueBrain> both weren't easy to look at
22:33:40 <frosch123> it's the same algorithm for both
22:33:51 <TrueBrain> I assumed as much :P
22:33:57 <TrueBrain> just weird and annoying code :D
22:33:58 <frosch123> nml has it twice: pure python, and C acceleration module
22:34:33 <TrueBrain> and I have to learn how to do action-chains again .. I kinda forgot .. I think I had boilerplate code for it now :P
22:35:25 <dP> When I needed to encode sprites I just ignored tile compression and decided just a lz77 is good enough xD
22:35:42 <frosch123> 1/4 of the nml source is the gpl copyright header :p
22:36:10 <frosch123> why does cmclient have a grf encoder?
22:36:20 <frosch123> do you submit player avatars or something?
22:36:34 <dP> no, that's how I make grfs now :p
22:36:58 <dP> at some point I decided that writing nml is a redundant step for going from python to grf xD
22:38:07 <dP> TrueBrain, yeah, you can ignore the whole thing, at least for starters
22:39:08 <TrueBrain> and it is nothing against the Python btw .. just a lot of byte-messing-around
22:39:43 <frosch123> yes, you can ignore it, it only affects filesize, nothing in-game, not even memory-usage in-game
22:39:44 <TrueBrain> I like that NML just tries both, and picks the smallest ..that is nice
22:40:46 <frosch123> and unless you do 32bpp zoomed sprites, newgrf tend to have more "code sprites" than "graphics sprites"
22:40:57 <frosch123> so saving filesize via graphics does not work either
22:41:53 <TrueBrain> so do I get it right that industry layouts are basically twice in the NewGRF .. once in the industry layout, and once in an action2-chain to pick the right sprite?
22:42:26 <andythenorth> that's the convention ytes
22:43:15 <TrueBrain> so I first need to do var62 to get the industry, var44 on that industry, and combine that with var43 to get the correct sprite
22:43:51 <glx> hmm I think nml just skips this part
22:44:09 <frosch123> you wanted to do one tile per industry, not one tile for all industries
22:44:31 <TrueBrain> per industry, or per industry layout?
22:44:46 <TrueBrain> var44 shows me the layout in use .. I first need that, not?
22:45:32 <frosch123> i can't follow when you mean tile variable and when you mean industry variables
22:45:48 *** virtualrandomnumber has joined #openttd
22:45:58 <frosch123> industry44 is layout, you need that
22:46:13 <frosch123> tile43 is position in layout, you need that
22:46:27 <TrueBrain> I can just get var44 from a callback in industry tiles?
22:46:47 <TrueBrain> lol; okay, so I can skip the var62 :P
22:47:12 <TrueBrain> owh, related object
22:47:26 <TrueBrain> and didn't find a reference to it
22:47:27 <frosch123> no idea what you had in mind with tile62
22:47:46 <TrueBrain> expecting that I understand 10% of this is silly
22:48:01 <TrueBrain> okay, so with related objects, I can just request anything I like from that object too
22:48:28 <frosch123> TrueBrain: 100% of people who understand grf learned that by writing grf generators :p
22:48:40 <TrueBrain> don't make me regret this :P
22:48:41 <glx> yes, but you have to chain varact2
22:49:13 <TrueBrain> I have no clue what point you try to make there glx :)
22:49:15 <frosch123> glx: i don't think tb is at advanced va2 yet :)
22:49:27 <frosch123> just plain switch on single variable
22:49:44 <TrueBrain> I have some boilerplate for advanced var2!
22:50:11 <TrueBrain> its ugly as fuck :P
22:50:38 <andythenorth> I see no ugly here
22:51:30 <glx> oh right you can check var44 of related then switch to the right block which will test var43 of tile to decide which tile layout to finally return
22:51:49 <TrueBrain> it will be a 3-deep nested switch
22:52:50 <TrueBrain> I mostly worry about the foundation and slope stuff .. but that is not for 1.0 :D
22:54:32 <TrueBrain> okay, so that are a lot of moving pieces at once to see if I made any mistake with any of them :P
22:54:37 <TrueBrain> I wonder if I can do shortcuts for now ..
22:55:06 <TrueBrain> using existing sprites works, I guess
22:56:11 <frosch123> baseset sprites are a trap :p
22:56:21 <frosch123> they all use different alignment and other magic
22:56:24 <TrueBrain> yeah, but at least I can make sure my action-chain-thingy works
22:56:25 <glx> I used baseset sprites to test the stations implementation
22:56:42 <TrueBrain> or .. hmm .. no, lets start with RealSprites
22:56:56 <glx> and the values from openttd
22:56:57 <frosch123> copy firs sprites, like everyone does
22:57:11 <TrueBrain> haha, yeah, I am not going to draw any actual sprites :P
22:57:16 <frosch123> 99% of industry newgrf are forks of firs, so it makes sense to add them as default to truegrf :p
22:58:04 <glx> and nobody understands how firs is build (not even andy I think)
22:58:59 <frosch123> that may be andy's self-protection instinct
22:59:59 <andythenorth> I understand most of it
22:59:59 <glx> CHIPS is even harder to understand
23:00:18 <TrueBrain> luckily enough, I don't care :P
23:00:39 <TrueBrain> right, now first some zzz
23:00:44 <TrueBrain> we will see tomorrow if any of this stuck
23:00:50 <glx> I had to, I converted a station from it as an example for NML
23:00:50 <andythenorth> tomorrow arrives soon!
23:00:54 * andythenorth must to sleep :)
23:01:02 *** andythenorth has quit IRC (Quit: andythenorth)
23:02:22 <glx> so now it's easy to have blinking cows :)
23:15:17 *** virtualrandomnumber has quit IRC (Quit: virtualrandomnumber)
23:16:56 *** frosch123 has quit IRC (Quit: be yourself, except: if you have the opportunity to be a unicorn, then be a unicorn)
23:30:41 <FLHerne> When the docs say e.g. > first byte of a new industry layout is FEh
23:30:54 <FLHerne> Is the 'h' just signifying hexadecimal?
23:31:16 <FLHerne> I was expecting it to be much more confusing
23:31:56 <glx> most of the time the doc use hexadecimal without even indicating it
23:38:43 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
23:44:44 *** dwfreed has joined #openttd
continue to next day ⏵