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

Ask questions, discuss ideas, get answers
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

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

Post by fo0k »

ok.. they are doing weird stuff now. every time this makes sense. they cruise off line and .. well.. I retract any confidence i had a minute ago. :mrgreen:
POTAmatt
Posts: 89
Joined: Mon Dec 07, 2009 9:09 pm
Location: New Yawk

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

Post by POTAmatt »

That's AI for ya! But then again, this map is fundamentally effed up to begin with (with regards to AI that is).

aiStrategicArea.create AlliedBase 26547/25916 26747/26116 50

You are creating a strategic area named Alliedbase whose bottom left X/Z coordinate is 26547/25916 and whose center is 26747/26116. It's initial temperature before modifications in Strategies.con is 50. If assigned here, a bot will go to the center coordinates to get ownership unless told otherwise via setorderposition. Once the SA is owned, bots will still patrol the border of the SA if they're assigned to attack or defend it.
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

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

Post by fo0k »

thank you.

so whats the deal with temperature?

the reason for confusion in last post.. I had an SA.. it was near the spawn.. and they would fly to it and circle it.. then I moved that same SA to the middle of the map.. just a coordinate change.. then their path (red line..) would still lock on to it .. but they would just fly straight from the spawn (the planes spawn direction).. still locked to SA.. but not flying towards it.

where is the logic! rofl
POTAmatt
Posts: 89
Joined: Mon Dec 07, 2009 9:09 pm
Location: New Yawk

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

Post by POTAmatt »

You set the initial temperature when defining your strategic areas, but you modulate the temperature of them in your strategies. Now if your current strategy is set to have, say, 2 attacks and, say, an agression of 100%, that means all your bots will be assigned to attack the 2 SA's with the highest temperatures at that moment.

As i mentioned, i rewrote everything in your AI folder because it's a hodgepodge of crap from botinator and who knows what else. I wrote a simple attack/defend strategy with your basic needs in mind; planes simply spawn in and head straight for the center point and then patrol it once owned. I'm going with the assumption that you don't want to change anything, because if we were able to add another CP and/or move the existing once, we could probably eliminate our remaining problems with careful placement of the flag(s). Of course, we still have that issue of them not firing, but at this point, they're probably being considered out of bounds by the SAI considering every SA is beyond that 4096 limit.

But, yeah, where's the logic? Ask me next time we work on something 'Normal'. LOL.
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

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

Post by fo0k »

I have the next project for you, fear not! Ill wait a few years though. :lol:

well all sounds awesome. At this point perhaps through sheer luck I may discover something useful, but for now I'll shut up and read this
POTAmatt
Posts: 89
Joined: Mon Dec 07, 2009 9:09 pm
Location: New Yawk

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

Post by POTAmatt »

Well, don't wait too long. I may forget the little that i do know.

I've been meaning to ask if you made any progress on that map you contacted me about a few months back? I'd always wanted to map an 'Asteroids' type map and it sounded similar.

While you're perusing the 'good book' definitely focus here:

• Stalled path finding.
• Failed sensing.
• Inadequate plan selection.
• Lack of a plan.
• Performing of dated actions.
• No action due to stalled action updating.

LOL. But seriously, if you want to know what's going on with your strats, throw on your AI stats (in AI.con) where you can see what strats are currently being run, where your SA's are defined and most importantly, who is assigned where.
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

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

Post by fo0k »

yeah we should give that a spin too. Ill send over.. is exactly what I was alluring to. perhaps can start releasing some of these concepts. :)

This AI system is fascinating stuff.. I didn't doubt it's complexity, but it's a good few steps on from what I expected.
cajunwolf
Posts: 115
Joined: Tue Jul 10, 2012 2:03 am
Location: Houston, Texas
Contact:

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

Post by cajunwolf »

