Map Generator- Please Critique!

Yeah I could pretty easily respawn the map as I move east, kind of as if I am on a tank track. Maybe 1 row at a time as I move.

Maybe if I use 2 sets of Vector Arrays:

  1. One Vector Array stores all the tiles for gameplay purposes. It would be the original map Vector Array.
  2. Another Vector Array stores all the tiles for render and GUI purposes.

The problem would be properly updating arrays using some middle layer. My head is spinning just trying to think about how that would work. It could be done though, so I will keep it in mind.

Ideally, there would be a giant portal wall that the player just passes through, and which also passes visuals. My map already generates in a way that makes each end ready to mesh together, so it should just be a matter of getting the portal to work. I will do some research and see if I can come up with something.

Look forward to it. :slight_smile:

Btw, I was reading up on A* and found a pretty awesome resource for both pathfinding and tile based map generation:

General
http://www-cs-students.stanford.edu/~amitp/gameprog.html#hex

A* - Be sure to hit all 13 pages of this document
http://theory.stanford.edu/~amitp/GameProgramming/AStarComparison.html

My take:
Instead of moving camera with controls - move whole map itself. When row/column touches edge of screen - make a duplicate and move it to other side outside of the screen, then move original and duplicate simultaneously. I made a quick video to describe idea better.
It super cheap, you don’t need thousands of hexagons(That means you don’t need static mesh instances, just static mesh, which make life simpler), easy to modify game logic for this approach.
However, first problem which I can think of - how to handle simultaneously vertical and horizontal panning, but I think you can figure it out by yourself, if you like this approach

That could be one way to do it.

The biggest problem I would have though is all the arrays that would have to be updated continually, and then referencing them properly. Would still have to reference them off screen as well, which could be a huge pain for the AI. A thousand units just had their grid coordinates changed… Even if you have the rectangular map maintained separately, it would be a big process to handle conversions with all the shifting vectors.

Additionally, zooming out would be an issue with all the static meshes. I would most likely keep the map cylindrical so there could still be thousands of hexes rendering and updating as you move around.

Currently I am looking at shadowing the map to the east and the west. In a way this is similar to what you have except it does it with the whole map, once for each side. The key point for me is that the Vector arrays are easily translatable between the shadows and the core map. Change Index 43 on the shadow and you can update Index 43 on the Main map, the other shadow, and the other dozen arrays that store information for each tile. If vectors are shifting around then that becomes a complicated job of tracking everything. Unless you have a straightforward solution for the vectors and the zooming I don’t think I would want to go in that direction.

Here is my current wrap:

Currently working on the streaming volumes for the shadows.

Ok, so World Wrap is basically implemented using the 3 map solution. There is a barely perceivable flicker as I teleport back to the middle map which is more obvious when zoomed out and you can see a whole map width. Given that the map is the smallest size with no bells and whistles, this solution may not work out in the end, but it works as a proof of concept and testing ground until I figure something better out. Could use a variation of zeOrb’s idea if I can be confident that all the math and array updating won’t bog things down(or melt my brain).

Sometime soon, hopefully tomorrow, I will create a new Map Generator post with an updated look at my current generation process and what I will work on next. I will leave the OP of this post untouched so people can look at it for reference.

The flicker may just be motion blur, depending on your visual goals you can just disable it on the Post Processing volume or do something more fancy like turn it off, move the camera, then turn it back on.

I’d really like to test what Ze0rb suggested in Blueprint, it’d be a good measure of how terrible clearing and re-creating multiple Instanced Static Mesh components really is. I think I’ll try to throw something together this weekend that does that.

And I am loving this thread! So much good stuff here.

Sweet, hopefully it is something I can just turn off or at least momentarily. I was wondering if the flicker might be due to a slight miscalculation or rounding error on my hex spacing, so hopefully it is an easy kill.

Btw, OMFG on the “Break Post Process Settings” node… lol

I would love to see your results on his method. If you can, throw some random math in there to see how it handles running lots of operations as you scroll the map.

I have created a new thread to show the latest version of the generator in detail. If you like we can continue our conversations over there. :slight_smile:

This is actually really good! I think you got the variation better and the lighting is certainly more improved :slight_smile: Infact I can see acouple of levels of water is it?

Thanks. :slight_smile:

By variation you mean the continent shape? This is generally how the biome generation looks when it is completely random. I was testing the dual continents generation for awhile there to see how I could tailor it. At some point I will do that again with this new system but completely random will always be a map option too. :slight_smile:

As for the lighting, nothing changed there other than perhaps the position where I took the screenshot from. Just the stock UE4 sun. I am not really going to worry about how pretty it looks until much further down the line, though I have been thinking of going in a more stylized, non-realistic art direction to allow for bigger maps and better overall play quality.

file

can you send me that file.

Because I see you have experience with ISMC and collision, can you help- during random rotation and movement, many instances of ISMC/HISMC component are overlapping. How to prevent that? I am trying to make asteroid fields. Thanks

Are you working with a hex grid like mine, or something else? If you are randomly rotating hexes you just have to make sure you only randomize between the 6 difference hex positions, but if you have a different problem I will need more details.

I do not use any system (hex grid, etc.). I can’t set Simulate Physics on ISMC/HISMC, because it is denied from the source. Can you tell me in this case what I should do to prevent overlapping between instances of one ISMC?

Sorry, I don’t use physics and nothing of mine collides with anything other than trace hits so I am probably not the best person to help with that issue.

You might want to ensure instances can even work with physics at all, because they may not be able to without some workarounds.