recursive shadowcasting FOV in ascii rogue
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: recursive shadowcasting FOV in ascii rogue
Suggestion: not having pre-defined fields of view (45 degrees), but rather generate them by following the imaginary line between the current position and the corner of the wall that is blocking the view
Write the ö of Löve with Alt+numPad(148) or Alt+numPad(153)
Re: recursive shadowcasting FOV in ascii rogue
algoritm is fixed -:)
updated download in first post.
keep pressing Enter until the room with enough pillars will be generated
number of pillars can be changed by 9/0 - anyway this is the maximum number of columns per room.
I followed that tut:
http://roguebasin.roguelikedevelopment. ... dowcasting
the next step is to tune it a little with this:
http://roguebasin.roguelikedevelopment. ... dowcasting
updated download in first post.
keep pressing Enter until the room with enough pillars will be generated
number of pillars can be changed by 9/0 - anyway this is the maximum number of columns per room.
i'll do that. its going to work like this: if there is a file called mapXXX.txt - load it, if not - generate random map.teh8bits wrote:You should load maps from a txt file, that would be awesome ;P
I don't quite understand - sorry it's new to me - but anyway I think that is already happening here.meoiswa wrote:Suggestion: not having pre-defined fields of view (45 degrees), but rather generate them by following the imaginary line between the current position and the corner of the wall that is blocking the view
I followed that tut:
http://roguebasin.roguelikedevelopment. ... dowcasting
the next step is to tune it a little with this:
http://roguebasin.roguelikedevelopment. ... dowcasting
Re: recursive shadowcasting FOV in ascii rogue
Nice work, and thanks. Now with pillars far away we can check angle "streching". Looks good. Are you still perfecting it or you advanced for things like light source?
Re: recursive shadowcasting FOV in ascii rogue
first i will try "upgrading" it with a more acurate slop/visibility calculations.
Lights will come shortly.
Just have one question, not about fov but about love and draw/update functions:
is there a way to force love not to redraw screen so often?
I'd like it to be redraw only when I press the movement key - since all calculations are done only once and only after arrow is pressed.
I,m asking because everytime I start my program then the fan in my computer starts as well and after a short time it gets quite loud.
Lights will come shortly.
Just have one question, not about fov but about love and draw/update functions:
is there a way to force love not to redraw screen so often?
I'd like it to be redraw only when I press the movement key - since all calculations are done only once and only after arrow is pressed.
I,m asking because everytime I start my program then the fan in my computer starts as well and after a short time it gets quite loud.
Re: recursive shadowcasting FOV in ascii rogue
You'll have to overwrite love.run, maybe like this (not tested), and call love.graphics.clear() and love.draw() in love.keypressed:
Code: Select all
function love.run()
if love.load then love.load(arg) end
local dt = 0
-- Main loop time.
while true do
if love.timer then
love.timer.step()
dt = love.timer.getDelta()
end
if love.update then love.update(dt) end -- will pass 0 if love.timer is disabled
--[[ if love.graphics then
love.graphics.clear()
if love.draw then love.draw() end
end]] --Simply delete this line and the 3 above
--Rest of love.run, don't delete this!
end
function love.keypressed(key, unicode)
--your stuff
love.graphics.clear()
love.draw()
end
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: recursive shadowcasting FOV in ascii rogue
Don't forget to call love.graphics.present after calling love.draw(), otherwise nothing will be shown.
Help us help you: attach a .love.
Re: recursive shadowcasting FOV in ascii rogue
I didn't know that ^^'
If you call it after love.draw you don't need to call it in love.run, right?
If you call it after love.draw you don't need to call it in love.run, right?
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Re: recursive shadowcasting FOV in ascii rogue
thanks.
I put that code and transfered love.graphics part into love.keypressed()
It redraws the screen continously but like 50% slower - so you can see horizontal border passing from top to bottom and it draws it in two different positions (it depends which arrow was pressed last) - for example left/right then it draws everything once and the next redraw shifts the image to the left/right and then back.
But I'll think on that since I have already a starting point.
ETA:
ok, my fault.
I forgot to remove
from the end of love.run() - so it was duplicated.
Now it works.
Thanks
I put that code and transfered love.graphics part into love.keypressed()
It redraws the screen continously but like 50% slower - so you can see horizontal border passing from top to bottom and it draws it in two different positions (it depends which arrow was pressed last) - for example left/right then it draws everything once and the next redraw shifts the image to the left/right and then back.
But I'll think on that since I have already a starting point.
ETA:
ok, my fault.
I forgot to remove
Code: Select all
if love.graphics then love.graphics.present() end
Now it works.
Thanks
Re: recursive shadowcasting FOV in ascii rogue
You did exactly what I suggested Have shadows work with any angle and not just 45. It's looking very nice already!
Write the ö of Löve with Alt+numPad(148) or Alt+numPad(153)
Re: recursive shadowcasting FOV in ascii rogue
IMO, everything it the shadow should be hidden, so enemies, objects, etc. Maybe even walls? Just omit any characters in the shadow area, perhaps.
Who is online
Users browsing this forum: No registered users and 4 guests