Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Drawde

Pages: 1 ... 9 10 [11]
Singleplayer and Coop / Re: Luttich 2.25...
« on: 30-01-2010, 18:01:23 »
The problem I believe is that the AI for the hull MG is created in the object AI but not created in the weapons AI.  In fact most of the US and GB tanks do not have any hull MG AI entries.

This shouldn't be the reason for the problem - the hull MGs use the from the attached gun entity (in this case Coaxial_Cal30_Main). Some of the German tanks have hull MG entries in their own file, but I don't think the game actually uses these, there are no references to them in the .tweak file.
You're right though that there are some weapons that the AI doesn't seem to use - the Vickers .303 on the Chevy truck and the rear MG on the SdKfz.251 are other ones. 
I'll have to do some more testing to see if the Sherman hull MGs work correctly - I've made a lot of changes to the AI files so may have fixed the problem already. I certainly noticed the AI using both the hull and hatch-mounted MGs on the M5 Stuart.

I'll see if I can fix the bug with the static US AT guns being defined as mobile (didn't notice that) for my AI tweak mini-mod which should be in a releasable state in a few days. Hopefully the FH2 developers will be able to fix this, as well as the AI aiming bug for the next official release, now that the problem has been tracked down (assuming they haven't found the problem already).
I think the mobile versions of the 6pdr and PaKs also need the AI control inputs fixing in the same way as the static ones - the bots don't seem to be able to aim them, though they can wheel them about (sometimes halfway across the map...)

The bots are certainly deadly with AT guns - even the 2pdrs on Siege of Tobruk managed to knock out several dozen German tanks before the guns were eventually taken out and the first defensive line overrun. Flak 88s and similar are beyond lethal - especially against AI tanks who don't have the sense to shell the gun positions with HE from as far away as possible before moving in.

Putting "aiTemplatePlugIn.setHasExposedSoldier 1" in the file should (theoretically) allow bots to shoot at the gun/vehicle crew rather than the object itself - though tanks still seem to prefer firing shells at the guns.

Also, it looks like I was wrong about mortars - I twice spotted Allied bots firing them on Siege of Tobruk and El Alamein - though they're not very accurate to say the least. Haven't seen the AI use artillery yet. Bots still seem to be very reluctant to use mounted MGs, though, even though I've set them to have a high "temperature", defensive StrategicStrength and target strength vs. infantry.

I think I've fixed the problem (after much comparing of the AA and AT gun .tweak and .ai files to try and find why exactly bot AA guns work but AT ones don't).

In the gun's file, change the following lines:

aiTemplatePlugIn.aimHorizontalControl       PIMouseLookX
aiTemplatePlugIn.aimVerticalControl         PIMouseLookY
aiTemplatePlugIn.lookHorizontalControl      PIMouseLookX
aiTemplatePlugIn.lookVerticalControl        PIMouseLookY


aiTemplatePlugIn.aimHorizontalControl       PIRoll
aiTemplatePlugIn.aimVerticalControl         PIPitch
aiTemplatePlugIn.lookHorizontalControl      PIRoll
aiTemplatePlugIn.lookVerticalControl        PIPitch

Most guns (excluding AA, MGs and mortars) have PIRoll/PIPitch rather than MouseLook as their input for turning and aiming, but all files (for every PCO) are set up with MouseLook as the aiming inputs. It might be possible to edit the gun .tweak files instead and change the inputs to PIMouseLookX/Y, but editing the files is a lot simpler.

With these changes to all the AT and artillery gun PCOs, bots can now use them effectively. This should make a big difference to SP/co-op games, especially on maps like Siege of Tobruk where one side is defending. They still don't seem to know how to use mortars, though - the bots will aim them at targets but don't fire.

Singleplayer and Coop / Re: Luttich 2.25...
« on: 28-01-2010, 11:01:23 »
I think I've finally worked out how to fix the Luttich bug: It's due to an error with the AI scripting for the turret-mounted .50 cal MG mount attached to some Sherman variants. One workaround mentioned is to replace the Shermans with other tank types, but after some looking through the AI data files, I think I've found a way to fix the problem directly.