Howdy Fo0K and sorry for the delayed response as I got your message on the 23rd. I had a busy week at work, but more importantly I wanted to get my head around the situation so I can better suggest a possible solution. First let me say this, and that is that there is no way to script the bots to follow any type of predetermined path of action because battlefield ai is reactive and therefore only reacts to it's surroundings at any given moment. That being said you can get them to do what you want (somewhat), or said another way get them to play the map how you want by creating situations so they tend to react to them in a way you hope they will, but they never do anything the same way because game play is dynamic. It's basically a balance thing and requires not only that the map is created with ai in mind from the very beginning, but one has to always keep in mind how the bots will react to each step of the process. You need to have strategies, CP placements, SA modifiers, and pathmapping concerns in mind just to name a few if you want the end result to be anywhere near what your original concept was in the beginning. Adding ai as an after thought never really works like you want it to because you end up compromising to much to get it to work in the first place. I have been there done that one many of times with numerous mod groups over the years.

Your never going to be able to make pathmaps for a map of this size, and yes 4096 is the max for ai as I understand it. It might be possible to create larger, but I don't know how well they will work. You could, using 3Dmax, texture the terrain using a slope texture of black and white to keep them (ground vehicles and bots) off of the mountains if you can save it in the right raw format for the different level maps. I don't see how you would create the waypoint files (smallones) though, and these are the most important if you want them to properly use the pathmaps. FourCentsShy could possibly answer this question but I haven't heard from him in a year now. He created the algorithm (or process) to convert the Level0 pathmaps to the smallones or waypoint files with his genpathmaps program. It only works on up to 4096 maps though. Now of course you only seem to have aircraft and they don't use the pathmaps so in theory, and as long as you have only aircraft, one would think you would not need pathmaps at all.

This makes me ask the question what is the theme (for lack of a better word atm) of the map? Is it a air battle only map? If there is to be no ground troops then what is the target of the bots in the aircraft? From reading the thread I am assuming that you have some "robotic ai planes" along with some on airfields (allied & Axis I presume) that all converge on one center CP. What does the center CP consist of? Some more details here might help me come up with some better suggestions.

As to the ai planes that Apache setup for you. Normally we create them by spawning a bot into the aircraft to where the only control he has is the throttle which he tends to hold on full. They spawn in the air and fly in a straight line until something stops them ( a mountain in your case). You might give the bot some elevation control to see if this fixes your problem here. The bots when in the aircraft have a third sensor you can see with stats on that tells them their altitude above the terrain. The first time I used this setup in a production map was when I added ai to DC_Lost_Village while ai coder with the DCX mod. I used two helicopters that spawned in air just behind the allied base which then spawned bots in all available seats and flew over each side of the village where I had landing zones causing them to parachute out to attack the axis positions. The pilots stayed with the choppers until they flew into the out of bounds areas where they blew up to re spawn. I also created a map years back (never finished as of yet) to where I had two B17's (robotic) fly over axis cities and bombing while axis fighters tried to knock them down. I had allied fighter support but never got it all working right. I did do away with the robotic bombers and what I did might help you out. The following will explain.

Now aircraft as we know do not use pathmaps, nor do they really use the SA's (or add neighbor) to any extent except for CP temperature (value). I can say they are somewhat attracted to neutral flags, but only if there are no other targets available. They tend to circle these flags unless distracted. Now as I mentioned above to get bots to do something you need to create something they will react to, and in the map I mentioned above I did just that with surprising results. First off think of the Battle of Britain map with the destructible factory and radar towers. DACV and I had played around with this map in his massive bfv mod and after tweaking the ai the bombers made a bee line to these objects. So in the map mentioned above I not only added theses items, but created others in the form of buildings who had a destroyed version as well as the non destroyed. Now when the bombers took off from the allied runway they took a direct path towards these targets. In other words the bots were reacting in a way I wanted them to by giving them a reason, if that makes sense. This might work in your case.

