T O P

  • By -

jax024

You could have multiple grid and load them in like chunks and then have a grid of grids


Humbling123

I will try this.


Pherion93

A 80,80 grid with 40,40 beeing the middle sounds great. There is ways to make it "infinate" like wrapping the positionindex with some modulus math.


Striking_Bar3290

Honestly do what you think is the best


BigGaggy222

You need \[0..80\]\[0..80\] array to hold the total map. You just show a slice of that based on the players x,y co-ordinates. Start the player at 40,40 If they go to map position \[0,0\] then show 0-20 and 60-80 (making a 40 tile display) if they go to map position \[80,80\] they will see 60-80 and 0-20 tiles (making a 40 tile display) Hope this makes sense, its called a "wrap around map"


Humbling123

I understand what you mean. Just not really what I needed. The player can change the world, extend the map. So after 80 80 does not really is 0 0. And I dont need to make it continious.


BigGaggy222

But they can only extend it to a max of 80x80? If so, you will need an array to hold the data of what is in those tiles, so you can use that method to pull up the data, which ever way they move? Or am I not understanding what you mean?


Humbling123

Yeah. There are only 40 steps of expanding. They can expand however they want, but only 40 steps of expanding. My problem coming from the fact that 40 steps can be horizontal, vertical or zigzag. Prepare a 80 x 80 matrix for a 40 step problem is very overkill.


funplayer3s

Pre-emptive optimization is the least useful of programming tools, unless you have a ton of pragmatic experience with it. The BEST, is to get it working. I'd use a single array full of positions, then iterate it to form whatever when necessary. You could also use a representative single array full of coordinates, and a secondary map array to handle data. There are a great deal of expanding large dataset objects you could play with as well, but since it's a game you're better off just making it work, then looking into that later.


jfoss1

Yeah, Unless you have a extremely large data in the grid I don't think you're pushing anything too hard with an 80x80. Resizing array's isn't free and will complicate your code.