Need help to implement a Line-of-Sight algorithm for a roguelike in VB
Greetings,
I am an amateur programmer from Greece who is currently trying to develop a roguelike resembling ADOM. I would like to implement an interesting algorithm that I found here:
http://www.geocities.com/temerra/los_rays.html
This is an algorithm about the Line of Sight (LOS) of the game entities, which means it calculates what an entity can and can't see (eg behind a column). It looks pretty fast and accurate, but alas it is poorly described in detail (especially towards the "end" of the algorithm) and the JAVA code link doesn't work any more.
I could really use some help, either with a piece of code with the above algorithm, or further explanation with steps on precisely what it does.
For those of you who have read the article: I actually understand what happens in diagrams a, b and c of the article, but I can't figure out how things evolve later, eg when and where a "pink obstruction" stops. Can it be when the x or y coord of the obstruction vector becomes less than zero? Anyway some VB code always helps!
Thank you in advance,
vdweller
http://vdweller.awardspace.com
Re: Need help to implement a Line-of-Sight algorithm for a roguelike in VB
Sorry for the double post, but I could really use your help on this one. I actually found a piece of C++ code for the aforementioned Line-Of_Sight algorithm here:
http://utilitybase.com/paste/7632
Problem is, I can't properly convert it to VB code.
Please, could anyone write the VB6 implementation of this C++ code?
Re: Need help to implement a Line-of-Sight algorithm for a roguelike in VB
How much does your game resemble ADOM? If your graphics are as simple it should make for a fairly easy line of site algorithm. I might have a look at this later.