Hello. (c++ sfml)
Why em i making this post?
Well the reason is, i wanna talk to my fellow "everyone" about and how to do the following thing:
2D tile based map that needs a few things:
Need to generate it at random
It needs to hold a info what type each tile is (because of gathering, mining, digging)
Should be able to stream it (during runtime save peaces of map that are far from user and open the ones hes gonna cross up to (if nothing to load, generate)
A height (aiming about to 0(bottom) to 3-10(top) height of land from bottom to far top)
Able to manipulate the terrain ( Because of digging, mining...)
If you are willing, think about it and gimme a helping hand if you had experience in doing this.
I am gonna probably make a tutorial with what i end up.
What i am gonna do first.
Think off what the base for a map needs to be in code
How i am gonna save it (format)
Get to display/draw it in code
Get to generate most simple of map
Manipulating the terrain
Streaming during runtime
Ive figured the sintax i am gonna use for the map.
Using sf::VertexArray for drawing, and array of ints to represent tile ID for code.
At moment when i have to change the tile as in (user cleaned a grass tile, it becomes dirt) acces the quads in vertex array change the texture coords, also change the ID in int array for the tile being manipuled.
Ive dumped the idea of having "height" in map for now.
Also i am dabbling how to save the map, its gonna be saved intro .txt file for sure. What scares me is that i need to figure out how to pack multyple maps intro one file so i dont bunch up tens... if not hundred of map.txt files in folder of the game when it runs. Deleting them when the "world" is desrtoyed/deleted.
Is there a container i can use to save multyple files something as zip. But usable during runtime of application?
Edited by BaneTrapper, 14 July 2013 - 11:36 AM.