I’ve been working on a little 2D turn-based space 4X for a while, and I’d like to add procedurally-generated hex-based maps. (I will probably make a separate prototype first, in a new project.) I’m wondering whether to generate my own procedurally-generated 2D mesh or to use Unity’s hexagonal tilemap. Is the tilemap just as good a way to make terrain procedurally? I incline toward making my own 2D mesh, as I already have some idea how to do that, but I’m not sure.
Also, I’m using the new input system. Whether I use the tilemap or my own custom mesh, will I need to attach a physics raycaster to the camera to detect clicks on the map? Is there any alternative?
The important part is to move forward with your game idea.
Make your own levels first, get 100% of everything proved out to work (spawning, navigation, etc.)
Once you have one level created and fully-playable, all initial features in your game, then start thinking about “How could I create code to produce this procedurally?”
You cannot answer that question until the game is at least substantially playable, has all the features, demands, requirements, distances, powerups, guns, props, enemies, etc.
Thanks for your reply. That’s a fair point. I have made wargames before, but always in other engines (Godot, Gamemaker). I’ve never tried refactoring them to add procedural map generation. Maybe I should. But the idea of going back to those engines is not appealing!
In any case, to get started on this new project, I do need to make a map, even if it’s not a procedural one. I guess I’ll just try a tilemap and see how I like it, and get units and AI up and running. If I don’t like the tilemap, I can switch to my own mesh and sprites. As you say, I can always add procedural code later.
Procgen in Unity is just so much fun. I don’t know about those other engines but wow, I love procgen in Unity, but it will take me a liftime to fully master.
(I still say you need to develop your game first though!)
You’re welcome to see my random mishmash of procgen stuff here: