Config
Log for #openttd on 3rd September 2018:
Times are UTC Toggle Colours
00:02:28  <peter1138> Why don't you test it if you don't understand?
00:17:57  <Samu_> im trying to test it right now
00:20:48  <Samu_> i don't really understand what's happening under the hood in an array
00:21:33  <Samu_> it's still keeping track of the correct number of m_townRouteArray
00:21:42  <Samu_> just not on the current for cycle
00:21:46  <Samu_> but on the next
00:22:29  <Samu_> I could probably say that "it werks"
00:22:47  <Samu_> does what I want it to do
00:23:03  <Samu_> remove dead routes from the array
00:34:10  *** KouDy has quit IRC
00:34:42  <Samu_> ok enough coding for today, I'm off to bed
00:49:35  *** Samu_ has quit IRC
01:40:36  *** mloc has quit IRC
02:38:12  *** Flygon has joined #openttd
03:29:56  *** KouDy has joined #openttd
03:35:42  *** haudrauf has quit IRC
03:37:08  *** haudrauf has joined #openttd
04:57:35  *** Wacko1976 has joined #openttd
05:08:03  *** nielsm has joined #openttd
05:08:43  *** APTX| has quit IRC
05:09:46  *** APTX has joined #openttd
05:17:45  *** agentw4b has quit IRC
05:38:17  *** Wacko1976 has quit IRC
05:41:46  *** nielsm has quit IRC
05:51:31  *** Supercheese has joined #openttd
06:42:14  *** KouDy has quit IRC
06:44:10  *** KouDy has joined #openttd
06:58:52  *** sla_ro|master has joined #openttd
07:23:34  *** Supercheese has quit IRC
07:23:55  *** Supercheese has joined #openttd
07:23:59  *** Samu has joined #openttd
07:43:07  *** andythenorth has joined #openttd
07:43:10  *** andythenorth has left #openttd
07:49:23  <Samu> testing a bunch of LuDIAI Afterfix's with is_friendly turned on, let's see if they build stations far from each other as I intended
08:45:09  *** Supercheese has quit IRC
08:55:31  <DorpsGek_II> [OpenTTD/OpenTTD] ghisvail commented on issue #6873: Jukebox not working in the flatpak version https://github.com/OpenTTD/OpenTTD/issues/6873#issuecomment-418047892
08:57:49  <peter1138> Samu, so while you are iterating an array, you usually can't remove items from the same array.
08:58:42  <peter1138> The usual method is to iterate the array and add the indices of the items you want to delete to second array. They you go through that array, removing from the first array, and then just clear the 2nd array.
08:59:13  <peter1138> There may be other simpler methods though, I'm not familiar with sq.
09:35:31  *** Progman has joined #openttd
09:37:00  <milek7_> maybe usual interating from end?
09:46:39  <Samu> oh, hi
09:46:42  <Samu> i fell asleep
09:47:08  <Samu> iterate from the end to the beginning?
09:49:30  <Samu> indexes are from 0 to 10, so if i start from 10 to 0 and i find that 6 is to be removed, I remove 6, and it can still iterate to the previous one, without issue?
09:50:55  <Samu> milek7_:
09:53:52  <Samu> for (local i = routeManager.m_townRouteArray.len() - 1; i >= 0, --i) {
09:53:55  <Samu> like this?
09:56:09  <Samu> or do as peter1138 say, but what if I find multiple indexes how exactly would that work
09:58:36  <peter1138> I guess the remove would be simpler in reverse as well.
10:01:47  <Samu> ok, thx will test anyway
10:26:40  *** KouDy has quit IRC
10:38:06  *** HerzogDeXtEr has joined #openttd
11:30:11  *** KouDy has joined #openttd
12:10:02  *** chomwitt has joined #openttd
12:19:33  *** andythenorth has joined #openttd
12:19:35  <andythenorth> o/
12:21:13  <Samu> Just medled with the TownManager.nut for the first time
12:21:58  <Samu> trying to understand how LuDi code handles town pairs like they're just 1 entity
12:26:41  *** Laedek has joined #openttd
12:43:44  <andythenorth> @seen danmack
12:43:45  <DorpsGek> andythenorth: danmack was last seen in #openttd 2 weeks, 5 days, 18 hours, 21 minutes, and 22 seconds ago: <DanMacK> LOL
13:24:42  *** KouDy has quit IRC
13:44:55  <Samu> peter1138: https://paste.openttdcoop.org/pwp2v1qoc
13:44:57  <Samu> lines 2-7
13:45:00  <Samu> is that ok?
13:45:11  <Samu> or milek7_
13:46:14  *** nielsm has joined #openttd
14:01:43  *** Wacko1976 has joined #openttd
14:33:08  *** KouDy has joined #openttd
14:44:44  *** KouDy has quit IRC
15:01:46  *** sla_ro|master has quit IRC
15:19:51  *** andythenorth has quit IRC
15:29:01  *** WWacko1976-work has quit IRC
15:29:33  *** andythenorth has joined #openttd
15:37:57  <Samu> I'm having trouble with && and || again grr
15:39:56  <nielsm> ah got a build working on fedora linux, and even music playback via extmidi/timidity
15:40:28  <nielsm> (I'm not impressed with the quality of freepats, they sound strange)
15:42:52  <peter1138> Samu, && = and, || = or. Nothing tricky about them.
15:42:58  *** Wormnest has joined #openttd
15:43:21  <Samu> HALP https://paste.openttdcoop.org/pgbxqhdnq trying to simplify it
15:43:55  <peter1138> && - both sides need to be true, || - either side (or both) can be true
15:44:29  <peter1138> when mixing && and || you NEED to use extra parenthesis
15:46:06  <peter1138> And also why do you test for IsStationTile on both sides of the or?
15:46:18  <Samu> because i am failing to simplify it
15:46:21  <Samu> i see wrong behaviour
15:46:43  <peter1138> I can't really decipher what you are intending to test for.
15:47:08  <peter1138> Ah, there's a comment :p
15:47:28  <peter1138> So...
15:47:37  <nielsm> start by splitting it into multiple statements
15:47:49  <nielsm> if (!AITile.IsStationTile(tile)) continue;
15:48:02  <nielsm> (don't do further checks if it isn't a station tile)
15:48:27  <nielsm> if (AITile.GetOwner(tile) != AICompany.ResolveCompanyID(AICompany.COMPANY_SELF)) return true;
15:48:46  <Samu> oki
15:48:47  <nielsm> (condition fulfilled if it's someone else's station)
15:49:01  <nielsm> if (AITile.GetOwner(tile) == AICompany.ResolveCompanyID(AICompany.COMPANY_SELF) && !AIStation.HasStationType(AIStation.GetStationID(tile), AIStation.STATION_AIRPORT)) return true;
15:49:28  <nielsm> you really don't need to combine everything into a single huge conditional, it just becomes harder to read
15:50:31  <nielsm> anyway, I need to debug the midi playback on non-windows because it can play the DOS version music (mpsmidi/catmidi) now but not the windows version music (smf .gm files)
15:51:06  <nielsm> I think I uncovered some time ago it does some wrong path manipulation somewhere
15:53:11  <Samu> gonna try this
15:53:14  <Samu>             if (AITile.IsStationTile(tile) && (AITile.GetOwner(tile) != AICompany.ResolveCompanyID(AICompany.COMPANY_SELF) || !AIStation.HasStationType(AIStation.GetStationID(tile), AIStation.STATION_AIRPORT))) {
15:53:20  <Samu> if it still fails I'll do the split
15:54:53  <andythenorth> so did we finish 16 cargos in/out? o_O
15:55:03  <andythenorth> or did we get caught up on spec agony?
15:56:46  <nielsm> nobody's discussing the spec
15:57:02  <nielsm> the only thing I'm waiting on before calling it done is that all aspects of it actually get tested
16:00:40  *** KouDy has joined #openttd
16:01:52  <andythenorth> ok so if iirc, I/someone needs to patch nml for updated prop 28
16:01:57  <andythenorth> https://github.com/OpenTTD/OpenTTD/pull/6867#issuecomment-412638554
16:03:07  <Samu> If I am a friendly AI that builds bus stations and airports and I'm looking for a place to place my bus station, I don't want to place it near any of my competitors, or near my other bus stations
16:03:25  <Samu> but i could place near my airports
16:04:27  <Samu> that thing returning true means the place is bad
16:05:23  <Samu> is that actually doing what I ask'
16:11:14  *** frosch123 has joined #openttd
16:32:40  *** Wacko1976 has quit IRC
16:37:28  *** andythenorth has quit IRC
16:41:32  *** sla_ro|master has joined #openttd
16:53:20  *** Flygon has quit IRC
16:55:47  *** Gja has joined #openttd
16:58:24  <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh opened pull request #6889: MIDI search path fixes https://github.com/OpenTTD/OpenTTD/pull/6889
16:58:56  *** gelignite has joined #openttd
16:59:57  *** Wacko1976 has joined #openttd
17:09:24  *** Wolf01 has joined #openttd
17:10:06  <Wolf01> o/
17:13:03  *** GroovyNoodle has joined #openttd
17:18:35  *** andythenorth has joined #openttd
17:19:25  *** Compu has joined #openttd
17:28:27  *** Wacko1976 has quit IRC
17:35:49  <andythenorth> on my holiday
17:35:51  <andythenorth> I read a book
17:38:10  *** gelignite has quit IRC
17:40:47  <Wolf01> I said: 4 holiday weeks, I'll start to read the neverending story... never started
17:41:49  <andythenorth> my book was about trains :P
17:44:18  *** Wacko1976 has joined #openttd
17:46:24  *** gelignite has joined #openttd
18:06:52  *** tokai|noir has joined #openttd
18:06:52  *** ChanServ sets mode: +v tokai|noir
18:06:53  *** slahhc has joined #openttd
18:11:53  <Samu> 						if (AITile.IsStationTile(t) && (AITile.GetOwner(t) != AICompany.ResolveCompanyID(AICompany.COMPANY_SELF) || !AIStation.HasStationType(AIStation.GetStationID(tile), LuDiAIAfterFix.cargoClass == AICargo.CC_PASSENGERS ? AIStation.STATION_BUS_STOP))) {
18:11:58  <Samu> big line
18:12:18  <Samu> now for the case of airport
18:13:16  <Samu> looking for a place to place my airport, i don't want to place it near any of my competitors, or near my other airports
18:13:22  <Samu> should work
18:13:51  <Samu> getStationID(t)
18:13:52  *** tokai has quit IRC
18:13:53  <Samu> must fix
18:16:25  <Samu> oops
18:16:28  <Samu> if (AITile.IsStationTile(t) && (AITile.GetOwner(t) != AICompany.ResolveCompanyID(AICompany.COMPANY_SELF) || !AIStation.HasStationType(AIStation.GetStationID(t), LuDiAIAfterFix.cargoClass == AICargo.CC_PASSENGERS ? AIStation.STATION_BUS_STOP : AIStation.STATION_TRUCK_STOP))) {
18:16:32  <Samu> fixed
18:16:59  <Samu> it needed to be bigger!
18:17:23  <slahhc> chater
18:18:48  <slahhc> who are you talking to?
18:19:21  <Wolf01> Noone, he writes here what he does
18:19:54  <Samu> yes... sorry
18:20:01  <Wolf01> Teddy bear programming, but with the whole chatroom
18:20:33  <slahhc> whats the code to get infinit money?
18:20:40  *** Thedarkb has joined #openttd
18:20:51  <Wolf01> Ctrl+shift+C or some other weird combination
18:23:12  <slahhc> im not chating with you anymore
18:25:06  <Samu> testing AI vs AI, I see nearly 0 airports, seems that it's a bit too friendly, they null each other the chances of building an airport
18:25:16  <Samu> :(
18:26:25  <Samu> i want it to behave friendly, but not too friendly :( how am I reach mid-term ?
18:28:02  <nielsm> build up an anger-meter and when it passes some threshold relieve some anger by being unfriendly
18:29:13  <slahhc> you need the AI to let the player think hes got a chance of making it, you need to find the sweet spot for maximizing human frustration
18:30:55  <slahhc> that always makes them come back for more
18:30:58  <Samu> i coult try checking how much is produced by the town
18:31:06  <Samu> and how much is being transported
18:35:27  *** slahhc has quit IRC
18:38:47  <Samu> the way the code is written, it feels like LuDiAI had more than 1 coder even before me
18:49:00  *** Thedarkb has quit IRC
18:49:32  *** Wacko1976 has quit IRC
19:00:53  *** Thedarkb has joined #openttd
19:14:35  *** Thedarkb has quit IRC
19:16:48  *** Gja has quit IRC
19:27:56  *** ToBeFree has joined #openttd
19:32:09  *** ToBeFree has quit IRC
19:47:20  *** gelignite has quit IRC
19:57:06  <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh merged pull request #6889: MIDI search path fixes https://github.com/OpenTTD/OpenTTD/pull/6889
19:57:07  <DorpsGek_II> [OpenTTD/OpenTTD] nielsmh pushed 2 commits to master:
19:57:07  <DorpsGek_II>   - Fix: Check the search paths for standard MIDI files (by nielsmh)
19:57:08  <DorpsGek_II>   - Fix: Better "temp" path for decoded MPSMIDI files when source filename has no path separators (by nielsmh)
19:57:08  <DorpsGek_II> https://github.com/OpenTTD/OpenTTD/compare/4b0b4e06435b...bb086f92403a
19:57:30  <andythenorth> :)
19:57:51  <nielsm> https://0x0.st/svAz.png  <- who will get number 23000 ?
19:58:08  <nielsm> and how insignificant will it be? :D
20:03:52  <andythenorth> oooo
20:04:09  *** HerzogDeXtEr has quit IRC
20:04:33  *** KouDy has quit IRC
20:14:56  *** sla_ro|master has quit IRC
20:17:46  *** KouDy has joined #openttd
20:20:41  *** GroovyNoodle has quit IRC
20:28:53  <Samu> testing another way to decide wether to build airports
20:29:04  <Samu> if (AITile.IsStationTile(t) && (AIStation.HasStationType(AIStation.GetStationID(t), AIStation.STATION_AIRPORT) || AITile.GetOwner(tile) != AICompany.ResolveCompanyID(AICompany.COMPANY_SELF) && AIController.GetSetting("is_friendly"))) {
20:29:32  <Samu> 					    nearby_station = true;
20:30:01  <Samu> oopps
20:30:20  <Samu> AITile.GetOwner(t), not tile
20:42:23  *** nielsm has quit IRC
20:46:41  <Wolf01> 'night
20:46:55  *** Wolf01 has quit IRC
20:57:33  *** andythenorth has quit IRC
21:00:32  <Samu> darn it :(
21:01:04  <Samu> a station that is tile walked has influence in dictating if a station is airport
21:01:37  <Samu> no wonder I wasn't seeing many airports
21:01:46  <Samu> the ai station spreads like a cheater
21:05:01  <Samu> even if it would find a bus station in the tile, it would only check if that station had an airport even if the airport was station spreaded past the search radius :(
21:05:23  <Samu> thus would not build the airport
21:06:00  <Samu> it wasn't really checking if the tile was already belonging to an airport
21:06:07  <Samu> bah, what can I do :(
21:09:12  <Samu> i've been doing this wrong all along
21:11:30  *** frosch123 has quit IRC
21:21:21  <Samu> this is gonna be much harder to do for road station tiles than airport tiles
21:21:42  <Samu> but at least I got an idea how to solve this issue
21:26:32  *** Thedarkb has joined #openttd
21:54:11  *** glx has joined #openttd
21:54:11  *** ChanServ sets mode: +v glx
22:10:18  *** Wormnest has quit IRC
22:13:11  *** Wacko1976 has joined #openttd
22:27:08  <Samu> testing... https://paste.openttdcoop.org/pgyu8bbk8
22:28:49  <Samu> and for the airport case:
22:28:51  <Samu> if (AITile.IsStationTile(t) && (AIAirport.IsAirportTile(t) || AITile.GetOwner(t) != AICompany.ResolveCompanyID(AICompany.COMPANY_SELF) && AIController.GetSetting("is_friendly"))) {
22:28:55  <Samu> just 1 line
22:29:18  <Samu> together, i shall see more airports, I hope
22:29:25  *** Wacko1976 has quit IRC
22:31:59  *** sim-al2 has quit IRC
22:44:40  *** Thedarkb has quit IRC
22:50:33  *** Progman has quit IRC

Powered by YARRSTE version: svn-trunk