Neroxis Map Generator

0

Ah nice point. The cartographic shader already renders lines based of slope. We just need to make it more selective. You can sort-of-mod shaders because they are cached and you can overwrite the cache. Now we just need a shader author...

0

maybe randomizing the sun colour and angle will make the maps feel a bit more different

0

@nine2 You can also add them to the repo, as is done with other shaders.

What would you like for it to do specifically? At the moment it is an edge detection algorithm:

// phase 0
float4 TerrainPS0( TerrainPixel pixel) : COLOR0
{
	float2 v0 = terrainSizeCoeff * pixel.world.xz;
	float2 v1 = v0 + float2(1,0);
	float2 v2 = v0 + float2(0,1);
	float2 v3 = v0 + float2(1,1);
	
	float2 t = v0 - floor(v0);
	
	float2 h0 = tex2D(elevSampler,gridSizeCoeff*v0).rg;
	float2 h1 = tex2D(elevSampler,gridSizeCoeff*v1).rg;
	float2 h2 = tex2D(elevSampler,gridSizeCoeff*v2).rg;
	float2 h3 = tex2D(elevSampler,gridSizeCoeff*v3).rg;
	float2 h  = clamp(lerp(lerp(h0,h1,t.x),lerp(h2,h3,t.x),t.y) - 0.0001,0,1);
	
	float3 hypsometric = tex1D(hypsometricSampler,h.x).rgb;
	float1 topographic = tex1D(topographicSampler,h.x).a;
	
	return float4(hypsometric,topographic);
}

// phase 1
float4 TerrainPS1( FramePixel pixel) : COLOR0
{
	static const half dx = 1.0 / frameWidth;
	static const half dy = 1.0 / frameHeight;
	
	float4 color = tex2D(frameSampler,pixel.texcoord);
	half4 c  = color.a;
	
	///	The following edge detection filter was adapted from
	/// and example provided by Mark J. Harris and GPGPU.org
	half4 bl = tex2D(frameSampler,pixel.texcoord+half2(-dx,-dy)).a;
	half4 l  = tex2D(frameSampler,pixel.texcoord+half2(-dx,  0)).a;
	half4 tl = tex2D(frameSampler,pixel.texcoord+half2(-dx, dy)).a;
	half4 t  = tex2D(frameSampler,pixel.texcoord+half2(  0, dy)).a;
	half4 ur = tex2D(frameSampler,pixel.texcoord+half2( dx, dy)).a;
	half4 r  = tex2D(frameSampler,pixel.texcoord+half2( dx,  0)).a;
	half4 br = tex2D(frameSampler,pixel.texcoord+half2( dx,-dy)).a;
	half4 b  = tex2D(frameSampler,pixel.texcoord+half2(  0,-dy)).a;	
	float topo = saturate( 16.0 * ( c - 0.125 * (bl + l + tl + t + ur + r + br + b )));
	
	return float4(color.rgb - topo.rrr,0);
}

This is the input of the shader:

float4x4 viewMatrix;
float4x4 projMatrix;

float4 gridSizeCoeff;
float4 terrainSizeCoeff;
float1 terrainHeightScale;
float1 elevMaximum;
float1 elevMinimum;

float1 frameWidth;
float1 frameHeight;
texture elevTexture;
texture hypsometricTexture;
texture topographicTexture;
texture frameTexture;
texture decalTexture;

I'm not entirely confident what a 'hypsometricTexture' is. We can not add (or remove) input parameters, but we can toy with what it does with the input.

0

Nice to hear that you guys have been playing and enjoying the generator. I always appreciate being able to watch replays to help improve the generator.

With regards to reclaim currently it always generates some amount of trees and small rocks although this can get down to about 2k mass. Reclaim options are a possibility but I have not yet defined a good range for those.

With regards to the visibility of pathing and texturing tit is constantly being improved to increase the pathing visibility. There were some updates in the last day to increase the texturing so that it is keyed based on the slope values in order to make it clear what is walkable and what is not. There are still some edge cases that are being ironed out. There is a way to change how the cartographic map is displayed so that may be something I look into as well.

