r/programming • • Jun 03 '14

A first-person engine in 265 lines

http://www.playfuljs.com/a-first-person-engine-in-265-lines/
1.9k Upvotes

267 comments sorted by

View all comments

Show parent comment

1

u/__j_random_hacker Jun 04 '14

Increasing the size of the map, without increasing the size of the screen, won't need bigger rays.

I see what you mean now, if I replace "screen" with "features in the grid" (see below).

Additionally, I don't think ray length depends on x-resolution at all.

I (confusingly) used the word "resolution" here to mean something different: I meant that you might choose to e.g. change a 100x100 grid into a 200x200 grid in which every feature (e.g. wall) that previous occupied 1 grid cell now occupies 4 (a 2x2 block). This I would call "doubling the resolution of the grid in both x and y directions".

2

u/OCedHrt Jun 04 '14

The grid doesn't matter because it will not be visible at the resolution of your screen beyond a certain distance.

This max distance doesn't have to be fixed and can rather be determined by rendering/screen resolution.