• Announcements

    • Detrux

      Site Relaunched   10/13/2016

      Welcome back to BFEditor.org! We've upgraded the forum software, removed the spammers, and improved security. Apologies for the downtime! Det
Sign in to follow this  
Followers 0
VictorM

Black Mountains ?

15 posts in this topic

Hi,

for my first post, I would like to congratulate everyone who contributes , day after day , to enrich this wonderful bf forum: often , I found here the answers I sought in vain elsewhere: specialy thanks to mschoeldgen[Xww2], Catbox, clivewil, bergerkiller for their excellent advice.

Today , I decided to ask for help in a more direct way :

My project is to edit maps from DEM data ( Aster ) real topography , and many mountains; I use 3DEM and L3DT to get the final HeightmapPrimary.raw . Within the editor,(map 1024x2) all work perfectly and by controling levelsettings carefully, the exact dimensions are met .

I apply the textures , either with Bf_TPaint or EcoMAP :

In the editor , i get this result:

298482201310291826.png

great B)/>/>

but in game , it's catastrophic :(/>/> : all the textures disappear once exceeded a certain height in the mountains .

629192screen001.png

it seems that the problem starts once the altitude exceeds 500 meters .

Do you think it might come from a limitation of the enginegame? don't know....

if so, can i expect to remedy this by changing a few lines of code, maybe ?

or so, I thought it was , perhaps, of a lighting problem ? have try but don't work....

what to do, I'm completely stuck.

any ideas ?

thanks

Share this post


Link to post
Share on other sites

if it was a editor limit it would just not render it until you got closer I think. Fog settings? can you post another picture or 2?

Share this post


Link to post
Share on other sites

i'm wondering if you've gone through the cloud plane... do you have cloud planes enabled?

Share this post


Link to post
Share on other sites

CTRifle

Fog settings? can you post another picture or 2?

552663screen007.jpg

421872screen008.jpg

Renderer.fogColor 0.00/0.00/0.00

Renderer.fogStartEndAndBase 0.00/2000.00/2000.00/1000.00

When i test a new map, I prefer a cloudless fog. It's more easy to detect problem

Anyway, with or without fog, it's always the same problem in game:

in Bfeditor, the texture terrain is perfect as you can see in the first image.

clivewil

do you have cloud planes enabled?

Skydome.skyTemplate skydome

Skydome.cloudTemplate cloudlayer

Skydome.hasCloudLayer 0

Skydome.hasCloudLayer2 0

Skydome.scrolldirection 0/0

Skydome.scrolldirection2 0/0

Skydome.cloudTexture

Skydome.cloudTexture2

Skydome.skyTexture

Skydome.domeRotation 0

Skydome.fadeCloudsDistances 1000/1100

Skydome.cloudLerpFactors 0.5/0.5

Skydome.flareTexture

Skydome.flareDirection 0.00/0.00/0.00

really weird :blink:/>/>

Before ask to you this riddle, i searched a lot on Bf2 forums, but I have not found anything about these strange black high mountains, I assumed that few mappers tried to land strong difference: I don't know why, while the visual interest is obvious for airplanes and helicopters: you should try with 3d glasses, it's really wonderful.

do you think the problem could come from the altitude of GILights ?

i continue searching...

thank you both:

any help is welcome

Edited by VictorM

Share this post


Link to post
Share on other sites

You can definitely see the jagged pixelated edges of the shadow so it is almost certainly a lightmap issue, although I'm not sure why they are black at a certain altitude. Have you tried re-baking the lightmaps or at least look at one with a DDS viewer to confirm the problem? If you want you can zip up the map I'll look at it for you.

I noticed your Skydome.flareDirection is 0/0/0, is your Lightmanager.sunDirection also set to 0/0/0? This will cause the editor to generate black lightmaps since the light has no source direction.

i'm wondering if you've gone through the cloud plane... do you have cloud planes enabled?

I'm not sure what you mean by cloud planes? The scrolling clouds are part of the skydome.fx shader and they use the second unwrap of the skydome mesh.

Edited by Coronaextra

Share this post


Link to post
Share on other sites

OK, thank you for the informations Coronaextra: Now, I think it should be better to start with the most simple map, so go to Essenciel: so I created a 512x1 map and drew a peak of 512 meters; one flag, one spawnpoint, one heli to go see in altitude, textures by hand, generated lowdetails.

The black shadow appears well near 500 meters.

815597screen009.jpg

(Other tests have indicated that, whatever the size of the map, it is still to this altitude 500 that the problem appears)

Then I positioned the sun, and sunflares verticaly: but in the game, the black shadow is still there.

Lightmanager.init

Lightmanager.skycolor 0.5/0.52/0.55

Lightmanager.ambientcolor 0.509804/0.517647/0.556863

Lightmanager.sunColor 0.7/0.67/0.63

Lightmanager.sunSpecColor 1/1/1

if v_arg1 == BF2Editor

