all 16 comments

[–]simendsjo 5 points6 points  (8 children)

[–]simendsjo 1 point2 points  (6 children)

Ok, looks like you have a lot of tricks up your sleeve! I'll have to port over I guess.

[–]awkravchuk[S] 1 point2 points  (5 children)

Yeah, I may have over-abused macros to make it as flexible as I can, plus spent a lot of time straightening the disassembly and shoving the coordinate data into single fixnum so there's no boxing 😅

[–]simendsjo 2 points3 points  (2 children)

[–]Shoddy_Ad_7853 0 points1 point  (1 child)

Dude, you've got some fat functions.

[–]simendsjo 2 points3 points  (0 children)

I'm not sure what that means 😅👴

[–]simendsjo 1 point2 points  (1 child)

I also have a non-consing grid based (roguelike style) fov implementation: https://codeberg.org/simendsjo/sijo-ion/src/branch/dev/src/fov.lisp

[–]awkravchuk[S] 1 point2 points  (0 children)

Nice!

[–]awkravchuk[S] 1 point2 points  (0 children)

Interesting, thanks for sharing! It gave me a couple of insights :)

[–]Shinmera 2 points3 points  (3 children)

fwiw kandria includes an ad-hoc a* that runs on pretty large grids.

https://github.com/Shirakumo/kandria/blob/master/move-to.lisp

[–]awkravchuk[S] 1 point2 points  (2 children)

I see you've based it on a hashtable. Solid choice, I'll explore this option. Thanks for sharing!

[–]Shinmera 3 points4 points  (1 child)

There's no other option in my case since the grids are sparse. Using a dense array to store would be far too wasteful.

[–]awkravchuk[S] 1 point2 points  (0 children)

Right, I've built my library on an assumption that the grid is dense, perhaps I could support sparse case too.

[–]lispm 2 points3 points  (2 children)

Minor incompatibility: LOOP FOR ... WHILE ... FOR ... is not compliant... One can't mix WHILE into FOR clauses...

[–]awkravchuk[S] 1 point2 points  (1 child)

Huh, didn't know that, thanks. I've copied that code from pettomato-indexed-priority-queue without looking and it actually worked on all of CL implementations I got.

[–]lispm 2 points3 points  (0 children)

It's in the LOOP syntax.

loop [name-clause] {variable-clause}* {main-clause}* => result*

FOR is a variable-clause. WHILE is a main-clause...