Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/sdk_aitips.php on line 3
Warning: include(http://map.planetmedalofhonor.gamespy.com/mohaa/poll/poll_cookie.php): failed to open stream: no suitable wrapper could be found in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/sdk_aitips.php on line 3
Warning: include(): Failed opening 'http://map.planetmedalofhonor.gamespy.com/mohaa/poll/poll_cookie.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/sdk_aitips.php on line 3 .map :: Mapping for MoHAA
Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/sdk_aitips.php on line 57
Warning: include(http://map.planetmedalofhonor.gamespy.com/mohaa/leftindex.php): failed to open stream: no suitable wrapper could be found in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/sdk_aitips.php on line 57
Warning: include(): Failed opening 'http://map.planetmedalofhonor.gamespy.com/mohaa/leftindex.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/sdk_aitips.php on line 57
Ai Tips
-------------------------------------------------------------------------------
Some useful things to know when you are working with
ai.
DONT_LINK
Marks the node as not linking into navigation. Conserves
memory and cpu usage.
DUCK
Tells the AI to duck at this node. Currently only used
with cover nodes.
COVER
Tells the AI that this node is potentially a cover node.
The definition of cover is that the enemy cannot see
me. The AI will only consider cover nodes that satisfy
leash, mindist, and maxdist constraints. This can target
one or more nodes for the AI to randomly step toward
when it is ready to attack the player again. If there
are no targeted nodes, the AI will try to step out along
a path to its enemy.
CONCEALMENT
Acts just like COVER, except that no sight trace is
done to validate that it is in fact cover. This is useful
for foliage and short walls and other things that provide
some partial cover or make it harder for the player
to see through. It can be used with any of the other
cover flags, though it really shouldnt be used
with anything except DUCK and possibly CRATE.
CORNER_LEFT
Never used with any other flags, except possibly COVER.
The COVER flag is assumed, so it is not necessary. Tells
the AI to do special corner attack behavior. The corner
is to the AIs left with his back to the wall.
The center of the node should be 16 units in from the
corner and 16 units out from the wall. The nodes
angles should point away from the wall; ie, the way
the AI would be facing with his back to the wall.
CORNER_RIGHT
Never used with any other flags, except possibly COVER.
The COVER flag is assumed, so it is not necessary. Tells
the AI to do special corner attack behavior. The corner
is to the AIs right with his back to the wall.
The center of the node should be 16 units in from the
corner and 16 units out from the wall. The nodes
angles should point away from the wall; ie, the way
the AI would be facing with his back to the wall.
SNIPER
Currently only works with turret attack behavior. Never
used with any other flags. Tells the AI that this is
a good place to stand still and shoot people. Use at
windows, for example. Can also be used to encourage
guys to go inside a building to attack a guy shooting
out of a window.
CRATE
Never used with any other flags, except possibly COVER.
The COVER flag is assumed, so it is not necessary. Tells
the AI to do special over-the-top attack behavior, as
if he were behind a crate. The center of the node should
be 16 units back from the crate. The nodes angles
should point towards the crate.
-------------------------------------------------------------------------------
AI Parameters
-------------------------------------------------------------------------------
mindist : The AI will
run away from its enemy if he is inside this distance.
Cover and sniper nodes inside this distance of the enemy
are ignored. Must be at least 128 units less than maxdist
to get good behavior.
maxdist : The AI will
charge its enemy if he is ouside this distance. Cover
and sniper nodes outside this distance of the enemy
are ignored. Must be at least 128 units more than mindist
to get good behavior.
leash : The AI will not
stray more than this distance from its leash home, except
for responding to grenades. Cover and sniper nodes outside
the leash are ignored. The leash is set at the AIs
spawn point. It can be reset to the AIs current
position at any time with the resetleash
event. It can be tethered to any entity with the actor
tether any_entity event. It automatically resets
to the AIs current position when they enter attack
mode. You can prevent it from changing with the statement
actor.fixedleash = 1, and let it change
again by actor.fixedleash = 0. Fixedleash
is ignored by tethers.
sight : The AI will not
see anything outside this radius.
hearing: The AI will not hear anything outside this
radius.
sound_awareness: The AI notices sounds with this probability.
If 0, they will never notice sounds; if 50, they will
notice sounds half the time; and if 100, they will always
notice sounds. This probability drops off to zero at
the outer edge of a sounds radius.
noticescale : This scales
how long it takes AI to see an enemy. At 100, it takes
100% as long as normal to see something; at 50, it takes
half as long; at 200, it takes twice as long.
enemysharerange : The
AI will not receive notification that a teammate has
a new enemy if outside this radius from his teammate.
By default, whenever an AI gets a new enemy, he tells
all his buddies within a 512 unit radius or a direct
line-of-sight about this fact. Keep in mind that this
parameter controls the radius for receiving the notification,
not for sending the notification. If set to 0, the default
behavior is used, so 1 should be considered the minimum
for this parameter.
accuracy : Percentage
chance for the AI to get a hit against its enemy when
shooting, assuming the weapon had no spread and the
enemy is in range.
ammo_grenade : number
of grenades the AI spawns with.
gren_awareness: chance the AI will notice a grenade
when they see it. This is used to slow down their responsiveness
to grenades to make them easier.
interval : used to space
AI apart when they are moving with each other and when
there are a bunch of them attacking the player. Default
is 128, but it can be tweaked per guy. Can be set to
0 to allow bunching, but only as a last resort to fix
a serious problem.
This is not an exhaustive list, but is most of the
common parameters.
if fixedleash is 0 and the AI enters either turret
or cover attack state, the leash home is reset to the
AIs current origin.
if the AI is tethered to an entity and that entity moves,
the leash home is reset to that entitys new origin,
regardless of the value of fixedleash.
Iif the AI is issued a resetleash command,
the AIs leash home is reset to its current
origin, regardless of the value of fixedleash.
The AI can leave their leashes for the following reasons:
They are responding to a grenade.
They were issued any of the moveto commands
in script that tells them to go outside the leash, such
as friendly AI following the player.
They are following a patrol path that takes them outside
their leash.
The AI picks the current best enemy to attack based
on distance to the enemy, the number of other AI that
are attacking that particular enemy, the enemys
weapon, whether or not that enemy is completely visible,
and whether or not that enemy is in pain. The AI prefer
to not switch enemies, but they will if the new enemy
is of enough higher threat.
When an AI changes enemy, he transfers perfect knowledge
about that enemys existence and location to all
other AI in his squad, if they are within
512 units or line-of-sight and they are not outside
their enemysharerange. This transfer of
information takes place 0.5 seconds after he switches
enemies. Each AI that becomes aware of this enemys
location can now decide to switch to the new enemy,
or to continue attacking their current enemy.
As soon as an AI fires its weapon, all other AI within
that weapons sound radius immediately know that
the weapon was fired and by who and where the shooter
was. The weapon sound radius is currently the same for
all weapons.
-------------------------------------------------------------------------------
How AI Initially See An Enemy
-------------------------------------------------------------------------------
Note that this is only how an AI initially detects
an enemy; once he has locked on to an enemy, sight is
done by a simple traceline, without all this extra checking.
AI sight is achieved based on the time it takes to
first notice an enemy given the current conditions.
This is scaled based on how long it has been since the
conditions were last checked to come up with a percentage
recognition; for example, if it has been 1 second since
we last checked, and it takes 3 seconds to notice the
enemy, the percentage recognition increases by 33.3%.
When percentage recognition reaches or exceeds 100%,
the enemy is sighted.
Recognition time is standard at 2 seconds. There are
multipliers to this time based on the LMRF function
(light, motion, range, fov). The recognition time gets
multiplied by all these factors to get the actual recognition
time.
* The light portion:
- if the enemy is the same brightness as self, the light
scale is 0.5 for bright areas and 2.0 for dark areas
- if the enemy is much brighter than self, the light
scale is 0.125
- if the enemy is much darker than self, the light scale
is 8
* The motion portion:
- set for players by the state file; ranges from 0.2
for jumping forward to 1.25 for being ducked while not
moving
- currently not set for AI, so it stays at 1 for AI
* The range portion:
- function of self's sight range; using a normalized
range of 0-1, the scales are as follows:
- the normalized range is current range divided by
maximum range. For fogged levels, maximum range is capped
to 82.8% of the fog farplane.
* The FOV portion:
- set to 1 for directly ahead, and increases to 1.25
at periphery
In addition to this, there is also a minimum sight
time that is a function of FOV. It is almost 0 for directly
in front of the AI, and about 1 second for the periphery.
This will make the AI turn its head to look at something
before seeing it.
-------------------------------------------------------------------------------
Making AI Look Smart
-------------------------------------------------------------------------------
Just an un-ordered list of ways to make the AI look
smart:
Place info_grenadehint entities in doors and windows.
These are just point entities that are places through
which the AI will try to throw grenades. It has no parameters,
and it does not eat up entity count, and it can make
the AI seem a lot smarter about its world.
Place SNIPER nodes at
doors and windows if the AI cannot get there without
leaving their leash, or because there is no path, or
because the AI does not have an angle to shoot a guy
in a building from the street.
Place COVER and CONCEALMENT
nodes where possible, unless it is going to make the
AI want to continually run up and down stairs or frequently
switch between nodes.
Remove a cover node if it will never be good cover,
or if the AI is frequently switching between it and
better cover.
Make sure you set the angles properly for CORNER,
CRATE, and SNIPER
nodes.
Play with the exact placement and orientation of special
nodes to get AI to look good along the most likely (or
only) player path.
Feel free to nudge the nodes a little if it will make
the AI look better.
Flag COVER nodes as CORNER_LEFT,
CORNER_RIGHT, and CRATE
as much as possible.
Have cover nodes target one or more other nodes if
you want the AI to consistently pop out at a known location.
For example, you could put pop-out nodes to the left
and right of a pillar that is cover.
Whenever possible, spawn guys near the cover you want
them to take.
Dont have a bunch of guys in tight spaces. Basically,
dont put a guy in the map who will probably get
in the way of other AI. This is particularly a problem
if you have an area where all but one guy in a large
group can take cover.
Dont give grenades to a bunch of guys right next
to each other.
Only one or two guys should have grenades, or youll
get synchronized grenade tossing.
Have careful placement of pathnodes! Dont have
pathnodes too near complex terrain / geometry that can
cause the AI to get stuck.
Dont spam the AI with movement commands.
Pick an appropriate leash, mindist, and maxdist. This
is very important! Setting the leash and / or maxdist
too small can prevent the AI from getting to cover and
consequently cause them look stupid. Only use a small
maxdist if you want the AI to charge its enemy.
Leave the AI disabled as long as possible (self ai_off).
If a guy is in a locked room, leave his AI off until
the door is unlocked and / or opened (self ai_on).
The lightgrid affects how quickly the AI will see an
enemy. If you dont do a light compile with extragrid,
you are not getting a perfectly accurate idea of how
long it takes for the AI to see an enemy.
AI that spawns within 1024 units of each other automatically
know about each others existence, joining squads.
AI in a squad are not surprised or curious by noises
generated by squadmates. Also, only squadmates get the
magical new enemy notification messages
mentioned above.
Reduce enemysharerange to 1 for guys who
are going to blow up the bridge, so that they only run
off if the player sees them.
Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/sdk_aitips.php on line 420
Warning: include(http://map.planetmedalofhonor.gamespy.com/mohaa/rightindex.php): failed to open stream: no suitable wrapper could be found in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/sdk_aitips.php on line 420
Warning: include(): Failed opening 'http://map.planetmedalofhonor.gamespy.com/mohaa/rightindex.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/sdk_aitips.php on line 420
Warning: require(): open_basedir restriction in effect. File(/home/map/cgi-bin/mohaa/poll/include/config.inc.php) is not within the allowed path(s): (/var/www/vhosts/own3mall/mohaaaa.co.uk:/usr/share/php:/usr/share/pear) in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/sdk_aitips.php on line 431
Warning: require(/home/map/cgi-bin/mohaa/poll/include/config.inc.php): failed to open stream: Operation not permitted in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/sdk_aitips.php on line 431
Fatal error: require(): Failed opening required '/home/map/cgi-bin/mohaa/poll/include/config.inc.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/vhosts/own3mall/mohaaaa.co.uk/httpdocs/mohaa/tutorials/sdk_aitips.php on line 431