code logs -> 2016 -> Wed, 30 Nov 2016< code.20161129.log - code.20161201.log >
--- Log opened Wed Nov 30 00:00:30 2016
00:04
<@celticminstrel>
Okay so hopefully this works.
00:04
<@celticminstrel>
...oh right, I forgot to account for the case where there are no stairs.
00:12
<@celticminstrel>
Okay, so clearly something didn't work.
00:21 [R] [rstamer@genoce.org] has quit [Operation timed out]
00:23 [R] [rstamer@Nightstar-d7h8ki.org] has joined #code
00:23 mode/#code [+ao [R] [R]] by ChanServ
00:28 Kindamoody is now known as Kindamoody[zZz]
00:36
<@celticminstrel>
Since my log message doesn't show up, I guess the problem probably lies in the DFS to enumerate the continents...
00:57 Derakon[AFK] is now known as Derakon
01:29 Vash [Vash@Nightstar-uhn82m.ct.comcast.net] has joined #code
02:26
<@celticminstrel>
So my DFS is running too long.
02:44
<@celticminstrel>
I think I probably should've done a BFS instead.
02:44
<~Vornicus>
both should cover everything in the same time
02:45
<@celticminstrel>
Well okay.
02:47
<@celticminstrel>
It just seems like BFS would result in fewer spaces being pushed multiple times.
02:47
<@celticminstrel>
But maybe that doesn't really matter.
02:48
<~Vornicus>
You shouldn't have spaces getting pushed multiple times in the first place
02:48
<~Vornicus>
and if you are then you shouldn't *look* at them multiple times, and these both you can do by a set membership test
02:49
<@celticminstrel>
Yeah, I have a set membership test going on here.
02:49
<@celticminstrel>
Hmm, I think I'm pushing neighbours even for impassable tiles...
02:50
<@celticminstrel>
I can't actually tell easily whether a tile is passable from stepping through in the debugger.
02:51
<@celticminstrel>
Or wait, yes I can, because it won't enter that if statement if it's not.
03:05
<@celticminstrel>
Wait, when did x become negative. o.O
03:06
<@celticminstrel>
Ohhhh...
03:10
<@celticminstrel>
So it was spilling off the edge of the map because I added the neighbours of impassable tiles and didn't bound-check the coordinates.
03:13
<@celticminstrel>
Fixed that, and it's now fast enough that jumping between breakpoints around the DFS is nigh-instantaneous.
03:20
<&Derakon>
For some reason I read "BFS" as "Big Fucking Sword" instead of Breadth-First Search.
03:20
<@celticminstrel>
Heh.
03:20
<&Derakon>
And yeah, you almost always want to use BFS instead of DFS.
03:20
<@celticminstrel>
Well, it should be easy to change.
03:20
<@celticminstrel>
Mostly just change "pop" to "shift", right?
03:21
<@celticminstrel>
Maybe move the if(visited[next]) check.
03:21
<@celticminstrel>
Into the push-neighbours loop.
03:21
<&Derakon>
The general idea for a BFS is something like:
03:21
<&Derakon>
queue = [start]
03:21
<&Derakon>
visited = []
03:21
<&Derakon>
while queue:
03:21
<&Derakon>
node = queue.pop()
03:21
<&Derakon>
for neighbor in node:
03:22
<&Derakon>
if neighbor not in visited: queue.push(neighbor)
03:22
<&Derakon>
visited.push(node)
03:22
<&Derakon>
Of course you need a termination condition, and you need to track the actual path somewhere, but that's the rough idea.
03:22
<@celticminstrel>
My DFS is basically like that except a stack and check visited after popping instead of before pusing.
03:23
<@celticminstrel>
So changing it to BFS should be trivial.
03:24
<@celticminstrel>
Okay, so my A* is not removing spaces from the discovered array,.,.
03:25
<@celticminstrel>
Which will almost certainly cause it to never terminate...
03:27
<@celticminstrel>
Hmm, maybe I'm wrong on that, but it's still probably not a good thing.
03:27
<@celticminstrel>
BTW Firefox, why is there no stop button.
03:27
<&Derakon>
Hit Escape.
03:27
<@celticminstrel>
Eh? Really?
03:27
<&Derakon>
I think so.
03:28
<@celticminstrel>
That just opens the console in split-screen mode...
03:28
<@celticminstrel>
Basically if I realize it's an infinite loop I'm forced to wait until Firefox decides my script is not responding.
03:28
<&Derakon>
Ahh.
03:29
<&Derakon>
Yeah, I think Escape just stops it from loading, not from executing Javascript.
04:01
<@celticminstrel>
Not sure how to tell if the A* is working...
04:06
<&Derakon>
Make a unit test.
04:06
<&Derakon>
Set up a simple environment with some obstructions and ensure that it returns the correct path.
04:08
<@celticminstrel>
Okay, factored out the A* into a separate function. That should make this easier.
04:09
<@celticminstrel>
(Also factored out the DFS for connected components into a separate function.)
04:10
<@celticminstrel>
(Which may or may not become a BFS later.)
04:40
<@celticminstrel>
I should've made the first test a clear path instead of around a lake. >_>
04:41
<&Derakon>
Heh.
04:42
<&Derakon>
Remember to test the situation where there is no path, as well.
04:42
<@celticminstrel>
That shouldn't happen with the cost function I used though.
04:42
<&Derakon>
Ah, it's just really expensive to go through water?
04:42
<@celticminstrel>
Yeah, currently 100.
04:43
<@celticminstrel>
Other tiles are no more than 3 IIRC.
04:43
<&Derakon>
Fairynuff.
04:44
<@celticminstrel>
I feel like it should've finished by now...
04:51
<@celticminstrel>
Oh. I forgot I'd hard-coded it to pathfinding through the underground area instead of the surface.
04:55
<@celticminstrel>
(I guess in theory it could be made to pathfind across layers. Maybe I'll add that later.)
04:58
<@celticminstrel>
It does seem like it's working for very simple paths, but I'm not seeing the output (it's supposed to draw it on the map).
05:01
<@celticminstrel>
...ah, I see why it's not. Duh.
05:01
<@celticminstrel>
Since I originally wrote this for digging passages I had it draw only on impassable tiles.
05:01 macdjord|wurk is now known as macdjord
05:07 Derakon is now known as Derakon[AFK]
05:37
<@celticminstrel>
Well it seems like it's working.
05:39
<@celticminstrel>
At least when I run it from the command console for short paths.
05:39
<@celticminstrel>
Even for somewhat long paths actually.
05:39
<@celticminstrel>
But now I'm running it in the original context and it's not terminating.
05:40
<@celticminstrel>
I wouldn't be surprised if it needs to visit nearly every clear space before realizing it needs to tunnel...
05:42 gnolam [lenin@Nightstar-t1tbf0.cust.bahnhof.se] has quit [[NS] Quit: Quit.]
05:46
<@celticminstrel>
Pretty sure it's in an infinite loop.
06:15 Vash [Vash@Nightstar-uhn82m.ct.comcast.net] has quit [Connection closed]
07:15 Reiver [quassel@Nightstar-ksqup0.co.uk] has quit [Connection closed]
07:15 Orthia [quassel@Nightstar-ksqup0.co.uk] has quit [Connection closed]
07:25 Kindamoody[zZz] is now known as Kindamoody
07:30 Kindamoody is now known as Kindamoody|afk
07:39 celticminstrel [celticminst@Nightstar-h4m24u.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
07:43 Orthia [quassel@Nightstar-ksqup0.co.uk] has joined #code
07:43 mode/#code [+o Orthia] by ChanServ
07:43 Reiver [quassel@Nightstar-ksqup0.co.uk] has joined #code
07:43 mode/#code [+ao Reiver Reiver] by ChanServ
08:53 macdjord is now known as macdjord|slep
09:44 crystalclaw [crystalclaw@Nightstar-12q9ui.xyz] has quit [Ping timeout: 121 seconds]
09:45 crystalclaw [crystalclaw@Nightstar-12q9ui.xyz] has joined #code
09:45 mode/#code [+o crystalclaw] by ChanServ
12:47 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
13:28
<@TheWatcher>
https://twitter.com/DJSnM/status/803659072218099713 - I wouldn't put it past some to try...
13:29
<@Tamber>
hee
13:44
<&VirusJTG>
I'd try
13:44
<&VirusJTG>
I enjoy basterdized configurations.
14:52 You're now known as TheWatcher[d00m]
15:41 macdjord|slep is now known as macdjord|wurk
15:43 You're now known as TheWatcher
16:03 celticminstrel [celticminst@Nightstar-h4m24u.dsl.bell.ca] has joined #code
16:03 mode/#code [+o celticminstrel] by ChanServ
16:35 Emmy-AFK is now known as Emmy
16:53 Alek [Alek@Nightstar-cltq0r.il.comcast.net] has quit [Operation timed out]
16:56 Alek [Alek@Nightstar-cltq0r.il.comcast.net] has joined #code
16:56 mode/#code [+o Alek] by ChanServ
17:35 Kindamoody|afk is now known as Kindamoody
17:56 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has quit [Connection closed]
17:57 Emmy [Emmy@Nightstar-9p7hb1.direct-adsl.nl] has joined #code
17:57 mode/#code [+o Emmy] by ChanServ
18:02
<@celticminstrel>
So I realized the taxi-cab distance isn't quite admissible, because negative x wraps to positive. I don't think this is going to cause any problems though with respect to whether it terminates with a possible path...
18:03
<@celticminstrel>
I wonder if using a proper priority queue rather than pushing into an array and linear-searching would be more efficient.
18:04
<@celticminstrel>
Proper priority queue would still involve search though... but it could be a binary search I guess...
18:23
<@celticminstrel>
Seems like failed binary search yields the index of the predecessor... (or maybe it depends on whether < or > is made non-strict)
18:26
<@celticminstrel>
(No, that doesn't look like it'd have any effect.)
18:34 Vash [Vash@Nightstar-uhn82m.ct.comcast.net] has joined #code
18:40
<@celticminstrel>
For now I guess I'll ignore wrapping.
18:41 catalyst [catalyst@Nightstar-bt5k4h.81.in-addr.arpa] has joined #code
18:41
<@celticminstrel>
I might want to support it once I get to monster pathfinding though... as well as movement between coordinate patches...
19:05 Vash [Vash@Nightstar-uhn82m.ct.comcast.net] has quit [Connection closed]
19:19 ErikMesoy [Erik@Nightstar-hq72t5.customer.cdi.no] has joined #code
19:19 mode/#code [+o ErikMesoy] by ChanServ
19:19
<@ErikMesoy>
Adventures In Budgeting.
19:19
<@ErikMesoy>
Consulting at a new workplace this month, I was supposed to submit my end-of-month timesheets.
19:19
<@ErikMesoy>
The timesheet submission software has a limited number of licenses.
19:20
<@ErikMesoy>
Every employee logged in to submit hours counts as a license user.
19:20
<@ErikMesoy>
The number of licenses the company has is substantially lower than the number of employees(+contractors).
19:20
<@ErikMesoy>
Result: complaining all around the table and all around the floor about the "you cannot log into timesheet submission right now" messages that persisted for various people ALL BLOODY DAY.
19:21
<@ErikMesoy>
Wonderful example of penny wise, pound foolish to buy fewer licenses for the timesheet submission software so that your workers have to queue for hours to use it.
19:22
<&jerith>
Yay timesheets.
19:22
<&jerith>
I always made timesheets go away by accurately tracking the amount of time I spent tracking time.
19:23
<&jerith>
These days, for the things I need to log hours on, I use powers of two and round up.
19:23
<@ErikMesoy>
Pfffft. Interesting approach.
19:24
<&jerith>
Minimum one hour (because if it's worth tracking at all, it's interrupty enough to cost me at least that), then two hours, then four hours, then eight hours.
19:24
<@ErikMesoy>
For that matter, I wonder why they have a license-limited thing in the first place.
19:25
<&jerith>
Fibonacci numbers also work well, but I like the four and eight for half and full days.
19:25
<@ErikMesoy>
Unless there are Great Hidden Depths in the timetracker, it's a glorified spreadsheet, not an MMO, and should be able to handle everyone in the building logging in if it's running on a server from this generation, right?
19:26
<&jerith>
ErikMesoy: Sure, and that means the vendor can extract money for every person using it.~
19:27
<@ErikMesoy>
jerith: yeah, but I'm thinking why buy from this kind of vendor in the first place? eldritch quality assurance policies somewhere?
19:28
<@ErikMesoy>
A horrendous spreadsheet market where every single vendor wants per-simultaneous-user license fees?
19:30
<@ErikMesoy>
I mean, it was bizarre in the first place to learn that employees have to *queue* for hour filing. Learning the why of "license limit" was just pushing the issue back. I wonder how many layers of bizarre why-ness lurk below here.
19:33
<@Tamber>
"...well, we're not going to have everyone try to do their timesheets at the same time, right? So we don't need that many licenses!"
19:34
<@ErikMesoy>
Tamber: Yeah, they might have had different expectations.
19:34
<@ErikMesoy>
They have definitely realized the problem now, though, as while I was logged in, I got an alert from the system requesting me to please finish fast and log out so other people can log in.
19:34
<@ErikMesoy>
Signed with a name of some mucky-muck rather than just "system".
19:35
<@ErikMesoy>
I have no great hopes for this impelling them to actually fix it though >_>
19:39 Vornicus [Vorn@ServerAdministrator.Nightstar.Net] has joined #code
19:39 mode/#code [+qo Vornicus Vornicus] by ChanServ
19:51 abudhabi is now known as Logar
21:35 gnolam [quassel@Nightstar-t2vo1j.tbcn.telia.com] has joined #code
21:35 mode/#code [+o gnolam] by ChanServ
21:44
<@celticminstrel>
I wonder if there's an easy way to get min distance between two points on a given surface with a given metric...
21:47
<@celticminstrel>
Gasp, "PriorityQueue.prototype.clear = PriorityQueue;"
21:47
<&[R]>
Nice, the clear function just calls the constructor again.
21:49 JustLurk [justbob@ServerAdministrator.Nightstar.Net] has joined #code
21:49 JustBob [justbob@Nightstar.Customer.Dissatisfaction.Administrator] has quit [NickServ (RECOVER command used by JustLurk)]
21:49 mode/#code [+o JustLurk] by ChanServ
21:49 JustLurk is now known as JustBob
21:59 gnolam [quassel@Nightstar-t2vo1j.tbcn.telia.com] has quit [Connection closed]
22:02 Kindamoody is now known as Kindamoody[zZz]
22:17 Logar is now known as abudhabi
22:39
<@celticminstrel>
If I'm going to use this A* for monster pathfinding at some point, I really should probably make it able to cross levels and coordinate patches... and even pass teleporters (which don't exist yet but will later).
22:44
<@celticminstrel>
(Crossing layers is the easy part of that.)
22:46
<@celticminstrel>
(Teleporters are also easy if they're always an "isthmus", which was what I'd been planning.)
22:53
<@celticminstrel>
Hmm, my priority queue inserted 3 after 5. Not good.
22:53
<@celticminstrel>
Oh, wait.
22:53
<@celticminstrel>
It then inserted 8 before 5.
22:53
<@celticminstrel>
Maybe I just have the comparison backwards.
22:56
<@celticminstrel>
No, that's not it. Maybe I want to insert at mid instead of mid+1.
22:57
<@celticminstrel>
:|
23:05
<@celticminstrel>
...
23:06
<@celticminstrel>
"right = this.priorities - 1"
23:07 JustBob [justbob@Nightstar.Customer.Dissatisfaction.Administrator] has quit [Ping timeout: 121 seconds]
23:16
<@celticminstrel>
Okay, aside from that it seems I can't assume either mid or mid+1 but rather need an additional test to determine which.
23:16
<@celticminstrel>
Works now.
23:26 JustBob [justbob@ServerAdministrator.Nightstar.Net] has joined #code
23:26 mode/#code [+o JustBob] by ChanServ
--- Log closed Thu Dec 01 00:00:31 2016
code logs -> 2016 -> Wed, 30 Nov 2016< code.20161129.log - code.20161201.log >

[ Latest log file ]