RexBoard - FieldOfView visiblePoints

Hi @rexrainbow

I have a question about FindFOV and visibilityPoints. I am using FindFOV passing in visibilityPoints. As you know, it goes FindFOV --> IsInLOS --> isPathVisible --> GetCost which will then call my costCallback.

In my game, each hex is assigned a terrain which all have a “sightCost”. Here is my costCallback

  costCallback:  (tileXY) => {
    // getTileAttribute returns an integer value for how hard is it to see through the hex
    const totalSightCost = this.ember.map.getTileAttribute(this.scene, tileXY, 'sightCost');
    return totalSightCost;
  },

Some terrains are “blockers” in that you can not see past them. Doors, walls, mountains, etc. What is happening is that when the “blocker” hex has a higher sightCost than what is left of the player’s visibilityPoints, everything behind that hex’s cone is hidden as expected. It ALSO hides the “blocker” hex from being seen.

What I would like is for the blocker hex to be visible (I want them to see the door), but everything behind it’s cone to be invisible like normal.

Hopefully that is clear enough for you to understand what I am trying to achieve. Any suggestions?

Dan

Nice suggestion, agree that blocker is better to be visible. Add to TODO.

Edit: Feature added. Now blocker is visible, but tiles after blocker are still invisible.

Cool, would you mind sharing your change? I can extend mine without a release - unless you release soon :wink:

Dan

Released now. Testing

I had a similar change to mine like your afterBlocker. Thank you for making the change so quickly. How do you do releases? Just another npm publish?

Publish to npm now.
(Usually I updated minify files on github only)

Yes, that’s working pretty good. Thanks again!

Development still in progress: https://emberquest.danmonroe.dev/

About 45000 tiles at the moment

1 Like