Monocle: Monaco-style line of sight engine
- Ranguna259
- Party member
- Posts: 911
- Joined: Tue Jun 18, 2013 10:58 pm
- Location: I'm right next to you
Re: Monocle: Monaco-style line of sight engine
Can't shake the feeling that those are buildings .. I wonder why
Re: Monocle: Monaco-style line of sight engine
Added repo.
How come you don't like canvases? For multiple light sources, I could make it so you can pass which canvas to use. This would allow you to use the same canvas for multiple light sources.
How come you don't like canvases? For multiple light sources, I could make it so you can pass which canvas to use. This would allow you to use the same canvas for multiple light sources.
Re: Monocle: Monaco-style line of sight engine
Many old PCs or laptops don't support canvases
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
-
- Party member
- Posts: 712
- Joined: Fri Jun 22, 2012 4:54 pm
- Contact:
Re: Monocle: Monaco-style line of sight engine
Forked your repo and added Gaussian Blur and Alpha support:
https://github.com/Germanunkol/Monocle
I'll create a pull request when this question has been answered/resolved...
I wasn't sure about alpha support, after all, you can always do that manually as a user, when drawing the canvas. But I'd like to make a version without canvases. Micha and me are working on a game where we want to use this (I tried it, it works real well so far 'cause we don't update shadows often, so we don't get the crashes) and we need alpha support and don't want to require shaders/canvases... So I want to make it all "switchable".
https://github.com/Germanunkol/Monocle
I'll create a pull request when this question has been answered/resolved...
I wasn't sure about alpha support, after all, you can always do that manually as a user, when drawing the canvas. But I'd like to make a version without canvases. Micha and me are working on a game where we want to use this (I tried it, it works real well so far 'cause we don't update shadows often, so we don't get the crashes) and we need alpha support and don't want to require shaders/canvases... So I want to make it all "switchable".
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Re: Monocle: Monaco-style line of sight engine
Looks great!
I'm working hard to figure out where the bugs are, but it's pretty tough at this point. There is still some strange behavior that happens when a projection edge hits an endpoint. As a last resort, I could pre-check for co-linearity among the player, the hanging edges, and all other edges, and, when I encounter it, add some small random value to the player's position. This is needless work though, so I'd rather get the logic I've already implemented working instead :-/
I'm working hard to figure out where the bugs are, but it's pretty tough at this point. There is still some strange behavior that happens when a projection edge hits an endpoint. As a last resort, I could pre-check for co-linearity among the player, the hanging edges, and all other edges, and, when I encounter it, add some small random value to the player's position. This is needless work though, so I'd rather get the logic I've already implemented working instead :-/
-
- Party member
- Posts: 712
- Joined: Fri Jun 22, 2012 4:54 pm
- Contact:
Re: Monocle: Monaco-style line of sight engine
Hm. I don't know if it helps, but I get an almost reliable crash if I walk start at the starting point and move diagonally towards the bottom right corner. When passing the tile at (6,6) and staying really close to it, it usually crashes...
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Re: Monocle: Monaco-style line of sight engine
I haven't fixed the bugs, but I pushed a new version with a check on the line that was crashing, so it just stops drawing triangles instead of crashing. I also added a random value between -0.005 and 0.005 to the x and y at every frame. This way, even when there is dropout, it only lasts for a single frame. I've seen it mess up a few times, and my eye was barely able to register it.
One thing you can do with your version is to return a success flag when the draw triangles loop completes (i.e. when current_edge == start[1]; currently line 270). When the success flag returns false, rerun the update in the next frame. In fact, I might make this a feature, since the optimizations I'm planning will involve not rerunning the update every frame.
Overall, though, I'd say that Monocle is now usable
One thing you can do with your version is to return a success flag when the draw triangles loop completes (i.e. when current_edge == start[1]; currently line 270). When the success flag returns false, rerun the update in the next frame. In fact, I might make this a feature, since the optimizations I'm planning will involve not rerunning the update every frame.
Overall, though, I'd say that Monocle is now usable
Re: Monocle: Monaco-style line of sight engine
Sorry for the bump, but does anyone have a version of this that doesn't use canvases? And, is there a way to make the tiles that are visible slowly fade into darkness, so you could see the texture of the tile?
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
-
- Party member
- Posts: 712
- Joined: Fri Jun 22, 2012 4:54 pm
- Contact:
Re: Monocle: Monaco-style line of sight engine
I'm working on a version. If its turns out to be any good, I'll post it here...
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Re: Monocle: Monaco-style line of sight engine
Great! I'll be sure to check it out.Germanunkol wrote:I'm working on a version. If its turns out to be any good, I'll post it here...
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Who is online
Users browsing this forum: No registered users and 1 guest