IRC logs for #openttd on OFTC at 2024-08-16
⏴ go to previous day
02:18:19 *** debdog has quit IRC (Ping timeout: 480 seconds)
02:54:54 *** gnu_jj_ has quit IRC (Ping timeout: 480 seconds)
04:42:58 <DorpsGek> - Update: Translations from eints (by translators)
05:53:09 *** SigHunter_ has joined #openttd
05:55:41 *** SigHunter has quit IRC (Ping timeout: 480 seconds)
05:57:48 *** SigHunter_ has quit IRC (Remote host closed the connection)
05:58:49 *** SigHunter has joined #openttd
07:08:19 <peter1138> locosage: grf-py/grf/sprites.py:52 seems like it might be wrong. image vs img
07:41:14 <locosage> I'll fix it when I get to pc
13:58:28 *** HerzogDeXtEr has joined #openttd
14:42:50 *** miloje357 has joined #openttd
14:54:09 *** miloje357 has quit IRC (Quit: Page closed)
15:45:29 *** Ox7C5 has quit IRC (Ping timeout: 480 seconds)
16:11:00 *** APTX has quit IRC (Ping timeout: 480 seconds)
16:29:31 *** PietroBR has joined #openttd
16:34:37 <PietroBR> Feature suggestion: 'Load cargo (ignore own transfers)' for when, for example, you want a train to transfer cargo to a station and load other transferred cargo that's in that station, ignoring what it transferred.
16:38:53 <_pruple> sounds like you want to turn on cargodist
16:49:54 <_pruple> settings > environment > cargo distribution, change the distribution modes
16:58:21 <PietroBR> Alright, now what do I do to have cargo going back and forth? I've tried setting the busses in both towns to transfer only TO the station, and the train connecting the towns to transfer at both stations, but that didn't work
16:59:04 <_pruple> if cargodist is on you don't need transfer orders, it all happens semi-magically
17:00:40 *** emperorjake has joined #openttd
17:00:44 *** D-HUND is now known as debdog
17:01:03 <emperorjake> don't know how well that translates into IRC 🙂
17:01:42 <PietroBR> Oh this feature is gonna revolutionize my networks
17:11:11 *** PietroBR has quit IRC (Quit: Going offline, see ya! (www.adiirc.com))
17:27:31 *** gelignite has joined #openttd
19:10:32 <_glx_> the hole in this position also has nice effect for AIs, as it's the airport location, but it's not an airport tile
19:12:53 <_glx_> I think the search for adjacent stations exclude the airport rectangle
19:20:23 <_pruple> _glx_: I don't think most/any AIs understand newgrf airports anyway
19:20:55 <_glx_> vanilla helistation is already an issue for them, as northern tile is a hangar
19:22:49 *** Flygon has quit IRC (Read error: Connection reset by peer)
19:28:53 <peter1138> The script API for airports is pretty broken.
20:20:07 <verzide68> i was hoping i could search on how road placement works, but after i saw 2632 lines... that's not happening.
20:20:42 <talltyler> Town growth is a bit of a mess 🙂
20:22:57 <verzide68> i can't even find the scripts i need, the whole game is a mess
20:23:08 <verzide68> i type road in and it shows 30 different things
20:23:59 <verzide68> my brain is too small for it i guess
20:26:37 <talltyler> What are you trying to do? I can point you to the right file 🙂
20:26:52 <verzide68> i'm not even sure anymore
20:28:22 <verzide68> i was trying to make something like the road placement in ttd
20:28:59 <verzide68> i can't figure out how roadbits work at all
20:29:41 <verzide68> mostly because i'm too sleepy to read and comprehend it
20:39:52 <talltyler> Player-built roads or town-built roads?
20:42:24 <peter1138> What does "trying to make" mean?
20:46:16 <locosage> there are worse parts in openttd code than town growth xD
20:47:51 <verzide68> talltyler: player built
20:49:38 <verzide68> peter1138: meaning i'm trying to remake it in c# at least part of it, no reason to I've just been wanting to do it for a while
20:51:15 <peter1138> Okay, then step 1 is probably to completely ignore any code OpenTTD does, because it's all stuck with legacies and limitations...
20:51:42 <verzide68> problem is I have no idea how to do it
20:52:20 <verzide68> trust me i've tried like 3 times
20:52:34 <verzide68> i can get single type placement to work
20:53:44 <verzide68> since you have these weird things where if you drag over a straight road facing the other direction it turns into a crossroad, how am i supposed to code that in for every single road type?
20:55:12 <verzide68> if i try to do that i'd make 64 different if statements with their own checks
20:57:30 <peter1138> What are you calling a "road type" here?
20:57:43 *** HerzogDeXtEr has quit IRC (Read error: Connection reset by peer)
20:57:50 <verzide68> the 16 different options for a road tile including removing it
20:57:52 <locosage> roadbits combination I guess
20:59:06 <peter1138> Bitmasks are useful.
20:59:45 <peter1138> (Well, useful if you actually want to limit yourself to OpenTTD's road system style)
21:00:51 <peter1138> Ah yes, very clear :p
21:02:09 <locosage> well, js isn't the clearest language :p
21:02:28 <locosage> especially when you write it thinking python xD
21:03:06 <verzide68> locosage: i don't understand anything xD
21:03:58 <verzide68> this.modified = true; i wonder what the hell this does
21:04:05 <locosage> well, basically it just loops tiles of the road and adds road bits xD
21:04:32 <verzide68> dx and dy is this math or what
21:04:46 <locosage> modified is irrelevant for road building, it just marks road layout as modified in the ui
21:06:23 <verzide68> i'm falling asleep so i'll look at it tmr when i can actually understand
21:06:44 <peter1138> So in OpenTTD there are 16 possible combinations of road pieces on one tile.
21:07:56 <verzide68> peter1138: not sure how i decided that number but i'd still need to check every single tile it goes over if i do with what i know
21:07:57 <peter1138> Each road piece is represented by 1 bit in the RoadBits value.
21:08:37 <peter1138> There are only 4 different roads leading away from the centre of the tile.
21:09:27 <peter1138> If the bit for NW is set then it's a road that joins to the next tile in that direction.
21:09:54 <peter1138> if NW and NE are set then you have a curve joining the NW and NE sides.
21:10:11 <peter1138> if NW and SE are set, you have a straight piece from NW to NE.
21:10:26 <peter1138> 3 bits gives you a T junction, and all 4 bits set gives you a crossroads.
21:10:48 <peter1138> To set the state of these bits you don't need to do any math, you just need to bit-wise set or clear individual bits.
21:11:45 <peter1138> to build a long road from NW to NE spanning several tiles, you just need to take the current road piece information, set the bits for NW and NE, and write it back.
21:14:10 <peter1138> You don't need to test all sorts of combinations, you just need to set the appropriate bits. If it's already set then nothing changes.
21:14:32 <peter1138> Now, whether you should do it this way is another matter.
21:16:16 <verzide68> the goal is to make the same road management system so i don't see why not
21:16:50 <peter1138> There are of course other things to consider when you get down to it.
21:17:25 <verzide68> i decided not to do that ...
21:17:35 <verzide68> it's too complicated if i can't even do a simple road
21:18:09 <verzide68> why does a road have to be the hard part, i've spent like 5h on just that
21:19:16 <verzide68> granted it's probably my coding skill is just awful
21:21:20 <verzide68> alright thanks for the much needed help, I have to go get some sleep, goodnight.
21:22:09 *** keikoz has quit IRC (Ping timeout: 480 seconds)
21:45:27 *** tokai|noir has joined #openttd
21:45:27 *** ChanServ sets mode: +v tokai|noir
21:52:19 *** tokai has quit IRC (Ping timeout: 480 seconds)
22:10:54 *** Wolf01 has quit IRC (Quit: Once again the world is quick to bury me.)
22:27:54 *** gelignite has quit IRC (Quit: Stay safe!)
continue to next day ⏵