Search found 131 matches

by kbmonkey
Thu Dec 07, 2017 8:04 pm
Forum: Libraries and Tools
Topic: Yet another path finding module
Replies: 7
Views: 3545

Re: Yet another path finding module

I will make a note of JPS, I can't promise I will work on that yet, I am too infatuated with other projects. But JPS sounds like the way to optimize for speed :)
by kbmonkey
Sat Dec 02, 2017 1:20 pm
Forum: Libraries and Tools
Topic: Yet another path finding module
Replies: 7
Views: 3545

Re: Yet another path finding module

FYI here is the git repo with some unit tests https://github.com/wesleywerner/lua-star
by kbmonkey
Sat Dec 02, 2017 1:13 pm
Forum: Libraries and Tools
Topic: Yet another path finding module
Replies: 7
Views: 3545

Re: Yet another path finding module

@erasio it is very similar to A*, because I use distance as part of the cost, and because I sort the node list by cost priority, the algorithm tends to follow low-cost paths first. As you note I don't have user specified path costs. @nyenye Thanks! I was thinking if you want to add path costs by way...
by kbmonkey
Fri Dec 01, 2017 10:43 pm
Forum: Libraries and Tools
Topic: Yet another path finding module
Replies: 7
Views: 3545

Yet another path finding module

Just because it's fun coding path finders :joker: pathfinder.png Easy to use, it will make you more attractive and you feel sensual doing so. local lib = require("lib") function isPositionOpenfunc(x, y) -- should return true if the map position at x, y is open to walk return map[x][y] end ...
by kbmonkey
Thu Nov 30, 2017 5:36 pm
Forum: Support and Development
Topic: [solved] Unpredictable error triangulating a polygon
Replies: 3
Views: 2767

Re: Unpredictable error triangulating a polygon

Thanks grump and vrld, I have it working. The trick is to ensure the first and last points are on the extremities of the polygon. Your help was invaluable, cheers. :D
by kbmonkey
Thu Nov 30, 2017 2:50 pm
Forum: Support and Development
Topic: [solved] Unpredictable error triangulating a polygon
Replies: 3
Views: 2767

[solved] Unpredictable error triangulating a polygon

I hope someone can help me. I have some code that draws a graph, it gives an error when I call love.math.triangulate. I have boiled the code down to this contrived example for demonstration purposes: function love.load() vertices = { 0, 138, 20, 138, 41, 144, 62, 162, 82, 181, 103, 181, 124, 191, --...
by kbmonkey
Thu Nov 23, 2017 2:20 pm
Forum: Games and Creations
Topic: Lake generator
Replies: 4
Views: 2321

Re: Lake generator

I tweaked the code to produce more natural looking ground structures by filling in random blocks. The green areas would be shallow waters where vegetation grows. Latest source attached to the first post.
lakegen-anim-v2.gif
lakegen-anim-v2.gif (56.44 KiB) Viewed 2234 times
by kbmonkey
Thu Nov 23, 2017 4:28 am
Forum: Games and Creations
Topic: Lake generator
Replies: 4
Views: 2321

Re: Lake generator

Thanks! Speaking of dungeon crawlers, I ran across rotLove in my research and made a mental note to look it over one day. It might be useful :crazy:
by kbmonkey
Wed Nov 22, 2017 8:57 pm
Forum: Games and Creations
Topic: Lake generator
Replies: 4
Views: 2321

Lake generator

I've been playing this old pc-dos game called BassTour, I have fond memories playing it and I landed a few lunkers - albeit hooking my partner's hat some. The lakes you fish in the game are all hand crafted, and it got me thinking about map generation. This technical demo uses cellular automata to m...
by kbmonkey
Tue Nov 14, 2017 5:30 pm
Forum: Games and Creations
Topic: Scrolling apertures: a technical demo
Replies: 7
Views: 3069

Re: Scrolling apertures: a technical demo

Drawing the visible page would be easy enough

Code: Select all

if loremscroll.page == 1 then
  -- draw page 1 here
elseif loremscroll.page == 2 then
  -- you get the idea
end
That should satisfy any performance concerns. I will have to try scissors too, thanks for the idea!