That looks so cool and nice! Good luck in development! Hope "it will end in enjoyable game" (not a nuclear war ) How do you make this "terra incognita" effect? (unexplored areas are not shown)
Thanks!
I don't know if I have a great answer for you. I don't think it's doing anything fancy or clever.
The map is currently a giant VertexArray which has its vertices set once immediatley after map generation. I have a variable representing the unexplored map color (I think its currently at an rgb of 22, 22, 22), which is what the background color of the window is set to, as well as what each vertex color on that array is initially set to.
I keep track of a few vision related things for every nation. Each tile has a VisionCount associated with it for every nation. If for instance a unit moves (or is created / destroyed), this VisionCount is updated for every relevant tile. In that way I know whether or not to draw a given unit or city.
But yeah, when a tile goes from unexplored to explored I update the VertexArray, changing the relevant vertex colors from the unexplored color to that tiles actual color.
Originally the vertex array only contained the tiles on screen, and I was reconstructing the array each time the camera panned or a game update happened, I'm not sure if there's a meaningful difference in terms of performance between the two. Eventually I'd like to convert it to a vbo so that there's not a ton of data continually getting sent to the video card each frame, but it runs fine on my old laptop at the moment so I haven't bothered.
I also used to do some crazy stuff with the background color and map edge, where I wanted the background color to be this certain shade of blue, but I couldn't set the background color at the start of the game to that, because then the player would be able to easily see where they were on the map by panning the camera around.
So to solve that problem, when a player explored any map edge, I'd cast a ray along that edge to either the actual end of the map if it was explored, or it'd continually cast to the edge of the screen if not explored. I'd use the two points on this ray to draw a shape filling out the remaining skybox of the screen.
So the camera is at the same spot in both of these screens. The top left edge isn't drawn in the first screen because the player hasn't explored a tile on the top left edge yet.
So in that first screen, the blue in the top right is a shape explicitly drawn. Like I said, it allowed me to have a separate background color and unexplored terrain color, and it's the type of thing that I personally appreciate and think is cool, but uh, on reflection it's a bit insane to focus on things like that when the actual gameplay needs work. That code currently isn't even in the game anymore as I commented it out during a refactor one day.
Tangents like that are partly the reason why this game is taking me so long to make. I've been trying to focus purely on the things that actually matter now. Which, as an aside, I implemented the above city location code and it looks like it's working well enough. Pretty happy about that.