Map Generator 3.0 - Please Critique!

My initial vision for the project is more of a game aid than a game. I DM for a pathfinder group and have been wanting to build my own world for a while now. On top of that my PCs like to flesh out their characters lives well beyond the scope of day to day adventuring, and while the downtime systems provide good inspiration for how to run that kind of thing, it can be a lot of work to manage and update the world as things happen, especially if you want to keep the events that happen to the PC connected to the larger world. Having looked around at tools, I havenā€™t really found one that I like, and since Iā€™ve been looking for an excuse to use UE4 anyways I decided to build my own.

In short: the overall initial vision for the project is a tool that I can generate maps and manage an extended pathfinder campaign inside. The next steps would be implementing logic such that the decisions of the PCs will have real consequences on their surroundings, even ones that Iā€™m not sure about. The final version, if I ever got that far would be a tool and DMā€™ed for me, doing the fuzzing of the rules where appropriate for the sake of a better story and such so that I could just jump in and play with my players. Goals B and C would be great but the initial version is a big enough chunk as it is so thatā€™s where Iā€™m going to start.

I suppose I do have 1 update that never really made it into this thread. A few months ago I basically implemented what I was talking about in this post: Map Generator 3.0 - Please Critique! - Blueprint - Epic Developer Community Forums The river system was rewired to use breadth first search combined with the height map.


Notice how the white hexes are mountains, and the heightmap forms around them. Red has a high cost which lowers as you move towards green. This naturally leads the river to find the easiest, most natural looking path to the ocean when combined with the pathfinding algorithm. Also notice how mountain ranges will naturally have rivers flowing from both sides to opposite oceans, and very rarely through them.

I also changed river placement from an edge tile setup to be center tile, since that significantly cleans up the river logic and also makes the river more central to what is happening on a given tile. My only misgiving with that is that it could be harder to handle tile improvements with a river front and center. Worst case I figure out a way to slide the river to the edge, while keeping the logic centered on the tile. Generally a visual problem and not one of map generation.

I may give a more detailed rundown of what is happening in the blueprints at a later date. Generally this system is much less complicated than the old river system, which is good for many reasons.

So apart from that, here is a rundown of what has happened to the generator over the past few months/year that havenā€™t really been discussed here:

  • Moved generation to spread out over tick instead of locking the program up while billions of iterations are processed.
  • Took the primary map generation blueprint apart and split it up into functional areas such as Climate, Tectonics, etc. The blueprint was well over 100MB and compile times were getting stupid, so this was a good move. The old map generation blueprint now acts as the controller for all things map related.
  • Made the generator more flexible, such as being able to regenerate climate/tectonics/etc on the fly. This is key for the map editor, as well as future features such as global warming. The cool part with the map editor will involve being able to alter settings and regenerate specific bits of the generation. If you like the tectonic layout, you can regenerate landmass until you get it how you like it, and so on down the line. Moving to get this into the UI, and then add single tile updates to the map editor capabilities.
  • Implemented a save/load system.
  • Put work into the UI and centralized UI functions into a UI controller.
  • Various other minor improvements and changes that I canā€™t think of right now.

So work on the Map Editor is the current focus, with unit pathfinding and a unit controller being next in line.

Aside from that, here are some of the things that remain to be worked on with the generator:

  • Seed Options. Right now there is only 1 generation type; tectonic. This basic system can be used to make a large number of your standard generation types just bey controlling where you place the seeds. For instance, Continent generation would simply work based on the player selecting the specific number of continents, the system evenly dividing up the map to cover each continental plates plus any specified ocean plates, and then properly placing the seeds in their zones and setting the tectonic boundary types to be conducive to the formation of standalone continents(divergent). Pangaea would be similar, but you would only have to place 1 continent in the middle of the map. This could even be an option in the continent generation where the player only chooses 1 continent, thereby removing the need for an additional setting.
  • Player balancing. Currently things generate pretty randomly(based on seed dispersal), which could make for rather unbalanced starting conditions. 1 player starts on a decent sized landmass, and other starts on a small island chain. When player start positions are put into the game some work will have to be done to inject the player start position into the generation process for consideration. This is a little easier if you are doing a 2 continent setup with 2 players, but other generations will at least need a setting to increase player balance if that is what the player wants to see.
  • Map generation of other planets. When you reach the space age a small moon map could be generated which you would kind of zone to and fight over as if it were another piece of your current map. Could do the same thing for the rest of the solar system, other solar systems, etc. I see this a the natural progression of a civilization game, as opposed to ending it in the year ~2050 as seems standard. :slight_smile:
  • Historical Development. This isnā€™t exactly map generation, but it would be similar in implementation. If players want to start in the medieval age, they wonā€™t necessarily start with a naked settler or small starting city. The game will generate and grow civilizations and history up to the starting point, which would give the world a feel of being lived in prior to the game starting for the player. This could vary from vaguely simulating what the players/ai would have done to reach a certain point, to actually having the AI play the game with the giving starting conditions up to the specified era.
  • General iteration, polishing, and bug fixing.

