Jump to content

  • Log In with Google      Sign In   
  • Create Account


c++ sfml Looking for idea how to make a map/multy layer difficult


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 BaneTrapper   Members   -  Reputation: 1149

Like
0Likes
Like

Posted 14 July 2013 - 07:39 AM

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)

Then
Get to display/draw it in code
Get to generate most simple of map

Then
Manipulating the terrain
Streaming during runtime

Then
Improve!

 

MAP::

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.

Question:
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.

Current projects:
The Wanderer, 2d turn based rpg style game

www.gamedev.net/topic/641117-check-up-the-wanderer/


Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS