AI, pathmaps, aircraft, strategic areas....

Ask questions, discuss ideas, get answers

Re: AI, pathmaps, aircraft, strategic areas....

Postby POTAmatt » Mon May 13, 2013 5:46 am

I was never sure what 'AiSettings.SetInformationGridDimension' was and might be worth looking into, but 'AiSettings.SetViewDistance' seems to be the AI physics distance. Set it to a low value like 5 meters for laughs, and you can adjust your AI LOD heights (pt boats for example) while you are at it.

I've come across the yscale issue before on a FHSW map IWO_JIMA_DAY1, if i'm not mistaken. I think it was set to something like 10 and the infantry could easily climb Mt. Suribachi, but the planes couldn't get out of its way quick enough.

the heightmap does use the full greyscale range already


I was wondering if you could adjust the contrast on the heightmap and lower the yscale.
POTAmatt
 
Posts: 88
Joined: Mon Dec 07, 2009 9:09 pm
Location: New Yawk

Re: AI, pathmaps, aircraft, strategic areas....

Postby fo0k » Sun Jun 02, 2013 2:06 pm

hmm.. to lower the contrast, but retain the same actual height, would mean having to increase the yscale further...


I am running the non-ai version of the map on the BFMODS server

You can download it here:

(If you dont have much time to play these days I'd really appreciate you loading this up just to see if anyone has issues with lag. hoping not but its big.. as we know.

Download 128planes.zip

SERVER: 173.208.44.68
User avatar
fo0k
 
Posts: 1412
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: AI, pathmaps, aircraft, strategic areas....

Postby cajunwolf » Thu Jun 06, 2013 3:10 am

The Y scale only controls how high the terrain can be, or put another way what percentage of the full heightmap scale, 0 to 255, you are using. If you want to use the full height you should have this set to 1 which will allow the terrain to be the full 255 height. The stock maps set this to .6, or 60% of the height available, and I have pretty well come to the conclusion, as with the rest of the game, this was to save precious memory and cpu resources which were very expensive when this game first came out (my rig in the day with an AMD 3200, ATI 9700 pro and 1 gig of twin channel memory set me back near $2500 bucks!). You can test this by opening a new map in BC with the Y scale at .6, and then keep raising the terrain until you see it start flatting out at some point, this being 60% (.6 of 1). Now create another map but set the Y scale to 1 and try the same thing. In each case use a static to see the Y height that it flattened out at, and you will see what I am talking about.

This terrain or heightmap then sets down into the cubemap (or skybox) and is rotated as well as "slid" up and down to match the picture of the sun on the skybox panel(s) with the lightsource vector in the SkyandSun.con file (these vector coordinates are relative to the maps center). All in all I don't think this affects the bots unless there is something hard coded to keep them x distance from the terrain, which some have suggested, but I don't fully agree with. I have had bot pilots follow me up forever into the sky and I don't think there is a real limit to the actual height of the sky. In the SkyandSun file, in some maps, you will see clouds set as high as 3500 (what ever the scale they are talking about).

@ POTAmatt

The "'AiSettings.SetInformationGridDimension" setting is for the size of the grid part of the smallones files (waypoints) and this needs to always set to 32 (32x32 info file maps). If you will remember or thread on the smallones files you will remember why. This doesn't really need to be declared because it is pretty much hard coded. If you will look at a lot of the original stock BF42 maps this line is missing. I have even seen in the many forums over the years where folks have played with this setting, obviously not understanding it's function, often with disastrous results, LoL.

It works like this ...

The search maps have 3 levels, 0-2, and each level is half the size of the previous (now again remember this is done to conserve memory and sets up a LOD system), the level 0 being the same size as the the map. What happens is that each level of compression compresses every 4 bits into one (two across, two down), effectively halving the searchmap each level. Before a searchmap is stored it is broken down into 64x64 tiles, and this creates the smallones files, or info files which is the proper term. They tell the SAI not only how to put the map back together again, but how to plot a path from point A to B using the info file part of this. The actual info file, the vehicle-nameInfo.raw file is farther compressed one additional level (32x32) to save space as it is basically just the grid of coordinates. I believe I posted images of all of this in the other thread if any are interested in the details. This in no way affects your bots so to speak because they are in aircraft so the pathmaps, to a degree, are not applicable. By, to a degree, I mean that for some reason they know of the out of bounds, but we humans are alerted to this also so who knows. Anyhow it kind of makes me think.

@fo0k ...

One thing in the AI.con that might be applicable, and I don't know if you have changed it or not, is the following line ...

aiSettings.setWorldMapSize 2048 2048 (these dimensions being replaced by you maps world dimensions).

So you might want to give this a go.

In closing let me say this ... your map project seems to work ok for humans, and one would think for this reason it should (in theory, right?) work for the ai, but there is just as much of a chance that it will not work for one reason or the other (map size being the most probable). I do know unless you could come up with a pathmap system, which would have to be entirely done by hand, you well never get land based bots to work because of the map dimension issue. FourCentsShy's Genpathmaps program can do a 8192 map (4096x2), but I don't remember for sure. I do know this, and that is that the airplane flying behavior is controlled by the "Patrol3d" settings, and 4c had successfully scripted bots in aircraft to patrol an area of coordinates. This was done a long time ago when he was ai coder for the Merciless Creations mod so I don't remember exactly how he did it, but might still have the files somewhere. If I find them I will of course post any applicable information they might contain here.
Image

"When you're up to your butt in alligators, you forget your original intent was to drain the swamp!"
User avatar
cajunwolf
 
Posts: 115
Joined: Tue Jul 10, 2012 2:03 am
Location: Houston, Texas

Re: AI, pathmaps, aircraft, strategic areas....

Postby POTAmatt » Thu Jun 13, 2013 3:39 am

This doesn't really need to be declared because it is pretty much hard coded.

Yeah, sounds right. Thanks for the confirmation, CW. I don't recall having any success straying from the usual settings (64 for 4096 maps, 32 for 2048, etc.)

hmm.. to lower the contrast, but retain the same actual height, would mean having to increase the yscale further...

Glad to hear that does work, not that i remember whether it was increasing or decreasing contrast.
POTAmatt
 
Posts: 88
Joined: Mon Dec 07, 2009 9:09 pm
Location: New Yawk

Re: AI, pathmaps, aircraft, strategic areas....

Postby cajunwolf » Thu Jun 13, 2013 4:26 am

To me raising the contrast would have more the effect of stark sharp edged cliffs and coast lines and rough rugged hills and country side to where lowering the contrast would have the opposite effect of smoothing things out. In the early days we created map heightmaps in Photoshop by terracing the terrain by gradual increases in greyscale from black to white. I would then apply a gauzian blur until the corners were round off and terrain had the smoothness I wanted. Kind of the same effect. The contrast would to some degree raise or lower the terrain, but it wouldn't effect the Y scale which is set in the terrain.con file of the map. For example if you increase the contrast, or increase the difference between the white and black, your going to raise the terrain in the areas that go whiter, but if you say have the Y scale set to .6 then the terrain will only go to 60% of it's possible height of 100% or 255.255.255 or pure white.
Image

"When you're up to your butt in alligators, you forget your original intent was to drain the swamp!"
User avatar
cajunwolf
 
Posts: 115
Joined: Tue Jul 10, 2012 2:03 am
Location: Houston, Texas

Re: AI, pathmaps, aircraft, strategic areas....

Postby fo0k » Thu Jun 13, 2013 1:06 pm

Hmm this heightmap info is a bit wrong/misleading.

Yscale controls the difference in height between a black and white pixel.

That's it.

A yscale of 1 means there's '256 in-game meters height difference between a black and a white pixel'.

You always have full use of the heightmap gradient - You are never limited to a percentage as such.

The common 0.6 value means 153 meters is the maximum (potential) vertical distance from the lowest point to the highest in the vanilla maps.
User avatar
fo0k
 
Posts: 1412
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Previous

Return to 1942 Modding Discussion

Who is online

Users browsing this forum: No registered users and 22 guests