Page 2 of 2

Re: modoption idea

Posted: 25 Nov 2009, 05:07
by Noruas
Something tells me doing that would dictate that since pathing is not changing, units can walk into a firey doom.

Re: modoption idea

Posted: 25 Nov 2009, 06:21
by Google_Frog
Has anyone tested adjusting the entire heightmap?

Re: modoption idea

Posted: 25 Nov 2009, 07:54
by smoth
I forget who it was.

Zwzsg did some experimentation. Achieving some really interesting dynamic results.

but when I was working on my map options code I was told that it is very expensive to do the sort of things like adjusting the water level for the entire map. I could have been told wrong :P. I would be happy to know it was possible.

Re: modoption idea

Posted: 25 Nov 2009, 09:50
by Google_Frog
As I said.

Spring.AdjustHeightMap(0,0,Game.mapSizeX,Game.mapSizeZ,n), n = any number. Causes a freeze of about 1/4 of a second in CA (which has 15 movedefs) on Scorpio Battleground which is a 16x16 map and it has large areas of water. All the pathing correctly recalculates.

Re: modoption idea

Posted: 25 Nov 2009, 10:04
by smoth
ok what about a 24x24?

Re: modoption idea

Posted: 25 Nov 2009, 12:05
by manolo_
dont turn the easy doable lua solution into a roland-emmerich-i-destroy-everything-nightmare-with-no-happy-end

Re: modoption idea

Posted: 25 Nov 2009, 20:26
by zwzsg
Google_Frog wrote:Has anyone tested adjusting the entire heightmap?
Yes. AFAIK the conclusion was the the huge CPU cost was not caused by repathing, but by applying damage to units. Don't ask me, go read.

Re: modoption idea

Posted: 25 Nov 2009, 21:29
by Kloot
That was not the conclusion at all (there aren't even any references made to "applying damage to units" in that thread). What is clearly mentioned is the function
Auswaschbar wrote: CBasicMapDamage::RecalcArea(int, int, int, int)
... which happens to be the one that handles updates of the...
Kloot wrote: heightmap, heightmap _texture_, normalmap, slopemap, terrain LOS states, positions of features
... upon a terrain deformation event, along with repathing in the affected area. The expense does not come from a single item.

Re: modoption idea

Posted: 25 Nov 2009, 23:31
by AF
Are heightmap changes collected so that if i lower a square 5 times, it will only recalc once at the end of the frame?

Re: modoption idea

Posted: 26 Nov 2009, 07:56
by Argh
The expense does not come from a single item.
That.

Whole map, like 24/24? Sure, you can do that, Smoth, but only at runtime, otherwise you will probably desync people while it runs. Tried some stuff, that was my conclusion. Not a really big deal, if you want a map that's never quite the same twice, but obviously there are some things that aren't possible.

Re: modoption idea

Posted: 26 Nov 2009, 22:30
by Pxtl
Oh, of course. Normal terrain deformation happens when the map is damaged... so the class that handles terrain deformation stuff is the mapdamage class.

Durrrr.