LightSettings.TerrainSunColor 0.97/0.81/0.57

LightSettings.TerrainSkyColor 0.63/0.70/0.75

LightmapSettings.waterSunIntensity 0.8

else

terrain.sunColor 0.97/0.81/0.57

terrain.GIColor 0.63/0.70/0.75

terrain.waterSunIntensity 0.8

endIf

Lightmanager.staticSunColor 0.67/0.64/0.55

Lightmanager.staticSpecularColor 1.00/1.00/1.00

Lightmanager.staticSkyColor 0.63/0.70/0.75

Lightmanager.singlePointColor 0.00/0.00/0.00

Lightmanager.sunDirection -0.040167/-0.994134/-0.100418

Lightmanager.enableSun 1

Lightmanager.effectSunColor 1.00/1.00/1.00

Lightmanager.effectShadowColor 1.00/1.00/1.00

Lightmanager.defaultEffectLightAffectionFactor 1

Lightmanager.hemilerpbias 1

hemiMapManager.setBaseHemiMap Levels/black512x1/groundhemi 0.000000/0.000000/0.000000 2048.000000 512.000000

Lightmanager.treeAmbientColor 0.00/0.00/0.00

Lightmanager.treeSunColor 1.00/1.00/1.00

Lightmanager.treeSkyColor 1.00/1.00/1.00

if v_arg1 == BF2Editor

else

run /Common/Sky/SkyDome/skydome.con

run /Common/Sky/Flare/flaresprite.con

endIf

Skydome.skyTemplate skydome

Skydome.cloudTemplate cloudlayer

Skydome.hasCloudLayer 0

Skydome.hasCloudLayer2 0

Skydome.scrolldirection 0/0

Skydome.scrolldirection2 0/0

Skydome.cloudTexture

Skydome.cloudTexture2

Skydome.skyTexture

Skydome.domeRotation 0

Skydome.fadeCloudsDistances 1000/1100

Skydome.cloudLerpFactors 0.5/0.5

Skydome.flareTexture

Skydome.flareDirection -0.04/-0.99/-0.10

Renderer.fogColor 128.00/128.00/128.00

Renderer.fogStartEndAndBase 10.00/512.00/1.00/0.50

I'm afraid we can't find a solution, it would be such a shame not to take advantage of the high mountains in game....... :unsure:/>

if you want, you can easily try at home, by creating this simple card 512x1, as I did .

Edited by VictorM

Share this post


Link to post
Share on other sites

I confirmed the problem and it is height related. I made a 512x1 map and set its TerrainHeight to 750. In the editor it looked fine:

editor_screen_zpsc6849904.png

I got in game and saw the problem:

screen019_zpsfecce787.png

Looking at the files I discovered the problem in the compiled Colormaps

BrokenColormaps_zps48cb1288.png

It seems that the editor will generate black colormaps if the terrain is higher than it is wide. This map is a 512x1 and the terrain above 512m is painted black. I really dont know why though. The total Z range is not immediatly apparent when you look at the screen shots. The flat area of the map is already at 300m. This is because when I created the map I set the default height to 100m, and when I changed the range it shifted it to 3x that. If you sample the height of the lowest part of your map with the platform tool, you may find that it is higher than you thought.

You said you generated your heightmap with L3DT, and it may be that your heightmap has a very low range of values, forcing you to extend the draw range in the editor. This problem could be fixed by Leveling out the heightmap in photoshop to give it full value range (0 to 1).

Another solution is to just copy /yourmap/editor/colormaps to /yourmap/colormaps/ but these will not have road textures burned onto them. If you must have a very large Z range in your terrain a better solution is to just user a larger size map so that the Z dimension never exceeds the X or Y.

Edited by Coronaextra

Share this post


Link to post
Share on other sites

Okayyyyy Coronaextra B)/> : all the black textures have gone away, now.

750891screen010.jpg

very well done :)/>

just a little thing; with my first mountains map, i was using 1024x2 scale, and the problem appeart near 500 meters: we are far away of 1024, in that even .

