Jump to content
Official BF Editor Forums

Engineer bot won't give up on full-health vehicle


Recommended Posts

Hello wizards (and HNY to you!), am stumped again on something so I seek your counsel.

Continuing with my FH2 SP sub-mod, I'm working on a tank which was not previously in my collection - I recently copied the files from the latest version of FH2 online. All looking grand with the tank in general except that, in some test battles an engineer bot will come over to the tank when it's on full hp and will stand there, spanner in hand, also chasing the tank if it moves. Assuming the bot hasn't become self aware and is waiting for me to make a mistake and get shot, any ideas as to why the bot thinks the tank needs fixing? The two notable changes I had made to this tank were changing the projectile template for the AP round and adding some jerry cans on the sides and underbelly to hide some broken track animations and pretty up the hull. However I've tested the vehicle without these extra templates added and the engineer still hugs the tank.

The second and third screenshots may be linked to the same problem, not sure. The third screenshot shows an abandoned enemy faction tank in the field (not abandoned by choice, the tank is open-top and the driver died from a nade), with an allied bot engineer standing by the tank again as if about to start fixing it. After about 15 seconds he detected an enemy soldier and went off to shoot at him, but once the enemy was dead he got interested in the abandoned tank again and stood by it some more. In the second screenshot, an enemy base has been captured and two ally engineer bots notice two enemy vehicles now unused; they proceed to sit by them, spanners in hand. At least in these latter two cases it's not so big of an issue because, should enemies appear, it looks like the bot will respond to the pressing danger, but in the first scenario in spite of enemies being close by and even shooting right at him, the engineer still wants to hug the allied tank on full health.

Kind regards,







dedicated engineers.png





v more distractions.png


Edited by mft001
Link to comment
Share on other sites

Alas haven't found a solution yet, if you have any ideas I'm all ears : ) I think my mention of adding objects to that new tank is a red herring, because many other vehicles seem to distract the engineer bots in this way and I haven't added objects to them.

Link to comment
Share on other sites

i have been thinking about this since you posted it but unfortunately these days have forgotten more than i remember, and am unable to run the game to test any theories...

are the hitpoints set the same in the armor comp?


ObjectTemplate.armor.maxHitPoints 850
ObjectTemplate.armor.hitPoints 850


in objects.ai, what is the basicTemp set to? (basic temperature sets how 'attractive' an object is to a bot - but this affects all bots, not just engies)


if you don't manage to fix it, perhaps you could post your .tweak and your objects.ai




Link to comment
Share on other sites

Yep am attaching here both of those files and the .con file for the tank where I first noticed this issue. If you can't see the files though let me know and I could try another way to share.

Can confirm that the HitPoints and maxHitPoints were set the same. Looking at the ai template (m5a1_stuart_auto_AI) used for this tank (t26_finn), objects.ai says the temp is 350.

If it helps, the ai templates for the other two vehicles I mentioned, which were on the enemy team (so maybe that's not the same issue) are:



Google Drive links to the files:


t26_finn.tweak t26_finn.con Objects.ai

(pdf copy) t26_finn.tweak.pdf (pdf copy) t26_finn.con.pdf (pdf copy) Objects.ai.pdf

Edited by mft004
Link to comment
Share on other sites

  • 3 weeks later...

i've been hanging back from replying to this because i wanted to wait until i had something conclusive to tell you, but i have not yet, and probably never will (i haven't been able to run the game *with mods* for years, so i'm very rusty and with issues like this i really need to be able to run before/after tests)

i noticed a couple of small things but i doubt they would affect engys specifically, but anyway...

temp for the driver is 350, the other vehicles of a similar type i made for AIX had temps of 80 for driver, 50 for passenger.

temps for the vanilla MiA2 were 20 and 7 respectively.

temperature is a relative thing and varies wildly and dynamically from point to point during a round, so if all other objects in the game have similarly high temps, then this might not have much effect on your bug.

turret azimuth for the ai vs. the actual tank doesn't match, i.e. (if i'm reading it correctly)

turret is -15 to +7

ObjectTemplate.setMinRotation 0/-15/0
ObjectTemplate.setMaxRotation 0/7/0

...but the ai thinks it is -20 to +7.5

aiTemplatePlugIn.setCameraRelativeMinRotationDeg -360.0/-20.0/0.0 
aiTemplatePlugIn.setCameraRelativeMaxRotationDeg 360.0/7.5/0.0

...as a result of using shared ai.***

aitemplate is defined in the .con instead of the .tweak, and is defined twice. not sure what difference that makes if any, it just looks odd to me, i'm used to the 'traditional' layout (that goes for combining all the objects ai into one file, too. absolutely hated trying to navigate that. much prefer one object = one file)

it would be interesting to write the tank its own normal ai template and see if the problem follows it, or if it suddenly becomes present in only those other vehicles using that m5a1_stuart_auto_AI  template.


*** for what it's worth - tobias karlsson (one of dice's ai guys) once told me that it is always best to give each object its own ai - the extra CPU overhead is negligible, the saved HD space from sharing it is negligible, and it makes debugging easier



Edited by clivewil
i rit rong stuff
Link to comment
Share on other sites

Thanks for those ideas and I don't blame you for staying away from more mod testing; in terms of time it's a death sentence! I ask myself one question, find some leads, then it leads to another question!

Yep in an effort to move the sub-mod away from strict realism towards a more arcade feel, I had altered the turn speeds / turn limits of most tank guns / mantlets, but just within the individual tweak files - I didn't know that was defined elsewhere for the ai too. I'll go ahead and match those all up and I'll make separate ai templates for each vehicle as you suggest. Then I'll get back with the results be they new or the same. To be fair to the Fh2 team they did seem to prefer separate templates too, but with these much later additions to the vehicle pool there's sometimes been no ai support in place - Fh2's singleplayer wizard Gavrant retired a few years ago.

As to the temp, it looks like all of the armoured vehicle driver positions are in the hundreds. Besides flags and some fixed guns (almost none in my sub-mod anyway) I can't think of anything else the ai would need to be interested in, so as a next attempt I could bring all of those down to maybe max 100.

Edited by mft004
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...