With regards to civilian bases there are currently four that are possible. 2 enemy and 2 neutral. If you have ideas or want to contribute additional ones I can let you know the template I would need. Each map currently has a 50% chance of trying to place civilians and a 50% chance of those being enemy bases.

With regards to the sun colour and angle there are a set of biome templates that are used for generating the map with the textures which includes the sun color and angle and I am always looking for people who are interested in contributing some more.

0

I'm not entirely confident what a 'hypsometricTexture' is. We can not add (or remove) input parameters, but we can toy with what it does with the input.

hyposymmetry is the measure of land elevation I believe if that helps.

0

@jip what I was hoping to achieve was to display a line if its unpassable.

The current shader perhaps [renders the heightmap clamped to brackets] then [runs edge detection over it].

Perhaps the first step needs to change to [render white if thisCellHeight - previousCellHeight > threshold, else render black]. Something like that?

0

Well the issue with the reclaim at the moment is its frequently quite high like 20k mass. That is fun but diversity would be nice.

0

I'd like to suggest bases and colours and stuff but don't really have the time to implement things

0

Would be nice if the map previews were retained.

If I watch a local replay then i can see the map preview in the local replays vault - until I restart the client.

0

I think the reclaim you see may just be a luck of the draw/run as the reclaim ranges from 2k to 20k on the 10km maps I have generated.

With regards to the previews that falls into the issue of spamming a users file system which does not have a great solution for storing just the preview as well.

0

Are you just using the zoomed out ctrl+shift totals that don't count tree groups with <10 mass or living civs? I just checked all my mapgen games and the range was 6k-27k on 10x10s, not counting tree groups (which the "low" reclaim maps definitely had) and civs. We've definitely never had a legitimately low reclaim map where there's no rocks or trees to bail out your build order - for reference Loki has 3k on ctrl+shift and no competent player would ever call it a low reclaim map.

Anyway, whether or not the mapgen can very occasionally spit out a genuinely low reclaim map is kind of beside the point, it's a far more influential variable for a map's gameplay than the number of ramps, for example, so it would be good to have a slider for it.

0

a player reported this artificial looking reclaim
93b59cd2-a7b5-415f-8cd5-36b68ce15409-image.png

0

As a note I have added in the link to the map generator discord on the first post for anyone who wants to hop in there as well.

0

And making the reclaim especially the rock reclaim look less artificial is on the todo list.

0

i feel like there are always heaps of tree groups

0

Heh yeah it currently only places trees as tree groups as one of the historical bottle necks for generation time is actually placing all of the trees on the map so tree groups were used to have a similar prop density and reduce the prop placement time.

0

@nine2

@nine2 said in Neroxis Map Generator:

On some maps it is hard to tell where you can walk or not, which is critical for early build decisions.

For example this replay I realise early on that there is only one chokepoint on the map so I dont defend the expansion even though it looks open. The other player doesnt realise the choke points, and at minute 7 is defending an expansion that is not under threat - and has less units than me in the middle. So I can get an advantage that is game defining but not fun at all. https://replay.faforever.com/13282178.

What would be cool is if there was a way to visualize where you can walk.

It is possible to generate a useful 'strategic overlay' image where red is unpathable, blue is underwater, etc. Then you can put the image on the screen as a decal and change the LOD so that it only appears when totally zoomed out. In this screenshot you can see one i made manually. It's not perfectly positioned but you can see its marking red & yellow where you cant walk and white where you can walk.

unknown.png

Not sure if its possible but perhaps a shortcut key could toggle the decal on and off.

This feature would be useful for all maps to be honest (including non mapgen) but with mapgen its much more important because you dont know the map before you play it. It's no fun to spend 15 minutes on a dud game because one player fatally misunderstood the map.

this looks decent af

2

It has been a while since I last updated here's what has been in progress and what is going to be worked on in the future. As of this post the generator is currently at Version 1.2.4

