Smallones

Lots of cool and useful tips to mod either serverside or clientside
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Smallones

Post by Swaffy »

I want to begin learning/working with Smallones. I have the basics of pathfinding done, now I want to learn more.

Can someone help me find tutorial(s), or help me directly?
I love you guys for putting up with me for so long.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
POTAmatt
Posts: 89
Joined: Mon Dec 07, 2009 9:09 pm
Location: New Yawk

Re: Smallones

Post by POTAmatt »

There really is no need providing you can get your pathmaps into Ed42 one way or another (using BFSPC, etc) to touch them up. As long as your paths are a minimun of 2-3 pixels wide, the SA's will be connected in the smallones files when you covert the textures back to pathmaps. You can double check by converting them back again to textures to see how they were interpreted. I went through this getting the bots through all the tunnels in BFV. Often it was just a matter of adding a black pixel or two in a tight area to open it up, and the bots would go through it (assuming the strategies are written to make them go that way).
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Smallones

Post by Swaffy »

My only problem is that the AI are walking and/or driving vehicles around things that are just in weird spots, I just want to "redirect" them to a more reasonable route.

For example: I have a DefGun next to a road, and the AI drive around the back of the DefGun instead of driving down the straight road. I get why they would do that, but I'd like them to be guided down paths that make more sense.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
POTAmatt
Posts: 89
Joined: Mon Dec 07, 2009 9:09 pm
Location: New Yawk

Re: Smallones

Post by POTAmatt »

I know what you mean. I find myself streaking the pathmaps when i want to keep them on the roadways:

Image
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Smallones

Post by Swaffy »

So I should just draw a lot of sideways lines everywhere? I thought about doing that, but felt unsure of the results.
I'll try it this afternoon.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
POTAmatt
Posts: 89
Joined: Mon Dec 07, 2009 9:09 pm
Location: New Yawk

Re: Smallones

Post by POTAmatt »

I wanted to show that example as a way to keep the bots from taking shortcuts off the roads, but with that in mind, i find myself using dots and dashs at keypoints to discourage bots from taking certain routes. Given a choice, bots usually will select a wider path.
cajunwolf
Posts: 115
Joined: Tue Jul 10, 2012 2:03 am
Location: Houston, Texas
Contact:

Re: Smallones

Post by cajunwolf »

Ok Swaffy, I see you have already started a thread, kewl. As I mentioned in the other post from the wee hours I will give a brief explanation here as a prelude to the mentioned tutorial. This can be a complicated topic and a lot of background knowledge of the Battlefield AI is a prerequisite to fully getting your head around how these files fit into the big picture. It is also important to have advanced knowledge of Battlefield mapping because to have outstanding AI performance you have to create your map from the very beginning with AI in mind, especially static object placement. The latter is essential for the generation of good pathmaps to where your "smallones" will come out right. I am going to attempt to show you why and answer your question, Swaffy, as to why the bots in your map go around the DefGun the way they do. Hopefully, I will get some good feed back that will help me better write the tutorial.

First let me address this question or issue ....
POTAmatt ...
I know what you mean. I find myself streaking the pathmaps when i want to keep them on the roadways:
I just path the roadways and it works perfect. Here is how I go about doing this. Using a sacrificial copy of the map (always have and work with one of these) I use the euro wood fence, or what ever you want, and I place it all along the roadways, trails, etc. Now drop this StaticObjects.con file in your maps directory within your ed42 dev folder and fire up ED42. Now you just paint everything in those areas white except the areas within the fence or what ever marker you used. All you are saving in ED42 is the textures anyhow so feel free to flatten the terrain at will to aid in painting the pathmap. Now generate you a new set of pathmaps, pack the map, load and play. Wha La! Your bots follow the roads or trails. Now I usually only do this with Tank maps because infantry should follow allowable terrain unless you want to say, have them follow vehicles along the road like a marching column. Hummmm .. that gives me an idea for a map .. a supply column moving along a road .. strafing with a P51comes to mind..... I digress .. darn ADHD!

