Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411507 Posts in 69374 Topics- by 58429 Members - Latest Member: Alternalo

April 26, 2024, 12:38:01 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Interesting Programming Problems
Pages: 1 [2]
Print
Author Topic: Interesting Programming Problems  (Read 3823 times)
BorisTheBrave
Level 10
*****


View Profile WWW
« Reply #20 on: August 21, 2011, 01:30:57 AM »

The terrain in the game is defined by a series of points (using interpolation to fill in between the points). What got tricky was that the placement of the terrain points is arbitrary so they don't line up with the chunk boundaries.
The way I usually solve this is to have no redundant data, but support multiple chunks at once, which you need to do anyway when the user is standing on the overlap. You arrange it so that a chunk is slightly larger than half a screen, and that enough chunks are loaded that everything on the screen can be drawn correctly. You case is sounds one dimensional, so you need 4 chunks loaded at a time, max -  2 which are actually covered by the screen, and then two additional ones to make sure that every terrain point in the first two chunks is the adjacent terrain point loaded.
Logged
Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic