Nox-like line of sight ?
Saturday, March 12, 2011 - 05:03
Hey.
One thing I [b]really[/b] like about Nox is the line of sight feature. You can't see things behind walls. Even things behind doors if doors are closed. Actually not just thing - you can see nothing around the corner, black area.
I think it makes the game look much more interesting (and atmospheric). I would link two youtube videos, but I don't know an obvious way to do that without my post being marked as spam. How do I do that ?
Does it sound doable to implement a similar feature in FLARE ?
I think about this often!
At first I wanted to implement a primitive tile-based light system like Diablo 1 had. That's easy code-wise, except that I don't have a function in SDL to blit a given sprite darker. It's possible I can find an advanced blit addon for SDL that can help here.
To do high-quality lighting requires some 3D data, even if using pre-rendered 2D sprites. Example, it would help to have a very rough outline of objects and do some sort of raycasting to separate light and shadow.
Probably there are good articles out there about efficient ways to implement this. I'm in favor of trying it.
Vision in Nox is quite unique (for a roguelike player) because it looks quite precise, a line is drawn from each corner of a tile. And it changes very dynamically, even when doors are opened and closed. In comparison, roguelike algorithms generally work on a per-tile basis. Vision in Nox is much more fine-grained.
I can't post the link - RogueBasin is a website (wiki) dedicated to development of roguelike games. It has a bunch of articles about FOV, even some new (amateur) research.
If you could pull this off, it would be great. It's more than just atmospheric/flavor. It would be very fun in multiplayer for sneaking on other players, and in single player it allows to create more action-packed levels, because you can't see all monsters from afar !
This is a wild guess, but perhaps - if implemented intelligently - it could even improve performance ? I mean, if you don't even have to draw most of stuff that's farther away...
Hi there, i always liked that line of sight feature, so i dedicated my in game to it, heres a progress sample: marrtDOTelementfxDOTcom
did you guys saw the anonymous' persons work - it actually does the effect pretty nicely. although its in 3D, i think its easier done in 3D and more feasible than just 2D.
@Clint - Not sure about what the best way to draw/blit this, but you can find the field of vision very quickly using the Bentley-Ottman algorithm - very simple and fast for the type of raycasting needed here. You could maybe even run on it on the isometric grid, and then blur the jagged light/shadow line somehow with prebuilt tile graphics.
Just my 2 cents, I'm just happen to be working on a javascript implementation of this.