Anyhow you get my point here right?

Next we have the best question in the class from Mr Swaffy! I mean you couldn't have asked a better question, and I have like the perfect example. I am hoping the two of them will help me explain this.
For example: I have a DefGun next to a road, and the AI drive around the back of the DefGun instead of driving down the straight road. I get why they would do that, but I'd like them to be guided down paths that make more sense.
Ok, how many of you have played Bocage with bots? Have you ever noticed how all the Axis bots when leaving the Axis base going towards the bridge, all run to a point way to the right of said bridge, then cut back and cross it?

Ok lets put things in perspective, here is an image from Bocage of the area we are talking about. I have the point of interest marked.
Map image showing location of waypoint in question.
Map image showing location of waypoint in question.
Ok now in both cases the bots are going where they are because of the "smallones" files. I prefer to call them a waypoint file as is the term AchingLasers used, and is more fitting to their purpose. I will get to the different files and what they are in a moment, but first lets have a look at the info waypoint files for this area of the Bocage map. I think you will start to get the picture. Now I am using FourCentsShy's kewl little tool he is or was developing called BFSAK or Battlefield Swiss Army Knife. This tool along with Genpathmaps are a total must have in any serious AI coders tool box. It is very buggy because it is a total beta but usable if you get a handle on it. The last time we chatted he was revamping it to load the map for edit like ED42, with with the ability to move spawns points and save in the Singleplayer folder. Anyhow I have it opened to Bocage and the Infantry pathmap, set to show the smallones.
View of smallones in FourCentsShy's BFSAK tool.
View of smallones in FourCentsShy's BFSAK tool.
You will note in the second image that I have a red arrow and my cursor on the waypoint (in the largest dogo area) for that info tile. This is where the bots go as they leave the connecting dogo area from the previous info tiles to this one. This is why you see all the bots run to this point then head across the bridge and in your map, Swaffy as they run around the DefGun. Can this be fixed? Oh yes it can. One way is to use BFSAK and simply pull the waypoints where you want them and save. You have to remember that if you generate a new set of pathmaps afterwards you have to re edit the waypoints if needed. If you put in the time and properly do your pathmaps the waypoint - info file pretty much take care of themselves.

Now in this image I have moved the waypoints in several areas to make the bots go where I want them to, the best you can given their reactive nature. Now this is the infantry map and even more important for the Tank maps as you can well imagine. Notice the difference of the waypoints between the two images. In the second I have the points flowing towards the windmill and sawmill then towards the second bridge.
View of waypoints after edit.
View of waypoints after edit.
Now that is one way to do it, but the proper way is to paint your pathmaps to where the smallones or waypoints come out right in the first place. In the case above I would paint or white out the whole area of that tile except for the path to the bridge, and once a new set of pathmaps are generated, the waypoint would then fall pretty much in the center of the path at the start of the bridge of it's own accord. You will note several other connections in different colors. This is because some tiles have more than one non connected dogo area and they are ranked by size. Each tile can have 4 states, 00, 01, 10, and 11. Largest to the smallest by size. The 00 would be the largest and in 4c's tool and genpathmaps diag images, they are yellow. The next largest is 01 or red then blue and green for 10 -11. If any of these dogo areas connect with a dogo area in an adjacent tiles, a waypoint connection is made. The trick is to have all 00 dogo areas but, this is not always possible. You first paint your pathmaps as clean as you can, and if you still have issues you then move them with BFSAK. They do not have to be all lined up like that and there are only certain cases where it occurs. In this case you have a bridge on an angle and a narrow gap where all traffic has to pass. If for instance in was all flat terrain and you had waypoints centered in tiles on both sides of the bridge the bots most likely, if there was a good reason to cross would go straight for the bridge.

