DRL > Discussion
Line of Sight and mapping
MadCoder:
So I think I have this great LOS code idea, then I discover a major flaw in it. I was going to use a lookup table for each block in a quadrant to map shadows. Problem is, when two blocks are next to each other they block much more than the original one does.
Damn, back to the drawing board.
I've been reading others LOS code, and there seems to be tons of calculations to make it happen. How in the world did Ultima III and IV get made with great LOS, nice graphics and less than 64k RAM? Granted, it was in machine language/assembly back then, but still, memory has to be allocated.
I'm surprised that with all the roguelikes out there, that someone hasn't come up with an object oriented code module just for LOS mapping. Nothing more, like light sources, or what the map contains (treasure, weapons, monsters, etc). I've found lots of code examples, but they all seem quite complex and have lots of hacks to make them work.
Has no one come up with a clean code base for LOS mapping? I hope I can find an effective one, or a roguelike may have to wait...
Aerton:
--- Quote from: MadCoder on February 10, 2007, 18:14 ---I hope it comes out ok. If any of you know of lookup table source code for LOS, I'd like to see it. Thanks!
--- End quote ---
Lookup table FOV is used in Angband. Although code is heavy optimised and thus is very hard to follow. I think the algorithm was posted on rgra or rgrd.
--- Quote from: MadCoder on February 11, 2007, 17:13 ---I'm surprised that with all the roguelikes out there, that someone hasn't come up with an object oriented code module just for LOS mapping. Nothing more, like light sources, or what the map contains (treasure, weapons, monsters, etc). I've found lots of code examples, but they all seem quite complex and have lots of hacks to make them work.
--- End quote ---
There is FOV library named libfov I never used it myself though so cannot comment of how fast or easy to use it is.
Kornel Kisielewicz:
Maybe you'd be interested in looking at Berserk! and the Valkyrie library. The advantage of Pascal is that it is readable as long as you can code in ANY language ;]
Navigation
[0] Message Index
[*] Previous page
Go to full version