Page 1 of 1

heightmap repeat

Posted: Sun Oct 30, 2011 4:24 pm
by fo0k
is it possible to stop the heightmap repeating/tiling at the edge?

Re: heightmap repeat

Posted: Sun Oct 30, 2011 6:46 pm
by Senshi
I don't think so. Only workaround is to make an even larger heightmap and reduce the actual combat area afterwards, so the "border" never is noticeable.

Re: heightmap repeat

Posted: Sun Oct 30, 2011 6:53 pm
by Apache Thunder
I think an old unused geometry class "RoamTerrain" that doesn't appear to repeat. ("GeometryTemplate.create roamTerrain patchGeometry" is example of what I mean)

I think it just ends at the edge or something. But it appears to be unstable as it's a left over for the beta days of BF1942 and will CTD on map restarts. (maybe there is an alternate coding scheme with this terrain type I'm missing? I did not experiment a whole lot with this terrain type)

Dynamic shadows don't work on it either and the water appearance is altered with this terrain type. Your free to experiment with it though. :P

Re: heightmap repeat

Posted: Sun Oct 30, 2011 11:50 pm
by fo0k
heheh I will give it a try.

Actually I have been trying a technique to have a huge map appearance but on a small map size... similar to the wide open desert map in BF3.

I have made a fairly simple static mesh of the hills/mountains in the distance. This then hangs off the map by a long way but the intention is not for players to ever go there.. the battle would focus on the main map. In game I have tried a view distance of 5000 and it does look like a big area! nice to see way off into the distance. screenshot shows the normal small map in green and then the 'fake' mountains bordering it all. This is why it would be great to not have the terrain repeat as it just uses resource at these huge view distances.

In game you see it all.. its like being able to see all of a medium (actually, almost a large) map on screen always.

mountains_mesh.png
mountains_mesh.png (499.03 KiB) Viewed 11151 times

Re: heightmap repeat

Posted: Mon Oct 31, 2011 2:28 am
by Swaffy
Have a Medium map that acts like some kind of dumpland or wasteland and have giant cement walls around the map with lookout buildings around the middle.

Re: heightmap repeat

Posted: Mon Oct 31, 2011 2:36 am
by fo0k
Swaffy wrote:Have a Medium map that acts like some kind of dumpland or wasteland and have giant cement walls around the map with lookout buildings around the middle.
? Is that just a suggestion for a map or relevant to my prob? I'm failing to see it :)

Re: heightmap repeat

Posted: Mon Oct 31, 2011 3:44 am
by fo0k
Tried out the roamterrain.. very strange stuff.

appeared to be very economical when the terrain was hidden, even removing areas of heightmap that were covered by the static mesh (actually cutting a jagged line under the mesh).. but that said it was buggy.. but did appear to optimize the terrain in real time depending on where you were and what was on top of it. Of course, sadly without dynamic shadow it's better to just only use mesh and no heightmap at all!

Re: heightmap repeat

Posted: Mon Oct 31, 2011 4:53 am
by Apache Thunder
I enabled roam terrain in a map and now remembered other "bugs". The CTD doesn't seem to occur when the round restarts but when the game tries to exit the map to reload another. Also vehicles and animated meshes appear all black. Looks like lighting settings don't work with roam terrain enabled. Also note that roamTerrain does not appear to recognize the material map file as all parts of the terrain use the same material despite what is in the materialmap raw file. (I'm unsure what material it's using though. It's either material 0 (material 1000) or material 2. Material 2 is dry grass and my projectile effects when firing at the terrain does not reflect that, so I'm leaning towards material 1000 as what's being used as the global material.

The terrain smoothing is very reminiscent of what goes on with BF2's terrain. I noticed it behaves almost the same as BF2. The hard edges the BFHeroes terrain has on it's hills makes this effect much more noticeable and is seen in BF2 and now appears to behave the same with roam Terrain. Makes me wonder what Dice was trying to do with RoamTerrain.... :P

(also the terrain still tiled despite setting it to roam terrain. I think the lack of tiling was the result of testing it with El Alamein and using the debugger to remove and respawn the terrain which can result in glitches with the water and the lack of terrain past the map border might have been a bug from this as well)

So as for your problem, the only fix I can think of is making a larger hightmap raw file so that areas outside your map combat area are lower in elevation then your main map, That way your mountains won't clip into the terrain that's outside the combat zone as that area is lowered. It will still tile though so it may still limit how far you can set the view distance.

Also note that you may need to use a custom skybox other then the vanilla ones. Marshall Nord from GFMod recently made a new sky box/dome and it appears the terrain clips into the vanilla skyboxes and will be noticeable if you have fog disabled and an extended view range. ;)