- Home /
Best way to store and access info in long txt files?
I'm creating a 2D tileset game. so each location a player can goto is on a x,y grid so say its 100x100. like a checker board map basically..
i want to not only store the location of each 'tile' in the file but i also need to store everything that might be in that location.
right now what im thinking about is like so:
1,1
int,string,string,int,float,so on..
1,2
string,int
only problem with that is if you view the file it makes it near impossible to know what each variable is just from looking at the file.
my other concern is when i go to read the file.
if i have to say get the 5th variable stored at location 234,2 how am i going to do that. i mean i think i can figure it out but its probably not the best method.. and i figured id better check before i start and find myself screwed
any better ideas?
keep in mind im going to be making big maps.. like 1000x1000. so that's 10,000 'tiles' i have to store variables in lol..
teach me o' wise people. :)
i guess it might has something to do with arrays and databases.. just not sure how. im going to go look into that in the meantime.
1000 x 1000 is 1,000,000 :) Too much to work with text files anyway, I suggest you take a look at UnitySerializer available for freed in the asset store, maybe you can even use it without having to modify it for your own needs.