That doesnā€™t sound like you would need overly complicated pathfinding which would make the pentagons less of an issue. Though, there are a few areas of my actual generation that would simply not work with the pentagons, such as when I am counting tiles across a continent to determine how deep a mountain range or weather pattern should penetrate.

It seems like you would need a much more spatially oriented generation system than the more tile oriented system I have. You would do more measuring of distance from A to B and less counting tiles. The only time I measure distance is for the Voronoi generation, but many of the systems rely on specific tile ā€œManhattan distancesā€ which would probably be thrown off by a pentagon. You could possibly account for them, but it would take some work to get that implementation right.

1 Like

Food for thought on your rivers:
Building the sphere mesh has force me to think in terms of subdivisions. It turns out that the combination of your tile locations and their corner locations gives you the centers of hexagon grid if you subdivided your existing grid once. This means that if you used those locations for the nodes of a finer navigation mesh for the pathfinding algorithm of you rivers they could move around and through tiles instead or the other. The only tricky part would be calculating path costs, but that would be simply taken care of if you extrapolated you current height map onto your finer mesh. After that none of the other logic would need to change.

The core of the river system requires that each tile either have a river or not. Subdividing it would only needlessly complicate the matter, both for pathfinding and the player.

The only issue with rivers right now is a visual one regarding tile improvements and other features. Offsetting the river to the edge of the hex is a pretty simple operation, though really I am hoping we can create a modular improvement system that bends around the rivers instead of forcing the rivers to bend around the improvement art setup.

Happy to see your project is ambitious as ever, :slight_smile: Especially when you have the progress to back it up. Any plans of going all Dwarf Fortress and generate random history/famous figures and battles? The lack of updates in this thread had me worried that your progress had slowed down, but it seems like you are making quick headway. If I was in your shoes I would begin implementing gameplay elements like unit movement, combat etc. sooner rather than later. Being able to actually play a game (if a rudimentary one) on your map might give you insights that might lead back to improvements in world generation. By the way, I know you want to build everything from the ground up, since that is the best way to understand the systems you are using, but if you ever want ideas or inspiration Iā€™ll send you the newest version of my toolkit free of charge.

Yeah 2015 was definitely a slow year that is for sure. Moving back to the states in a month, so once that process is complete I am hoping I can get back up to full speed.

How detailed the pre-generated history gets will really be determined if/when I work on it. I doubt it will be as detailed as Dwarf Fortress, but if I decide to make it a full system it will have some work put into it. :slight_smile:

I agree about getting to gameplay and I was actually hoping to be deep into pathfinding by this time. Due to work/health induced exhaustion levels I have generally tried to not bite off more than I could chew at the time. Working on the map editor has other benefits that lead directly into other gameplay systems though, even pathfinding. Even simple bits of the editor have required me to open up and make other areas more flexible which would have also been required for any number of other things. Also, the UI stuff I pick up for the map editor will be directly relevant for the gameplay additions as the UI basically is the game with 4Xā€™s.

I may take you up on your offer for a new version of your toolkit when the time comes. Learning your system from the ground up by spending time expanding it to meet even more complicated objectives could hopefully kill 2 birds with 1 stone. I could make a thread like this one while I do it if you donā€™t mind too much of itā€™s code being exposed to the masses. :slight_smile:

Glad to hear youā€™re picking up steam again :slight_smile: Iā€™ve also had a pretty exhausting year in regards to work, so Iā€™ve also made less progress than what Iā€™d have wanted, but I will probably begin having more free time in a couple of months when Iā€™m done with data collection for the research project Iā€™m working on.

Iā€™ll help in any way I can when you come around to path finding. Iā€™m sure Iā€™ll be learning a lot from seeing how you tackle the problems specific to your project. You are free to share screenshots and videos of any of my blueprints. I have already exposed all of them in my YouTube videos anyway. Anyone with enough free time could already recreate my entire toolkit just from watching my nearly 3-hour long blueprint tutorial video, though if they are willing to go through that to save 40 bucks I figure they deserve it :stuck_out_tongue:

Sounds good. I will definitely have those videos open in another screen while I work it out! Hopefully my work can help improve your toolkit as well. :slight_smile:

I think I just might be able to finish the barebones map editor prototype before I leave in a couple weeks, but it will probably be May before I get back up and running at the new house.

This is very impressive. Great work there.

Thanks! I should hopefully be ready to start working again soon. Moving is hell! :slight_smile:

Is this only available in 4.10? I just upgraded to 4.12 and I canā€™t find it in a Marketplace search.

Not on the marketplace, sorry. :slight_smile:

Holy wow! This is exactly the sort of thing I am looking to do. Could we have a chat?

Hey, not sure if youā€™re still active - fast approaching a year since the last post in this thread - but Iā€™d be interested to hear if youā€™ve made any improvements since to your world wrap methods (now that youā€™re back on a plane and not a sphere), or if they still require an east and west ā€˜shadowā€™ map. Iā€™ve been trying to get level streaming working but no luck thus far.

I just can say: amazing!

Noooo all the images expired! This is a tragedy!

Hereā€™s a video I found from back in the day. Hope it gives some idea of where he was at with thisā€¦