Fred's Hint Nodes Tutorial

Started by Phobos, October 23, 2014, 03:10:08 PM

Previous topic - Next topic
October 23, 2014, 03:10:08 PM Last Edit: October 23, 2014, 03:52:51 PM by Phobos
Hint nodes tutorial and forum notes by Psych0fred, merged from various sources by Phobos. BF2-only stuff is crossed out.

Hint Nodes Tutorial by Psych0fred

Hint Nodes are hotspots that when an AI is in range triggers the specified behavior in the unit. There many node and behavior types, some with primary and secondary stances for deeper control over the unit's behavior. Hint nodes should be used in moderation for the best performance and AI behavior. Hint Nodes have indicators that illustrate the hot spot and direction the unit must be facing to perform the behavior. Some of these have primary and secondary stances that cause a unit to stand, crouch, go prone, or face left or right. A METANODE allows for a behavior to be applied to a greater realm of influence or collection of nodes.

NEW MODE
Selecting NEW NODE in the ACTION control panel will allow for the placement of a new node with each mouse click.

MOVE
Once placed a node can be select by changing to MOVE mode and it's properties adjusted.

NAME
Hint Nodes can be named for convenience in the editor.

TOGGLE HEIGHT
This toggle controls the ghosted height indicators that appear on objects in the editor such as hint nodes, This is just a visual indicator that can be changed to make it easier to see how this nodes line up in the editor as objects of infinite height. These same controls apply to other edit modes as well and they all have controls to change the height as well as transparency of the height indicators.

TYPE
The TYPE controls set the node types as well as any subsequent behavior that can be controlled. The node types are SNIPE, PATROL, COVER, ACCESS, JETJUMP, MINE, and LAND.

- Snipe Only snipers will use these. They run to them, get into one of the selected Primary stances, face the direction of the hint, and sit there shooting people. After a minute or two they'll leave and do something else. Snipers don't need to be under attack before they use the hint nodes. Here's a brief description on how to make the AI defenders stay in defensive positions:
- Place snipe hints at the defensive positions.
- Make sure the direction of the hint faces the forward-facing direction for the defender.
- Set the mode of the hint to "Defend".
- Don't use the MetaNode property.
- In the LUA script, add the following: SetDefenderSnipeRange(170)
Note from Phobos: Unit ODFs should have UnitType = "Scout" for use with these hintnodes.

- Patrol For defensive movement, PATROL causes units to hang around an area changing position. Patrol nodes are not waypoints for patrolling, they are more or less hang out spots, they hang out on the node and scan the area for so many seconds before moving on if they encounter no enemies. The patrol nodes can be set up as metanodes I believe, in which case they hang out in and scan a larger area.

- Cover nodes are the general combat nodes, put it behind a bush or rock. It has advanced properties like right and left which is the direction from behind the rock or bush they stick their head out on. You should place lots of them everywhere in the level, since they use these while fighting. These cause AI to duck behind the object the node is placed behind. The direction should be set facing the 'covered' direction. So if the node is behind a barrel, the direction would point towards the barrel. This way they know that they should use that node if the enemy their hiding from is on the other side of the barrel. You should also set both primary and secondary stances.
- Primary stance is the 'covered' state, and is usually Crouch.
- Secondary stance is the 'attacking' state, and could be Stand, Crouch, Left, or Right.
- Selecting Stand will make them stay put but stand up and shoot, while left or right make them take a step (2m) in that direction before firing.

- Access nodes would just make AI stand around, like in front of a control panel or something. They were never used as 99% of the time you want the AI doing something battle-related.

- JetJump targets jet troopers and can be used to control whether or not they leap up to higher levels such as the huts in the trees on Endor. Jet Jump nodes are used by Dark Trooper-style jet jumpers while in combat. They will occasionally run to a node and jet jump in that direction.
- They get launched exactly in the direction that the node points, so the up/down is important as well.
- You should rotate the node to face the correct direction, then angle it upwards about 45 degrees. This is pretty close to what a player would do if they run and jet jump.

- Mine specifies a spot for the AI to place a mine field. Units with mines will drop them on these nodes, one mine per node. AI units will now lay mines in minefields that you can place in the editor. Make sure you've got latest data, then add some minefields to your maps. The minefields are hints: they need the Metanode button selecting, and then enter a radius for the size of the minefield. AI will lay mines 3 meters apart. You're probably best off laying a series of small minefields (say with a radius of 5m). If you lay a huge minefield, the AI will try to fill it in, so they could end up laying dozens of mines there. AI units will not lay mines in minefields that contain enemy mines. Also, you can associate a minefield with a Command Post. For now, this will only allow AI units whose team owns that Command Post to lay mines there. Of course, you do not have to associate a minefield with a CP, in which case any AI unit can lay mines there.
Note from Phobos: Unit ODFs should have UnitType = "assault" for deploying mines most effectively.

- Land targets Carriers for landing a deploying troops. Flyers will now only land at "land hints" that are ready to be placed in the editor. This will allow us to guarantee that flyers land safely. You should place the hints in fairly open areas, to allow the flyers some room for error.  The direction of the hint is important - it tells the flyer which direction to land in. So, for example, if the hint direction points to the right then the flyer will approach the landing spot from the left. Bear in mind that the flyers need a safe landing approach distance of say 50-100 meters. I'm relying on you to make sure this approach path is safe ;-)

Also, the landing hints take an optional command post parameter. If you don't set this in the editor, then the hint is associated with the nearest command post, so you should rarely need to set it manually.  The AI uses this data in the following way: if a flyer spots a non-owned command post that has a landing hint associated with it, the flyer will land, the AI soldier will jump out of the vehicle and try to acquire the command post. Transports also use the landing hints. They will land at friendly command posts to pick up soldiers, then fly and land at enemy command posts to deploy the soldiers.  You can place multiple land hints around the same command post to give the AI several places to land. By the way, like I mentioned above, flyers now need these landing hints in order to land at command posts, so until you have added these to your maps flyers will not be landing. You can still use regular MoveTension, and that sets all directions to the same value.

- Fortification nodes are used by units while they are Defending something. So CTF guys that are on flag defense, or the defensive side of assault goals. They use the same stance actions as Cover nodes, so you should set the direction, primary and secondary stances.