PDA

View Full Version : Recursive Shadowmapping component and sample released



jdarling
15-11-2007, 09:01 PM
I've been looking at Roguelikes for a while now, and started playing with a few concepts. I was amazed at how LITTLE pascal source there is for Roguelikes and how even fewer the number of components and samples were. So, I'm placing my work and research on Eon Clash as I build out sample applications and components.

The first of these is a pascal implementation of the Recursive Shadowcasting algorithm by Bjorn Bergstrom. I converted his original C++ source over to a FreePascal (Lazarus) unit that contains two classes (TFOV and TSimpleFOV) as well as a sample application showing how to use them. Hopefully this helps others out a bit.

Also included in the download is my uScreen unit that contains a wrapper for fast screen updates. Nothing fancy, but it should work on Windows, Linux and Mac without any changes since it uses pure Pascal and the Video unit. You might need to make a few minor edits to the demo application to get it to run on other platforms though.

Get it here (http://eonclash.com/ViewProduct.php?ProductID=27 (http://eonclash.com/ViewProduct.php?ProductID=27))

Screen shot of sample:
http://eonclash.com/roguelike/lighttest.png

Robert Kosek
15-11-2007, 09:25 PM
I've been looking into roguelikes for quite awhile too, but while pascal roguelikes are certainly the minority they are among the best out there. Just look at Kornel's work (http://chaosforge.org/) and Joe Hewitt's work (http://gearhead.roguelikedevelopment.org/). Both of these guys make some of the best roguelikes on RGRD (http://groups.google.com/group/rec.games.roguelike.development) and so far have been releasing all their source.


That said, many, many, many thanks for working on Bjorn's FOV algorithm! I've been puzzling over how to get a basic FOV working for a little while now. The only thing I see as being a potential problem is visible light areas out of the players FOV ... so maybe there's a way to bind both together and fade the further parts out if they're out of sight. Just a thought. (EDIT:) The algorithm I'm really interested in is this one (http://groups.google.com/group/rec.games.roguelike.development/browse_thread/thread/4cfd1dae870a7370), but I never got a satisfactory answer for passing between vertical layers.

I had been wondering why you were messing around with a high speed screen unit for a while there. :D

jdarling
16-11-2007, 01:48 PM
Actually, I needed the screen updates stuff for conversion of a POS system from an older DOS based system to something that a new screen scraper could pickup in Windows :). It just worked out that I was also playing with RL's for fun and it helped on that front too :).

I'll have to take a look at the links you posted up, but I'm curious to know why you would need Z index on your LOS algo? Unless you are some how going to show 3 views it doesn't make sense to calculate 3 axis in your LOS algo.

Kornel and Hewets work is quite good, the problem is that I found it to be overly complex in some situations and to some extent not newbie friendly :). I'm sure I'll be going back and referencing their work at some point, but for now I find the C/C++ sources to be enough in most cases.

Robert Kosek
16-11-2007, 02:35 PM
Hmm, since posting last night I've had an idea for improving the realism of the FOV/Lighting calculations. I'll have to try that today and see what I come up with. (I'll share the result of course.) EDIT: Actually, what I was thinking about was the trouble with the lighting being visible through walls, but that doesn't affect the LOS code. It just changes how the map is rendered, and so on. Fixing that is relatively easy though.

Ah, but you're thinking of a map with only one vertical layer. What if I was on top of a building sniping down at you? For that you'd have to be able to tell where you could see down to the area below as well as on your level, so that you could tell where was visible/hitable in the first place. That was why. ;)

I do agree with you about their work. It's really advanced, and like I said some of the best at RGRD, but functionally it's a good example where you can find understanding in their code.