The most important thing to remember is that you need to white out ANY AREAS that a bot does not need to go, or would never have reason to go. This reduces the waypoint connections to areas not used or don't need to be used within the battle area making the bots play and follow the map more like you intended. It is with your pathmaps along with proper strategies that allow you to do what scripting that is possible with BF AI. I once added AI to a BF1918 map for a friend where he had to armies charging each other head on down a slope to a valley below with three control points. First I used a striping technique as you demonstrated POTAmat, but a series of them connected by StragicAreas with connected neighbors, and each group of bots spawned in their own "cells" at first, then charged down the hill. The effect of the multiple Sa's and random striping patterns gave them all a realistic weaving back and forth movement as the groups mixed then aggregated into a whole in stages until ending up in the open area around the CP's where fight began in earnest. Was pretty kewl but took a lot of work and especially in pathmapping, coding SA's and writing strategies.

Think of it this way. The SAI for a given side says "Bots, I need you to go here." so he consults the pathmapping files for infantry and tanks, noting he is at at waypoint such and such. Now they need to be at waypoint this and that, so he lays out all the info tiles using the waypoint file as a guide (it is the index or xy grid) from point A to point B and the bots take off. This is some times why you see them making kind of zig zag paths because they are going from waypoint to waypoint, tile by tile towards their destination. It's actually an abstraction layer designed to save memory for the old rigs we were gaming with in the days the game came out. In fact the whole AI system uses an abstraction layer for this purpose. In the early days bots were dumb because of not only a lack of memory but crappy AI code to boot. The stock pathmap for Bocage is total trash and I am being nice. I am in the process of doing my own for all of the stock maps. Anyhow I digress again.

Let me end this one and start part two for the rest of the story as this post is getting a bit long.

Someone needs to show me how to do one of those video tutorial things! Come on this old dog loves new tricks. All this typing and image work, jeez it's a lot of work.
Image

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

Re: Smallones

Post by cajunwolf »

Ok here is part two and I have to be brief as it is after midnight now.

First lets go over the files that make up the AIPathfinding group. Now terminology differs between 4c and AchingLasers, but each are speaking of the same thing.

First are the pathfinding or searchmap files. 4c calls them a searchmap and it is closer to what they really are. This would be your main "*Level0Map.raw" file. Both the waypoint and info files are made from the searchmap for that vehicle type.

Second is the "*info.raw" file which both call the info file or info map. This is a 64x64 image of the info tiles. These are the tiles with the various size dogo and donotgo tiles.

Third is the "*.raw file or as 4c calls it the smallones and AchingLasers calls it the waypoint file. It is compressed one more time to 32x32. I find waypoint a more appropriate name myself because that is what it is, an index or grid that gives x-y coordinates for all the waypoints in each info tile.

Now using Genpathmaps I have the following images. They are 2048x2048 original size but I have reduced them for viewing here so detail is lacking. You will see enough to understand what they are, and if you want to look at the full size images I have a link for download of both as .zip.

First is the info file for Bocage.
Bocage InfantryInfo,raw file image.
Bocage InfantryInfo,raw file image.
Second is the smallone or waypoint file.
Infantry.raw file image.
Infantry.raw file image.
Now using Genpathmaps I converted the waypoint file to text. Now it is a large file but here is the first part of it.

