User Tools

Site Tools


navmesh

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
navmesh [2023/11/29 23:09] – body wormadminnavmesh [2023/11/29 23:49] (current) – [Exporting Data] wormadmin
Line 1: Line 1:
-== Navigation Meshes ==+====== Navigation Meshes ====== 
  
 A navigation mesh is a joined set of polygons with geometric auxiliary data that informs an agent how to travel on the mesh. A navigation mesh is a joined set of polygons with geometric auxiliary data that informs an agent how to travel on the mesh.
  
-WORM is capable of automatically generation navigation meshes in the Goldsource engine. A user is able to export navigation meshes on the fly post-generation.+WORM is capable of automatically generating navigation meshes in the Goldsource engine. A user is able to export navigation meshes on the fly post-generation.
  
-=== Generating a Mesh ===+==== Generating a Mesh ====
  
 There are multiple ways of generating a navigation mesh. There are multiple ways of generating a navigation mesh.
  
-==== Method 1: Manual Seeding ====+=== Method 1: Manual Seeding ===
  
   - Enter the game level you wish to generate a navigation mesh for.   - Enter the game level you wish to generate a navigation mesh for.
Line 16: Line 17:
   - Wait for the mesh to generate.   - Wait for the mesh to generate.
   - If WORM Editor is set to interactive mode, execute **worm continue** until the process finishes. Otherwise, it will finish automatically.   - If WORM Editor is set to interactive mode, execute **worm continue** until the process finishes. Otherwise, it will finish automatically.
-  - The navigation mesh file will save to <root game directory>/addons/worm/data/nav/<map name>_#.sgd where # is a number from 0-9 depending on what already exists.+  - The navigation mesh file will save to <root game directory>/addons/worm/data/nav/<map name>_#.sgd where # is an ID from 0-9 depending on what already exists.
  
-==== Method 2: Automatic Seeding ====+=== Method 2: Automatic Seeding ===
  
-  - In order to perform automatic seeding, ensure that **Autoseed** is set to **true** in your worm.ini configuration.+  - In order to perform automatic seeding, ensure that **Autoseed** is set to **true** in the [[configuration|configuration]].
   - Simply execute **worm generate** after entering a level.   - Simply execute **worm generate** after entering a level.
   - Wait for the mesh to generate.   - Wait for the mesh to generate.
   - If WORM Editor is set to interactive mode, execute **worm continue** until the process finishes. Otherwise, it will finish automatically.   - If WORM Editor is set to interactive mode, execute **worm continue** until the process finishes. Otherwise, it will finish automatically.
  
-=== Exporting Data ===+==== Editing the Mesh ==== 
 + 
 +Once the automatic generation process is completed, use **worm load_spl #** to load the mesh into the level, where # is the file ID . To unload the mesh, use **worm unload_mesh**.  
 + 
 +In order to manually create a polygon, use **worm addpoint** to set the polygon's vertices, **worm createpoly** to create the polygon, and **worm graft** to append the element to the mesh. 
 + 
 +You can also force connections in this way. Use **worm addpoint** to create the boundary determined by exactly two points. Then use **worm select_node** to select the target node. Go within the interior of the source polygon and execute **worm forceconnect**. If you are not satisfied with the result, you can use **worm remove_connection** to remove the connection to the target node. 
 + 
 +After you are satisfied with your changes, you can use **worm save_spl #** to save the mesh as the desired ID. 
 + 
 +==== Exporting Data ====
  
-There are different ways of exporting data depending on the user's needs. If you require the navigation mesh, then use the command **worm export_mesh** in order to save it in JSON format. Otherwise, you can use **worm export_polys_raw** to export only the mesh itself. In order to export shortest paths, execute **worm export_paths**.+There are different ways of exporting data depending on the user's needs. See [[exporting_meshes|Exporting Meshes]] for more information. If you require the navigation mesh, then use the command **worm export_mesh** in order to save it in JSON format. Otherwise, you can use **worm export_polys_raw** to export only the mesh itself. In order to export shortest paths, execute **worm export_paths**.
navmesh.1701299343.txt.gz · Last modified: 2023/11/29 23:09 by wormadmin