Hello,
I’m thinking about the best way to write a strategie game. as far as my imagination gets me I can think about 2 ways to implement a 2D gameworld:
-
A Tiled Map, you make your board/field out of smaller fields, called tiles, these tiles each have the same hight and width, and are represented through an Object in your 2 Dimensional Array, that contains informations about units, buildings etc. on this tile.
-
A positionbased map, On this kind of map the building- and unitobjects have a position object, that tells us where it is, and they also have an radius or hight and width, when you move the units on this map you change their position Object and the render method does the remaining.
I believe, the Tiled Map is the easier one to implement, but not as multifunctional as the position map, what makes the Tiled Map (at least for me) easier is, the easier posibility to build a uniue terrain. On the Tiled Map you do it with an attribute of your tile object, that says what kind of terrain it is (I would do it so), but with an position map that gets a little bit harder. My way of doing it would be to create an 2D pixel-array, that says what terrain is on which pixel, and when I’m trying to build something I check for a collision (checking every coordiante in the range of the new building for the right terrain).
My Questions are:
- What do you use?
- Maybe what do you want to use, and why? (If it’s different from question 1)
- How large can this 2D pixel-array be, that it’s still performant enough?
- Everything else you know about this topic.
Reasons for me asking:
I’m thinking about writing a strategy game, that gives you as much freedom as possible, and for that I want to implement a “position map” that let’s the user build and move everything as exact as possible.
Greetings
biro