Image res: 2048 x 2048
Image tile res: 32 x 32
Total tiles: 1024
Set point - tile: 15x02:0 pt: 42x62
Set point - tile: 16x02:0 pt: 97x127
Set point - tile: 16x02:1 pt: 01x59
Set point - tile: 16x02:2 pt: 61x63
Set point - tile: 16x02:3 pt: 51x63
Set point - tile: 17x02:0 pt: 54x58
Set point - tile: 17x02:1 pt: 27x63
Set point - tile: 17x02:2 pt: 37x63
Set point - tile: 18x02:0 pt: 34x62
Set point - tile: 18x02:1 pt: 55x61
Set point - tile: 19x02:0 pt: 04x62
Set point - tile: 04x03:0 pt: 43x63
Set point - tile: 05x03:0 pt: 38x62
Set point - tile: 06x03:0 pt: 06x54
Set point - tile: 06x03:1 pt: 58x62
Set point - tile: 07x03:0 pt: 34x50
Set point - tile: 07x03:1 pt: 35x62
Set point - tile: 08x03:0 pt: 34x54
Set point - tile: 09x03:0 pt: 22x62
Set point - tile: 10x03:0 pt: 50x62
Set point - tile: 11x03:0 pt: 34x58
Set point - tile: 12x03:0 pt: 18x54
Set point - tile: 12x03:1 pt: 46x58
Set point - tile: 12x03:2 pt: 27x63
Set point - tile: 13x03:0 pt: 50x38
Set point - tile: 13x03:1 pt: 63x19


So as you can see the waypoint file is nothing more than an index if you will as to how the whole thing is constructed. The SAI would use this map to find the point A to B coordinates and the info tiles to use to get there. I think all can see now just how important those smallones files are right?

You can see the whole file here is you want to.
The full sized diag images above can be downloaded here in a zip file.

Now as I mentioned before and you can see now how placement of your objects on the map effects the out come of your pathmaps. I also want to mention again that pathing only the actual battle areas the bots are going to use and whitening out EVERYTHING else. The cleaner your pathmaps are the better the AI. As an example of what I mean I am going to use two maps as an example.

First is a map for BFV I did a long time ago. It was just after BFV came out and there was a big to do argument on the forums about weither or not bots could actually use the buildings interior. There were several loud mouths of course claiming it could never be done etc. Well I built this little map as a test and proof that it could be done and you could even place control points inside structures. I basically connected the various buildings by their doorways and attached it all the the Hue Citadel. We of course know today it is very easy to do, but at the time this map surprised them. The main thing I want you to notice is the pathmap and how clean it is then how nice the info-waypoints came out.

First is an image of the map so you can get things in perspective.
Map image
Map image
Max number of attachments reached.
Image

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

Re: Smallones

Post by cajunwolf »

Continued ...

Next is the pathmap. Note that there is nothing pathed but the areas the bots use.
Pathmap image.
Pathmap image.
And finally the info - waypoint image in BFSAK.
Info and waypoint image.
Info and waypoint image.
The next map as example I will do in a new reply as it has three attachments.
Image

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

Re: Smallones

Post by cajunwolf »

This map was sent to me as were many to add AI to. I used to get hundreds and chose the few I could do from the ones where someone had put a great deal of time and effort into and it was a really nice looking map that played well. This was one of those. At first it just looked like on of the many silly maps I got with all the buildings connected, but looking closer I saw a lot of work and very clever use of statics. The map was finished in a very professional manner so I said "hey, what the heck". Well it was one of the most challangeing maps I ever added AI to let me tell you and the one where I really discovered what the smallones were and what they did.

First an image of the map.
Map image.
Map image.
Next the pathmap. Again notice how clean my pathmap is.
Diag image in BFSAK
Diag image in BFSAK
And last the image of the diag image in BFSAK.
Pathmap image.
Pathmap image.
That about wraps up what I can do for now. I will try to get everything into a more complete tutorial as soon as I can. Any questions, comments, or information please post it.

The above two maps can be downloaded if you want to try them out. My map Urban War Beta is that, a beta and is always a WIP but very fun to play, it is for BFV. SWAT, for bf1942 is a real exciting total action map and everyone over at BFSP loved it.

First my old map Urban_War_BetaA.

Hakasi's SWAT_XL Map.

I have a AI tool Kit for download here that contains Genpathmaps and BFSAK. You can get it HERE.

L8trs,

Cajunwolf
Image

"When you're up to your butt in alligators, you forget your original intent was to drain the swamp!"
Post Reply