As always feel free to leave feedback in this thread or also get in touch with me at the map generator discord: https://discord.gg/XZW62UdYfm

What's been done:

New Generation Types
Two additional types of map generation have been added to allow for three different ways of generating maps. The types are described below.

  • Casual - This method is for casual gameplay with the generator. When used the generator will use the settings specified by the client for the various options. Additionally the generator will produce a preview of the map that the host can view from the client before launching the game

  • Tournament - This method is for when the generator is used in tournaments. All the options in the client will be forced to be random and there will be no preview visible for the host in the client, however the preview will be visible in the game lobby. This is so that the player hosting the game does not have an unfair advantage as to what the map will look like. Additionally the time that the map is originally generated at is added to the map description so that players can verify that the map was not generated at an earlier time. The map generation process in this case depends on the time the map was originally generated so any attempt to falsify the generation time will result in a different map being generated.

  • Blind - This method is for when players want the full random experience. This method of generation will also replace the in game preview with the dice icon so that players will not see the map until the game is launched. This method will also use the timestamp similar to the tournament method.

Biome/Texture Overhaul
The biomes that the map generator uses have been entirely reworked. Previously generated maps only used 4 out of 8 possible textures and they now currently use all 9 available textures for map detail. The textures are placed according to the map features such as slope, height, and terrain type so that can both look more realistic as well as better communicate the terrain to players in game. Additionally individual props have been specified to complete the theme of the map. This means no more evergreens in the desert. There are currently 9 biomes that the map generator can choose from. 3 Red, 3 Green, 1 Snow, 2 Yellow, 1 Desert.

Additional biomes can be added as well. If are interested in contributing a biome the following section describes how each texture layer is used.

To submit a biome you can create a map which uses textures as defined. Send the map files to me along with a name for the biome and it can be tested and added to the list of biomes upon approval. Please send me the map files and do not upload the map to the vault

Additionally you will need to specify props that should be used with the map as well. The generator currently has three categories of props that should be used. tree groups, rocks, and boulders. Rocks are the smaller rocks seen around cliffs or fields. Boulders are the larger props.

The layers are used as follows:

  • Layer 0: Base layer - used for sea level ground.
  • Layer 1: Ground Accent - used to accent land not on plateaus
  • Layer 2: Plateau Accent - used to land higher than sea level
  • Layer 3: Slopes - used to texture ramps
  • Layer 4: Slopes Accent - used to accent slopes
  • Layer 5: Steep Hills - used to texture high slope areas
  • Layer 6: Beach Texture - used to texture the beaches
  • Layer 7: Rock - used to texture impassable terrain
  • Layer 8: Rock Accent - used to accent impassable terrain

Terrain Generation Overhaul
The terrain generation has been reworked to produce more realistic looking mountains and plateaus while also introducing more variety to the types of maps that can be generated.Additionally new symmetries have been added as well.

Civilians
Civilians bases have been added as a possibility to the map generator. Currently there are 4 civilian bases possible, 2 neutral and 2 enemy. If you would like to contribute a civilian base layout you can design a base on a map and send the map file to me for review and approval. There are not strict guidelines however it should allow for reasonable gameplay if it were to be placed anywhere on the map.

AI Markers
All generated maps should now include AI Path Markers.

Prop Placement
Props are now placed more randomly so you will not see perfect grids of rocks.
Trees and cliff rock will also have greater appearance variety from map to map.

What's to come (planned but not yet implemented):

  • FFA and multi-team maps - Allow for generation of symmetric and asymmetric FFA maps as well as arbitrary number of teams (e.g 3v3v3)
  • Additional generation options (e.g. reclaim, mex count, ...)
  • Improved 20km map generation
2

Now the only thing left for my wet dream to come into existence is Blind mapgen mode + unexplored mode ingame. If anyone manages that, ill host a doubleblind tourney

1

I have been looking into whether it is possible to do an unexplored terrain version in the map scripting since unexplored fog of war was removed in the game from the OG supcom.