Haxelibs, Line of Sight, and Rooms

Hey Folks! Hope everyone had a good weekend. This was our final weekend of having my folks visit to help take care of the baby. We said our goodbyes this afternoon, and we are officially unsupervised parents now :)

Even though Friday's post was about the discount, I did get some work done that day. It was limited, though. After my successes the day before with localized UI, I managed to screw up my Haxe libraries. This meant my prototype wouldn't compile, or sometimes, would compile but would immediately crash when run. I spent most of my day trying different combos of Haxe libs, and even some manual code patches to smooth things over, but wasn't able to do much.

So, I backed-out the UI and localization for now, and reverted to my working prototype code. I'll try again in a bit, perhaps paying closer attention to the library dependencies.

The work I managed to do, however, involved line of sight. I've been trying to figure out how line of sight might work in the space prototype. One of my early iterations was a brute force line of sight calc, which was a true raycast to each tile on the map. This was cool in that it allowed me to see down hallways, but also was expensive to calculate, and had some edge case issues (e.g. cannot see walls in the same room if at too shallow a viewing angle).

Investigating this further, I focused on a so-called "flood fill" algorithm to figure out the bounds of the player's current room. This works similar to how paint programs fill an area with a color (hence the name), and is fairly efficient. The downside, though, is that it's only a rough approximation. Line of sight is "all or nothing" for the current room, and one cannot see down halls.

Line of sight might seem a bit overkill for a grid-based ship sim, but I think it also might allow for some interesting gameplay. One need only look at NEO Scavenger's line of sight on the hex map to see how limited visibility can produce interesting situations. And in the cramped quarters of a ship, maybe even more so. E.g. "Is someone lurking behind that corner? What are those noises I hear from the next room?"

I'm also trying to figure out this game's eventual point of view. Should the line of sight be limited to a single crewmember (i.e. the player) or to all crewmembers? (e.g. FTL-style)

My first instinct is to limit it to a player-centric viewpoint. I kind of want to make the game focus on ship stations and controls instead of an omniscient viewpoint. E.g. the player can see things in their current room, or things on the control panel they're using.
But if the player wants to see the activity in the galley, they need to either walk there or install CCTV in their ship. I think this approach lends itself to the most suspense and drama, as the player is left to wonder what happens behind closed doors.

One alternative is to make all crew's sight visible to the player, like FTL (or X-COM). This still allows for some suspense, but changes the feel of the game from occupying a person to experiencing all the crew's lives first-hand. Not necessarily bad, as Firefly shows us, but a different experience.

And a final option is complete omniscience, like Rimworld. I'd kind of like to avoid this, as it exposes a lot of what might make for good mystery or drama. It's a bit more fun to watch in a "fishbowl" sort of way, but dampens the suspense a bit.

What I eventually choose, however, is going to depend on how it feels. And for that, have to test and iterate :)

That's all for now. Have a good night, all!