Home - Forums - Documentation - Gallery - Bugs
m (CEL AI Navigation)
(CEL AI Navigation)
Line 1: Line 1:
= CEL AI Navigation =
= CEL AI Navigation =
-
celNavigationTools it's part of celtool that makes bunch of useful operations for navigation.
+
== Introduction ==
-
1. You need to choose Navigator - entity with mesh
+
''celNavigationTools'' it's part of celtool that makes a bunch of useful operations for navigation.
-
2. Choose tracked target - other entity or map mode
+
You need to choose '''Navigator''' - entity with pcmesh and tracked '''Target''' - vector, other entity or map mode.
-
Then information is returned to celNavigationInfo or choosed variables in blxml:
+
Then information is returned to ''celNavigationInfo'' or choosed variables in blxml:
-
* bool success - if everything is ok, entity exists, target exist etc.
+
* ''bool success'' - if everything is ok, entity exists, target exist etc.
-
* bool visible - if target is visible
+
* ''bool visible'' - if target is visible
-
* float distance - distance between navigator and target
+
* ''float distance'' - distance between navigator and target
-
* vector3 angle - angle between navigator and target (note it's angle between point-point in worldspace, it omits direction vectors)
+
* ''vector3 angle'' - angle between navigator and target (note it's angle between point-point in worldspace, it omits direction vectors)
 +
 
 +
== Simplest case : quite dumb car ==
 +
 
 +
* Determine track by placing nodes on the map. Name that objects for example "node1" "node2" etc. Usualy the best way to do this is making spline/bezier and automatically duplicate nodes on this.
 +
* Make in your level loader creating trigger for every node.
 +
* In every AI loop step (1/10s for example) set Navigator to car entity, and target to map node "node"+current_node_nr. This number should be increased after reaching node trigger.
 +
* Now check what celNavigationInfo says. If ''distance'' is far than car can move fast.

Revision as of 10:28, 2 February 2007

CEL AI Navigation

Introduction

celNavigationTools it's part of celtool that makes a bunch of useful operations for navigation.

You need to choose Navigator - entity with pcmesh and tracked Target - vector, other entity or map mode.

Then information is returned to celNavigationInfo or choosed variables in blxml:

  • bool success - if everything is ok, entity exists, target exist etc.
  • bool visible - if target is visible
  • float distance - distance between navigator and target
  • vector3 angle - angle between navigator and target (note it's angle between point-point in worldspace, it omits direction vectors)

Simplest case : quite dumb car

  • Determine track by placing nodes on the map. Name that objects for example "node1" "node2" etc. Usualy the best way to do this is making spline/bezier and automatically duplicate nodes on this.
  • Make in your level loader creating trigger for every node.
  • In every AI loop step (1/10s for example) set Navigator to car entity, and target to map node "node"+current_node_nr. This number should be increased after reaching node trigger.
  • Now check what celNavigationInfo says. If distance is far than car can move fast.
| Article | Discussion | View source | History |