Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : Development : What's a good LOS algorithm for tile-based games?
New Topic New Poll Post Reply
Poster Message
hyphz
Level: Delver
Rank Points: 34
Registered: 01-02-2006
IP: Logged
icon What's a good LOS algorithm for tile-based games? (0)  
Can anyone think of or know of a good LOS algorithm for a tile-based game?

At the moment I'm doing it by using Bresenham linedraw from the source to the target and stopping on an encountered obstacle, but that sometimes introduces problems when Bresenham shifts coordinate at an unusual position.

I'm used to doing things like "tracing four corners" in tabletop grid-based games but that isn't so viable to do in a tile-based computer game because there is no coordinate system more detailed than the grid.

04-04-2012 at 03:32 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Briareos
Level: Smitemaster
Avatar
Rank Points: 3516
Registered: 08-07-2005
IP: Logged
icon Re: What's a good LOS algorithm for tile-based games? (+1)  
Can't you just do the Bresenham in half-tile increments, i.e. treat each tile as a 2x2 square? Or do you mean the case when the line waltzes diagonally across the corner of a tile?

np: Mouse On Mars - Froschroom (Rost Pocks)

____________________________
"I'm not anti-anything, I'm anti-everything, it fits better." - Sole
R.I.P. Robert Feldhoff (1962-2009) :(
04-04-2012 at 03:57 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
Pekka
Level: Smiter
Rank Points: 302
Registered: 09-19-2007
IP: Logged
icon Re: What's a good LOS algorithm for tile-based games? (+1)  
The Roguebasin Wiki lists and discusses several Field of Vision techniques. You'll probably find good ideas to try there.

http://roguebasin.roguelikedevelopment.org/index.php/Category:FOV


04-04-2012 at 08:16 PM
View Profile Show all user's posts This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : Development : What's a good LOS algorithm for tile-based games?
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.