Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / 2D Isomap Issue

Author
Message
Grim Gary
13
Years of Service
User Offline
Joined: 12th Dec 2010
Location:
Posted: 12th Dec 2010 20:11
Maybe I'm just having a brain fart or some such, and as best I can figure this bit of code should work.

Background:
This code takes world chunks arranged in a 10x10 grid (0-9). Each chunk is a 96x96 tiled map. The display area of the map is 13x13 This code should read parts from other world chunks if the player is on the edge of a particular world chunk. However, when the player walks into another world chunk it seems to forget to read the chunk they just came from. Any help would be appreciated.



-Grim
Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 12th Dec 2010 22:09
Could you show a screen shot of the problem?

Correct me if I'm wrong, you want the world chunks that the player is not on to be darker but when you cross to a different chunk nothing happens to the previous chunk?

Grim Gary
13
Years of Service
User Offline
Joined: 12th Dec 2010
Location:
Posted: 12th Dec 2010 22:16
A screenshot by itself isn't very revealing unless its in motion.

Let me clarify a bit:

Lets say player is on World Chunk 3X 2Y and moves north onto 3X 1Y (After stepping from Map Coordinate Y 0. It seems once the player crosses onto the new world chunk and onto Y 96 the above code seems to forget to update anything south of him (in the old Chunk)...until the old chunk is completely out of view (out of the 13x13 display area). Once the player heads back south though, the chunk that he came from before (at 3X 2Y) seems to read again fine.

Nothing to do with making the tiles around him darker.

-Grim
Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 13th Dec 2010 08:01 Edited at: 13th Dec 2010 08:02
Took your post long enough to show up.

I get a better understanding of your problem now. I took a look at your code again and might have found something.

Is this suppose to be "OR iModChunkY > 9" or "OR iModChunkY > 96"?


David Gervais
Retired Moderator
19
Years of Service
User Offline
Joined: 28th Sep 2005
Location: Montreal, Canada
Posted: 13th Dec 2010 10:32 Edited at: 13th Dec 2010 10:34
I think this 'IF' line is the culprit...



I think the last iModChunk variable is missing the 'X' (should read "iModChunkX" just before the final "> 96")

And like Ashingda 27 said.., is the second iModChunkY supposed to be "> 96" (since you mention that "the player crosses onto the new world chunk and onto Y 96")

Anyways I think this line in the code is where the problem is, it looks wonky.

Cheers!

Grim Gary
13
Years of Service
User Offline
Joined: 12th Dec 2010
Location:
Posted: 13th Dec 2010 14:25
Hehe! Thanks! So it was a moment of blindness! (Relief!)

-Grim

Login to post a reply

Server time is: 2024-11-08 23:45:48
Your offset time is: 2024-11-08 23:45:48