ponedjeljak, 18. veljače 2019.

Turn based strategy game - Dev diary - Hex field in 3D world - Simple right?

I want to create hex turn based game (TBG). Newest very good example is  Afghanistan.11:

http://slitherine.com/products/641/details/Afghanistan.11

I've just finished some fundamental prototype learning all core concepts in C++ and BP to produce TBD with grid system.

Yet this prototype didn't introduced hex fields but simple Ludo type game with round fields just like simplest board game around.

My next challenge is how to create hex fields? Pondering on these question solely from technical point I've realized it's more complex than I first thought.

Board game with shine metallic figurine and cards and beautifully painted board are with use for decades. People still like playing them today. They've mastered concept of playability.

It's wast arena with great potential. One should follow his heart and passion .Hence I choose to try developing strategy TBS.

In these games, just like in chess, you need too have clear and simple look to your map.
This is key point. You are looking at map which is primarily there to cleanly give you info where are your forces in relation to enemy. Oddly 2D works better for this. Placing your infantry in woods in 2D is simple and efficiently represented:
- front plane - infantry
- back plane - trees
It just works best. How to achieve this in 3D ? We are not speaking technically just visually.

Predefined landscape

UE has excellent landscape feature. There is layer concept. One approach is to sculpt landscape on main layer. Then from code on different landscape layer "draw" hex fields where needed. I  haven't researched but it should be possible avenue of development.
I can't asses technical complexity for this but there is one other issue.
Manually sculpted landscape in UE or made in external tool like World Machine would look great. Now how would you map your hex locations to landscape? You must do it manually. In STBS traditionally each hex has terrain quality (road, plane, river, hill etc.) This is done that way in Panzer Corps 2D system. Landscape 2D image was mapped to game map.
On pro side this approach gives very artistic and beautiful map. On con side you need to manually map and you are basically stuck with it. You can resort to some kind of procedural random generation. Initial landscape hard-codes your game level.
But even that one can accept in some scenario.
Problem is  artistic. Imagine extreme case. Few mountain peeks end up with river bend. You draw hex on part mountain and part river. It is greatly distorted. One part is drawn very high on mountain peek and other is placed on river bend. Obviously we need relation between landscape and hex size. In other words landscape should conform to grid and not vice versa. You can not have mountain occupying  2.45 hex but either 2 either 3.
Conclusion is that non-procedural artistic landscape creation should  start from predefined  hex grid system and adopt terrain element size accordingly to avoid hex distortion.

World realism in board style game ?

But its not just that. You simple cannot create very high mountain peek and than place another bit smaller and so on. Contrary to gorgeous worlds in modern RPG in STBS you simple don't strive to world realism.
Height of your mountain or depth of river bend must be symbolic and not realistic.
As explained earlier you must not sacrifice crisp and sharp identification of two key concepts when looking at map:
- what unit?
- what terrain?

One can definitely learn from Slitherine hex games.

Procedural map generation saves the day?

At the moment it looks that procedural generation of map wins. As in 2D classics you create bunch of terrain specific hexes with variations and place them according to your game map like in a puzzle.
Yes it's not as nice as artistic landscape but gives simple and full control. You can always put effort in creating a lot of variations for example for mountain or town and achieve somewhat realistic look.

Camera & Perspective?

Considering above clear map representation is there any value in fly around mode for STBS? Many modern Total War style games and RTS games introduce ability to fly around map and look your units and terrain. You cruise, rotate, go up and down, zoom in/out etc.
I don't think this works for STBS. It looks to me that height of camera should be fixed. There is value in changing camera direction and of course moving in X,Y.
Definitely specific keyboard/mouse control should be made to help player quickly roam map, get back to last position, find its nearest troops. Any support for zooming  looks useless. In RPG's you can enjoy scenery and free roam but in STBS your focus is on your units in relation with opponents and terrain.
Strangely but when looking at recent success of 2D hex game like Afganistan '11 whole story of controlling camera looks useless.
Which is good news I guess. ;)


Placing units on terrain

And so we come to funny but important point. So how do you place tank model on a mountain hex?
There is a mountain peek which is pointy. Tank unit as discussed earlier must be clearly identifiable. Small model is not acceptable. Actually tank unit is more important than terrain representation.
One solution would be to cut out piece of mountain by using different mountain mesh when tank is on it. I think that answer is definitely  in making significant difference between terrain representation without unit and one with terrain with unit. For example we could flatten or smooth mountain top to place unit. Truly mountain seems biggest problems since all other terrains have mostly flatten areas.
Exception is forest.
I guess the solution is that you cannot visually place tank on mountain peek. You need some other mountain representation when tank is there. It's quite hard to avoid that it looks odd since tank has to be big. Eureka!  Tank will be covered in snow! And it will be placed on plateau which will have small slopes around like when you cut pinnacle of mountain. So focus is on pretty tank stuck in heavy snow and terrain beneath it. This will primarily point to fact that this is mountain.
Yes! You can place big rocks around it.
Same approach could be for forest. Small trees, broken branches. Yes. We should decorate unit which is in focus and put terrain in background making it small, beneath unit. Parts of terrain in question should be placed visible on unit and near it. For example, standing in river, desert sand on unit etc.

I guess we want have tanks flying above hex after all ;)