Open "vehicles\land\US\m4a1_turret_gunner\ai\" in and change the following lines at the end of the file:

aiTemplate.addPlugIn m4a1_turret_gunnerRearGunnerArms
aiTemplate.addPlugIn m4a1_turret_gunnerRearGunnerUnit
aiTemplate.addPlugIn m4a1_turret_gunnerRearGunnerCtrl


aiTemplate.addPlugIn m4a1_turret_gunnerTopGunnerArms
aiTemplate.addPlugIn m4a1_turret_gunnerTopGunnerUnit
aiTemplate.addPlugIn m4a1_turret_gunnerTopGunnerCtrl

With this change, Luttich now loads in both SP and co-op modes. I haven't tested it enough to see if the AI uses the Sherman gun mounts correctly (it  doesn't help that bots don't spawn at the base with the US tanks, at least at the start of the game) but they should be OK.

I think the "HMG_M2HB" weapon attached to the m4a1_turret_gunner object is also missing an AI template; it's defined as "Stationary_M2HB_AI" but there is no AI template with this name. I don't think this will crash the game, however (though it'll probably prevent the AI from using the gun effectively) but it's fairly easy to add the missing AI template, or edit the weapon to use an AI template from an existing weapon (such as the M1919A4 .30 cal)

As other posters have mentioned, there appears to be a problem with the bot AI in FH2 2.25 causing them to not aim and rotate fixed AT and artillery guns. Bots will often man the guns when enemy tanks are near, but will not actually aim the guns and will only fire when enemies are right in front of them. Bots manning anti-aircraft guns do NOT have this problem and will aim at and track enemy planes very effectively - and if you set the AI strength values of the AA gun to allow it to be fired at ground targets, they'll aim at infantry and tanks just as well.

Any clues as to what could be causing this problem? I've looked at the files for the various AT, AA and artillery guns and there don't appear to be any significant differences in the data which could be causing the problem. A few gun types have very limited max/min rotation values, but altering these doesn't change the AI's behaviour.
Reading older posts from previous versions of FH2 seems to suggest that this problem wasn't present in previous versions - am I correct?

Please share this with the community when you can

I'll definitely release my AI tweaks as a "mini-mod" for FH2 once I've got them a bit more polished. I've managed to get tank vs. tank and tank vs. infantry + AT gun combat working very well - almost as well as infantry vs. infantry, when the tanks don't get stuck on the scenery - but I'm still trying trying - without any success so far - to get the AI for AT guns working properly. (As other posters have mentioned, the bots seem to be unable to rotate/aim any guns other than AA). I'd also like to get AI aircraft to use their bombs, but again no luck so far.

The tanks in AIX have both ammo-types and the bots use them both, firing one then the other in quick succession (at other vehicles). Although, IIRC they're not too keen on using the MG...

So is there already an AI mod for FH2? I did a quick web search for this the other day, but didn't find anything.
Currently, tanks seem to fire shells at distant infantry/gun targets then switch to MGs when closer. They don't always seem to use MGs when they should, but it's better than the default AI settings.

The min/max range values are similar but the target strength values are completely different. The FH Stuka has single digit values (6.0, 8.0, etc.), while Clive's has double digit values (35, 45, etc.). The FH Stuka also has a lower deviation on the bombs...

Interesting - so does increasing the target strength values increase the chance of the AI using a particular weapon? I assumed the values were only"relative", i.e. the AI would just use the weapon that had the highest strength against its target, whether the strength was 5 or 35 doesn't matter if it's the highest strength weapon the AI has. But I'd be interested to know if this is wrong!

I've already fixed all of the tank shell range values in my "AI tweak mini-mod".
The Cromwell, BTW, uses AI values from other tank weapons (Sherman, I think), as does the Churchill and a few other vehicles. Another change I've made in my mini-mod is to give them all these vehicles their own AI files, and do the reverse (multiple vehicles referring to a single AI file) with identically-armed variants of the same vehicle, such as the Sherman.

So far I haven't had much luck getting AI tanks to use both coaxial MGs and HE shells. They seem to stick to using either one or the other, depending on which one has the highest strength value vs. Infantry. But I'll have to do some more testing to see for certain.

Modding / Re: SP/bot AI modding: help/advice needed
« on: 25-01-2010, 12:01:21 »
Looks like the problem with the second and third methods was due to my own stupidity; I packed the archives with the wrong folder structure. Having corrected this, I've now got FH2 to work with the modded files (using the second method - separate archives containing the modded files, loaded before the default FH2 files in serverarchives.con).
My AI tweaks seem to have made a noticeable difference to the vehicle AI, I played a game on "Siege of Tobruk" and the AI was much more aggressive and effective in its use of tanks. I even saw the AI firing emplaced mortars a couple of times! Still a lot of work to be done, but it shows that the AI can be improved.

I'd still appreciate any help/advice on how to get the first method (i.e a separate mod which refers to the FH2 files) working.

One particular thing I noticed when looking through the FH2 AI files, is that many weapons have extremely high minimum range values. Most HE rounds for tanks are 250 (the maximum range of tank guns in vanilla BF2 is around 150!). This could be the reason that tanks rarely if ever fire HE at infantry.
There also appears to be a lot of inconsistency with the maximum + minimum range values for weapons, particularly tank guns, as well as with the deviation (allowed inaccuracy) values. Most tank guns, including coaxial MGs, have a maximum range value of 1000, which is far beyond visual range in the BF2 engine - I'm wondering whether it might improve the AI to reduce this to 500, and possibly also add optimalRangePercentage values to more weapons. This might reduce the problem of AI tanks sitting in place miles away from the enemy (in the last game I played on the "Supercharge" map, an AI Crusader was firing at the the German-held town with its coaxial MG from almost the other side of the map)

I haven't yet worked out why AI emplaced guns don't turn to face enemies that aren't directly in front of them. The rotation values for these weapons look OK. But quite a few emplaced weapons + AT guns also have rather high minimum range values, which doesn't help!

It seems like FH2's tank/vehicle AI is much more flawed/buggy than the infantry. The virtually infantry-only Pointe du Hoc map works great, both the Allied and Axis AI fight very effectively. Vanilla BF2 proves that bots can use tanks + vehicles reasonably effectively, so hopefully the FH2 vehicle AI can be improved with some tweaking.

Modding / SP/bot AI modding: help/advice needed
« on: 25-01-2010, 10:01:11 »
I used to do a lot of modding with BF1 and BF:V, both AI tweaks and weapon/vehicle "realism" mods - though I don't think I ever got anything complete and polished enough to release, I had a lot of fun! However, I never really got into BF2 modding, and in any case my BF modding skills are very "rusty" as I haven't played the game for a couple of years. Recently I decided to reinstall BF2 and try out some of the mods available, including FH2.

Anyway, after playing some offline games on various maps, and reading the threads in the single-player feedback section of this forum, I've had a look through the AI files to see if there's anything that can be tweaked to improve/fix the AI a bit, and it seems like there are a lot of inconsistent and odd values in the weapon ai.con files which could be contributing to the AI's erratic behaviour. For example, a lot of weapons have extremely high minimum range values - notably HE rounds for tank guns. Values for "deviation" (I think this controls how (in)accurate the AI is allowed to be when firing the gun) are also very inconsistent for weapons of the same type.

I've been attempting to modify this data to see if it makes any difference to the AI's behaviour, but haven't so far managed to get BF2/FH2 to load my modified data. I've tried the following:
- Created a new mod with its own folder, loading the data files from the FH2 folder via serverarchives.con - result: FH2 levels/maps don't show up on the map list, though the menu uses FH2's text colours and music (but the background movies are the default BF2 ones)
- Created separate ZIP files with the modified files, and modify FH2's serverarchives.con to load these as well as the original files - result: BF2 crashes almost immediately when loading a map. Unfortunately there doesn't seem to be an error/crash log stored anywhere to give me a clue as to what specifically could be causing the crash.
- Unzipped, modified and repacked the FH2 objects_weapons_server and objects_vehicles_server ZIP files - result: BF2 crashes when the map is about 75% loaded (regardless of whether or not I modify anything).

Any clues as to what I could be doing wrong?

Pages: 1 ... 9 10 [11]