Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualgnomgrol

Posted 23 June 2012 - 02:38 AM

Thanks again, but Im affraid I still cant make it.
I cant really get what to put into the two std::maps (I dont want to use an outer lib if possible).
I made the chunks mark themself for deletion as soon as they get out of range and then erease them (works fine).
But I cant get how to compute where a new chunk has to be created and what key to choose to indentifier them, as well as how a second map will help me, sorry.

What I have right now looks like the following:
One std::map which contains all chunks and an int to identifier them.
Every chunk has a startX/startZ coordinate, and its width/height. In their update() function (called every frame) they test if their startpoint (lower left corner) is in range of 500 to the player. If not, they mark themself to get deleted.

But now I cant really deside when to create a new one, and how to store it. The second map you mentioned confuses me =(

#1gnomgrol

Posted 23 June 2012 - 02:32 AM

Thanks again, but Im affraid I still cant make it.
I cant really get what to put into the two std::maps (I dont want to use an outer lib if possible).
I made the chunks mark themselfe for deletion as soon as they get out of range and then erease them (works fine).
But I cant get how to compute where a new chunk has to be created and what key to choose to indentifier them, as well as how a second map will help me, sorry.

PARTNERS