Page 1 of 1
Create 500 tiles X and Y (500x500) quickly?
Posted:
Sat Apr 27, 2013 4:17 am
by Hblade
How can I make a map 500x500 instantly (with "air" tiles)? I've tried using for loops but it just hangs, or takes a very long time to create all 500x500 (Which I understand is a poop load of tiles). Whats the most optimized way to do this? (500 tiles wide and 500 tiles high)
Re: Create 500 tiles X and Y (500x500) quickly?
Posted:
Sat Apr 27, 2013 5:19 am
by tzoli
What do you need it for?
For FreeCity I used a map system that shows only 16x13 from the map and the tiles only exist as datas.
But If you need them as real tiles(actually actors) I can't help you.
Re: Create 500 tiles X and Y (500x500) quickly?
Posted:
Sat Apr 27, 2013 5:22 am
by skydereign
There isn't a more efficient way to do this. The reason it is slow when you create 250000 is because you are creating 250000. Optimization has to do with the number of commands run, and how long each takes. In your case, you are running only one command, 250000 times.
Re: Create 500 tiles X and Y (500x500) quickly?
Posted:
Sat Apr 27, 2013 7:17 am
by Hblade
Ahh ok thanks sky =) I have a simple workaround though
Re: Create 500 tiles X and Y (500x500) quickly?
Posted:
Sat Apr 27, 2013 6:00 pm
by lcl
You could do it so that you create only 1 row (500 tiles) of tiles in one frame.
Then the program won't need to create them all in one frame and
it won't lag. You could even make a progress bar to indicate the progress.
Sorta like what I did with the level loading of the unfinished Worm War game.
Re: Create 500 tiles X and Y (500x500) quickly?
Posted:
Mon Apr 29, 2013 4:47 am
by Hblade
Lcl! I love you haha, thanks man =)