-
-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Recursive Shadowcasting which allows for 90/180 degree viewsheds #29
Conversation
… algorithm on Rogue Basin
…dowcastng algorithms for same radius
Very neat, thanks! This is a welcome addition to rot.js, so I am definitely going to accept your code. Automated merge is now not possible (probably due to conflicts in rot.js/rot.min.js w.r.t. your last pull request), but I will examine your new code and merge the stuff locally. Probably on monday/tuesday. I have two small recommendations:
|
I am totally delighted to see this code shared, right on. :) |
…ithin the project. Updated method naming in RecursiveShadowcasting to use underscores in front of private methods. Recompiled.
Thanks for the feedback, I'm glad this will be useful and that I can contribute. I've updated (I think) all the space indents to tab indents and have a local vimrc file so that any future changes I propose for the project will (hopefully) have the correct indentation. I've updated all the methods not publicly called in RecursiveShadowcasting to be prefaced with an underscore. I left the OCTANTS variable "public" as it may come in handy for other computations. I'm not very advanced with git, but I believe I merged your updates with this fov_updates branch. See if Github will let you auto merge it now. It definitely was unhappy with the changes to rot.js and rot.min.js, probably the dateline conflicting between the two branches. If in the future you'd prefer I submit just the src/whatever.js changes and not the compiled files, let me know. I'm happy to do whatever's easiest for you. |
Merged and cleaned up. |
(sending pull requests without rot.js and rot.min.js is probably the best way in the future...) |
Good evening,
I kept this separate from the random number pull request because this one is larger and may require more time to vet. I figured it would be easier for you if they're separate changes.
I added an implementation of the Rogue basin recursive shadowcasting algorithm (http://www.roguebasin.com/index.php?title=FOV_using_recursive_shadowcasting) as a new FOV class: ROT.FOV.RecursiveShadowcasting. I needed the ability to render just a 90-degree view of a particular mob in a project I'm working on and figured that other authors might need the same some day. Rather than change the existing classes, this class was created and ported from another Github user's (@pushcx) Ruby implementation of the same algorithm.
For compatibility, this new class will behave exactly the same as the other FOV classes if calling
compute
(showing a 360-degree circle of omniscience) but it also allows for 90-degree quadrants (compute90
) and 180-degree hemispheres (compute180
). Both of those methods take just one extra argument to note the direction the FOV should be cast in.Specific changes:
This is a much bigger change than the other one and I'm in no rush. I do believe it adds more to this toolkit that is in line with common needs for roguelike games. Please look at it when you have time and if you have any suggestions/questions, let me know. I'm more than happy to make any further changes to this to get it up to your standards for the toolkit.
Thanks,