something else, I noticed in the settings of the minimap (C:\Program Files\EA GAMES\Battlefield 2 Makeminimap.con that there is a limitation to 500 meters in altitude: maybe it would be interesting to understand whether it can influence this phenomemon, no ?

rem *** store settings ***

varExec v_drawObjects = renderer.drawObjects

varExec v_drawBundledMeshes = renderer.drawBundledMeshes

varExec v_drawStaticMeshes = renderer.drawStaticMeshes

varExec v_drawSkyDome = renderer.drawSkyDome

varExec v_drawRoads = renderer.drawRoads

varExec v_drawTerrain = renderer.drawTerrain

varExec v_drawNametags = renderer.drawNametags

varExec v_drawTrees = renderer.drawTrees

varExec v_drawHud = renderer.drawHud

varExec v_drawFps = renderer.drawFps

varExec v_drawBoundingSpheres = renderer.drawBoundingSpheres

varExec v_drawLightSources = renderer.drawLightSources

varExec v_drawLightSourceOpacity = renderer.drawLightSourceOpacity

varExec v_drawConsole = renderer.drawConsole

varExec v_perPixelRenderingDistance = staticMeshRenderer.perPixelRenderingDistance

varExec v_fogStartAndEnd = renderer.fogStartAndEnd

varExec v_dynamicShadows = shadowManager.dynamicShadowsEnabled

rem *** setup for miniMap ***

renderer.drawObjects 1

renderer.drawBundledMeshes 1

renderer.drawStaticMeshes 1

renderer.drawSkyDome 0

renderer.drawRoads 1

renderer.drawTerrain 1

renderer.drawNametags 0

renderer.drawTrees 0

renderer.drawHud 0

renderer.drawFps 0

renderer.drawBoundingSpheres 0

renderer.drawLightSources 0

renderer.drawLightSourceOpacity 0

renderer.drawConsole 0

rem renderer.fogStartAndEnd 1000/1000

shadowManager.dynamicShadowsEnabled 0

staticMeshRenderer.perPixelRenderingDistance 1000

renderer.makeTopWorldScreen 512 miniMap 0/500/0 2048

aiDebug.draw 0

rem *** reset settings ***

renderer.drawObjects v_drawObjects

renderer.drawBundledMeshes v_drawBundledMeshes

renderer.drawStaticMeshes v_drawStaticMeshes

renderer.drawSkyDome v_drawSkyDome

renderer.drawRoads v_drawRoads

renderer.drawTerrain v_drawTerrain

renderer.drawNametags v_drawNametags

renderer.drawTrees v_drawTrees

renderer.drawHud v_drawHud

renderer.drawFps v_drawFps

renderer.drawBoundingSpheres v_drawBoundingSpheres

renderer.drawLightSources v_drawLightSources

renderer.drawLightSourceOpacity v_drawLightSourceOpacity

renderer.drawConsole v_drawConsole

renderer.fogStartAndEnd v_fogStartAndEnd

staticMeshRenderer.perPixelRenderingDistance v_perPixelRenderingDistance

shadowManager.dynamicShadowsEnabled v_dynamicShadows

anyway, many thanks for your help, Coronaextra

Share this post


Link to post
Share on other sites
The flat area of the map is already at 300m. This is because when I created the map I set the default height to 100m, and when I changed the range it shifted it to 3x that. If you sample the height of the lowest part of your map with the platform tool, you may find that it is higher than you thought.

yes, I have often noticed that important detail, especially when you add the surrounding areas; that's why, with mountains maps only, i set the default height nearby zero.

You said you generated your heightmap with L3DT, and it may be that your heightmap has a very low range of values, forcing you to extend the draw range in the editor. This problem could be fixed by Leveling out the heightmap in photoshop to give it full value range (0 to 1).

Ooooups, it's a great suggetion, but have no idea how to do this; could you explain the proccedure, please ?

thxs

Share this post


Link to post
Share on other sites

Open your heightmap raw file with photoshop using the settings, 1025x1025, 1 channel, 16bit, IBM. Hit Ctrl + L to open the levels window. Play with the sliders to so that image uses full range and goes from black to white instead of just middle gray values. When your're happy save the file.

One caveat of giving the heightmap full range is that if you wanted to lower the terrain to make a lake or river, you cant because the heightmap is already black and it cant go any lower.

It's like, how much more black could this be? and the answer is none. None more black.
" Edited by Coronaextra

Share this post


Link to post
Share on other sites

as you can see, the heighmapPrimary.raw exported from L3DT is pretty well balanced, and I did nothing to change.

162644201311011644.png

personnaly I don't like changing the histogram of a real world map, because I found that it inevitably leads to distortions in the topology.

Share this post


Link to post
Share on other sites

Hum, we have always the "black" problem with the miniMap......

634615201311011619.png

Share this post


Link to post
Share on other sites

Find your MakeMiniMap.con file in the bf2 directory, copy it and give it a different name. Then edit the camera height to an altitude above the hightest point on your map. I changed mine to 1024. I also had to change the last number to 512 (my map is a 512x1). You have to create your own file because the editor ignores changes in the original (at least it did for me)

MakeMiniMapTest.con

renderer.makeTopWorldScreen 512 miniMap 0/1024/0 512

In the editor, go to Tools>Options>Miscellaneous and type the name of your file into one of the CustomCommandFile fields. If you put your file in the same directory as the original you don't have to specify a path. Close that then go to Tools>CustomAction and select your file. It should create a minimap.dds in the same directory as the con file.

Rhino has a good minimap tutorial. His cons have code for specifying an output path and rendering multiple high res minimap tiles.

http://www.bfeditor....showtopic=10926

Edited by Coronaextra

Share this post


Link to post
Share on other sites

you just save me a lot of time, man : really.

I believe that this time the problem is solved.

thanks a lot, Coronaextra ;)

vic

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0