Something I also want to mention is POTAmatt has brought up an interesting topic here and that is the importance of the SA's and the AddNeighbor function that most do not understand. He has in an off hand way mention during the conversation here he was writing strategies to work with the SA's in an attempt to solve the issue. Even though it will not work well in this instance because we are dealing with aircraft it is the way that you get bots to play the map as intended. POTAmatt is one of the few that not only understand the strategies, but also knows that both the SA's and strategies depend on each other to properly work. The strategies modulate the temperatures (values) of the SA's during game play. When people use the BattlefieldSingleplayerCreater tool or Bontinator the SA's are setup generic with all SA's tied together as neighbors and a very basic set of strategies. Yes this works ok, but until you set these relationships up properly and write a set of strategies to complement them you have mediocre ai at best. Now this also means you have to have a very good set of pathmaps with good waypoint files. I am in the process of writing a set of tutorials on this topic and would enjoy your input POTAmatt so shoot me a pm if interested.

In closing let me mention a couple of other possible solutions. One is the patrol 3D behavior of the aircraft can be scripted which DCX did in the Bot sniper map based on the Battle of the Bulge map. They setup a patrol pattern for a parachute spawner. FourCentsShy also used this effect in a map where he had a group of fighters patrolling in a figure eight pattern. I have the code somewhere, and will look for it, but best I remember it works something like the add line point used to create a sound area within a map. Another is the "CreateAreaCondition" to where you can have focus on a particular Strategic Area, but it is very complected to setup, and I have had limited success on this one to date.

I hope something here helps.
Image

"When you're up to your butt in alligators, you forget your original intent was to drain the swamp!"
User avatar
fo0k
Posts: 1433
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

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

Post by fo0k »

Cajun, thanks. missed this reply...

Some useful info here for sure, thank you. I will digest further with coffee..!

One 'major' issue which I was stuck on was the ai ability to read the terrain up ahead. if there is a large mountain between the bot and its destination then rather than gain altitude ahead of it.. it will leave it until the last moments before attempting to climb.. but its too late. We have played with a bunch of obvious looking variables for this but for me the effects are minimal at best.


In terms of general gameplay..

Well if it was just humans, then its a case of take off from opposite ends of the map and then cap (airborn like no fly zone) flag of flags in the middle..

Some AI to shoot would be fun.. literally that. if the ai were able to look ahead more and read the terrain it would make a big difference.
cajunwolf
Posts: 115
Joined: Tue Jul 10, 2012 2:03 am
Location: Houston, Texas
Contact:

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

Post by cajunwolf »

The problem is that bots don't sense the terrain, hence the pathmaps. They use 3D mode only in aircraft via a sensor. If you have bots enter on spawn into the aircraft and fly themselves to the control point(s) then they should be able to sense the on coming mountain unless there might be a problem with the height scale. This is the only thing that comes to mind without more detailed information. Now, as mentioned, if you are using the robotic aircraft with the controls fixed then there is no way they can make the aircraft gain altitude unless this is allowed.

As to bots as boots on the ground let me mention a couple of things. If you want just a air to air map then leave the ground bots out of the picture because they are a distraction. I have added ai to, or created many of air to air, and maps with ground combat along with air to air, and you need to stick to one or the other depending on what you want from the map. I did a BFV map sometime ago where a new member was trying to setup a strictly air to air battle map, and after working with it for a couple weeks I discovered that it worked best with aircraft only with no more than 4 control points, and two seems to be optimal. You have to remember that bots in aircraft, unlike their counter points on the ground have less of a urge to cap a flag than to attack infantry or vehicles. It makes perfect sense when you think about it because what are they supposed to do, land and cap each time, HA good luck with that one, LoL. When you have ground troops, even with a couple flags in the air to cap, the bots first priority is attacking ground troops with the aircraft and then cap the flags if there is nothing to distract it from doing so. Yes you will sometimes seen a bot fly straight to an air born flag (usually at the start of play before the map is populated widely with bots), but much more often they will be distracted by infantry or armored vehicles on the ground to attack. If there is nothing but enemy aircraft in the air well you can guess the results here, now add two or more control points in the air and you have mayhem. As mentioned above I had the best success with only two control points. I had them placed far enough apart to make things interesting but close enough to almost allow their huge strategic areas to overlap.
Image

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