PDA

View Full Version : Graphical glitches after editing the map



Dead Moroz
10-28-2004, 10:55
I'm editing default campaign map of RTW and found out that when I change something in map_heights.tga it cause small changes throughout all the map. So different bugs appears. Most of them are just minor graphical glitches. But some are more serious problems.

http://www.ruslan-com.ru/zotov/bugs.jpg

My question to Duke John, MonocerosDragon and other people who created their own maps. Did you experience the same graphical problems? How did you solve it?

And to CA: What could I do wrong editing the map_heights.tga? Any recommendations?
Also I noticed that map_roughness.tga is not required to generate the map. But may this file cause those graphical problems?
And the last question. Are you planning to include strategy map editor in future patch?

Midnight
10-28-2004, 12:03
Yes, I experienced various nasty-looking glitches in the map, and I solved them by painstakingly going through them, one by one, finding out what was wrong, and editing it. AFAIK, if everything's good, there's no glitch. However, excessive height coming directly out of the sea can cause nasty jagged edges, sea-cliffs on land cause things to go screwy, single dots of sea with only a diagonal connection to the main ocean cause glitches...

It's a matter of trial, error and patience.

Duke John
10-28-2004, 12:08
It appears as if the map_regions is differing too much from map_heights. You do have some freedom, but I doubt that you can make entire river (topright) in map_heights without making the river in map_regions. In map_regions the regions are still attached to each other, hence the borderline in the middle of the river, but according to map_heights it is water.

As a rule of thumb ( at least a rule I keep in mind ) is to differ the map_heights not more than 2 pixels. Map_heights is twice the size as map_regions, so when you look at a single pixel of the latter:

*

it becomes in map_regions:

**
**

which you can change (using my rule of thumb too)

*0
*0

or

*0
00

etc. Small islands shouldn't be a problem (although you should give them cliffs like the little greek islands from the imperial campaign using map_ground_types), but rivers like in topright is pushing the limits.

Dead Moroz
10-28-2004, 13:04
Really ALL these bugs were caused by changing a small part of Alps - I made some mountains lower. Maybe the border between highland and lowland is too sharp?

Any comments from CA?

Btw, guys, how did you make map_heights for your own maps - manually by brush tool, etc. or by converting some real map?

Midnight
10-28-2004, 14:17
Manually, although it would have been a pain without some painting experience and a graphics tablet.

Duke John
10-28-2004, 14:32
Try renaming map_heights.hgt so that R:TW can no longer find it. It's not necessary to run the game and I heard from Jerome that it was somehow used to finetune. Anyway, my Japan map works without the file (and lucky for that since it's not generated).
The reason for doing this is that since you change the map_heights.tga it starts to clash with map_heigts.hgt which might result in unwanted side effects all over the map.


I also use a tablet and set my brush at opacity 10, hardness 1, and switching in grey tones to ensure smoothness of the altitudes.


A sidenote: don't see the CA employees answering to your plea as a given. I notice more and more questions directed at CA while normal members are most of the time also able to answer. See the CA answers as a surprise bonus.

tailkickusmaximus
10-28-2004, 14:38
I had the same graphical problems and most were not related to being out of sync with the map_regions tga.

Mine were related to pixels somehow going form say 12, 12, 12 to 12, 11, 12 which would cause weird relations in how the roughness was generated on the campaign map.

I'm also going to concur with what Midnight said.. excessive height up out of a sea region can cause weird things to happen.. especially on tiles which are only 2x2 (1x1 on the region map)

And yea.. you are going to have to go through each bug and attempt to find out what happened.

Dead Moroz
10-28-2004, 14:41
Try renaming map_heights.hgt so that R:TW can no longer find it. It's not necessary to run the game and I heard from Jerome that it was somehow used to finetune. Anyway, my Japan map works without the file (and lucky for that since it's not generated).
The reason for doing this is that since you change the map_heights.tga it starts to clash with map_heigts.hgt which might result in unwanted side effects all over the map.
Unfortunaly these bugs appears the same with or without map_heights.hgt.

Did you create both map_roughness and map_heights tgas for your maps or map_heights only?

Dead Moroz
10-28-2004, 14:45
And yea.. you are going to have to go through each bug and attempt to find out what happened.
The problem is that these bugs appears on places that have not even a pixel edited. And everything works great with default map_heights.tga.
~:confused:

tailkickusmaximus
10-28-2004, 17:47
The problem is that these bugs appears on places that have not even a pixel edited. And everything works great with default map_heights.tga.
~:confused:

You would be suprised what might have changed in just editing one side of the file.

Find the area in question.. eydropper it to verify that it is a valid greyscale range in rgb (all three numbers the same)

When in doubt.. zero to , 5, 5, 5 (I've found this height works well for transition from sea to coast)

Vercingetorix
10-28-2004, 20:21
If you guys need a program to convert map_heights.tga to map_heights.hgt I could probably wip one up.

Dead Moroz
10-29-2004, 08:39
If you guys need a program to convert map_heights.tga to map_heights.hgt I could probably wip one up.
Thank you! ~:cheers:

But what is the role of map_heights.hgt? I noticed that the map can be generated and work well without this file.

Vercingetorix
10-29-2004, 20:52
The map_heights.hgt is simply the heights of all the vertices. My understanding is the map is made up of tiles (I haven't really looked much into it but that's how most maps are). The dimension of the map is 255x156. Each tile subdivided you get 511x313 vertices. Hence the size of the map_heights.tga; 1 pixel per vertex. The hgt file takes all the info in desc_terrain and the map_heights.tga and turns it into an easy binary format. If however the hgt file is not needed I would guess it's just used for quicker loading purposes, and creating one would be unnessercery.

tailkickusmaximus
10-29-2004, 21:48
Heights is for the campaign maps
roughness is the visual representation of heights for the battlemaps

Do a test to see, level off roughness and shrink the distance between min and max in the descr_terrain.txt to something like between -1k to 1k.

Load up the map and you'll see that the campaign, now battle in an area that would have hilly or mountains in the campaign map and when the battle loads, you'll notice it's mostly flat.

You roughness should closely match your heights file, and each one is neede otherwise you can get CTDs and hangs when coming out of battlemodes.

This honestly does not rear it's head in the given campaign map, but really comes to light when creating a map from scratch.

The current 80 by 80 map I have works like a champ 100% of the time now once I realized that.

Sleaker
10-31-2004, 14:04
Really ALL these bugs were caused by changing a small part of Alps - I made some mountains lower. Maybe the border between highland and lowland is too sharp?

If you lower the Alps, which are most likely the tallest mountains on the map, then the distance between the min and max heights listed in the terrain.txt will be less. So you'd probably get the effect of "rising water"