Page 1 of 1

AI Visual Range

Posted: Mon Dec 26, 2005 11:51 am
by saberhagen
During my weapons testing (see here for details) I discovered that AI bots can't see soldiers more than 64 metres away. They can see and shoot at vehicles further than this (haven't found the exact range yet), so it seems to depend on the size of the target (but not on the target's AISizeType - changing that from SOLDIER to MEDIUM makes no difference). This is a bit of a problem as it means you can shoot at bots when they can't shoot back, even if their weapons are in range. It's one of the main things I was hoping to change from the shipped game in order to make single player games more challenging. Increasing the MaxRange and LockOnRange of the weapon doesn't fix it.

I've tried reducing the range of all the weapons to 64 metres or less, so that human players don't have an advantage over the bots. It's more or less acceptable for the basic rifles, but it's a ridiculously short range for the sniper rifle. Making the range of the sniper rifle more than 64 metres effectively makes it a cheat weapon in the hands of a human player, and useless in the hands of a bot. If the range of the sniper rifle and normal blaster rifle are the same, the sniper rifle is largely useless for everyone (although I can compensate to a certain extent using differences in accuracy and damage). Giving the other weapons a shorter range than the sniper rifle makes them seem ridiculously short as well.

I don't know if there is any way to increase the visual range of AI bots, or whether it would cause lag. Does anyone have any thoughts on this?

Posted: Thu Dec 29, 2005 11:31 pm
by Riley75
I spent a fair bit of time at the end of last year looking through the game's data files. The only places I can think of that might directly affect AI behaviour are common.lvl and the executable. It's quite likely that the AI's visual range is hardcoded in the EXE.

Posted: Thu Dec 29, 2005 11:56 pm
by -_-
this might sound a bit stupid, but it could be coded in the weapons... afterall, AI snipers tend to see a lot farther than the others...

Posted: Fri Dec 30, 2005 10:38 am
by saberhagen
This is definitely not in the weapon ODFs. There are values there which control the actual range of the weapons and the minimum and maximum ranges that AI will use the weapons at, but this sight range thing seems to override that. Even when these values are set to long ranges, bots will not open fire at a soldier more than 64 metres away.

I think Riley is likely to be right: it's probably hard coded (maybe because AI seeing further would put too much strain on the CPU). I can't find anything in the easily moddable files which would control it. That means I'll just have to work around it. It's certainly something to bear in mind when designing custom maps.

Posted: Fri Dec 30, 2005 5:40 pm
by Riley75
common.lvl contains:

- Scripts for the interface elements during gameplay (player list, menu, etc).
- Common textures, models, animations, and effects.
- The base classes for entities, weapons, explosions, and ordnance.

One other possibility... the AI visual range might be in the player class information. Maybe even in one of the base classes in common.lvl.

At any rate, you'll probably find lots of other interesting stuff in the base classes (entc, wpnc, ordc, expc).