Git Product home page Git Product logo

Comments (9)

sbj42 avatar sbj42 commented on July 18, 2024

Thanks for your interest. What you describe sounds plausible - I think the test cases use only positive coordinates. I'll look into this later this week, probably starting with some test cases that use negative offsets.

from wally-fov.

sbj42 avatar sbj42 commented on July 18, 2024

I believe this is fixed in 0.1.2. Instead of an infinite loop, it now exits early, so the areas outside of the map are not visible.

The originally intended usage would be to set up a FieldOfViewMap covering the entire map - that way you don't need to recreate it with each step as your view window moves. If you do that, then presumably there would be no way for the player to walk off of the map, thus preventing out-of-bounds issues. If instead you want the map to have "exits" that lead to other maps, then you might consider using WallyFOV's sucessor, WarpField.

I can see how there might be some cases where you'd rather not put the whole map in a FieldOfViewMap. For instance, the map is large and it is costly or redundant to copy the features of the map into another class. In that case, your sliding-window approach makes sense, but as you discovered you will probably need to rebuild the FOVMap with each step.

from wally-fov.

IntegerMan avatar IntegerMan commented on July 18, 2024

Thanks for the update. I'll look to incorporate the new code this week. My intended case was to represent the entire map in memory up front, but the hang made me improvise a little. And this is just a dev-data thing on my end since I could easily make my auto-genned maps have 0, 0 as an absolute upper left corner anyway (and likely will).

Probably short term I'll take the update and drop my offset code, and long-term (when I write moving from level to level) do this as part of the level transition. I do intend for some actors to block line of sight, so I might need to rebuild the map anyway every turn.

At any rate, I appreciate the speedy response and stellar library. I've been mentioning it on a Discord server pertaining to roguelike development, but the technology basis is pretty different from project to project.

Kudos again.

from wally-fov.

IntegerMan avatar IntegerMan commented on July 18, 2024

Okay, I removed my shims and the hang is now gone. What I am seeing now, however, is that negative tiles are not returned as candidates from the engine. I think this is fine as in many cases you shouldn't have anything off of the bounds and my test data is a bit weird since 0, 0 is in the middle of the map.

See the attached gif of game performance under the updated algorithm without my offset shim:

wallyfov

For reference, a version with the shim running WallyFOV 1.1 is out at https://integerman.itch.io/emergence as a basis of comparison.

I'm fine if this remains closed as not a bug / outside of the design of the framework. I have a workaround and it's a short term problem, but I wanted to follow-up with you now that I've investigated. Besides, I feel better that the danger of a hang is resolved.

from wally-fov.

sbj42 avatar sbj42 commented on July 18, 2024

Oh I see. Actually that would make a good feature request: support for maps whose coordinates span an arbitrary rectangle. So you could have a map on, for example, (-20,-20)-(20,20) or (10000, 5000)-(10030, 5030). Basically we just need to use a Rectangle in FieldOfViewMap instead of a Size. I'll make a separate issue for that.

From the look of your game, you aren't using the "walls" feature of WallyFOV. If so, it might be better to have a simpler FOV algorithm. I could take WallyFOV and strip out the walls and the result might be faster and use less memory. That could be an interesting project.

from wally-fov.

IntegerMan avatar IntegerMan commented on July 18, 2024

Maybe. I can also tinker with it and submit a pull request instead of just consume-consume-consume. Might be about time to pull my weight on the online ecosystem. Probably not this week as I just committed to a goal of a hefty number of enhancements, but yes, I'm not looking at using walls - more a block or no block approach.

from wally-fov.

sbj42 avatar sbj42 commented on July 18, 2024

@IntegerMan FYI I just published TheField, which is a clone of WallyFOV but without the wall support. It seems to run about twice as fast that way.

from wally-fov.

IntegerMan avatar IntegerMan commented on July 18, 2024

Hey thanks! It was still on my roadmap, but it was a few sprints down the road behind things like AI and world gen. I'm actually starting a new sprint tonight so I'll spike into swapping out the algorithm. For what it's worth, WallyFOV wasn't on my top 3 of performance targets, and perf is fine right now anyway, but this will be great! I'll let you know.

image

from wally-fov.

IntegerMan avatar IntegerMan commented on July 18, 2024

It works great. I pushed the commit to my dev branch and TeamCity deployed a version relying on TheField instead of WallyFOV. Since the API was so similar it was a piece of cake to migrate.

If you're curious, http://www.matteland.com/Emergence/Nightly/ runs TheField while http://matteland.com/Emergence/Preview/ or http://matteland.com/Emergence/Stable/ run WallyFOV.

from wally-fov.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.