@directivegames/genesys.js 3.1.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +123 -0
- package/assets/animation-profiles/mixamo.skeleton-profile.json +63 -0
- package/assets/animation-profiles/rigify.skeleton-profile.json +61 -0
- package/assets/character/SKM_SB_MediumHuman.glb +0 -0
- package/assets/character/config/AnimationStateMachineComponent.md +107 -0
- package/assets/character/config/mannequin-anim.json +53 -0
- package/assets/character/mannequin.glb +0 -0
- package/assets/character/mannequinG.glb +0 -0
- package/assets/default.genesys-scene +194 -0
- package/assets/models/PickupActors/SM_Pickup_Health.glb +0 -0
- package/assets/models/PickupActors/SM_Pickup_Station.glb +0 -0
- package/assets/models/SM_Capsule.glb +0 -0
- package/assets/models/SM_ChamferCube.glb +0 -0
- package/assets/models/SM_Cone.glb +0 -0
- package/assets/models/SM_Cube.glb +0 -0
- package/assets/models/SM_Cylinder.glb +0 -0
- package/assets/models/SM_Plane.glb +0 -0
- package/assets/models/SM_Pyramid.glb +0 -0
- package/assets/models/SM_Sphere.glb +0 -0
- package/assets/models/SM_Torus.glb +0 -0
- package/assets/models/SM_Wedge.glb +0 -0
- package/assets/models/Weapons/SM_ShotGun_01.glb +0 -0
- package/assets/models/demo/Characters/Knightdude.glb +0 -0
- package/assets/models/demo/Characters/Spacedude.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Bush01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Bush02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Flower01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Flower02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Flower03.glb +0 -0
- package/assets/models/demo/LowPoly/SM_GeneratedLandscape.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Grass01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Grass02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Grass03.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Mushroom01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Mushroom02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_MushroomCluster01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_MushroomCluster02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Rock01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Rock02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Rock03.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Rock04.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Tree01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Tree02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Tree03.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Tree04.glb +0 -0
- package/assets/models/demo/LowPoly/SM_TreeStump.glb +0 -0
- package/assets/models/demo/LowPoly/SM_TreeTrunk.glb +0 -0
- package/assets/models/demo/LowPoly/low_poly_ship_wreck.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Dirt.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Grass02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Grass02Patch.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Gravel.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Lava.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_LavaStone.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Sand.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Stone.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_StoneA.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_StoneC.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Wall.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Water.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_Arachnids_Large_Spider.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Adventurer_F01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Adventurer_M01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Aviator_F01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Aviator_M01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Aztec_F01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Aztec_M01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_MediumHuman.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Shaman.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Cloud_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Cloud_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Cloud_03.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Cloud_04.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_03.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_04.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_05.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_06.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_07.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_SmallCloud01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_SmallCloud_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_AztecStatue.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Claypot_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Claypot_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Claypot_03.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Claypot_Broken_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Claypot_Broken_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Crystal_Calendar_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Crystal_Calendar_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Crystal_Skull.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Goldpile_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Goldpile_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Rubble_Skeleton_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_TreasureChest.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_TreasureChestSmall.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Wall_Deco_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_AngledWall.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Arch.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Beams.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Beams02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Corner.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_CornerB.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Floor.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Floor2.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Floor3.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_GrowingTree.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_HalfFloor.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_IronBucket.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Pillar.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Railing.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_RoofWindow.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Stairs01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Statue.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Wall.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Wall02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Wall03.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Wall03B.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Wall04.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_WallB.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_WallTrim.glb +0 -0
- package/assets/models/demo/SandboxAsset/Floors/SM_SB_Floor_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Floors/SM_SB_Floor_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Flowers/SM_SB_Flower01_ColorA.glb +0 -0
- package/assets/models/demo/SandboxAsset/Flowers/SM_SB_Flower01_ColorB.glb +0 -0
- package/assets/models/demo/SandboxAsset/Flowers/SM_SB_Flower02_ColorA.glb +0 -0
- package/assets/models/demo/SandboxAsset/Flowers/SM_SB_Flower02_ColorB.glb +0 -0
- package/assets/models/demo/SandboxAsset/Flowers/SM_SB_Flower03_ColorA.glb +0 -0
- package/assets/models/demo/SandboxAsset/Flowers/SM_SB_Flower03_ColorB.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Beach_Grass.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Birgaradier_Tree.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Cactus_Long.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_ElephantEar01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Fern01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_GrassPatch.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Growing_Plant.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Leaf_bush01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Middle_Moss.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Oracle_Tree.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Plant01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Tree01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_plant.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_Arrow_large_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_Arrow_large_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_HangingBridgeEnd_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_HangingBridgeEnd_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_HangingBridgeMiddle.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_MovingPlatform_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_MovingWall.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_ObsidianTrap.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_Scull_Arrowshooter01.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_Scull_Arrowshooter02.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_Snakepit.glb +0 -0
- package/assets/models/demo/SandboxAsset/Rocks/SM_SB_Rock01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Rocks/SM_SB_Rock02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Slides/SM_SB_Slide_Corner_L.glb +0 -0
- package/assets/models/demo/SandboxAsset/Slides/SM_SB_Slide_Corner_R.glb +0 -0
- package/assets/models/demo/SandboxAsset/Slides/SM_SB_Slide_Edge.glb +0 -0
- package/assets/models/demo/SandboxAsset/Slides/SM_SB_Slide_End01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Slides/SM_SB_Slide_Module.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_CaribbeanPine_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_CaribbeanPine_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_CoconutTree01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_CoconutTree02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_KapokTree_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_KapokTree_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_QueenPalm_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_QueenPalm_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_TreeTrunk.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimA.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimB.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimC.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimD.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimE.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimF.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimG.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimH.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimI.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimJ.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Aztec_Wall_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Aztec_Wall_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Brick01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_BrickBlock01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_BrickBlock02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Vineswall01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_WallDecoA.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_01B_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_01_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_02B_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_02C_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_02D_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_02_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_03B_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_03_128x96.glb +0 -0
- package/assets/prefabs/actors/demo_health_pickup.prefab.json +114 -0
- package/assets/prefabs/actors/demo_health_pickup_spawner.prefab.json +102 -0
- package/assets/prefabs/actors/test.prefab.json +87 -0
- package/assets/shaders/M_Anisotropy_Brushed.material.json +89 -0
- package/assets/shaders/M_Anisotropy_Radial.material.json +55 -0
- package/assets/shaders/M_Chrome.material.json +18 -0
- package/assets/shaders/M_Emissive_Blue.material.json +26 -0
- package/assets/shaders/M_Glass_Frosted.material.json +24 -0
- package/assets/shaders/M_Glass_ThinFilm.material.json +23 -0
- package/assets/shaders/M_Glossy_Grey.material.json +20 -0
- package/assets/shaders/M_Matte_White.material.json +20 -0
- package/assets/shaders/M_Metal_Anisotropic_Gold.material.json +31 -0
- package/assets/shaders/M_Metal_Anisotropic_Silver.material.json +31 -0
- package/assets/shaders/M_Metal_Brushed.material.json +61 -0
- package/assets/shaders/M_Paint_Clearcoat.material.json +28 -0
- package/assets/shaders/M_Stone_Mossy.material.json +153 -0
- package/assets/shaders/M_Stone_Mossy_Snow.material.json +151 -0
- package/assets/shaders/M_Toon_Anime.material.json +49 -0
- package/assets/shaders/M_Toon_Anime_5Step.material.json +45 -0
- package/assets/shaders/M_Toon_Cel.material.json +49 -0
- package/assets/shaders/M_Transmission.material.json +42 -0
- package/assets/shaders/M_Velvet_Blue.material.json +33 -0
- package/assets/shaders/M_Velvet_Purple.material.json +30 -0
- package/assets/shaders/M_Velvet_Red.material.json +33 -0
- package/assets/shaders/M_Wax_SSSLite.material.json +55 -0
- package/assets/shaders/matcap/M_Matcap_Blue.material.json +27 -0
- package/assets/shaders/matcap/M_Matcap_Rainbow.material.json +26 -0
- package/assets/shaders/matcap/M_Matcap_White.material.json +28 -0
- package/assets/sounds/birds.mp3 +0 -0
- package/assets/sounds/explosion.mp3 +0 -0
- package/assets/sounds/game-gun-short.mp3 +0 -0
- package/assets/sounds/laser.mp3 +0 -0
- package/assets/sounds/pickup.mp3 +0 -0
- package/assets/sounds/tuba.mp3 +0 -0
- package/assets/textures/Checkerboard.png +0 -0
- package/assets/textures/Grid_10x10.png +0 -0
- package/assets/textures/T_AnisotropyMap_Radial.png +0 -0
- package/assets/textures/T_Anisotropy_Roughness.png +0 -0
- package/assets/textures/T_Gradient.png +0 -0
- package/assets/textures/T_Grid_01.png +0 -0
- package/assets/textures/T_Grid_01.texture.json +7 -0
- package/assets/textures/T_Metal_Brushed_Normal.png +0 -0
- package/assets/textures/T_Normal.png +0 -0
- package/assets/textures/T_Stone_Mossy_AmbientOcclusion.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_BaseColor.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_Normal.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_Roughness.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_Snow_AmbientOcclusion.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_Snow_BaseColor.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_Snow_Normal.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_Snow_Roughness.jpg +0 -0
- package/assets/textures/T_Toon_Anime_4Step.png +0 -0
- package/assets/textures/T_Toon_Anime_5Step.png +0 -0
- package/assets/textures/T_Toon_Cel_2Step.png +0 -0
- package/assets/textures/T_Wax_Thickness.png +0 -0
- package/assets/textures/matcaps/T_Matcap_Rainbow.png.png +0 -0
- package/assets/textures/matcaps/beige.png +0 -0
- package/assets/textures/matcaps/black.png +0 -0
- package/assets/textures/matcaps/blue.png +0 -0
- package/assets/textures/matcaps/brown.png +0 -0
- package/assets/textures/matcaps/emeraldGreen.png +0 -0
- package/assets/textures/matcaps/gold.png +0 -0
- package/assets/textures/matcaps/gray.png +0 -0
- package/assets/textures/matcaps/green.png +0 -0
- package/assets/textures/matcaps/metal.png +0 -0
- package/assets/textures/matcaps/orange.png +0 -0
- package/assets/textures/matcaps/purple.png +0 -0
- package/assets/textures/matcaps/red.png +0 -0
- package/assets/textures/matcaps/white.png +0 -0
- package/assets/textures/matcaps/yellow.png +0 -0
- package/assets/textures/skybox/citrus_orchard_road_puresky_2k.hdr +0 -0
- package/assets/textures/skybox/venice_sunset_4k.hdr +0 -0
- package/assets/ui/styles/ammo-counter.css +58 -0
- package/assets/ui/styles/compass.css +54 -0
- package/assets/ui/styles/controls-help.css +21 -0
- package/assets/ui/styles/crosshair.css +51 -0
- package/assets/ui/styles/inventory-bar.css +112 -0
- package/assets/ui/styles/inventory-grid.css +257 -0
- package/assets/ui/styles/main-menu.css +59 -0
- package/assets/ui/styles/minimap.css +12 -0
- package/assets/ui/styles/number-display.css +18 -0
- package/assets/ui/styles/progress-bar.css +199 -0
- package/assets/ui/styles/reload-indicator.css +76 -0
- package/assets/ui/templates/ammo-counter.html +7 -0
- package/assets/ui/templates/compass.html +6 -0
- package/assets/ui/templates/controls-help.html +9 -0
- package/assets/ui/templates/crosshair.html +1 -0
- package/assets/ui/templates/inventory-bar.html +38 -0
- package/assets/ui/templates/inventory-grid.html +9 -0
- package/assets/ui/templates/main-menu.html +10 -0
- package/assets/ui/templates/minimap.html +3 -0
- package/assets/ui/templates/number-display.html +3 -0
- package/assets/ui/templates/progress-bar.html +7 -0
- package/assets/ui/templates/reload-indicator.html +13 -0
- package/dist/games/animation-demo.d.ts +21 -0
- package/dist/games/animation-demo.js +398 -0
- package/dist/games/animation-retarget-demo.d.ts +44 -0
- package/dist/games/animation-retarget-demo.js +574 -0
- package/dist/games/behavior-tree-demo.d.ts +100 -0
- package/dist/games/behavior-tree-demo.js +1656 -0
- package/dist/games/character_animation.d.ts +15 -0
- package/dist/games/character_animation.js +170 -0
- package/dist/games/collision-demo.d.ts +4 -0
- package/dist/games/collision-demo.js +134 -0
- package/dist/games/deprecated/advanced-grid-demo.d.ts +18 -0
- package/dist/games/deprecated/advanced-grid-demo.js +305 -0
- package/dist/games/deprecated/airplane-demo.d.ts +10 -0
- package/dist/games/deprecated/airplane-demo.js +136 -0
- package/dist/games/deprecated/character-controller.d.ts +6 -0
- package/dist/games/deprecated/character-controller.js +144 -0
- package/dist/games/deprecated/chase-game.d.ts +17 -0
- package/dist/games/deprecated/chase-game.js +269 -0
- package/dist/games/deprecated/collision-config.d.ts +7 -0
- package/dist/games/deprecated/collision-config.js +295 -0
- package/dist/games/deprecated/door-demo.d.ts +30 -0
- package/dist/games/deprecated/door-demo.js +562 -0
- package/dist/games/deprecated/fps-demo.d.ts +9 -0
- package/dist/games/deprecated/fps-demo.js +119 -0
- package/dist/games/deprecated/fps-shotgun-demo.d.ts +19 -0
- package/dist/games/deprecated/fps-shotgun-demo.js +221 -0
- package/dist/games/deprecated/index.d.ts +25 -0
- package/dist/games/deprecated/index.js +26 -0
- package/dist/games/deprecated/lightmapping-demo.d.ts +135 -0
- package/dist/games/deprecated/lightmapping-demo.js +1344 -0
- package/dist/games/deprecated/lights-demo.d.ts +93 -0
- package/dist/games/deprecated/lights-demo.js +815 -0
- package/dist/games/deprecated/matcap-demo.d.ts +54 -0
- package/dist/games/deprecated/matcap-demo.js +788 -0
- package/dist/games/deprecated/material-demo-2.d.ts +14 -0
- package/dist/games/deprecated/material-demo-2.js +521 -0
- package/dist/games/deprecated/material-demo.d.ts +8 -0
- package/dist/games/deprecated/material-demo.js +177 -0
- package/dist/games/deprecated/memory-leak-test.d.ts +6 -0
- package/dist/games/deprecated/memory-leak-test.js +20 -0
- package/dist/games/deprecated/model-stress-test.d.ts +10 -0
- package/dist/games/deprecated/model-stress-test.js +116 -0
- package/dist/games/deprecated/multiplayer-demo.d.ts +13 -0
- package/dist/games/deprecated/multiplayer-demo.js +377 -0
- package/dist/games/deprecated/physics-demo.d.ts +10 -0
- package/dist/games/deprecated/physics-demo.js +200 -0
- package/dist/games/deprecated/shadow-demo.d.ts +25 -0
- package/dist/games/deprecated/shadow-demo.js +402 -0
- package/dist/games/deprecated/shooting-demo.d.ts +19 -0
- package/dist/games/deprecated/shooting-demo.js +338 -0
- package/dist/games/deprecated/skybox-demo.d.ts +35 -0
- package/dist/games/deprecated/skybox-demo.js +323 -0
- package/dist/games/deprecated/sound-demo.d.ts +11 -0
- package/dist/games/deprecated/sound-demo.js +125 -0
- package/dist/games/deprecated/timer-demo.d.ts +11 -0
- package/dist/games/deprecated/timer-demo.js +150 -0
- package/dist/games/deprecated/voxel-demo.d.ts +5 -0
- package/dist/games/deprecated/voxel-demo.js +41 -0
- package/dist/games/deprecated/world-commands.d.ts +8 -0
- package/dist/games/deprecated/world-commands.js +168 -0
- package/dist/games/deprecated/world-loading.d.ts +6 -0
- package/dist/games/deprecated/world-loading.js +86 -0
- package/dist/games/examples/fps-advanced/const.d.ts +171 -0
- package/dist/games/examples/fps-advanced/const.js +116 -0
- package/dist/games/examples/fps-advanced/enemies.d.ts +21 -0
- package/dist/games/examples/fps-advanced/enemies.js +182 -0
- package/dist/games/examples/fps-advanced/game-mode.d.ts +53 -0
- package/dist/games/examples/fps-advanced/game-mode.js +353 -0
- package/dist/games/examples/fps-advanced/game.d.ts +9 -0
- package/dist/games/examples/fps-advanced/game.js +58 -0
- package/dist/games/examples/fps-advanced/pickups.d.ts +36 -0
- package/dist/games/examples/fps-advanced/pickups.js +225 -0
- package/dist/games/examples/fps-advanced/player.d.ts +12 -0
- package/dist/games/examples/fps-advanced/player.js +110 -0
- package/dist/games/examples/fps-advanced/ui/endgame-ui.d.ts +21 -0
- package/dist/games/examples/fps-advanced/ui/endgame-ui.js +291 -0
- package/dist/games/examples/fps-advanced/ui/game-hud.d.ts +17 -0
- package/dist/games/examples/fps-advanced/ui/game-hud.js +225 -0
- package/dist/games/examples/fps-advanced/ui/menu-ui.d.ts +13 -0
- package/dist/games/examples/fps-advanced/ui/menu-ui.js +224 -0
- package/dist/games/examples/fps-advanced/ui/weapon-hud.d.ts +27 -0
- package/dist/games/examples/fps-advanced/ui/weapon-hud.js +259 -0
- package/dist/games/examples/fps-advanced/weapons.d.ts +14 -0
- package/dist/games/examples/fps-advanced/weapons.js +173 -0
- package/dist/games/examples/index.d.ts +5 -0
- package/dist/games/examples/index.js +6 -0
- package/dist/games/examples/plugin-demo/game.d.ts +7 -0
- package/dist/games/examples/plugin-demo/game.js +168 -0
- package/dist/games/examples/plugin-demo/plugins/dynamic-lighting.d.ts +8 -0
- package/dist/games/examples/plugin-demo/plugins/dynamic-lighting.js +156 -0
- package/dist/games/examples/plugin-demo/plugins/instanced-forest.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/instanced-forest.js +194 -0
- package/dist/games/examples/plugin-demo/plugins/particle-fountain.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/particle-fountain.js +64 -0
- package/dist/games/examples/plugin-demo/plugins/physics-playground.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/physics-playground.js +185 -0
- package/dist/games/examples/plugin-demo/plugins/robot-follower.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/robot-follower.js +347 -0
- package/dist/games/examples/plugin-demo/plugins/scatter-models.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/scatter-models.js +70 -0
- package/dist/games/examples/plugin-demo/plugins/simple-cube.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/simple-cube.js +44 -0
- package/dist/games/examples/plugin-demo/plugins/tic-tac-toe.d.ts +8 -0
- package/dist/games/examples/plugin-demo/plugins/tic-tac-toe.js +526 -0
- package/dist/games/examples/plugin-demo/plugins/wobbling-sphere.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/wobbling-sphere.js +63 -0
- package/dist/games/examples/side-scroller-advanced/const.d.ts +97 -0
- package/dist/games/examples/side-scroller-advanced/const.js +82 -0
- package/dist/games/examples/side-scroller-advanced/game-mode.d.ts +54 -0
- package/dist/games/examples/side-scroller-advanced/game-mode.js +351 -0
- package/dist/games/examples/side-scroller-advanced/game.d.ts +9 -0
- package/dist/games/examples/side-scroller-advanced/game.js +70 -0
- package/dist/games/examples/side-scroller-advanced/level-generator.d.ts +68 -0
- package/dist/games/examples/side-scroller-advanced/level-generator.js +366 -0
- package/dist/games/examples/side-scroller-advanced/pickups.d.ts +18 -0
- package/dist/games/examples/side-scroller-advanced/pickups.js +147 -0
- package/dist/games/examples/side-scroller-advanced/player.d.ts +5 -0
- package/dist/games/examples/side-scroller-advanced/player.js +104 -0
- package/dist/games/examples/side-scroller-advanced/ui/endgame-ui.d.ts +16 -0
- package/dist/games/examples/side-scroller-advanced/ui/endgame-ui.js +290 -0
- package/dist/games/examples/side-scroller-advanced/ui/game-hud.d.ts +21 -0
- package/dist/games/examples/side-scroller-advanced/ui/game-hud.js +265 -0
- package/dist/games/examples/side-scroller-advanced/ui/menu-ui.d.ts +13 -0
- package/dist/games/examples/side-scroller-advanced/ui/menu-ui.js +222 -0
- package/dist/games/examples/vehicle/base-vehicle.d.ts +30 -0
- package/dist/games/examples/vehicle/base-vehicle.js +155 -0
- package/dist/games/examples/vehicle/game.d.ts +11 -0
- package/dist/games/examples/vehicle/game.js +140 -0
- package/dist/games/examples/vehicle/mesh-vehicle.d.ts +19 -0
- package/dist/games/examples/vehicle/mesh-vehicle.js +194 -0
- package/dist/games/examples/vehicle/player.d.ts +9 -0
- package/dist/games/examples/vehicle/player.js +87 -0
- package/dist/games/examples/vehicle/primitive-vehicle.d.ts +21 -0
- package/dist/games/examples/vehicle/primitive-vehicle.js +269 -0
- package/dist/games/examples/vr-game/VRAttachableCube.d.ts +8 -0
- package/dist/games/examples/vr-game/VRAttachableCube.js +41 -0
- package/dist/games/examples/vr-game/VRInteractableCylinder.d.ts +10 -0
- package/dist/games/examples/vr-game/VRInteractableCylinder.js +76 -0
- package/dist/games/examples/vr-game/VRPressableButton.d.ts +24 -0
- package/dist/games/examples/vr-game/VRPressableButton.js +135 -0
- package/dist/games/examples/vr-game/VRProjectileActor.d.ts +19 -0
- package/dist/games/examples/vr-game/VRProjectileActor.js +75 -0
- package/dist/games/examples/vr-game/VRRifleActor.d.ts +16 -0
- package/dist/games/examples/vr-game/VRRifleActor.js +142 -0
- package/dist/games/examples/vr-game/game.d.ts +9 -0
- package/dist/games/examples/vr-game/game.js +56 -0
- package/dist/games/examples/vr-game/index.d.ts +5 -0
- package/dist/games/examples/vr-game/index.js +9 -0
- package/dist/games/examples/vr-game/scene.d.ts +5 -0
- package/dist/games/examples/vr-game/scene.js +83 -0
- package/dist/games/hand-tracking-demo.d.ts +10 -0
- package/dist/games/hand-tracking-demo.js +65 -0
- package/dist/games/index.d.ts +21 -0
- package/dist/games/index.js +22 -0
- package/dist/games/instanced-mesh-demo.d.ts +45 -0
- package/dist/games/instanced-mesh-demo.js +416 -0
- package/dist/games/manifold-demo.d.ts +6 -0
- package/dist/games/manifold-demo.js +44 -0
- package/dist/games/navigation-demo.d.ts +30 -0
- package/dist/games/navigation-demo.js +336 -0
- package/dist/games/navmesh-primitives-demo.d.ts +167 -0
- package/dist/games/navmesh-primitives-demo.js +1105 -0
- package/dist/games/performance-test-demo.d.ts +13 -0
- package/dist/games/performance-test-demo.js +214 -0
- package/dist/games/postprocess-demo.d.ts +46 -0
- package/dist/games/postprocess-demo.js +829 -0
- package/dist/games/ragdoll-demo-simple.d.ts +34 -0
- package/dist/games/ragdoll-demo-simple.js +152 -0
- package/dist/games/ragdoll-demo.d.ts +30 -0
- package/dist/games/ragdoll-demo.js +258 -0
- package/dist/games/swipe-tap-demo.d.ts +24 -0
- package/dist/games/swipe-tap-demo.js +238 -0
- package/dist/games/tween-demo.d.ts +22 -0
- package/dist/games/tween-demo.js +122 -0
- package/dist/games/ui-demo.d.ts +75 -0
- package/dist/games/ui-demo.js +1054 -0
- package/dist/games/vfx-demo.d.ts +48 -0
- package/dist/games/vfx-demo.js +821 -0
- package/dist/games/vfx-wawa-demo.d.ts +7 -0
- package/dist/games/vfx-wawa-demo.js +471 -0
- package/dist/games/vr-ui-demo-minimal.d.ts +15 -0
- package/dist/games/vr-ui-demo-minimal.js +141 -0
- package/dist/games/vr-ui-demo.d.ts +32 -0
- package/dist/games/vr-ui-demo.js +871 -0
- package/dist/genesys.min.mjs +7035 -0
- package/dist/launcher.d.ts +1 -0
- package/dist/launcher.js +778 -0
- package/dist/scripts/build-browser-bundle.d.ts +5 -0
- package/dist/scripts/build-browser-bundle.js +69 -0
- package/dist/scripts/check-asset-path.d.ts +1 -0
- package/dist/scripts/check-asset-path.js +146 -0
- package/dist/scripts/dump-templates.d.ts +1 -0
- package/dist/scripts/dump-templates.js +16 -0
- package/dist/scripts/generate-dependencies.d.ts +1 -0
- package/dist/scripts/generate-dependencies.js +110 -0
- package/dist/scripts/generate-prefabs.d.ts +1 -0
- package/dist/scripts/generate-prefabs.js +106 -0
- package/dist/scripts/load-save-world.d.ts +2 -0
- package/dist/scripts/load-save-world.js +35 -0
- package/dist/scripts/loc.d.ts +1 -0
- package/dist/scripts/loc.js +80 -0
- package/dist/scripts/optimize-glb-wrapper.d.ts +1 -0
- package/dist/scripts/optimize-glb-wrapper.js +26 -0
- package/dist/scripts/optimize-glb.d.ts +41 -0
- package/dist/scripts/optimize-glb.js +296 -0
- package/dist/scripts/session-server.d.ts +117 -0
- package/dist/scripts/session-server.js +782 -0
- package/dist/scripts/test-world-loading.d.ts +14 -0
- package/dist/scripts/test-world-loading.js +19 -0
- package/dist/src/actors/Actor.d.ts +510 -0
- package/dist/src/actors/Actor.js +1180 -0
- package/dist/src/actors/GLTFMeshActor.d.ts +34 -0
- package/dist/src/actors/GLTFMeshActor.js +102 -0
- package/dist/src/actors/GlobalParticleManager.d.ts +154 -0
- package/dist/src/actors/GlobalParticleManager.js +365 -0
- package/dist/src/actors/Pawn.d.ts +191 -0
- package/dist/src/actors/Pawn.js +384 -0
- package/dist/src/actors/PlayerController.d.ts +177 -0
- package/dist/src/actors/PlayerController.js +763 -0
- package/dist/src/actors/PlayerStart.d.ts +8 -0
- package/dist/src/actors/PlayerStart.js +48 -0
- package/dist/src/actors/Projectile.d.ts +50 -0
- package/dist/src/actors/Projectile.js +157 -0
- package/dist/src/actors/RagdollTestActor.d.ts +31 -0
- package/dist/src/actors/RagdollTestActor.js +153 -0
- package/dist/src/actors/ThirdPersonCharacterPawn.d.ts +27 -0
- package/dist/src/actors/ThirdPersonCharacterPawn.js +149 -0
- package/dist/src/actors/index.d.ts +20 -0
- package/dist/src/actors/index.js +21 -0
- package/dist/src/animation/AnimationClipCache.d.ts +41 -0
- package/dist/src/animation/AnimationClipCache.js +97 -0
- package/dist/src/animation/AnimationRetargeting.d.ts +100 -0
- package/dist/src/animation/AnimationRetargeting.js +455 -0
- package/dist/src/animation/SkeletonProfile.d.ts +112 -0
- package/dist/src/animation/SkeletonProfile.js +84 -0
- package/dist/src/animation/index.d.ts +14 -0
- package/dist/src/animation/index.js +15 -0
- package/dist/src/animation/retargeting.d.ts +142 -0
- package/dist/src/animation/retargeting.js +834 -0
- package/dist/src/components/CharacterStatsComponent.d.ts +89 -0
- package/dist/src/components/CharacterStatsComponent.js +207 -0
- package/dist/src/components/CollisionShapeComponent.d.ts +102 -0
- package/dist/src/components/CollisionShapeComponent.js +232 -0
- package/dist/src/components/Component.d.ts +82 -0
- package/dist/src/components/Component.js +2 -0
- package/dist/src/components/FollowComponent.d.ts +67 -0
- package/dist/src/components/FollowComponent.js +128 -0
- package/dist/src/components/PrimitiveComponent.d.ts +183 -0
- package/dist/src/components/PrimitiveComponent.js +368 -0
- package/dist/src/components/ResetPositionComponent.d.ts +52 -0
- package/dist/src/components/ResetPositionComponent.js +161 -0
- package/dist/src/components/SceneComponent.d.ts +225 -0
- package/dist/src/components/SceneComponent.js +621 -0
- package/dist/src/components/audio/SoundComponent.d.ts +109 -0
- package/dist/src/components/audio/SoundComponent.js +353 -0
- package/dist/src/components/audio/index.d.ts +11 -0
- package/dist/src/components/audio/index.js +12 -0
- package/dist/src/components/csg/CSGCombiner.d.ts +87 -0
- package/dist/src/components/csg/CSGCombiner.js +240 -0
- package/dist/src/components/csg/CSGShapes.d.ts +173 -0
- package/dist/src/components/csg/CSGShapes.js +326 -0
- package/dist/src/components/csg/index.d.ts +12 -0
- package/dist/src/components/csg/index.js +13 -0
- package/dist/src/components/gameplay/BaseWeaponComponent.d.ts +175 -0
- package/dist/src/components/gameplay/BaseWeaponComponent.js +496 -0
- package/dist/src/components/gameplay/DoorComponent.d.ts +236 -0
- package/dist/src/components/gameplay/DoorComponent.js +928 -0
- package/dist/src/components/gameplay/Equipment.d.ts +22 -0
- package/dist/src/components/gameplay/Equipment.js +9 -0
- package/dist/src/components/gameplay/GenericEquipment.d.ts +37 -0
- package/dist/src/components/gameplay/GenericEquipment.js +90 -0
- package/dist/src/components/gameplay/InstantHitWeaponComponent.d.ts +96 -0
- package/dist/src/components/gameplay/InstantHitWeaponComponent.js +194 -0
- package/dist/src/components/gameplay/PickupComponent.d.ts +130 -0
- package/dist/src/components/gameplay/PickupComponent.js +429 -0
- package/dist/src/components/gameplay/ProjectileWeaponComponent.d.ts +49 -0
- package/dist/src/components/gameplay/ProjectileWeaponComponent.js +93 -0
- package/dist/src/components/gameplay/ShotgunComponent.d.ts +18 -0
- package/dist/src/components/gameplay/ShotgunComponent.js +216 -0
- package/dist/src/components/gameplay/SwitchComponent.d.ts +152 -0
- package/dist/src/components/gameplay/SwitchComponent.js +481 -0
- package/dist/src/components/gameplay/TriggerZoneComponent.d.ts +157 -0
- package/dist/src/components/gameplay/TriggerZoneComponent.js +312 -0
- package/dist/src/components/gameplay/index.d.ts +20 -0
- package/dist/src/components/gameplay/index.js +21 -0
- package/dist/src/components/index.d.ts +16 -0
- package/dist/src/components/index.js +18 -0
- package/dist/src/components/lights/AmbientLightComponent.d.ts +37 -0
- package/dist/src/components/lights/AmbientLightComponent.js +68 -0
- package/dist/src/components/lights/DirectionalLightComponent.d.ts +77 -0
- package/dist/src/components/lights/DirectionalLightComponent.js +146 -0
- package/dist/src/components/lights/HemisphereLightComponent.d.ts +67 -0
- package/dist/src/components/lights/HemisphereLightComponent.js +121 -0
- package/dist/src/components/lights/LightComponent.d.ts +145 -0
- package/dist/src/components/lights/LightComponent.js +315 -0
- package/dist/src/components/lights/PointLightComponent.d.ts +61 -0
- package/dist/src/components/lights/PointLightComponent.js +103 -0
- package/dist/src/components/lights/RectAreaLightComponent.d.ts +78 -0
- package/dist/src/components/lights/RectAreaLightComponent.js +135 -0
- package/dist/src/components/lights/SpotLightComponent.d.ts +100 -0
- package/dist/src/components/lights/SpotLightComponent.js +167 -0
- package/dist/src/components/lights/index.d.ts +17 -0
- package/dist/src/components/lights/index.js +18 -0
- package/dist/src/components/movement/AerialMovementComponent.d.ts +93 -0
- package/dist/src/components/movement/AerialMovementComponent.js +339 -0
- package/dist/src/components/movement/AirplaneMovementComponent.d.ts +59 -0
- package/dist/src/components/movement/AirplaneMovementComponent.js +215 -0
- package/dist/src/components/movement/BasePawnMovementComponent.d.ts +132 -0
- package/dist/src/components/movement/BasePawnMovementComponent.js +264 -0
- package/dist/src/components/movement/CharacterMovementComponent.d.ts +175 -0
- package/dist/src/components/movement/CharacterMovementComponent.js +448 -0
- package/dist/src/components/movement/DirectionalCharacterMovementComponent.d.ts +17 -0
- package/dist/src/components/movement/DirectionalCharacterMovementComponent.js +82 -0
- package/dist/src/components/movement/NpcMovementComponent.d.ts +232 -0
- package/dist/src/components/movement/NpcMovementComponent.js +890 -0
- package/dist/src/components/movement/PathMovementComponent.d.ts +54 -0
- package/dist/src/components/movement/PathMovementComponent.js +211 -0
- package/dist/src/components/movement/TopDownMovementComponent.d.ts +25 -0
- package/dist/src/components/movement/TopDownMovementComponent.js +79 -0
- package/dist/src/components/movement/TweenMovementComponent.d.ts +59 -0
- package/dist/src/components/movement/TweenMovementComponent.js +362 -0
- package/dist/src/components/movement/VehicleMovementComponent.d.ts +98 -0
- package/dist/src/components/movement/VehicleMovementComponent.js +402 -0
- package/dist/src/components/movement/index.d.ts +19 -0
- package/dist/src/components/movement/index.js +20 -0
- package/dist/src/components/physics/RagdollComponent.d.ts +118 -0
- package/dist/src/components/physics/RagdollComponent.js +671 -0
- package/dist/src/components/visual/AnimationComponent.d.ts +29 -0
- package/dist/src/components/visual/AnimationComponent.js +234 -0
- package/dist/src/components/visual/AnimationStateMachineComponent.d.ts +235 -0
- package/dist/src/components/visual/AnimationStateMachineComponent.js +1048 -0
- package/dist/src/components/visual/BaseInstancedMeshComponent.d.ts +253 -0
- package/dist/src/components/visual/BaseInstancedMeshComponent.js +763 -0
- package/dist/src/components/visual/BillboardComponent.d.ts +26 -0
- package/dist/src/components/visual/BillboardComponent.js +143 -0
- package/dist/src/components/visual/EditorOnlyMeshComponent.d.ts +17 -0
- package/dist/src/components/visual/EditorOnlyMeshComponent.js +53 -0
- package/dist/src/components/visual/FogComponent.d.ts +32 -0
- package/dist/src/components/visual/FogComponent.js +131 -0
- package/dist/src/components/visual/GLTFMeshComponent.d.ts +138 -0
- package/dist/src/components/visual/GLTFMeshComponent.js +411 -0
- package/dist/src/components/visual/InstancedGltfMeshComponent.d.ts +75 -0
- package/dist/src/components/visual/InstancedGltfMeshComponent.js +217 -0
- package/dist/src/components/visual/InstancedMeshComponent.d.ts +57 -0
- package/dist/src/components/visual/InstancedMeshComponent.js +114 -0
- package/dist/src/components/visual/MeshComponent.d.ts +71 -0
- package/dist/src/components/visual/MeshComponent.js +208 -0
- package/dist/src/components/visual/ParticleEmitterComponent.d.ts +145 -0
- package/dist/src/components/visual/ParticleEmitterComponent.js +569 -0
- package/dist/src/components/visual/SkyboxComponent.d.ts +135 -0
- package/dist/src/components/visual/SkyboxComponent.js +342 -0
- package/dist/src/components/visual/TerrainMeshComponent.d.ts +119 -0
- package/dist/src/components/visual/TerrainMeshComponent.js +309 -0
- package/dist/src/components/visual/UI3DComponent.d.ts +60 -0
- package/dist/src/components/visual/UI3DComponent.js +248 -0
- package/dist/src/components/visual/index.d.ts +23 -0
- package/dist/src/components/visual/index.js +24 -0
- package/dist/src/components/voxel/MagicaVoxelLoader.d.ts +18 -0
- package/dist/src/components/voxel/MagicaVoxelLoader.js +151 -0
- package/dist/src/components/voxel/VoxelMeshComponent.d.ts +66 -0
- package/dist/src/components/voxel/VoxelMeshComponent.js +246 -0
- package/dist/src/components/voxel/index.d.ts +2 -0
- package/dist/src/components/voxel/index.js +3 -0
- package/dist/src/const.d.ts +61 -0
- package/dist/src/const.js +62 -0
- package/dist/src/csg/CSGUtils.d.ts +118 -0
- package/dist/src/csg/CSGUtils.js +805 -0
- package/dist/src/csg/ManifoldWrapper.d.ts +172 -0
- package/dist/src/csg/ManifoldWrapper.js +629 -0
- package/dist/src/csg/index.d.ts +13 -0
- package/dist/src/csg/index.js +14 -0
- package/dist/src/dependencies.d.ts +125 -0
- package/dist/src/dependencies.js +72 -0
- package/dist/src/game/GameBuilder.d.ts +104 -0
- package/dist/src/game/GameBuilder.js +263 -0
- package/dist/src/game/GameLoop.d.ts +204 -0
- package/dist/src/game/GameLoop.js +545 -0
- package/dist/src/game/GameMode.d.ts +58 -0
- package/dist/src/game/GameMode.js +131 -0
- package/dist/src/game/Playable.d.ts +38 -0
- package/dist/src/game/Playable.js +83 -0
- package/dist/src/game/World.d.ts +512 -0
- package/dist/src/game/World.js +1467 -0
- package/dist/src/game/index.d.ts +18 -0
- package/dist/src/game/index.js +19 -0
- package/dist/src/index.d.ts +39 -0
- package/dist/src/index.js +40 -0
- package/dist/src/materials.d.ts +49 -0
- package/dist/src/materials.js +177 -0
- package/dist/src/multiplayer/MovementPrediction.d.ts +28 -0
- package/dist/src/multiplayer/MovementPrediction.js +204 -0
- package/dist/src/multiplayer/NetWorld.d.ts +125 -0
- package/dist/src/multiplayer/NetWorld.js +960 -0
- package/dist/src/multiplayer/implementations/MemorySession.d.ts +18 -0
- package/dist/src/multiplayer/implementations/MemorySession.js +112 -0
- package/dist/src/multiplayer/implementations/WebSocketSession.d.ts +134 -0
- package/dist/src/multiplayer/implementations/WebSocketSession.js +439 -0
- package/dist/src/multiplayer/implementations/index.d.ts +14 -0
- package/dist/src/multiplayer/implementations/index.js +15 -0
- package/dist/src/multiplayer/index.d.ts +16 -0
- package/dist/src/multiplayer/index.js +17 -0
- package/dist/src/multiplayer/interface.d.ts +134 -0
- package/dist/src/multiplayer/interface.js +87 -0
- package/dist/src/navigation/NavigationServer.d.ts +134 -0
- package/dist/src/navigation/NavigationServer.js +47 -0
- package/dist/src/navigation/RecastNavigationServer.d.ts +82 -0
- package/dist/src/navigation/RecastNavigationServer.js +325 -0
- package/dist/src/navigation/index.d.ts +16 -0
- package/dist/src/navigation/index.js +17 -0
- package/dist/src/npc/behavior-tree/BehaviorNode.d.ts +95 -0
- package/dist/src/npc/behavior-tree/BehaviorNode.js +177 -0
- package/dist/src/npc/behavior-tree/BehaviorTreeComponent.d.ts +104 -0
- package/dist/src/npc/behavior-tree/BehaviorTreeComponent.js +341 -0
- package/dist/src/npc/behavior-tree/behaviors/BehaviorAction.d.ts +52 -0
- package/dist/src/npc/behavior-tree/behaviors/BehaviorAction.js +70 -0
- package/dist/src/npc/behavior-tree/behaviors/ConditionEvaluator.d.ts +73 -0
- package/dist/src/npc/behavior-tree/behaviors/ConditionEvaluator.js +116 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialMoveToTargetAction.d.ts +33 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialMoveToTargetAction.js +138 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialSearchAction.d.ts +42 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialSearchAction.js +170 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialTrackTargetAction.d.ts +27 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialTrackTargetAction.js +86 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialWanderAction.d.ts +50 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialWanderAction.js +189 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/index.d.ts +4 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/index.js +6 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/combat/MeleeAttackAction.d.ts +37 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/combat/MeleeAttackAction.js +172 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/combat/ShootAction.d.ts +35 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/combat/ShootAction.js +173 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/combat/index.d.ts +2 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/combat/index.js +4 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/FleeFromTargetAction.d.ts +34 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/FleeFromTargetAction.js +148 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/FollowActorAction.d.ts +30 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/FollowActorAction.js +129 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/MoveToPositionAction.d.ts +27 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/MoveToPositionAction.js +115 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/SetNextWaypointAction.d.ts +28 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/SetNextWaypointAction.js +120 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/WanderAction.d.ts +35 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/WanderAction.js +172 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/index.d.ts +5 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/index.js +7 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/index.d.ts +4 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/index.js +10 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/CalculateTacticalPositionAction.d.ts +32 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/CalculateTacticalPositionAction.js +123 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/LookAtTargetAction.d.ts +43 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/LookAtTargetAction.js +140 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/WaitAction.d.ts +24 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/WaitAction.js +85 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/index.d.ts +3 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/index.js +5 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/BlackboardValueCondition.d.ts +40 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/BlackboardValueCondition.js +133 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/CanSeeTargetCondition.d.ts +29 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/CanSeeTargetCondition.js +167 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/HasLastKnownPositionCondition.d.ts +19 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/HasLastKnownPositionCondition.js +67 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/HpAbovePercentCondition.d.ts +25 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/HpAbovePercentCondition.js +94 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/IsPlayerNearCondition.d.ts +15 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/IsPlayerNearCondition.js +51 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/TargetBelowHpPercentCondition.d.ts +19 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/TargetBelowHpPercentCondition.js +66 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/TargetInConeCondition.d.ts +26 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/TargetInConeCondition.js +111 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/TimeLimitCondition.d.ts +24 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/TimeLimitCondition.js +81 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/index.d.ts +8 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/index.js +15 -0
- package/dist/src/npc/behavior-tree/behaviors/index.d.ts +4 -0
- package/dist/src/npc/behavior-tree/behaviors/index.js +8 -0
- package/dist/src/npc/behavior-tree/blackboard/Blackboard.d.ts +50 -0
- package/dist/src/npc/behavior-tree/blackboard/Blackboard.js +121 -0
- package/dist/src/npc/behavior-tree/blackboard/BlackboardKey.d.ts +35 -0
- package/dist/src/npc/behavior-tree/blackboard/BlackboardKey.js +66 -0
- package/dist/src/npc/behavior-tree/blackboard/index.d.ts +2 -0
- package/dist/src/npc/behavior-tree/blackboard/index.js +3 -0
- package/dist/src/npc/behavior-tree/index.d.ts +9 -0
- package/dist/src/npc/behavior-tree/index.js +19 -0
- package/dist/src/npc/behavior-tree/loader/BehaviorTreeLoader.d.ts +91 -0
- package/dist/src/npc/behavior-tree/loader/BehaviorTreeLoader.js +240 -0
- package/dist/src/npc/behavior-tree/nodes/CompositeNode.d.ts +46 -0
- package/dist/src/npc/behavior-tree/nodes/CompositeNode.js +93 -0
- package/dist/src/npc/behavior-tree/nodes/LeafNode.d.ts +8 -0
- package/dist/src/npc/behavior-tree/nodes/LeafNode.js +11 -0
- package/dist/src/npc/behavior-tree/nodes/composite/SelectorNode.d.ts +15 -0
- package/dist/src/npc/behavior-tree/nodes/composite/SelectorNode.js +61 -0
- package/dist/src/npc/behavior-tree/nodes/composite/SequenceNode.d.ts +15 -0
- package/dist/src/npc/behavior-tree/nodes/composite/SequenceNode.js +61 -0
- package/dist/src/physics/BasePhysicsEngine.d.ts +389 -0
- package/dist/src/physics/BasePhysicsEngine.js +1227 -0
- package/dist/src/physics/IPhysicsVehicle.d.ts +150 -0
- package/dist/src/physics/IPhysicsVehicle.js +2 -0
- package/dist/src/physics/PhysicsEngine.d.ts +425 -0
- package/dist/src/physics/PhysicsEngine.js +69 -0
- package/dist/src/physics/PhysicsTypes.d.ts +91 -0
- package/dist/src/physics/PhysicsTypes.js +24 -0
- package/dist/src/physics/implementations/RapierDebugRender.d.ts +24 -0
- package/dist/src/physics/implementations/RapierDebugRender.js +66 -0
- package/dist/src/physics/implementations/RapierPhysics.d.ts +122 -0
- package/dist/src/physics/implementations/RapierPhysics.js +1191 -0
- package/dist/src/physics/implementations/RapierVehicle.d.ts +31 -0
- package/dist/src/physics/implementations/RapierVehicle.js +236 -0
- package/dist/src/physics/index.d.ts +16 -0
- package/dist/src/physics/index.js +17 -0
- package/dist/src/render/EdgeOutlineEffect.d.ts +40 -0
- package/dist/src/render/EdgeOutlineEffect.js +389 -0
- package/dist/src/render/PostProcessManager.d.ts +274 -0
- package/dist/src/render/PostProcessManager.js +932 -0
- package/dist/src/render/Renderer.d.ts +84 -0
- package/dist/src/render/Renderer.js +306 -0
- package/dist/src/render/Texture.d.ts +51 -0
- package/dist/src/render/Texture.js +144 -0
- package/dist/src/render/index.d.ts +20 -0
- package/dist/src/render/index.js +21 -0
- package/dist/src/render/lightmapping/LightmapAtlas.d.ts +52 -0
- package/dist/src/render/lightmapping/LightmapAtlas.js +201 -0
- package/dist/src/render/lightmapping/LightmapBaker.d.ts +99 -0
- package/dist/src/render/lightmapping/LightmapBaker.js +239 -0
- package/dist/src/render/lightmapping/LightmapManager.d.ts +148 -0
- package/dist/src/render/lightmapping/LightmapManager.js +630 -0
- package/dist/src/render/lightmapping/LightmapMaterial.d.ts +26 -0
- package/dist/src/render/lightmapping/LightmapMaterial.js +242 -0
- package/dist/src/render/lightmapping/LightmapSerialization.d.ts +379 -0
- package/dist/src/render/lightmapping/LightmapSerialization.js +244 -0
- package/dist/src/render/lightmapping/LightmapSerializer.d.ts +94 -0
- package/dist/src/render/lightmapping/LightmapSerializer.js +223 -0
- package/dist/src/render/lightmapping/MultiLightmapperMaterial.d.ts +41 -0
- package/dist/src/render/lightmapping/MultiLightmapperMaterial.js +424 -0
- package/dist/src/render/lightmapping/index.d.ts +9 -0
- package/dist/src/render/lightmapping/index.js +6 -0
- package/dist/src/render/postprocessing/EffectPassWrapper.d.ts +17 -0
- package/dist/src/render/postprocessing/EffectPassWrapper.js +47 -0
- package/dist/src/render/postprocessing/ObjectOutlineEffect.d.ts +49 -0
- package/dist/src/render/postprocessing/ObjectOutlineEffect.js +364 -0
- package/dist/src/render/postprocessing/index.d.ts +2 -0
- package/dist/src/render/postprocessing/index.js +3 -0
- package/dist/src/runtime/GameRuntime.d.ts +25 -0
- package/dist/src/runtime/GameRuntime.js +131 -0
- package/dist/src/runtime/InjectedDependencies.d.ts +13 -0
- package/dist/src/runtime/InjectedDependencies.js +63 -0
- package/dist/src/runtime/Utils.d.ts +16 -0
- package/dist/src/runtime/Utils.js +113 -0
- package/dist/src/runtime/index.d.ts +4 -0
- package/dist/src/runtime/index.js +5 -0
- package/dist/src/runtime/materials/MatcapShaderMaterial.d.ts +23 -0
- package/dist/src/runtime/materials/MatcapShaderMaterial.js +235 -0
- package/dist/src/runtime/materials/index.d.ts +1 -0
- package/dist/src/runtime/materials/index.js +2 -0
- package/dist/src/scripting/Plugin.d.ts +64 -0
- package/dist/src/scripting/Plugin.js +2 -0
- package/dist/src/scripting/PluginManager.d.ts +40 -0
- package/dist/src/scripting/PluginManager.js +111 -0
- package/dist/src/scripting/index.d.ts +1 -0
- package/dist/src/scripting/index.js +2 -0
- package/dist/src/storage/defaultStorageProvider.d.ts +15 -0
- package/dist/src/storage/defaultStorageProvider.js +73 -0
- package/dist/src/storage/index.d.ts +16 -0
- package/dist/src/storage/index.js +17 -0
- package/dist/src/storage/projectContext.d.ts +80 -0
- package/dist/src/storage/projectContext.js +164 -0
- package/dist/src/storage/storageProvider.d.ts +148 -0
- package/dist/src/storage/storageProvider.js +181 -0
- package/dist/src/systems/ClassRegistry.d.ts +98 -0
- package/dist/src/systems/ClassRegistry.js +478 -0
- package/dist/src/systems/ConsoleManager.d.ts +66 -0
- package/dist/src/systems/ConsoleManager.js +465 -0
- package/dist/src/systems/ConsoleVariableHandler.d.ts +17 -0
- package/dist/src/systems/ConsoleVariableHandler.js +120 -0
- package/dist/src/systems/ConsoleVariableManager.d.ts +128 -0
- package/dist/src/systems/ConsoleVariableManager.js +295 -0
- package/dist/src/systems/InputManager.d.ts +511 -0
- package/dist/src/systems/InputManager.js +1025 -0
- package/dist/src/systems/ObjectNamingSystem.d.ts +9 -0
- package/dist/src/systems/ObjectNamingSystem.js +34 -0
- package/dist/src/systems/Stats.d.ts +36 -0
- package/dist/src/systems/Stats.js +193 -0
- package/dist/src/systems/TimerSystem.d.ts +180 -0
- package/dist/src/systems/TimerSystem.js +292 -0
- package/dist/src/systems/TweenManager.d.ts +57 -0
- package/dist/src/systems/TweenManager.js +107 -0
- package/dist/src/systems/WorldSerialization.d.ts +216 -0
- package/dist/src/systems/WorldSerialization.js +1082 -0
- package/dist/src/systems/collision/CollisionConfig.d.ts +56 -0
- package/dist/src/systems/collision/CollisionConfig.js +249 -0
- package/dist/src/systems/collision/CollisionTypes.d.ts +138 -0
- package/dist/src/systems/collision/CollisionTypes.js +204 -0
- package/dist/src/systems/collision/index.d.ts +15 -0
- package/dist/src/systems/collision/index.js +16 -0
- package/dist/src/systems/index.d.ts +23 -0
- package/dist/src/systems/index.js +24 -0
- package/dist/src/templates/MyActor.d.ts +9 -0
- package/dist/src/templates/MyActor.js +25 -0
- package/dist/src/templates/MySceneComponent.d.ts +9 -0
- package/dist/src/templates/MySceneComponent.js +25 -0
- package/dist/src/ui/LoadingScreen.d.ts +15 -0
- package/dist/src/ui/LoadingScreen.js +103 -0
- package/dist/src/ui/UIElement.d.ts +74 -0
- package/dist/src/ui/UIElement.js +202 -0
- package/dist/src/ui/UILayout.d.ts +126 -0
- package/dist/src/ui/UILayout.js +244 -0
- package/dist/src/ui/UIManager.d.ts +44 -0
- package/dist/src/ui/UIManager.js +148 -0
- package/dist/src/ui/UIResource.d.ts +6 -0
- package/dist/src/ui/UIResource.js +24 -0
- package/dist/src/ui/components/AmmoCounter.d.ts +28 -0
- package/dist/src/ui/components/AmmoCounter.js +125 -0
- package/dist/src/ui/components/BaseUIComponent.d.ts +128 -0
- package/dist/src/ui/components/BaseUIComponent.js +342 -0
- package/dist/src/ui/components/Compass.d.ts +28 -0
- package/dist/src/ui/components/Compass.js +125 -0
- package/dist/src/ui/components/ControlsPanel.d.ts +37 -0
- package/dist/src/ui/components/ControlsPanel.js +47 -0
- package/dist/src/ui/components/Crosshair.d.ts +20 -0
- package/dist/src/ui/components/Crosshair.js +67 -0
- package/dist/src/ui/components/InventoryBar.d.ts +103 -0
- package/dist/src/ui/components/InventoryBar.js +177 -0
- package/dist/src/ui/components/InventoryGrid.d.ts +139 -0
- package/dist/src/ui/components/InventoryGrid.js +407 -0
- package/dist/src/ui/components/Minimap.d.ts +39 -0
- package/dist/src/ui/components/Minimap.js +156 -0
- package/dist/src/ui/components/NumberDisplay.d.ts +51 -0
- package/dist/src/ui/components/NumberDisplay.js +164 -0
- package/dist/src/ui/components/ProgressBar.d.ts +115 -0
- package/dist/src/ui/components/ProgressBar.js +347 -0
- package/dist/src/ui/components/ReloadIndicator.d.ts +29 -0
- package/dist/src/ui/components/ReloadIndicator.js +147 -0
- package/dist/src/ui/components/index.d.ts +11 -0
- package/dist/src/ui/components/index.js +13 -0
- package/dist/src/ui/index.d.ts +21 -0
- package/dist/src/ui/index.js +22 -0
- package/dist/src/ui/ui-loader.d.ts +49 -0
- package/dist/src/ui/ui-loader.js +83 -0
- package/dist/src/utils/Color.d.ts +48 -0
- package/dist/src/utils/Color.js +121 -0
- package/dist/src/utils/Delegate.d.ts +72 -0
- package/dist/src/utils/Delegate.js +102 -0
- package/dist/src/utils/DescriptionHelpers.d.ts +47 -0
- package/dist/src/utils/DescriptionHelpers.js +65 -0
- package/dist/src/utils/EditorClassMeta.d.ts +99 -0
- package/dist/src/utils/EditorClassMeta.js +2 -0
- package/dist/src/utils/GlobalAudioManager.d.ts +141 -0
- package/dist/src/utils/GlobalAudioManager.js +312 -0
- package/dist/src/utils/IAsyncLoadable.d.ts +94 -0
- package/dist/src/utils/IAsyncLoadable.js +52 -0
- package/dist/src/utils/MaterialHelpers.d.ts +67 -0
- package/dist/src/utils/MaterialHelpers.js +278 -0
- package/dist/src/utils/MathHelpers.d.ts +65 -0
- package/dist/src/utils/MathHelpers.js +60 -0
- package/dist/src/utils/NodeJs.d.ts +1 -0
- package/dist/src/utils/NodeJs.js +81 -0
- package/dist/src/utils/Perlin.d.ts +39 -0
- package/dist/src/utils/Perlin.js +380 -0
- package/dist/src/utils/ResourceManager.d.ts +183 -0
- package/dist/src/utils/ResourceManager.js +703 -0
- package/dist/src/utils/SceneGraphUtils.d.ts +26 -0
- package/dist/src/utils/SceneGraphUtils.js +139 -0
- package/dist/src/utils/Spawn.d.ts +27 -0
- package/dist/src/utils/Spawn.js +73 -0
- package/dist/src/utils/ThreeJsExtensions.d.ts +298 -0
- package/dist/src/utils/ThreeJsExtensions.js +817 -0
- package/dist/src/utils/TweenExtensions.d.ts +8 -0
- package/dist/src/utils/TweenExtensions.js +103 -0
- package/dist/src/utils/UserCodeEngine.d.ts +70 -0
- package/dist/src/utils/UserCodeEngine.js +235 -0
- package/dist/src/utils/Utils.d.ts +65 -0
- package/dist/src/utils/Utils.js +296 -0
- package/dist/src/utils/VRButtonUtils.d.ts +21 -0
- package/dist/src/utils/VRButtonUtils.js +88 -0
- package/dist/src/utils/browser-polyfills/module.d.ts +20 -0
- package/dist/src/utils/browser-polyfills/module.js +31 -0
- package/dist/src/utils/browser-polyfills/path.d.ts +69 -0
- package/dist/src/utils/browser-polyfills/path.js +188 -0
- package/dist/src/utils/index.d.ts +29 -0
- package/dist/src/utils/index.js +30 -0
- package/dist/src/utils/serialization/cdo.d.ts +6 -0
- package/dist/src/utils/serialization/cdo.js +74 -0
- package/dist/src/utils/serialization/clsAlias.d.ts +15 -0
- package/dist/src/utils/serialization/clsAlias.js +96 -0
- package/dist/src/utils/serialization/decorator.d.ts +132 -0
- package/dist/src/utils/serialization/decorator.js +66 -0
- package/dist/src/utils/serialization/index.d.ts +7 -0
- package/dist/src/utils/serialization/index.js +8 -0
- package/dist/src/utils/serialization/prefab.d.ts +9 -0
- package/dist/src/utils/serialization/prefab.js +55 -0
- package/dist/src/utils/serialization/prefabManager.d.ts +17 -0
- package/dist/src/utils/serialization/prefabManager.js +84 -0
- package/dist/src/utils/serialization/serializable.d.ts +23 -0
- package/dist/src/utils/serialization/serializable.js +2 -0
- package/dist/src/utils/serialization/serializer.d.ts +126 -0
- package/dist/src/utils/serialization/serializer.js +1032 -0
- package/dist/src/utils/serialization/specialization.d.ts +1 -0
- package/dist/src/utils/serialization/specialization.js +194 -0
- package/dist/src/utils/serialization/specializationUtils.d.ts +27 -0
- package/dist/src/utils/serialization/specializationUtils.js +137 -0
- package/dist/src/vfx/VFXComponent.d.ts +65 -0
- package/dist/src/vfx/VFXComponent.js +202 -0
- package/dist/src/vfx/index.d.ts +11 -0
- package/dist/src/vfx/index.js +11 -0
- package/dist/src/vfx/types.d.ts +146 -0
- package/dist/src/vfx/types.js +146 -0
- package/dist/src/world-commands/common.d.ts +23 -0
- package/dist/src/world-commands/common.js +2 -0
- package/dist/src/world-commands/generate-code.d.ts +3 -0
- package/dist/src/world-commands/generate-code.js +90 -0
- package/dist/src/world-commands/index.d.ts +19 -0
- package/dist/src/world-commands/index.js +20 -0
- package/dist/src/world-commands/place-gltf.d.ts +25 -0
- package/dist/src/world-commands/place-gltf.js +39 -0
- package/dist/src/world-commands/place-prefab.d.ts +25 -0
- package/dist/src/world-commands/place-prefab.js +40 -0
- package/dist/src/world-commands/place-primitive.d.ts +39 -0
- package/dist/src/world-commands/place-primitive.js +100 -0
- package/dist/src/world-commands/remove-actors.d.ts +23 -0
- package/dist/src/world-commands/remove-actors.js +9 -0
- package/dist/src/xr/VRActor.d.ts +46 -0
- package/dist/src/xr/VRActor.js +56 -0
- package/dist/src/xr/VRControllerHandler.d.ts +25 -0
- package/dist/src/xr/VRControllerHandler.js +74 -0
- package/dist/src/xr/VRControllerManager.d.ts +194 -0
- package/dist/src/xr/VRControllerManager.js +539 -0
- package/dist/src/xr/VRDeviceHandler.d.ts +47 -0
- package/dist/src/xr/VRDeviceHandler.js +61 -0
- package/dist/src/xr/VRHandHandler.d.ts +23 -0
- package/dist/src/xr/VRHandHandler.js +161 -0
- package/dist/src/xr/VRInputDevice.d.ts +100 -0
- package/dist/src/xr/VRInputDevice.js +367 -0
- package/dist/src/xr/VRPawn.d.ts +198 -0
- package/dist/src/xr/VRPawn.js +771 -0
- package/dist/src/xr/actor-components/CanvasUIComponent.d.ts +61 -0
- package/dist/src/xr/actor-components/CanvasUIComponent.js +418 -0
- package/dist/src/xr/actor-components/VRBaseComponent.d.ts +15 -0
- package/dist/src/xr/actor-components/VRBaseComponent.js +24 -0
- package/dist/src/xr/actor-components/VRGrabbableComponent.d.ts +31 -0
- package/dist/src/xr/actor-components/VRGrabbableComponent.js +81 -0
- package/dist/src/xr/actor-components/VRInteractableComponent.d.ts +19 -0
- package/dist/src/xr/actor-components/VRInteractableComponent.js +50 -0
- package/dist/src/xr/index.d.ts +17 -0
- package/dist/src/xr/index.js +18 -0
- package/dist/src/xr/pawn-components/VRGrabComponent.d.ts +36 -0
- package/dist/src/xr/pawn-components/VRGrabComponent.js +445 -0
- package/dist/src/xr/pawn-components/VRInteractComponent.d.ts +20 -0
- package/dist/src/xr/pawn-components/VRInteractComponent.js +81 -0
- package/dist/src/xr/pawn-components/VRSnapTurnComponent.d.ts +25 -0
- package/dist/src/xr/pawn-components/VRSnapTurnComponent.js +114 -0
- package/dist/src/xr/pawn-components/VRTeleportComponent.d.ts +42 -0
- package/dist/src/xr/pawn-components/VRTeleportComponent.js +318 -0
- package/dist/src/xr/ui/CanvasColorPicker.d.ts +33 -0
- package/dist/src/xr/ui/CanvasColorPicker.js +188 -0
- package/dist/src/xr/ui/CanvasKeyboard.d.ts +21 -0
- package/dist/src/xr/ui/CanvasKeyboard.js +281 -0
- package/dist/src/xr/ui/CanvasSlider.d.ts +21 -0
- package/dist/src/xr/ui/CanvasSlider.js +112 -0
- package/dist/src/xr/ui/CanvasUI.d.ts +129 -0
- package/dist/src/xr/ui/CanvasUI.js +876 -0
- package/dist/src/xr/ui/index.d.ts +8 -0
- package/dist/src/xr/ui/index.js +9 -0
- package/dist/test/absolute-transform.test.d.ts +1 -0
- package/dist/test/absolute-transform.test.js +796 -0
- package/dist/test/asset-path.test.d.ts +1 -0
- package/dist/test/asset-path.test.js +339 -0
- package/dist/test/component.test.d.ts +1 -0
- package/dist/test/component.test.js +24 -0
- package/dist/test/construction.test.d.ts +1 -0
- package/dist/test/construction.test.js +26 -0
- package/dist/test/default-options-validation.test.d.ts +1 -0
- package/dist/test/default-options-validation.test.js +186 -0
- package/dist/test/metadata.test.d.ts +1 -0
- package/dist/test/metadata.test.js +82 -0
- package/dist/test/nodeStorage.d.ts +19 -0
- package/dist/test/nodeStorage.js +85 -0
- package/dist/test/postprocess-manager.test.d.ts +1 -0
- package/dist/test/postprocess-manager.test.js +77 -0
- package/dist/test/prefab.test.d.ts +1 -0
- package/dist/test/prefab.test.js +903 -0
- package/dist/test/scene-component.test.d.ts +1 -0
- package/dist/test/scene-component.test.js +13 -0
- package/dist/test/scene-graph.test.d.ts +1 -0
- package/dist/test/scene-graph.test.js +163 -0
- package/dist/test/serialization-v1.test.d.ts +15 -0
- package/dist/test/serialization-v1.test.js +1057 -0
- package/dist/test/serialization.test.d.ts +1 -0
- package/dist/test/serialization.test.js +425 -0
- package/dist/test/spawn.test.d.ts +1 -0
- package/dist/test/spawn.test.js +137 -0
- package/dist/test/utils.d.ts +27 -0
- package/dist/test/utils.js +115 -0
- package/docs/agent-instructions.md +49 -0
- package/docs/deprecated/8-guide-user-interface-2.md +600 -0
- package/docs/deprecated/Agents.md +117 -0
- package/docs/deprecated/TELEGRAM_MINIAPP_SUPPORT_PLAN.md +283 -0
- package/docs/deprecated/summary-2.md +101 -0
- package/docs/engine-summary.md +104 -0
- package/docs/guides/0-world-and-gameloop.md +331 -0
- package/docs/guides/1-actors-and-components.md +955 -0
- package/docs/guides/10-camera-system.md +778 -0
- package/docs/guides/11-equipment-and-weapons.md +850 -0
- package/docs/guides/12-threejs-extensions.md +528 -0
- package/docs/guides/13-visual-effects-and-particles.md +530 -0
- package/docs/guides/14-sound-system.md +436 -0
- package/docs/guides/15-global-audio-manager.md +367 -0
- package/docs/guides/15-navigation-and-pathfinding.md +818 -0
- package/docs/guides/16-ragdoll-physics.md +479 -0
- package/docs/guides/17-asset-referencing.md +248 -0
- package/docs/guides/18-lightmapping-system.md +984 -0
- package/docs/guides/19-webxr-virtual-reality.md +367 -0
- package/docs/guides/2-player-inputs-and-controls.md +737 -0
- package/docs/guides/3-physics-and-collisions.md +248 -0
- package/docs/guides/4-visuals-and-rendering.md +946 -0
- package/docs/guides/5-animation.md +310 -0
- package/docs/guides/6-ai-and-behavior-trees.md +1316 -0
- package/docs/guides/7-building-levels.md +211 -0
- package/docs/guides/8-user-interface.md +291 -0
- package/docs/guides/9-multiplayer.md +181 -0
- package/docs/high-level-class-hierarchy.md +218 -0
- package/eslint-rules/constructor-type-consistency.js +251 -0
- package/eslint-rules/default-getter-return-type.js +42 -0
- package/eslint-rules/engine-class-name-consistency.js +62 -0
- package/eslint-rules/no-async-override-mismatch.js +100 -0
- package/eslint-rules/no-default-class-fields.js +66 -0
- package/eslint-rules/no-override-methods.js +158 -0
- package/games/animation-demo.ts +367 -0
- package/games/animation-retarget-demo.ts +553 -0
- package/games/behavior-tree-demo.ts +1774 -0
- package/games/character_animation.ts +194 -0
- package/games/collision-demo.ts +139 -0
- package/games/deprecated/advanced-grid-demo.ts +336 -0
- package/games/deprecated/airplane-demo.ts +156 -0
- package/games/deprecated/character-controller.ts +161 -0
- package/games/deprecated/chase-game.ts +310 -0
- package/games/deprecated/collision-config.ts +317 -0
- package/games/deprecated/door-demo.ts +641 -0
- package/games/deprecated/fps-demo.ts +128 -0
- package/games/deprecated/fps-shotgun-demo.ts +227 -0
- package/games/deprecated/index.ts +25 -0
- package/games/deprecated/lightmapping-demo.ts +1515 -0
- package/games/deprecated/lights-demo.ts +957 -0
- package/games/deprecated/matcap-demo.ts +823 -0
- package/games/deprecated/material-demo-2.ts +582 -0
- package/games/deprecated/material-demo.ts +204 -0
- package/games/deprecated/memory-leak-test.ts +23 -0
- package/games/deprecated/model-stress-test.ts +150 -0
- package/games/deprecated/multiplayer-demo.ts +392 -0
- package/games/deprecated/physics-demo.ts +199 -0
- package/games/deprecated/shadow-demo.ts +435 -0
- package/games/deprecated/shooting-demo.ts +352 -0
- package/games/deprecated/skybox-demo.ts +341 -0
- package/games/deprecated/sound-demo.ts +117 -0
- package/games/deprecated/timer-demo.ts +178 -0
- package/games/deprecated/voxel-demo.ts +50 -0
- package/games/deprecated/world-commands.ts +184 -0
- package/games/deprecated/world-loading.ts +90 -0
- package/games/examples/fps-advanced/const.ts +122 -0
- package/games/examples/fps-advanced/enemies.ts +174 -0
- package/games/examples/fps-advanced/game-mode.ts +347 -0
- package/games/examples/fps-advanced/game.ts +74 -0
- package/games/examples/fps-advanced/pickups.ts +225 -0
- package/games/examples/fps-advanced/player.ts +101 -0
- package/games/examples/fps-advanced/ui/endgame-ui.ts +277 -0
- package/games/examples/fps-advanced/ui/game-hud.ts +211 -0
- package/games/examples/fps-advanced/ui/menu-ui.ts +217 -0
- package/games/examples/fps-advanced/ui/weapon-hud.ts +254 -0
- package/games/examples/fps-advanced/weapons.ts +209 -0
- package/games/examples/index.ts +5 -0
- package/games/examples/plugin-demo/game.ts +175 -0
- package/games/examples/plugin-demo/plugins/dynamic-lighting.ts +146 -0
- package/games/examples/plugin-demo/plugins/instanced-forest.ts +186 -0
- package/games/examples/plugin-demo/plugins/particle-fountain.ts +63 -0
- package/games/examples/plugin-demo/plugins/physics-playground.ts +189 -0
- package/games/examples/plugin-demo/plugins/robot-follower.ts +306 -0
- package/games/examples/plugin-demo/plugins/scatter-models.ts +74 -0
- package/games/examples/plugin-demo/plugins/simple-cube.ts +44 -0
- package/games/examples/plugin-demo/plugins/tic-tac-toe.ts +522 -0
- package/games/examples/plugin-demo/plugins/wobbling-sphere.ts +66 -0
- package/games/examples/side-scroller-advanced/const.ts +88 -0
- package/games/examples/side-scroller-advanced/game-mode.ts +350 -0
- package/games/examples/side-scroller-advanced/game.ts +80 -0
- package/games/examples/side-scroller-advanced/level-generator.ts +384 -0
- package/games/examples/side-scroller-advanced/pickups.ts +132 -0
- package/games/examples/side-scroller-advanced/player.ts +105 -0
- package/games/examples/side-scroller-advanced/ui/endgame-ui.ts +278 -0
- package/games/examples/side-scroller-advanced/ui/game-hud.ts +238 -0
- package/games/examples/side-scroller-advanced/ui/menu-ui.ts +215 -0
- package/games/examples/vehicle/base-vehicle.ts +159 -0
- package/games/examples/vehicle/game.ts +154 -0
- package/games/examples/vehicle/mesh-vehicle.ts +191 -0
- package/games/examples/vehicle/player.ts +86 -0
- package/games/examples/vehicle/primitive-vehicle.ts +266 -0
- package/games/examples/vr-game/VRAttachableCube.ts +39 -0
- package/games/examples/vr-game/VRInteractableCylinder.ts +83 -0
- package/games/examples/vr-game/VRPressableButton.ts +113 -0
- package/games/examples/vr-game/VRProjectileActor.ts +69 -0
- package/games/examples/vr-game/VRRifleActor.ts +138 -0
- package/games/examples/vr-game/game.ts +69 -0
- package/games/examples/vr-game/index.ts +9 -0
- package/games/examples/vr-game/scene.ts +99 -0
- package/games/hand-tracking-demo.ts +71 -0
- package/games/index.ts +21 -0
- package/games/instanced-mesh-demo.ts +429 -0
- package/games/manifold-demo.ts +52 -0
- package/games/navigation-demo.ts +351 -0
- package/games/navmesh-primitives-demo.ts +1252 -0
- package/games/performance-test-demo.ts +237 -0
- package/games/postprocess-demo.ts +867 -0
- package/games/ragdoll-demo-simple.ts +163 -0
- package/games/ragdoll-demo.ts +272 -0
- package/games/swipe-tap-demo.ts +228 -0
- package/games/tween-demo.ts +125 -0
- package/games/ui-demo.ts +1058 -0
- package/games/vfx-demo.ts +922 -0
- package/games/vfx-wawa-demo.ts +540 -0
- package/games/vr-ui-demo-minimal.ts +156 -0
- package/games/vr-ui-demo.ts +972 -0
- package/package.json +104 -0
- package/scripts/build-browser-bundle.ts +75 -0
- package/scripts/check-asset-path.ts +166 -0
- package/scripts/dump-templates.ts +21 -0
- package/scripts/generate-dependencies.ts +145 -0
- package/scripts/generate-prefabs.ts +120 -0
- package/scripts/load-save-world.ts +44 -0
- package/scripts/loc.ts +112 -0
- package/scripts/optimize-glb-wrapper.ts +28 -0
- package/scripts/optimize-glb.ts +352 -0
- package/scripts/session-server.ts +861 -0
- package/scripts/test-world-loading.ts +23 -0
- package/src/actors/Actor.ts +1183 -0
- package/src/actors/GLTFMeshActor.ts +107 -0
- package/src/actors/GlobalParticleManager.ts +460 -0
- package/src/actors/Pawn.ts +370 -0
- package/src/actors/PlayerController.ts +646 -0
- package/src/actors/PlayerStart.ts +47 -0
- package/src/actors/Projectile.ts +179 -0
- package/src/actors/RagdollTestActor.ts +153 -0
- package/src/actors/ThirdPersonCharacterPawn.ts +139 -0
- package/src/actors/index.ts +21 -0
- package/src/animation/AnimationClipCache.ts +86 -0
- package/src/animation/AnimationRetargeting.ts +566 -0
- package/src/animation/SkeletonProfile.ts +137 -0
- package/src/animation/index.ts +14 -0
- package/src/animation/retargeting.ts +866 -0
- package/src/components/CharacterStatsComponent.ts +199 -0
- package/src/components/CollisionShapeComponent.ts +256 -0
- package/src/components/Component.ts +111 -0
- package/src/components/FollowComponent.ts +149 -0
- package/src/components/PrimitiveComponent.ts +368 -0
- package/src/components/ResetPositionComponent.ts +175 -0
- package/src/components/SceneComponent.ts +628 -0
- package/src/components/audio/SoundComponent.ts +385 -0
- package/src/components/audio/index.ts +11 -0
- package/src/components/csg/CSGCombiner.ts +268 -0
- package/src/components/csg/CSGShapes.ts +344 -0
- package/src/components/csg/index.ts +12 -0
- package/src/components/gameplay/BaseWeaponComponent.ts +597 -0
- package/src/components/gameplay/DoorComponent.ts +930 -0
- package/src/components/gameplay/Equipment.ts +30 -0
- package/src/components/gameplay/GenericEquipment.ts +96 -0
- package/src/components/gameplay/InstantHitWeaponComponent.ts +248 -0
- package/src/components/gameplay/PickupComponent.ts +473 -0
- package/src/components/gameplay/ProjectileWeaponComponent.ts +114 -0
- package/src/components/gameplay/ShotgunComponent.ts +220 -0
- package/src/components/gameplay/SwitchComponent.ts +466 -0
- package/src/components/gameplay/TriggerZoneComponent.ts +346 -0
- package/src/components/gameplay/index.ts +20 -0
- package/src/components/index.ts +19 -0
- package/src/components/lights/AmbientLightComponent.ts +72 -0
- package/src/components/lights/DirectionalLightComponent.ts +163 -0
- package/src/components/lights/HemisphereLightComponent.ts +132 -0
- package/src/components/lights/LightComponent.ts +351 -0
- package/src/components/lights/PointLightComponent.ts +115 -0
- package/src/components/lights/RectAreaLightComponent.ts +151 -0
- package/src/components/lights/SpotLightComponent.ts +193 -0
- package/src/components/lights/index.ts +17 -0
- package/src/components/movement/AerialMovementComponent.ts +348 -0
- package/src/components/movement/AirplaneMovementComponent.ts +236 -0
- package/src/components/movement/BasePawnMovementComponent.ts +297 -0
- package/src/components/movement/CharacterMovementComponent.ts +446 -0
- package/src/components/movement/DirectionalCharacterMovementComponent.ts +79 -0
- package/src/components/movement/NpcMovementComponent.ts +930 -0
- package/src/components/movement/PathMovementComponent.ts +190 -0
- package/src/components/movement/TopDownMovementComponent.ts +88 -0
- package/src/components/movement/TweenMovementComponent.ts +386 -0
- package/src/components/movement/VehicleMovementComponent.ts +469 -0
- package/src/components/movement/index.ts +19 -0
- package/src/components/physics/RagdollComponent.ts +730 -0
- package/src/components/visual/AnimationComponent.ts +208 -0
- package/src/components/visual/AnimationStateMachineComponent.ts +1079 -0
- package/src/components/visual/BaseInstancedMeshComponent.ts +904 -0
- package/src/components/visual/BillboardComponent.ts +127 -0
- package/src/components/visual/EditorOnlyMeshComponent.ts +54 -0
- package/src/components/visual/FogComponent.ts +131 -0
- package/src/components/visual/GLTFMeshComponent.ts +444 -0
- package/src/components/visual/InstancedGltfMeshComponent.ts +215 -0
- package/src/components/visual/InstancedMeshComponent.ts +118 -0
- package/src/components/visual/MeshComponent.ts +224 -0
- package/src/components/visual/ParticleEmitterComponent.ts +628 -0
- package/src/components/visual/SkyboxComponent.ts +381 -0
- package/src/components/visual/TerrainMeshComponent.ts +346 -0
- package/src/components/visual/UI3DComponent.ts +264 -0
- package/src/components/visual/index.ts +23 -0
- package/src/components/voxel/MagicaVoxelLoader.ts +184 -0
- package/src/components/voxel/VoxelMeshComponent.ts +274 -0
- package/src/components/voxel/index.ts +3 -0
- package/src/const.ts +68 -0
- package/src/csg/CSGUtils.ts +771 -0
- package/src/csg/ManifoldWrapper.ts +704 -0
- package/src/csg/index.ts +13 -0
- package/src/dependencies.ts +76 -0
- package/src/game/GameBuilder.ts +280 -0
- package/src/game/GameLoop.ts +614 -0
- package/src/game/GameMode.ts +127 -0
- package/src/game/Playable.ts +84 -0
- package/src/game/World.ts +1430 -0
- package/src/game/index.ts +18 -0
- package/src/global.d.ts +11 -0
- package/src/index.ts +39 -0
- package/src/materials.ts +181 -0
- package/src/multiplayer/MovementPrediction.ts +202 -0
- package/src/multiplayer/NetWorld.ts +920 -0
- package/src/multiplayer/README.md +349 -0
- package/src/multiplayer/implementations/MemorySession.ts +112 -0
- package/src/multiplayer/implementations/WebSocketSession.ts +468 -0
- package/src/multiplayer/implementations/index.ts +14 -0
- package/src/multiplayer/index.ts +16 -0
- package/src/multiplayer/interface.ts +174 -0
- package/src/navigation/NavigationServer.ts +170 -0
- package/src/navigation/RecastNavigationServer.ts +370 -0
- package/src/navigation/index.ts +17 -0
- package/src/npc/behavior-tree/BehaviorNode.ts +191 -0
- package/src/npc/behavior-tree/BehaviorTreeComponent.ts +351 -0
- package/src/npc/behavior-tree/behaviors/BehaviorAction.ts +97 -0
- package/src/npc/behavior-tree/behaviors/ConditionEvaluator.ts +128 -0
- package/src/npc/behavior-tree/behaviors/actions/aerial/AerialMoveToTargetAction.ts +128 -0
- package/src/npc/behavior-tree/behaviors/actions/aerial/AerialSearchAction.ts +159 -0
- package/src/npc/behavior-tree/behaviors/actions/aerial/AerialTrackTargetAction.ts +76 -0
- package/src/npc/behavior-tree/behaviors/actions/aerial/AerialWanderAction.ts +160 -0
- package/src/npc/behavior-tree/behaviors/actions/aerial/index.ts +5 -0
- package/src/npc/behavior-tree/behaviors/actions/combat/MeleeAttackAction.ts +151 -0
- package/src/npc/behavior-tree/behaviors/actions/combat/ShootAction.ts +158 -0
- package/src/npc/behavior-tree/behaviors/actions/combat/index.ts +3 -0
- package/src/npc/behavior-tree/behaviors/actions/ground/FleeFromTargetAction.ts +157 -0
- package/src/npc/behavior-tree/behaviors/actions/ground/FollowActorAction.ts +131 -0
- package/src/npc/behavior-tree/behaviors/actions/ground/MoveToPositionAction.ts +99 -0
- package/src/npc/behavior-tree/behaviors/actions/ground/SetNextWaypointAction.ts +114 -0
- package/src/npc/behavior-tree/behaviors/actions/ground/WanderAction.ts +146 -0
- package/src/npc/behavior-tree/behaviors/actions/ground/index.ts +6 -0
- package/src/npc/behavior-tree/behaviors/actions/index.ts +13 -0
- package/src/npc/behavior-tree/behaviors/actions/utility/CalculateTacticalPositionAction.ts +117 -0
- package/src/npc/behavior-tree/behaviors/actions/utility/LookAtTargetAction.ts +136 -0
- package/src/npc/behavior-tree/behaviors/actions/utility/WaitAction.ts +70 -0
- package/src/npc/behavior-tree/behaviors/actions/utility/index.ts +4 -0
- package/src/npc/behavior-tree/behaviors/conditions/BlackboardValueCondition.ts +144 -0
- package/src/npc/behavior-tree/behaviors/conditions/CanSeeTargetCondition.ts +171 -0
- package/src/npc/behavior-tree/behaviors/conditions/HasLastKnownPositionCondition.ts +63 -0
- package/src/npc/behavior-tree/behaviors/conditions/HpAbovePercentCondition.ts +83 -0
- package/src/npc/behavior-tree/behaviors/conditions/IsPlayerNearCondition.ts +49 -0
- package/src/npc/behavior-tree/behaviors/conditions/TargetBelowHpPercentCondition.ts +61 -0
- package/src/npc/behavior-tree/behaviors/conditions/TargetInConeCondition.ts +106 -0
- package/src/npc/behavior-tree/behaviors/conditions/TimeLimitCondition.ts +65 -0
- package/src/npc/behavior-tree/behaviors/conditions/index.ts +19 -0
- package/src/npc/behavior-tree/behaviors/index.ts +9 -0
- package/src/npc/behavior-tree/blackboard/Blackboard.ts +127 -0
- package/src/npc/behavior-tree/blackboard/BlackboardKey.ts +59 -0
- package/src/npc/behavior-tree/blackboard/index.ts +2 -0
- package/src/npc/behavior-tree/index.ts +27 -0
- package/src/npc/behavior-tree/loader/BehaviorTreeLoader.ts +296 -0
- package/src/npc/behavior-tree/nodes/CompositeNode.ts +100 -0
- package/src/npc/behavior-tree/nodes/LeafNode.ts +11 -0
- package/src/npc/behavior-tree/nodes/composite/SelectorNode.ts +56 -0
- package/src/npc/behavior-tree/nodes/composite/SequenceNode.ts +56 -0
- package/src/physics/BasePhysicsEngine.ts +1486 -0
- package/src/physics/IPhysicsVehicle.ts +162 -0
- package/src/physics/PhysicsEngine.ts +517 -0
- package/src/physics/PhysicsTypes.ts +116 -0
- package/src/physics/implementations/RapierDebugRender.ts +55 -0
- package/src/physics/implementations/RapierPhysics.ts +1419 -0
- package/src/physics/implementations/RapierVehicle.ts +267 -0
- package/src/physics/index.ts +16 -0
- package/src/render/EdgeOutlineEffect.ts +365 -0
- package/src/render/PostProcessManager.ts +1025 -0
- package/src/render/Renderer.ts +310 -0
- package/src/render/Texture.ts +140 -0
- package/src/render/index.ts +22 -0
- package/src/render/lightmapping/LightmapAtlas.ts +248 -0
- package/src/render/lightmapping/LightmapBaker.ts +333 -0
- package/src/render/lightmapping/LightmapManager.ts +752 -0
- package/src/render/lightmapping/LightmapMaterial.ts +283 -0
- package/src/render/lightmapping/LightmapSerialization.ts +336 -0
- package/src/render/lightmapping/LightmapSerializer.ts +309 -0
- package/src/render/lightmapping/MultiLightmapperMaterial.ts +484 -0
- package/src/render/lightmapping/index.ts +18 -0
- package/src/render/postprocessing/EffectPassWrapper.ts +47 -0
- package/src/render/postprocessing/ObjectOutlineEffect.ts +356 -0
- package/src/render/postprocessing/index.ts +2 -0
- package/src/runtime/GameRuntime.ts +153 -0
- package/src/runtime/InjectedDependencies.ts +70 -0
- package/src/runtime/Utils.ts +146 -0
- package/src/runtime/index.ts +4 -0
- package/src/runtime/materials/MatcapShaderMaterial.ts +242 -0
- package/src/runtime/materials/index.ts +1 -0
- package/src/scripting/Plugin.ts +67 -0
- package/src/scripting/PluginManager.ts +99 -0
- package/src/scripting/index.ts +1 -0
- package/src/storage/defaultStorageProvider.ts +95 -0
- package/src/storage/index.ts +16 -0
- package/src/storage/projectContext.ts +176 -0
- package/src/storage/storageProvider.ts +271 -0
- package/src/systems/ClassRegistry.ts +484 -0
- package/src/systems/ConsoleManager.ts +484 -0
- package/src/systems/ConsoleVariableHandler.ts +105 -0
- package/src/systems/ConsoleVariableManager.ts +288 -0
- package/src/systems/InputManager.ts +1255 -0
- package/src/systems/ObjectNamingSystem.ts +30 -0
- package/src/systems/Stats.ts +178 -0
- package/src/systems/TimerSystem.ts +353 -0
- package/src/systems/TweenManager.ts +107 -0
- package/src/systems/WorldSerialization.ts +1211 -0
- package/src/systems/collision/CollisionConfig.ts +281 -0
- package/src/systems/collision/CollisionTypes.ts +185 -0
- package/src/systems/collision/index.ts +15 -0
- package/src/systems/index.ts +23 -0
- package/src/templates/MyActor.ts +29 -0
- package/src/templates/MySceneComponent.ts +29 -0
- package/src/templates/README.md +1 -0
- package/src/types/rapier-es.d.ts +16 -0
- package/src/types/stats.js.d.ts +22 -0
- package/src/ui/LoadingScreen.ts +110 -0
- package/src/ui/UIElement.ts +224 -0
- package/src/ui/UILayout.ts +269 -0
- package/src/ui/UIManager.ts +161 -0
- package/src/ui/UIResource.ts +20 -0
- package/src/ui/components/AmmoCounter.ts +126 -0
- package/src/ui/components/BaseUIComponent.md +296 -0
- package/src/ui/components/BaseUIComponent.ts +390 -0
- package/src/ui/components/Compass.ts +144 -0
- package/src/ui/components/ControlsPanel.ts +62 -0
- package/src/ui/components/Crosshair.ts +76 -0
- package/src/ui/components/InventoryBar.ts +224 -0
- package/src/ui/components/InventoryGrid.ts +471 -0
- package/src/ui/components/Minimap.ts +181 -0
- package/src/ui/components/NumberDisplay.ts +198 -0
- package/src/ui/components/ProgressBar.ts +403 -0
- package/src/ui/components/ReloadIndicator.ts +159 -0
- package/src/ui/components/index.ts +12 -0
- package/src/ui/index.ts +21 -0
- package/src/ui/ui-loader.ts +87 -0
- package/src/utils/Color.ts +51 -0
- package/src/utils/Delegate.ts +112 -0
- package/src/utils/DescriptionHelpers.ts +93 -0
- package/src/utils/EditorClassMeta.ts +91 -0
- package/src/utils/GlobalAudioManager.ts +370 -0
- package/src/utils/IAsyncLoadable.ts +122 -0
- package/src/utils/MaterialHelpers.ts +321 -0
- package/src/utils/MathHelpers.ts +79 -0
- package/src/utils/NodeJs.ts +79 -0
- package/src/utils/Perlin.ts +346 -0
- package/src/utils/ResourceManager.ts +716 -0
- package/src/utils/SceneGraphUtils.ts +173 -0
- package/src/utils/Spawn.ts +93 -0
- package/src/utils/ThreeJsExtensions.ts +1200 -0
- package/src/utils/TweenExtensions.ts +124 -0
- package/src/utils/UserCodeEngine.ts +243 -0
- package/src/utils/Utils.ts +328 -0
- package/src/utils/VRButtonUtils.ts +125 -0
- package/src/utils/browser-polyfills/module.ts +36 -0
- package/src/utils/browser-polyfills/path.ts +232 -0
- package/src/utils/index.ts +29 -0
- package/src/utils/serialization/cdo.ts +87 -0
- package/src/utils/serialization/clsAlias.ts +92 -0
- package/src/utils/serialization/decorator.ts +176 -0
- package/src/utils/serialization/index.ts +7 -0
- package/src/utils/serialization/prefab.ts +78 -0
- package/src/utils/serialization/prefabManager.ts +88 -0
- package/src/utils/serialization/serializable.ts +28 -0
- package/src/utils/serialization/serializer.ts +1111 -0
- package/src/utils/serialization/specialization.ts +224 -0
- package/src/utils/serialization/specializationUtils.ts +185 -0
- package/src/vfx/VFXComponent.ts +206 -0
- package/src/vfx/index.ts +17 -0
- package/src/vfx/types.ts +287 -0
- package/src/vfx/wawa-vfx-reference.md +399 -0
- package/src/world-commands/common.ts +25 -0
- package/src/world-commands/generate-code.ts +99 -0
- package/src/world-commands/index.ts +19 -0
- package/src/world-commands/place-gltf.ts +63 -0
- package/src/world-commands/place-prefab.ts +62 -0
- package/src/world-commands/place-primitive.ts +128 -0
- package/src/world-commands/remove-actors.ts +32 -0
- package/src/xr/VRActor.ts +71 -0
- package/src/xr/VRControllerHandler.ts +87 -0
- package/src/xr/VRControllerManager.ts +559 -0
- package/src/xr/VRDeviceHandler.ts +77 -0
- package/src/xr/VRHandHandler.ts +166 -0
- package/src/xr/VRInputDevice.ts +374 -0
- package/src/xr/VRPawn.ts +815 -0
- package/src/xr/actor-components/CanvasUIComponent.ts +425 -0
- package/src/xr/actor-components/VRBaseComponent.ts +26 -0
- package/src/xr/actor-components/VRGrabbableComponent.ts +73 -0
- package/src/xr/actor-components/VRInteractableComponent.ts +43 -0
- package/src/xr/index.ts +17 -0
- package/src/xr/pawn-components/VRGrabComponent.ts +435 -0
- package/src/xr/pawn-components/VRInteractComponent.ts +77 -0
- package/src/xr/pawn-components/VRSnapTurnComponent.ts +103 -0
- package/src/xr/pawn-components/VRTeleportComponent.ts +284 -0
- package/src/xr/ui/CanvasColorPicker.ts +172 -0
- package/src/xr/ui/CanvasKeyboard.ts +283 -0
- package/src/xr/ui/CanvasSlider.ts +83 -0
- package/src/xr/ui/CanvasUI.ts +879 -0
- package/src/xr/ui/index.ts +9 -0
|
@@ -0,0 +1,1316 @@
|
|
|
1
|
+
## Instruction
|
|
2
|
+
Use this doc to understand how AI and behavior trees work in Genesys.js. Learn how to implement sophisticated AI decision-making systems, behavior trees for NPCs, aerial movement patterns, and advanced AI debugging techniques.
|
|
3
|
+
|
|
4
|
+
# AI and Behavior Trees in Genesys.js
|
|
5
|
+
|
|
6
|
+
Creating intelligent, believable Non-Player Characters (NPCs) requires sophisticated decision-making systems that go beyond simple pathfinding. Genesys.js provides a powerful behavior tree system for complex AI logic, along with specialized movement components for different types of characters.
|
|
7
|
+
|
|
8
|
+
This guide covers **AI behavior and decision-making systems**. For ground-based navigation and pathfinding, see the **[Navigation and Pathfinding Guide](15-navigation-and-pathfinding.md)**.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 1. Introduction to Behavior Trees
|
|
13
|
+
|
|
14
|
+
Behavior trees provide a modular, hierarchical approach to AI programming that's more flexible than traditional state machines. They allow you to create complex AI behaviors by combining simple, reusable components.
|
|
15
|
+
|
|
16
|
+
The behavior tree system in Genesys.js features:
|
|
17
|
+
- **Code-first approach** with full TypeScript support
|
|
18
|
+
- **Organized behavior categories** (ground, aerial, combat, utility)
|
|
19
|
+
- **Attached conditions system** inspired by Unreal Engine
|
|
20
|
+
- **Comprehensive debugging tools**
|
|
21
|
+
- **Blackboard system** for shared memory
|
|
22
|
+
|
|
23
|
+
### Basic Concepts
|
|
24
|
+
|
|
25
|
+
**Behavior Trees** consist of nodes that execute in a specific order:
|
|
26
|
+
- **Composite Nodes**: Control execution flow (Sequence, Selector)
|
|
27
|
+
- **Action Nodes**: Perform specific behaviors (Move, Attack, Wait)
|
|
28
|
+
- **Condition Evaluators**: Check game state (attached to actions)
|
|
29
|
+
|
|
30
|
+
**Blackboard**: Shared memory system for data exchange between nodes
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 2. Movement Components for AI
|
|
35
|
+
|
|
36
|
+
Genesys.js provides specialized movement components for different types of AI characters.
|
|
37
|
+
|
|
38
|
+
### Aerial Movement: AerialMovementComponent
|
|
39
|
+
|
|
40
|
+
For flying enemies, drones, or floating characters, use the `AerialMovementComponent`. This component provides full 3D movement without requiring NavMesh pathfinding.
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
const aerialEnemy = new ENGINE.Pawn({
|
|
44
|
+
movementComponent: new ENGINE.AerialMovementComponent({
|
|
45
|
+
maxSpeed: 15, // Movement speed in units per second
|
|
46
|
+
hoverHeight: 20, // Preferred height above ground
|
|
47
|
+
hoverVariation: 3, // Random height variation
|
|
48
|
+
rotationSpeed: 2.0, // How fast it rotates
|
|
49
|
+
maxTiltAngle: 15 // Banking angle when moving (degrees)
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The `AerialMovementComponent` provides:
|
|
55
|
+
- **setTargetPosition()**: Set a 3D position to move toward
|
|
56
|
+
- **setLastKnownPlayerPosition()**: Enable search behavior around a position
|
|
57
|
+
- **clearTarget()**: Stop movement and hover in place
|
|
58
|
+
- **getTargetPosition()**: Get current target position
|
|
59
|
+
- **lookAtTarget()**: Rotate to face a target position
|
|
60
|
+
- **isFacingTarget()**: Check if facing a target within angle threshold
|
|
61
|
+
|
|
62
|
+
Key features:
|
|
63
|
+
- **3D Movement**: Move freely in all three dimensions
|
|
64
|
+
- **Hovering**: Gentle up/down floating motion with animation
|
|
65
|
+
- **Banking**: Tilts when turning for realistic flight
|
|
66
|
+
- **Search Behavior**: Circles around last known positions
|
|
67
|
+
- **No NavMesh Required**: Works without navigation mesh
|
|
68
|
+
|
|
69
|
+
### Ground-Based Movement Integration
|
|
70
|
+
|
|
71
|
+
The `NpcMovementComponent` is the foundation for ground-based NPC movement. It extends `CharacterMovementComponent`, providing physics-based character movement with NavMesh pathfinding.
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
const npc = new ENGINE.ThirdPersonCharacterPawn({
|
|
75
|
+
movementComponent: new ENGINE.NpcMovementComponent({
|
|
76
|
+
movementSpeed: 3, // How fast the NPC moves
|
|
77
|
+
turnSpeed: 5, // How fast it turns
|
|
78
|
+
useNavigationServer: true, // Use NavMesh pathfinding
|
|
79
|
+
actorFollowingDistance: 2.0, // Stop distance when following
|
|
80
|
+
pathFollowingAccuracy: 3.0, // How close to get to waypoints
|
|
81
|
+
stopDistance: 1.0 // Distance to stop from targets
|
|
82
|
+
}),
|
|
83
|
+
camera: null // NPCs don't need cameras
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The `NpcMovementComponent` provides methods for:
|
|
88
|
+
- **setPath()**: Set a path of waypoints for the NPC to follow
|
|
89
|
+
- **setTargetPosition()**: Set a target position and automatically calculate the path using navigation server
|
|
90
|
+
- **setTargetActor()**: Set a target actor to follow and automatically handle pathfinding
|
|
91
|
+
- **followActor()**: Follow another actor at a specified distance
|
|
92
|
+
- **stop()**: Stop all movement
|
|
93
|
+
- **hasReachedCurrentTarget()**: Check if the NPC has reached its target
|
|
94
|
+
- **getCurrentTarget()**: Get the current movement target
|
|
95
|
+
|
|
96
|
+
For detailed information about NavMesh generation, pathfinding configuration, and ground-based movement debugging, see the [Navigation and Pathfinding Guide](15-navigation-and-pathfinding.md).
|
|
97
|
+
|
|
98
|
+
### Architectural Design: Separation of Concerns
|
|
99
|
+
|
|
100
|
+
The behavior tree system follows a clean separation of concerns where:
|
|
101
|
+
|
|
102
|
+
- **Actions** focus on behavior logic and decision-making
|
|
103
|
+
- **Movement Components** handle all pathfinding and navigation details
|
|
104
|
+
- **Navigation Server** provides the underlying pathfinding capabilities
|
|
105
|
+
|
|
106
|
+
This means ground-based actions like `MoveToPositionAction` and `FollowActorAction` simply call `setTargetPosition()` or `setTargetActor()` on the `NpcMovementComponent`, which then handles:
|
|
107
|
+
- Path calculation using the Navigation Server
|
|
108
|
+
- NavMesh integration and closest point finding
|
|
109
|
+
- Path following and waypoint management
|
|
110
|
+
- Obstacle avoidance and path recalculation
|
|
111
|
+
|
|
112
|
+
This design provides several benefits:
|
|
113
|
+
- **Reusability**: Pathfinding logic is centralized and reusable
|
|
114
|
+
- **Simplicity**: Actions focus on "what to do" rather than "how to move"
|
|
115
|
+
- **Maintainability**: Navigation improvements benefit all actions automatically
|
|
116
|
+
- **Performance**: Eliminates duplicate pathfinding code across actions
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## 3. Behavior Tree System
|
|
121
|
+
|
|
122
|
+
The behavior tree system provides a powerful, modular approach to AI programming. It uses an **attached conditions** system inspired by Unreal Engine, with actions organized into logical categories.
|
|
123
|
+
|
|
124
|
+
### Creating Behavior Trees in Code (Recommended)
|
|
125
|
+
|
|
126
|
+
For full control and type safety, create behavior trees programmatically. The system organizes actions into categories:
|
|
127
|
+
|
|
128
|
+
```typescript
|
|
129
|
+
import * as ENGINE from 'genesys.js';
|
|
130
|
+
|
|
131
|
+
// Actions are organized by category:
|
|
132
|
+
// - Ground actions (NavMesh-based): FollowActorAction, MoveToPositionAction, etc.
|
|
133
|
+
// - Aerial actions (3D flying): AerialMoveToTargetAction, AerialSearchAction, etc.
|
|
134
|
+
// - Combat actions: MeleeAttackAction, ShootAction
|
|
135
|
+
// - Utility actions: WaitAction, LookAtTargetAction
|
|
136
|
+
|
|
137
|
+
// Create a guard that follows the player when they get close
|
|
138
|
+
const followPlayer = new ENGINE.FollowActorAction({
|
|
139
|
+
targetActorKey: 'PlayerActor',
|
|
140
|
+
followDistance: 5.0,
|
|
141
|
+
useNavigation: true,
|
|
142
|
+
conditions: [
|
|
143
|
+
new ENGINE.IsPlayerNearCondition({ range: 15.0 })
|
|
144
|
+
]
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
const npc = new ENGINE.ThirdPersonCharacterPawn({
|
|
148
|
+
movementComponent: new ENGINE.NpcMovementComponent({
|
|
149
|
+
movementSpeed: 3,
|
|
150
|
+
turnSpeed: 5,
|
|
151
|
+
useNavigationServer: true
|
|
152
|
+
}),
|
|
153
|
+
camera: null
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
const behaviorTree = new ENGINE.BehaviorTreeComponent({
|
|
157
|
+
rootNode: followPlayer,
|
|
158
|
+
updateInterval: 0.1,
|
|
159
|
+
autoStart: true
|
|
160
|
+
});
|
|
161
|
+
npc.addComponents(behaviorTree);
|
|
162
|
+
this.world.addActors(npc);
|
|
163
|
+
|
|
164
|
+
// Initialize blackboard data - ALL actor references must go through blackboard
|
|
165
|
+
const blackboard = behaviorTree.getBlackboard();
|
|
166
|
+
blackboard.setValue('PlayerActor', this.playerPawn);
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Node Types
|
|
170
|
+
|
|
171
|
+
**Composite Nodes** control execution flow:
|
|
172
|
+
- `SequenceNode`: Execute children in order (AND logic)
|
|
173
|
+
- `SelectorNode`: Try children until one succeeds (OR logic)
|
|
174
|
+
|
|
175
|
+
**Adding Children to Composite Nodes**:
|
|
176
|
+
- `addChild(node)`: Add a single child node
|
|
177
|
+
- `addChildren([node1, node2, ...])`: Add multiple child nodes at once
|
|
178
|
+
|
|
179
|
+
**Action Categories**:
|
|
180
|
+
|
|
181
|
+
**Ground Actions** (NavMesh-based movement):
|
|
182
|
+
- `MoveToPositionAction`: Move to a specific position
|
|
183
|
+
- `FollowActorAction`: Follow another actor
|
|
184
|
+
- `SetNextWaypointAction`: Manage waypoint cycling
|
|
185
|
+
- `FleeFromTargetAction`: Flee from a target
|
|
186
|
+
- `WanderAction`: Random ground movement
|
|
187
|
+
|
|
188
|
+
**Aerial Actions** (3D flying movement):
|
|
189
|
+
- `AerialMoveToTargetAction`: Move to target in 3D space
|
|
190
|
+
- `AerialSearchAction`: Search around last known position
|
|
191
|
+
- `AerialTrackTargetAction`: Continuously track target
|
|
192
|
+
- `AerialWanderAction`: Random 3D movement
|
|
193
|
+
|
|
194
|
+
**Combat Actions**:
|
|
195
|
+
- `MeleeAttackAction`: Close-range melee attacks
|
|
196
|
+
- `ShootAction`: Ranged projectile attacks
|
|
197
|
+
|
|
198
|
+
**Utility Actions**:
|
|
199
|
+
- `LookAtTargetAction`: Rotate to face a target
|
|
200
|
+
- `WaitAction`: Wait for a specified duration
|
|
201
|
+
- `CalculateTacticalPositionAction`: Calculate tactical positions relative to targets
|
|
202
|
+
|
|
203
|
+
**Condition Evaluators** check game state:
|
|
204
|
+
- `IsPlayerNearCondition`: Check if player is within range
|
|
205
|
+
- `CanSeeTargetCondition`: Check line-of-sight to a target
|
|
206
|
+
- `TargetInConeCondition`: Check if target is in field of view
|
|
207
|
+
- `HpAbovePercentCondition`: Check HP above threshold
|
|
208
|
+
- `TargetBelowHpPercentCondition`: Check target HP below threshold
|
|
209
|
+
- `TimeLimitCondition`: Check within time limit
|
|
210
|
+
- `HasLastKnownPositionCondition`: Check if position is known
|
|
211
|
+
|
|
212
|
+
### Attached Conditions System
|
|
213
|
+
|
|
214
|
+
Instead of conditions being separate nodes, they are **attached as properties** to any node:
|
|
215
|
+
|
|
216
|
+
```typescript
|
|
217
|
+
const followPlayer = new ENGINE.FollowActorAction({
|
|
218
|
+
targetActorKey: 'PlayerActor',
|
|
219
|
+
followDistance: 5.0,
|
|
220
|
+
useNavigation: true,
|
|
221
|
+
conditions: [
|
|
222
|
+
new ENGINE.IsPlayerNearCondition({ range: 15.0 })
|
|
223
|
+
]
|
|
224
|
+
});
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Multiple conditions (all must succeed):
|
|
228
|
+
```typescript
|
|
229
|
+
const attackAction = new ENGINE.MeleeAttackAction({
|
|
230
|
+
targetActorKey: 'PlayerActor',
|
|
231
|
+
conditions: [
|
|
232
|
+
new ENGINE.IsPlayerNearCondition({ range: 8.0 }),
|
|
233
|
+
new ENGINE.CanSeeTargetCondition({
|
|
234
|
+
targetActorKey: 'PlayerActor',
|
|
235
|
+
maxDistance: 10.0
|
|
236
|
+
})
|
|
237
|
+
]
|
|
238
|
+
});
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Inverted conditions:
|
|
242
|
+
```typescript
|
|
243
|
+
const moveToWaypoint = new ENGINE.MoveToPositionAction({
|
|
244
|
+
targetPositionKey: 'CurrentWaypoint',
|
|
245
|
+
acceptanceRadius: 2.0,
|
|
246
|
+
useNavigation: true,
|
|
247
|
+
conditions: [
|
|
248
|
+
new ENGINE.IsPlayerNearCondition({
|
|
249
|
+
range: 15.0,
|
|
250
|
+
invert: true // Only move when player is NOT near
|
|
251
|
+
})
|
|
252
|
+
]
|
|
253
|
+
});
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### Blackboard System
|
|
257
|
+
|
|
258
|
+
The behavior tree system uses a **blackboard** for shared memory. This provides a clean, data-driven approach to AI configuration.
|
|
259
|
+
|
|
260
|
+
#### Blackboard-Only Actor References
|
|
261
|
+
|
|
262
|
+
**All actor references must go through blackboard keys** - direct actor references are not supported. This ensures clean separation and reusability:
|
|
263
|
+
|
|
264
|
+
```typescript
|
|
265
|
+
// ✅ CORRECT: Use blackboard keys
|
|
266
|
+
const blackboard = behaviorTreeComponent.getBlackboard();
|
|
267
|
+
blackboard.setValue('PlayerActor', this.playerPawn);
|
|
268
|
+
blackboard.setValue('EnemyActor', this.enemyNpc);
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
#### Setting Up Blackboard Values
|
|
272
|
+
|
|
273
|
+
```typescript
|
|
274
|
+
// Set up all required blackboard values
|
|
275
|
+
const blackboard = behaviorTreeComponent.getBlackboard();
|
|
276
|
+
|
|
277
|
+
// Actor references (required for targeting)
|
|
278
|
+
blackboard.setValue('PlayerActor', this.playerPawn);
|
|
279
|
+
blackboard.setValue('EnemyActor', this.enemyNpc);
|
|
280
|
+
|
|
281
|
+
// Position arrays for waypoint systems
|
|
282
|
+
blackboard.setValue('PatrolWaypoints', [
|
|
283
|
+
new THREE.Vector3(-15, 1, -15),
|
|
284
|
+
new THREE.Vector3(-15, 1, 5),
|
|
285
|
+
new THREE.Vector3(5, 1, 5),
|
|
286
|
+
new THREE.Vector3(5, 1, -15)
|
|
287
|
+
]);
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## 4. Complete Behavior Examples
|
|
293
|
+
|
|
294
|
+
### Ground-Based Patrol Example
|
|
295
|
+
|
|
296
|
+
Create a patrol system with player detection using attached conditions:
|
|
297
|
+
|
|
298
|
+
```typescript
|
|
299
|
+
// Define patrol waypoints
|
|
300
|
+
const patrolWaypoints = [
|
|
301
|
+
new THREE.Vector3(-15, 1, -15),
|
|
302
|
+
new THREE.Vector3(-15, 1, 5),
|
|
303
|
+
new THREE.Vector3(5, 1, 5),
|
|
304
|
+
new THREE.Vector3(5, 1, -15)
|
|
305
|
+
];
|
|
306
|
+
|
|
307
|
+
// Patrol behavior - only when player is NOT near
|
|
308
|
+
const setNextWaypoint = new ENGINE.SetNextWaypointAction({
|
|
309
|
+
waypointsKey: 'PatrolWaypoints',
|
|
310
|
+
currentIndexKey: 'CurrentWaypointIndex',
|
|
311
|
+
targetPositionKey: 'CurrentWaypoint',
|
|
312
|
+
loop: true,
|
|
313
|
+
conditions: [
|
|
314
|
+
new ENGINE.IsPlayerNearCondition({
|
|
315
|
+
range: 12.0,
|
|
316
|
+
invert: true
|
|
317
|
+
})
|
|
318
|
+
]
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
const moveToWaypoint = new ENGINE.MoveToPositionAction({
|
|
322
|
+
targetPositionKey: 'CurrentWaypoint',
|
|
323
|
+
useNavigation: true,
|
|
324
|
+
conditions: [
|
|
325
|
+
new ENGINE.IsPlayerNearCondition({
|
|
326
|
+
range: 12.0,
|
|
327
|
+
invert: true
|
|
328
|
+
})
|
|
329
|
+
]
|
|
330
|
+
});
|
|
331
|
+
|
|
332
|
+
const patrolSequence = new ENGINE.SequenceNode({
|
|
333
|
+
name: 'Patrol Sequence'
|
|
334
|
+
});
|
|
335
|
+
patrolSequence.addChildren([setNextWaypoint, moveToWaypoint]);
|
|
336
|
+
|
|
337
|
+
// Chase behavior - only when player IS near
|
|
338
|
+
const chasePlayer = new ENGINE.FollowActorAction({
|
|
339
|
+
targetActorKey: 'PlayerActor',
|
|
340
|
+
followDistance: 3.0,
|
|
341
|
+
useNavigation: true,
|
|
342
|
+
conditions: [
|
|
343
|
+
new ENGINE.IsPlayerNearCondition({ range: 12.0 })
|
|
344
|
+
]
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
// Main behavior: try chase first, then patrol
|
|
348
|
+
const mainBehavior = new ENGINE.SelectorNode({
|
|
349
|
+
name: 'Main Behavior'
|
|
350
|
+
});
|
|
351
|
+
mainBehavior.addChildren([chasePlayer, patrolSequence]);
|
|
352
|
+
|
|
353
|
+
// Apply to NPC
|
|
354
|
+
const patrolNpc = new ENGINE.ThirdPersonCharacterPawn({
|
|
355
|
+
movementComponent: new ENGINE.NpcMovementComponent({
|
|
356
|
+
movementSpeed: 3,
|
|
357
|
+
turnSpeed: 5,
|
|
358
|
+
useNavigationServer: true
|
|
359
|
+
}),
|
|
360
|
+
camera: null
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
const behaviorTree = new ENGINE.BehaviorTreeComponent({
|
|
364
|
+
rootNode: mainBehavior,
|
|
365
|
+
updateInterval: 0.1,
|
|
366
|
+
autoStart: true
|
|
367
|
+
});
|
|
368
|
+
patrolNpc.addComponents(behaviorTree);
|
|
369
|
+
this.world.addActors(patrolNpc);
|
|
370
|
+
|
|
371
|
+
// Initialize blackboard data - ALL actor references must go through blackboard
|
|
372
|
+
const blackboard = behaviorTree.getBlackboard();
|
|
373
|
+
blackboard.setValue('PlayerActor', this.playerPawn); // Required for targeting actions/conditions
|
|
374
|
+
blackboard.setValue('PatrolWaypoints', patrolWaypoints);
|
|
375
|
+
blackboard.setValue('CurrentWaypointIndex', 0);
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
### Complex Combat Example
|
|
379
|
+
|
|
380
|
+
Create a sophisticated combat AI with multiple behaviors:
|
|
381
|
+
|
|
382
|
+
```typescript
|
|
383
|
+
// Low health flee behavior
|
|
384
|
+
const fleeWhenLowHealth = new ENGINE.FleeFromTargetAction({
|
|
385
|
+
targetActorKey: 'PlayerActor',
|
|
386
|
+
fleeDistance: 20.0,
|
|
387
|
+
fleeSpeedMultiplier: 1.5,
|
|
388
|
+
conditions: [
|
|
389
|
+
new ENGINE.HpAbovePercentCondition({
|
|
390
|
+
percentage: 30.0,
|
|
391
|
+
checkOwner: true,
|
|
392
|
+
invert: true // Flee when HP is below 30%
|
|
393
|
+
})
|
|
394
|
+
]
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
// Melee attack when close
|
|
398
|
+
const meleeAttack = new ENGINE.MeleeAttackAction({
|
|
399
|
+
targetActorKey: 'PlayerActor',
|
|
400
|
+
conditions: [
|
|
401
|
+
new ENGINE.IsPlayerNearCondition({ range: 3.0 }),
|
|
402
|
+
new ENGINE.TargetInConeCondition({
|
|
403
|
+
targetActorKey: 'PlayerActor',
|
|
404
|
+
coneAngle: 90.0,
|
|
405
|
+
maxDistance: 3.0
|
|
406
|
+
})
|
|
407
|
+
]
|
|
408
|
+
});
|
|
409
|
+
|
|
410
|
+
// Ranged combat sequence
|
|
411
|
+
const lookAtPlayer = new ENGINE.LookAtTargetAction({
|
|
412
|
+
targetActorKey: 'PlayerActor'
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
const shootAtPlayer = new ENGINE.ShootAction({
|
|
416
|
+
targetActorKey: 'PlayerActor',
|
|
417
|
+
shootRange: 15.0,
|
|
418
|
+
aimDuration: 0.5
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
const rangedCombatSequence = new ENGINE.SequenceNode({
|
|
422
|
+
name: 'Ranged Combat',
|
|
423
|
+
conditions: [
|
|
424
|
+
new ENGINE.IsPlayerNearCondition({ range: 15.0 }),
|
|
425
|
+
new ENGINE.TargetInConeCondition({
|
|
426
|
+
targetActorKey: 'PlayerActor',
|
|
427
|
+
coneAngle: 45.0,
|
|
428
|
+
maxDistance: 15.0
|
|
429
|
+
})
|
|
430
|
+
]
|
|
431
|
+
});
|
|
432
|
+
rangedCombatSequence.addChildren([lookAtPlayer, shootAtPlayer]);
|
|
433
|
+
|
|
434
|
+
// Wander when nothing else to do
|
|
435
|
+
const wanderAction = new ENGINE.WanderAction({
|
|
436
|
+
wanderRadius: 8.0
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
// Main combat behavior tree
|
|
440
|
+
const combatBehavior = new ENGINE.SelectorNode({
|
|
441
|
+
name: 'Combat Behavior'
|
|
442
|
+
});
|
|
443
|
+
combatBehavior.addChildren([
|
|
444
|
+
fleeWhenLowHealth,
|
|
445
|
+
meleeAttack,
|
|
446
|
+
rangedCombatSequence,
|
|
447
|
+
wanderAction
|
|
448
|
+
]);
|
|
449
|
+
|
|
450
|
+
// Create combat NPC
|
|
451
|
+
const combatNpc = new ENGINE.ThirdPersonCharacterPawn({
|
|
452
|
+
movementComponent: new ENGINE.NpcMovementComponent({
|
|
453
|
+
movementSpeed: 4,
|
|
454
|
+
turnSpeed: 6,
|
|
455
|
+
useNavigationServer: true
|
|
456
|
+
}),
|
|
457
|
+
camera: null
|
|
458
|
+
});
|
|
459
|
+
|
|
460
|
+
// Add weapon for combat
|
|
461
|
+
const weapon = new ENGINE.ProjectileWeaponComponent({
|
|
462
|
+
projectileClass: ENGINE.BasicProjectile,
|
|
463
|
+
fireRate: 2.0,
|
|
464
|
+
maxAmmo: 30
|
|
465
|
+
});
|
|
466
|
+
combatNpc.addComponents(weapon);
|
|
467
|
+
|
|
468
|
+
// Add stats for combat behavior
|
|
469
|
+
const stats = new ENGINE.CharacterStatsComponent({
|
|
470
|
+
health: 100
|
|
471
|
+
});
|
|
472
|
+
combatNpc.addComponents(stats);
|
|
473
|
+
|
|
474
|
+
// Apply behavior tree
|
|
475
|
+
const behaviorTree = new ENGINE.BehaviorTreeComponent({
|
|
476
|
+
rootNode: combatBehavior,
|
|
477
|
+
updateInterval: 0.1,
|
|
478
|
+
autoStart: true
|
|
479
|
+
});
|
|
480
|
+
combatNpc.addComponents(behaviorTree);
|
|
481
|
+
this.world.addActors(combatNpc);
|
|
482
|
+
|
|
483
|
+
// Initialize blackboard
|
|
484
|
+
const blackboard = behaviorTree.getBlackboard();
|
|
485
|
+
blackboard.setValue('PlayerActor', this.playerPawn);
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
### Aerial Behavior Example
|
|
489
|
+
|
|
490
|
+
Create a flying enemy that hunts the player from the sky:
|
|
491
|
+
|
|
492
|
+
```typescript
|
|
493
|
+
// Create aerial hunter behavior
|
|
494
|
+
const aerialHunt = new ENGINE.SelectorNode({
|
|
495
|
+
name: 'Aerial Hunter Behavior'
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
// Track and attack when player is visible
|
|
499
|
+
const attackSequence = new ENGINE.SequenceNode({
|
|
500
|
+
name: 'Attack Player',
|
|
501
|
+
conditions: [
|
|
502
|
+
new ENGINE.IsPlayerNearCondition({ range: 80.0 }),
|
|
503
|
+
new ENGINE.CanSeeTargetCondition({
|
|
504
|
+
targetActorKey: 'PlayerActor',
|
|
505
|
+
maxDistance: 80.0
|
|
506
|
+
})
|
|
507
|
+
]
|
|
508
|
+
});
|
|
509
|
+
attackSequence.addChildren([
|
|
510
|
+
new ENGINE.AerialTrackTargetAction({
|
|
511
|
+
targetActorKey: 'PlayerActor',
|
|
512
|
+
lastKnownPositionKey: 'LastKnownPlayerPosition',
|
|
513
|
+
updateInterval: 0.3
|
|
514
|
+
}),
|
|
515
|
+
new ENGINE.AerialMoveToTargetAction({
|
|
516
|
+
targetActorKey: 'PlayerActor',
|
|
517
|
+
acceptanceRadius: 25.0,
|
|
518
|
+
hoverAboveTarget: true,
|
|
519
|
+
hoverHeightOffset: 15.0
|
|
520
|
+
}),
|
|
521
|
+
new ENGINE.ShootAction({
|
|
522
|
+
targetActorKey: 'PlayerActor',
|
|
523
|
+
shootRange: 70.0,
|
|
524
|
+
aimDuration: 0.6
|
|
525
|
+
})
|
|
526
|
+
]);
|
|
527
|
+
|
|
528
|
+
// Search when player is lost
|
|
529
|
+
const searchAction = new ENGINE.AerialSearchAction({
|
|
530
|
+
lastKnownPositionKey: 'LastKnownPlayerPosition',
|
|
531
|
+
searchRadius: 15.0,
|
|
532
|
+
searchDuration: 8.0,
|
|
533
|
+
conditions: [
|
|
534
|
+
new ENGINE.HasLastKnownPositionCondition({
|
|
535
|
+
positionKey: 'LastKnownPlayerPosition'
|
|
536
|
+
})
|
|
537
|
+
]
|
|
538
|
+
});
|
|
539
|
+
|
|
540
|
+
// Wander when no information
|
|
541
|
+
const wanderAction = new ENGINE.AerialWanderAction({
|
|
542
|
+
wanderRadius: 30.0,
|
|
543
|
+
wanderHeight: 20.0,
|
|
544
|
+
heightVariation: 8.0
|
|
545
|
+
});
|
|
546
|
+
|
|
547
|
+
aerialHunt.addChildren([
|
|
548
|
+
attackSequence,
|
|
549
|
+
searchAction,
|
|
550
|
+
wanderAction
|
|
551
|
+
]);
|
|
552
|
+
|
|
553
|
+
// Create aerial NPC
|
|
554
|
+
const aerialEnemy = new ENGINE.Pawn({
|
|
555
|
+
movementComponent: new ENGINE.AerialMovementComponent({
|
|
556
|
+
maxSpeed: 15,
|
|
557
|
+
hoverHeight: 20,
|
|
558
|
+
hoverVariation: 3,
|
|
559
|
+
rotationSpeed: 2.0
|
|
560
|
+
})
|
|
561
|
+
});
|
|
562
|
+
|
|
563
|
+
// Add weapon for aerial combat
|
|
564
|
+
const weapon = new ENGINE.ProjectileWeaponComponent({
|
|
565
|
+
projectileClass: ENGINE.BasicProjectile,
|
|
566
|
+
fireRate: 1.5,
|
|
567
|
+
maxAmmo: 50
|
|
568
|
+
});
|
|
569
|
+
aerialEnemy.addComponents(weapon);
|
|
570
|
+
|
|
571
|
+
const behaviorTree = new ENGINE.BehaviorTreeComponent({
|
|
572
|
+
rootNode: aerialHunt,
|
|
573
|
+
updateInterval: 0.2,
|
|
574
|
+
autoStart: true
|
|
575
|
+
});
|
|
576
|
+
aerialEnemy.addComponents(behaviorTree);
|
|
577
|
+
this.world.addActors(aerialEnemy);
|
|
578
|
+
|
|
579
|
+
// Initialize blackboard
|
|
580
|
+
const blackboard = behaviorTree.getBlackboard();
|
|
581
|
+
blackboard.setValue('PlayerActor', this.playerPawn);
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
---
|
|
585
|
+
|
|
586
|
+
## 5. Alternative: JSON Configuration
|
|
587
|
+
|
|
588
|
+
For data-driven workflows or when non-programmers need to modify AI behavior, you can use JSON configuration files. **Note**: JSON type names may differ from class names.
|
|
589
|
+
|
|
590
|
+
### Loading JSON Behavior Trees
|
|
591
|
+
|
|
592
|
+
```typescript
|
|
593
|
+
// Load behavior tree from JSON
|
|
594
|
+
const { rootNode, blackboardData } = await ENGINE.BehaviorTreeLoader.loadFromFile(ENGINE.AssetPath.fromString('@engine/assets/behavior-trees/my-guard.json'));
|
|
595
|
+
|
|
596
|
+
// Apply to NPC
|
|
597
|
+
const behaviorTreeComponent = new ENGINE.BehaviorTreeComponent({
|
|
598
|
+
rootNode: rootNode
|
|
599
|
+
});
|
|
600
|
+
npc.addComponents(behaviorTreeComponent);
|
|
601
|
+
|
|
602
|
+
// Set blackboard data if provided
|
|
603
|
+
if (blackboardData) {
|
|
604
|
+
const blackboard = behaviorTreeComponent.getBlackboard();
|
|
605
|
+
Object.entries(blackboardData).forEach(([key, value]) => {
|
|
606
|
+
blackboard.setValue(key, value);
|
|
607
|
+
});
|
|
608
|
+
}
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
### JSON Type Mappings
|
|
612
|
+
|
|
613
|
+
JSON uses specific type names that map to classes:
|
|
614
|
+
|
|
615
|
+
| JSON Type | Class |
|
|
616
|
+
|-----------|-------|
|
|
617
|
+
| `"FollowActor"` | `FollowActorAction` |
|
|
618
|
+
| `"MoveToPosition"` | `MoveToPositionAction` |
|
|
619
|
+
| `"AerialMoveToTarget"` | `AerialMoveToTargetAction` |
|
|
620
|
+
| `"AerialSearch"` | `AerialSearchAction` |
|
|
621
|
+
| `"Shoot"` | `ShootAction` |
|
|
622
|
+
| `"MeleeAttack"` | `MeleeAttackAction` |
|
|
623
|
+
| `"Wait"` | `WaitAction` |
|
|
624
|
+
| `"IsPlayerNear"` | `IsPlayerNearCondition` |
|
|
625
|
+
| `"CanSeeTarget"` | `CanSeeTargetCondition` |
|
|
626
|
+
|
|
627
|
+
### Simple Guard Behavior (JSON)
|
|
628
|
+
```json
|
|
629
|
+
{
|
|
630
|
+
"name": "SimpleGuardBehavior",
|
|
631
|
+
"rootNode": {
|
|
632
|
+
"type": "FollowActor",
|
|
633
|
+
"targetActorKey": "PlayerActor",
|
|
634
|
+
"followDistance": 5.0,
|
|
635
|
+
"useNavigation": true,
|
|
636
|
+
"conditions": [
|
|
637
|
+
{
|
|
638
|
+
"type": "IsPlayerNear",
|
|
639
|
+
"range": 15.0
|
|
640
|
+
}
|
|
641
|
+
]
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
```
|
|
645
|
+
|
|
646
|
+
### Patrol with Player Detection (JSON)
|
|
647
|
+
```json
|
|
648
|
+
{
|
|
649
|
+
"name": "PatrolGuardBehavior",
|
|
650
|
+
"rootNode": {
|
|
651
|
+
"type": "Selector",
|
|
652
|
+
"children": [
|
|
653
|
+
{
|
|
654
|
+
"type": "FollowActor",
|
|
655
|
+
"targetActorKey": "PlayerActor",
|
|
656
|
+
"followDistance": 3.0,
|
|
657
|
+
"useNavigation": true,
|
|
658
|
+
"conditions": [
|
|
659
|
+
{
|
|
660
|
+
"type": "IsPlayerNear",
|
|
661
|
+
"range": 12.0
|
|
662
|
+
}
|
|
663
|
+
]
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
"type": "Sequence",
|
|
667
|
+
"children": [
|
|
668
|
+
{
|
|
669
|
+
"type": "SetNextWaypoint",
|
|
670
|
+
"waypointsKey": "PatrolWaypoints",
|
|
671
|
+
"currentIndexKey": "CurrentWaypointIndex",
|
|
672
|
+
"targetPositionKey": "CurrentWaypoint",
|
|
673
|
+
"loop": true,
|
|
674
|
+
"conditions": [
|
|
675
|
+
{
|
|
676
|
+
"type": "IsPlayerNear",
|
|
677
|
+
"range": 12.0,
|
|
678
|
+
"invert": true
|
|
679
|
+
}
|
|
680
|
+
]
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
"type": "MoveToPosition",
|
|
684
|
+
"targetPositionKey": "CurrentWaypoint",
|
|
685
|
+
"acceptanceRadius": 2.0,
|
|
686
|
+
"useNavigation": true,
|
|
687
|
+
"conditions": [
|
|
688
|
+
{
|
|
689
|
+
"type": "IsPlayerNear",
|
|
690
|
+
"range": 12.0,
|
|
691
|
+
"invert": true
|
|
692
|
+
}
|
|
693
|
+
]
|
|
694
|
+
}
|
|
695
|
+
]
|
|
696
|
+
}
|
|
697
|
+
]
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
```
|
|
701
|
+
|
|
702
|
+
### Aerial Hunter Behavior (JSON)
|
|
703
|
+
```json
|
|
704
|
+
{
|
|
705
|
+
"name": "AerialHunterBehavior",
|
|
706
|
+
"description": "Flying enemy that hunts the player from the sky",
|
|
707
|
+
"rootNode": {
|
|
708
|
+
"type": "Selector",
|
|
709
|
+
"children": [
|
|
710
|
+
{
|
|
711
|
+
"type": "Sequence",
|
|
712
|
+
"name": "Attack Player",
|
|
713
|
+
"conditions": [
|
|
714
|
+
{
|
|
715
|
+
"type": "IsPlayerNear",
|
|
716
|
+
"range": 80.0
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
"type": "CanSeeTarget",
|
|
720
|
+
"targetActorKey": "PlayerActor",
|
|
721
|
+
"maxDistance": 80.0
|
|
722
|
+
}
|
|
723
|
+
],
|
|
724
|
+
"children": [
|
|
725
|
+
{
|
|
726
|
+
"type": "AerialTrackTarget",
|
|
727
|
+
"targetActorKey": "PlayerActor",
|
|
728
|
+
"lastKnownPositionKey": "LastKnownPlayerPosition",
|
|
729
|
+
"updateInterval": 0.3
|
|
730
|
+
},
|
|
731
|
+
{
|
|
732
|
+
"type": "AerialMoveToTarget",
|
|
733
|
+
"targetActorKey": "PlayerActor",
|
|
734
|
+
"acceptanceRadius": 25.0,
|
|
735
|
+
"hoverAboveTarget": true,
|
|
736
|
+
"hoverHeightOffset": 15.0
|
|
737
|
+
},
|
|
738
|
+
{
|
|
739
|
+
"type": "Shoot",
|
|
740
|
+
"targetActorKey": "PlayerActor",
|
|
741
|
+
"maxRange": 70.0,
|
|
742
|
+
"aimTime": 0.6,
|
|
743
|
+
"leadTarget": true
|
|
744
|
+
}
|
|
745
|
+
]
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
"type": "AerialSearch",
|
|
749
|
+
"lastKnownPositionKey": "LastKnownPlayerPosition",
|
|
750
|
+
"searchRadius": 15.0,
|
|
751
|
+
"searchDuration": 8.0,
|
|
752
|
+
"conditions": [
|
|
753
|
+
{
|
|
754
|
+
"type": "IsPlayerNear",
|
|
755
|
+
"range": 80.0,
|
|
756
|
+
"invert": true
|
|
757
|
+
}
|
|
758
|
+
]
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
"type": "AerialWander",
|
|
762
|
+
"wanderRadius": 30.0,
|
|
763
|
+
"wanderHeight": 20.0,
|
|
764
|
+
"heightVariation": 8.0
|
|
765
|
+
}
|
|
766
|
+
]
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
```
|
|
770
|
+
|
|
771
|
+
---
|
|
772
|
+
|
|
773
|
+
## 6. Animation Integration
|
|
774
|
+
|
|
775
|
+
Both AI systems automatically integrate with the animation system. Movement actions set animation parameters:
|
|
776
|
+
|
|
777
|
+
- `speed`: Movement speed (0-1)
|
|
778
|
+
- `forward`: Forward movement amount
|
|
779
|
+
- `right`: Right movement amount
|
|
780
|
+
|
|
781
|
+
This ensures NPCs play appropriate walking/running animations based on their behavior.
|
|
782
|
+
|
|
783
|
+
---
|
|
784
|
+
|
|
785
|
+
## 7. Combat Integration
|
|
786
|
+
|
|
787
|
+
NPCs can be equipped with weapons for combat scenarios:
|
|
788
|
+
|
|
789
|
+
```typescript
|
|
790
|
+
// Add weapon to NPC
|
|
791
|
+
const weapon = new ENGINE.ProjectileWeaponComponent({
|
|
792
|
+
projectileClass: ENGINE.BasicProjectile,
|
|
793
|
+
fireRate: 2.0,
|
|
794
|
+
maxAmmo: 30
|
|
795
|
+
});
|
|
796
|
+
npc.addComponents(weapon);
|
|
797
|
+
|
|
798
|
+
// Add stats for combat behavior
|
|
799
|
+
const stats = new ENGINE.CharacterStatsComponent({
|
|
800
|
+
health: 100
|
|
801
|
+
});
|
|
802
|
+
npc.addComponents(stats);
|
|
803
|
+
```
|
|
804
|
+
|
|
805
|
+
Combat actions (`ShootAction`, `MeleeAttackAction`) automatically integrate with weapon components to handle combat scenarios.
|
|
806
|
+
|
|
807
|
+
---
|
|
808
|
+
|
|
809
|
+
## 8. Debugging Behavior Trees
|
|
810
|
+
|
|
811
|
+
Effective debugging is crucial for developing reliable AI behaviors. Genesys.js provides comprehensive debugging tools to help you understand what your behavior trees are doing and identify issues.
|
|
812
|
+
|
|
813
|
+
### Debug Information Methods
|
|
814
|
+
|
|
815
|
+
The `BehaviorTreeComponent` provides several methods to inspect the current state of your AI:
|
|
816
|
+
|
|
817
|
+
```typescript
|
|
818
|
+
const behaviorTree = npc.getComponent(ENGINE.BehaviorTreeComponent);
|
|
819
|
+
|
|
820
|
+
// Get comprehensive debug information
|
|
821
|
+
const debugInfo = behaviorTree.getDebugInfo();
|
|
822
|
+
console.log('Behavior Tree Debug Info:', debugInfo);
|
|
823
|
+
|
|
824
|
+
// Get current execution status
|
|
825
|
+
const currentStatus = behaviorTree.getCurrentStatus();
|
|
826
|
+
console.log('Current Status:', currentStatus); // Success, Failure, or Running
|
|
827
|
+
|
|
828
|
+
// Check if the tree is actively running
|
|
829
|
+
const isRunning = behaviorTree.isRunningBehaviorTree();
|
|
830
|
+
console.log('Is Running:', isRunning);
|
|
831
|
+
|
|
832
|
+
// Get human-readable description of current behavior
|
|
833
|
+
const description = behaviorTree.getCurrentBehaviorDescription();
|
|
834
|
+
console.log('Current Behavior:', description);
|
|
835
|
+
```
|
|
836
|
+
|
|
837
|
+
### Execution Path Tracking
|
|
838
|
+
|
|
839
|
+
Understanding the execution flow through your behavior tree is essential for debugging:
|
|
840
|
+
|
|
841
|
+
```typescript
|
|
842
|
+
// Get the full execution path from root to current leaf
|
|
843
|
+
const executionPath = behaviorTree.getCurrentExecutionPath();
|
|
844
|
+
console.log('Execution Path:');
|
|
845
|
+
executionPath.forEach((node, index) => {
|
|
846
|
+
const indent = ' '.repeat(index);
|
|
847
|
+
console.log(`${indent}${node.name} (${node.getStatus()})`);
|
|
848
|
+
});
|
|
849
|
+
|
|
850
|
+
// Get the currently executing composite node (Sequence/Selector)
|
|
851
|
+
const currentSequence = behaviorTree.getCurrentSequence();
|
|
852
|
+
if (currentSequence) {
|
|
853
|
+
console.log(`Currently in: ${currentSequence.name}`);
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
// Get the currently executing action
|
|
857
|
+
const currentAction = behaviorTree.getCurrentAction();
|
|
858
|
+
if (currentAction) {
|
|
859
|
+
console.log(`Currently executing: ${currentAction.name}`);
|
|
860
|
+
}
|
|
861
|
+
```
|
|
862
|
+
|
|
863
|
+
### Blackboard Inspection
|
|
864
|
+
|
|
865
|
+
The blackboard contains all the shared data your behavior tree uses:
|
|
866
|
+
|
|
867
|
+
```typescript
|
|
868
|
+
const blackboard = behaviorTree.getBlackboard();
|
|
869
|
+
|
|
870
|
+
// Get formatted debug information about all blackboard values
|
|
871
|
+
const blackboardDebug = blackboard.getDebugInfo();
|
|
872
|
+
console.log('Blackboard Contents:', blackboardDebug);
|
|
873
|
+
|
|
874
|
+
// Check specific values
|
|
875
|
+
const playerPosition = blackboard.getValue('PlayerPosition');
|
|
876
|
+
const distanceToPlayer = blackboard.getValue('DistanceToPlayer');
|
|
877
|
+
console.log(`Player at: ${playerPosition}, Distance: ${distanceToPlayer}`);
|
|
878
|
+
|
|
879
|
+
// List all available keys
|
|
880
|
+
const allKeys = blackboard.getKeys();
|
|
881
|
+
console.log('Available blackboard keys:', allKeys);
|
|
882
|
+
```
|
|
883
|
+
|
|
884
|
+
### Real-Time Debug Monitoring
|
|
885
|
+
|
|
886
|
+
Set up continuous monitoring to track AI behavior over time:
|
|
887
|
+
|
|
888
|
+
```typescript
|
|
889
|
+
class MyGame extends ENGINE.BaseGameLoop {
|
|
890
|
+
private debugTimer: number = 0;
|
|
891
|
+
private debugInterval: number = 2.0; // Debug every 2 seconds
|
|
892
|
+
|
|
893
|
+
protected override onTick(deltaTime: number): void {
|
|
894
|
+
super.onTick(deltaTime);
|
|
895
|
+
|
|
896
|
+
// Debug monitoring
|
|
897
|
+
this.debugTimer += deltaTime;
|
|
898
|
+
if (this.debugTimer >= this.debugInterval) {
|
|
899
|
+
this.debugAI();
|
|
900
|
+
this.debugTimer = 0;
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
private debugAI(): void {
|
|
905
|
+
// Find all NPCs with behavior trees
|
|
906
|
+
const npcs = this.world.getAllActorsOfType(ENGINE.ThirdPersonCharacterPawn)
|
|
907
|
+
.filter(npc => npc.getComponent(ENGINE.BehaviorTreeComponent));
|
|
908
|
+
|
|
909
|
+
console.log('\n=== AI Debug Report ===');
|
|
910
|
+
npcs.forEach((npc, index) => {
|
|
911
|
+
const behaviorTree = npc.getComponent(ENGINE.BehaviorTreeComponent)!;
|
|
912
|
+
const description = behaviorTree.getCurrentBehaviorDescription();
|
|
913
|
+
const status = behaviorTree.getCurrentStatus();
|
|
914
|
+
|
|
915
|
+
console.log(`NPC ${index + 1}: ${description} (${status})`);
|
|
916
|
+
|
|
917
|
+
// Show blackboard values
|
|
918
|
+
const blackboard = behaviorTree.getBlackboard();
|
|
919
|
+
const distanceToPlayer = blackboard.getValue('DistanceToPlayer');
|
|
920
|
+
if (distanceToPlayer !== undefined) {
|
|
921
|
+
console.log(` Distance to player: ${distanceToPlayer.toFixed(1)}`);
|
|
922
|
+
}
|
|
923
|
+
});
|
|
924
|
+
console.log('========================\n');
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
```
|
|
928
|
+
|
|
929
|
+
### Node-Level Debugging
|
|
930
|
+
|
|
931
|
+
Individual nodes provide their own debug information:
|
|
932
|
+
|
|
933
|
+
```typescript
|
|
934
|
+
// Get debug info from any node
|
|
935
|
+
const nodeDebugInfo = someNode.getDebugInfo();
|
|
936
|
+
console.log('Node Debug Info:', {
|
|
937
|
+
name: nodeDebugInfo.name,
|
|
938
|
+
description: nodeDebugInfo.description,
|
|
939
|
+
status: nodeDebugInfo.status,
|
|
940
|
+
isExecuting: nodeDebugInfo.isExecuting
|
|
941
|
+
});
|
|
942
|
+
|
|
943
|
+
// For composite nodes, get child information
|
|
944
|
+
if (someNode instanceof ENGINE.CompositeNode) {
|
|
945
|
+
const compositeDebug = someNode.getDebugInfo();
|
|
946
|
+
console.log(`Current child index: ${compositeDebug.currentChildIndex}`);
|
|
947
|
+
console.log('Children:', compositeDebug.children);
|
|
948
|
+
}
|
|
949
|
+
```
|
|
950
|
+
|
|
951
|
+
### Debug Output Examples
|
|
952
|
+
|
|
953
|
+
Here's what typical debug output looks like:
|
|
954
|
+
|
|
955
|
+
```typescript
|
|
956
|
+
// Comprehensive debug info structure
|
|
957
|
+
{
|
|
958
|
+
isRunning: true,
|
|
959
|
+
currentStatus: "Running",
|
|
960
|
+
updateInterval: 0.1,
|
|
961
|
+
blackboard: {
|
|
962
|
+
"PlayerPosition": "Vector3(10.50, 1.00, -5.25)",
|
|
963
|
+
"DistanceToPlayer": 12.3,
|
|
964
|
+
"CurrentWaypoint": "Vector3(0.00, 1.00, 0.00)",
|
|
965
|
+
"PatrolWaypoints": [Array of waypoints],
|
|
966
|
+
"PlayerActor": "ThirdPersonCharacterPawn(Player)"
|
|
967
|
+
},
|
|
968
|
+
rootNode: {
|
|
969
|
+
name: "PatrolBehavior",
|
|
970
|
+
description: "Main patrol behavior",
|
|
971
|
+
status: "Running",
|
|
972
|
+
isExecuting: true,
|
|
973
|
+
children: [...]
|
|
974
|
+
},
|
|
975
|
+
executionPath: [
|
|
976
|
+
{ name: "PatrolBehavior", status: "Running" },
|
|
977
|
+
{ name: "PatrolSequence", status: "Running" },
|
|
978
|
+
{ name: "MoveToPosition", status: "Running" }
|
|
979
|
+
]
|
|
980
|
+
}
|
|
981
|
+
```
|
|
982
|
+
|
|
983
|
+
### Common Debugging Scenarios
|
|
984
|
+
|
|
985
|
+
#### 1. Action Not Executing
|
|
986
|
+
```typescript
|
|
987
|
+
// Check if conditions are failing
|
|
988
|
+
const currentAction = behaviorTree.getCurrentAction();
|
|
989
|
+
if (!currentAction) {
|
|
990
|
+
console.log('No action executing - check conditions');
|
|
991
|
+
|
|
992
|
+
// Inspect the execution path to see where it stops
|
|
993
|
+
const path = behaviorTree.getCurrentExecutionPath();
|
|
994
|
+
console.log('Execution stopped at:', path[path.length - 1]?.name);
|
|
995
|
+
}
|
|
996
|
+
```
|
|
997
|
+
|
|
998
|
+
#### 2. Blackboard Issues
|
|
999
|
+
```typescript
|
|
1000
|
+
// Verify required blackboard values are set
|
|
1001
|
+
const blackboard = behaviorTree.getBlackboard();
|
|
1002
|
+
const requiredKeys = ['PlayerActor', 'PatrolWaypoints', 'CurrentWaypoint'];
|
|
1003
|
+
|
|
1004
|
+
requiredKeys.forEach(key => {
|
|
1005
|
+
if (!blackboard.hasValue(key)) {
|
|
1006
|
+
console.error(`Missing required blackboard key: ${key}`);
|
|
1007
|
+
} else {
|
|
1008
|
+
console.log(`✓ ${key}:`, blackboard.getValue(key));
|
|
1009
|
+
}
|
|
1010
|
+
});
|
|
1011
|
+
```
|
|
1012
|
+
|
|
1013
|
+
#### 3. Performance Issues
|
|
1014
|
+
```typescript
|
|
1015
|
+
// Monitor update frequency and execution time
|
|
1016
|
+
class DebugBehaviorTreeComponent extends ENGINE.BehaviorTreeComponent {
|
|
1017
|
+
private lastExecutionTime: number = 0;
|
|
1018
|
+
|
|
1019
|
+
protected override async updateBehaviorTree(): Promise<void> {
|
|
1020
|
+
const startTime = performance.now();
|
|
1021
|
+
await super.updateBehaviorTree();
|
|
1022
|
+
const executionTime = performance.now() - startTime;
|
|
1023
|
+
|
|
1024
|
+
if (executionTime > 5) { // Warn if execution takes more than 5ms
|
|
1025
|
+
console.warn(`Slow behavior tree execution: ${executionTime.toFixed(2)}ms`);
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
```
|
|
1030
|
+
|
|
1031
|
+
---
|
|
1032
|
+
|
|
1033
|
+
## 9. Creating Custom Actions and Conditions
|
|
1034
|
+
|
|
1035
|
+
The behavior tree system is fully extensible. You can create your own custom actions and conditions in your game project.
|
|
1036
|
+
|
|
1037
|
+
### Creating Custom Actions
|
|
1038
|
+
|
|
1039
|
+
```typescript
|
|
1040
|
+
// src/ai/actions/MyCustomAction.ts
|
|
1041
|
+
import * as ENGINE from 'genesys.js';
|
|
1042
|
+
|
|
1043
|
+
export interface MyCustomActionOptions extends ENGINE.BehaviorActionOptions {
|
|
1044
|
+
customParameter?: string;
|
|
1045
|
+
customValue?: number;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
@ENGINE.EngineClass('MyCustomAction')
|
|
1049
|
+
export class MyCustomAction extends ENGINE.BehaviorAction {
|
|
1050
|
+
private customParameter: string;
|
|
1051
|
+
private customValue: number;
|
|
1052
|
+
|
|
1053
|
+
constructor(options: MyCustomActionOptions = {}) {
|
|
1054
|
+
super({ name: 'MyCustomAction', ...options });
|
|
1055
|
+
this.customParameter = options.customParameter ?? 'default';
|
|
1056
|
+
this.customValue = options.customValue ?? 1.0;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
protected override async onUpdate(blackboard: ENGINE.Blackboard): Promise<ENGINE.BehaviorStatus> {
|
|
1060
|
+
const owner = this.getOwner(blackboard);
|
|
1061
|
+
if (!owner) return ENGINE.BehaviorStatus.Failure;
|
|
1062
|
+
|
|
1063
|
+
// Your custom logic here
|
|
1064
|
+
console.log(`Custom action executing: ${this.customParameter}, ${this.customValue}`);
|
|
1065
|
+
|
|
1066
|
+
return ENGINE.BehaviorStatus.Success;
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
```
|
|
1070
|
+
|
|
1071
|
+
### ⚠️ Important: Avoid Indefinitely Running Actions
|
|
1072
|
+
|
|
1073
|
+
**Critical Best Practice**: Custom actions should **always** have a completion condition and should not run indefinitely. Actions that return `BehaviorStatus.Running` forever will block the behavior tree from re-evaluating other branches and conditions.
|
|
1074
|
+
|
|
1075
|
+
**❌ Bad Example** (Indefinitely running action):
|
|
1076
|
+
```typescript
|
|
1077
|
+
// DON'T DO THIS - This action will run forever
|
|
1078
|
+
protected override async onUpdate(blackboard: ENGINE.Blackboard): Promise<ENGINE.BehaviorStatus> {
|
|
1079
|
+
// This action never completes!
|
|
1080
|
+
return ENGINE.BehaviorStatus.Running;
|
|
1081
|
+
}
|
|
1082
|
+
```
|
|
1083
|
+
|
|
1084
|
+
**✅ Good Examples** (Actions with completion conditions):
|
|
1085
|
+
```typescript
|
|
1086
|
+
// Timer-based completion
|
|
1087
|
+
protected override async onUpdate(blackboard: ENGINE.Blackboard): Promise<ENGINE.BehaviorStatus> {
|
|
1088
|
+
const currentTime = Date.now() / 1000;
|
|
1089
|
+
const elapsedTime = currentTime - this.startTime;
|
|
1090
|
+
|
|
1091
|
+
if (elapsedTime >= this.maxDuration) {
|
|
1092
|
+
return ENGINE.BehaviorStatus.Success; // Complete after timeout
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
// Do work...
|
|
1096
|
+
return ENGINE.BehaviorStatus.Running;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
// Condition-based completion
|
|
1100
|
+
protected override async onUpdate(blackboard: ENGINE.Blackboard): Promise<ENGINE.BehaviorStatus> {
|
|
1101
|
+
const owner = this.getOwner(blackboard);
|
|
1102
|
+
|
|
1103
|
+
// Check if goal is achieved
|
|
1104
|
+
if (this.hasAchievedGoal(owner)) {
|
|
1105
|
+
return ENGINE.BehaviorStatus.Success;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
// Continue working toward goal
|
|
1109
|
+
return ENGINE.BehaviorStatus.Running;
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
// Immediate completion for utility actions
|
|
1113
|
+
protected override async onUpdate(blackboard: ENGINE.Blackboard): Promise<ENGINE.BehaviorStatus> {
|
|
1114
|
+
// Perform immediate action (like setting a value)
|
|
1115
|
+
blackboard.setValue('SomeKey', 'SomeValue');
|
|
1116
|
+
|
|
1117
|
+
// Complete immediately
|
|
1118
|
+
return ENGINE.BehaviorStatus.Success;
|
|
1119
|
+
}
|
|
1120
|
+
```
|
|
1121
|
+
|
|
1122
|
+
**Why This Matters**: The behavior tree system expects actions to eventually complete so it can:
|
|
1123
|
+
- Re-evaluate conditions on other branches
|
|
1124
|
+
- Allow higher-priority behaviors to interrupt
|
|
1125
|
+
- Reset and restart the tree when needed
|
|
1126
|
+
- Provide responsive AI that can adapt to changing game state
|
|
1127
|
+
|
|
1128
|
+
### Creating Custom Conditions
|
|
1129
|
+
|
|
1130
|
+
```typescript
|
|
1131
|
+
// src/ai/conditions/MyCustomCondition.ts
|
|
1132
|
+
import * as ENGINE from 'genesys.js';
|
|
1133
|
+
|
|
1134
|
+
export interface MyCustomConditionOptions extends ENGINE.ConditionEvaluatorOptions {
|
|
1135
|
+
threshold?: number;
|
|
1136
|
+
targetActorKey?: string;
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
@ENGINE.EngineClass('MyCustomCondition')
|
|
1140
|
+
export class MyCustomCondition extends ENGINE.ConditionEvaluator {
|
|
1141
|
+
private threshold: number;
|
|
1142
|
+
private targetActorKey: string;
|
|
1143
|
+
|
|
1144
|
+
constructor(options: MyCustomConditionOptions = {}) {
|
|
1145
|
+
super({ name: 'MyCustomCondition', ...options });
|
|
1146
|
+
this.threshold = options.threshold ?? 10.0;
|
|
1147
|
+
this.targetActorKey = options.targetActorKey ?? 'PlayerActor';
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
protected override async onEvaluate(blackboard: ENGINE.Blackboard): Promise<ENGINE.BehaviorStatus> {
|
|
1151
|
+
const owner = this.getOwner(blackboard);
|
|
1152
|
+
const target = blackboard.getValue<any>(this.targetActorKey);
|
|
1153
|
+
|
|
1154
|
+
if (!owner || !target) return ENGINE.BehaviorStatus.Failure;
|
|
1155
|
+
|
|
1156
|
+
// Your custom condition logic here
|
|
1157
|
+
// Return Success if condition is met, Failure otherwise
|
|
1158
|
+
return ENGINE.BehaviorStatus.Success;
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
```
|
|
1162
|
+
|
|
1163
|
+
### Using Custom Behaviors in Code
|
|
1164
|
+
|
|
1165
|
+
```typescript
|
|
1166
|
+
// Use your custom behaviors directly in behavior trees
|
|
1167
|
+
const customBehavior = new ENGINE.SelectorNode({
|
|
1168
|
+
name: 'Custom Behavior'
|
|
1169
|
+
});
|
|
1170
|
+
customBehavior.addChildren([
|
|
1171
|
+
new MyCustomAction({
|
|
1172
|
+
customParameter: 'myValue',
|
|
1173
|
+
customValue: 42,
|
|
1174
|
+
conditions: [
|
|
1175
|
+
new MyCustomCondition({ threshold: 15.0 })
|
|
1176
|
+
]
|
|
1177
|
+
}),
|
|
1178
|
+
new ENGINE.WanderAction({ wanderRadius: 10.0 })
|
|
1179
|
+
]);
|
|
1180
|
+
|
|
1181
|
+
// Apply to NPC
|
|
1182
|
+
const behaviorTree = new ENGINE.BehaviorTreeComponent({
|
|
1183
|
+
rootNode: customBehavior,
|
|
1184
|
+
updateInterval: 0.1,
|
|
1185
|
+
autoStart: true
|
|
1186
|
+
});
|
|
1187
|
+
npc.addComponents(behaviorTree);
|
|
1188
|
+
this.world.addActors(npc);
|
|
1189
|
+
```
|
|
1190
|
+
|
|
1191
|
+
### Registering for JSON Support (Optional)
|
|
1192
|
+
|
|
1193
|
+
If you want to use your custom behaviors in JSON files, register them:
|
|
1194
|
+
|
|
1195
|
+
```typescript
|
|
1196
|
+
// src/ai/registerCustomBehaviors.ts
|
|
1197
|
+
import * as ENGINE from 'genesys.js';
|
|
1198
|
+
import { MyCustomAction } from './actions/MyCustomAction.js';
|
|
1199
|
+
import { MyCustomCondition } from './conditions/MyCustomCondition.js';
|
|
1200
|
+
|
|
1201
|
+
export function registerCustomBehaviors(): void {
|
|
1202
|
+
// Register custom actions
|
|
1203
|
+
ENGINE.BehaviorTreeLoader.registerNodeType('MyCustomAction', MyCustomAction as any);
|
|
1204
|
+
|
|
1205
|
+
// Register custom conditions
|
|
1206
|
+
ENGINE.BehaviorTreeLoader.registerConditionType('MyCustomCondition', MyCustomCondition as any);
|
|
1207
|
+
|
|
1208
|
+
console.log('Custom behavior tree types registered');
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
// Initialize in your game
|
|
1212
|
+
export class MyGame extends ENGINE.BaseGameLoop {
|
|
1213
|
+
constructor(container: HTMLElement) {
|
|
1214
|
+
super(container);
|
|
1215
|
+
|
|
1216
|
+
// Register custom types BEFORE loading JSON behavior trees
|
|
1217
|
+
registerCustomBehaviors();
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
```
|
|
1221
|
+
|
|
1222
|
+
---
|
|
1223
|
+
|
|
1224
|
+
## 10. Built-in Actions and Conditions
|
|
1225
|
+
|
|
1226
|
+
### Actions by Category
|
|
1227
|
+
|
|
1228
|
+
All actions use **blackboard keys** for actor references.
|
|
1229
|
+
|
|
1230
|
+
#### Ground Actions (NavMesh-based)
|
|
1231
|
+
| Action | Description | Key Properties |
|
|
1232
|
+
|--------|-------------|----------------|
|
|
1233
|
+
| `MoveToPositionAction` | Move to a specific position | `targetPositionKey`, `useNavigation` |
|
|
1234
|
+
| `FollowActorAction` | Follow another actor | `targetActorKey`, `followDistance`, `useNavigation` |
|
|
1235
|
+
| `SetNextWaypointAction` | Cycle through patrol points | `waypointsKey`, `targetPositionKey`, `loop` |
|
|
1236
|
+
| `FleeFromTargetAction` | Flee from a target actor | `targetActorKey`, `fleeDistance`, `fleeSpeedMultiplier` |
|
|
1237
|
+
| `WanderAction` | Random ground movement | `wanderRadius` |
|
|
1238
|
+
|
|
1239
|
+
#### Aerial Actions (3D flying)
|
|
1240
|
+
| Action | Description | Key Properties |
|
|
1241
|
+
|--------|-------------|----------------|
|
|
1242
|
+
| `AerialMoveToTargetAction` | Move to target in 3D space | `targetActorKey`, `hoverAboveTarget`, `hoverHeightOffset` |
|
|
1243
|
+
| `AerialSearchAction` | Search around last known position | `lastKnownPositionKey`, `searchRadius`, `searchDuration` |
|
|
1244
|
+
| `AerialTrackTargetAction` | Continuously track target position | `targetActorKey`, `lastKnownPositionKey`, `updateInterval` |
|
|
1245
|
+
| `AerialWanderAction` | Random 3D movement in sky | `wanderRadius`, `wanderHeight`, `heightVariation` |
|
|
1246
|
+
|
|
1247
|
+
#### Combat Actions
|
|
1248
|
+
| Action | Description | Key Properties |
|
|
1249
|
+
|--------|-------------|----------------|
|
|
1250
|
+
| `MeleeAttackAction` | Attack target at close range | `targetActorKey` |
|
|
1251
|
+
| `ShootAction` | Fire projectile weapon at target | `targetActorKey`, `shootRange`, `aimDuration` |
|
|
1252
|
+
|
|
1253
|
+
#### Utility Actions
|
|
1254
|
+
| Action | Description | Key Properties |
|
|
1255
|
+
|--------|-------------|----------------|
|
|
1256
|
+
| `LookAtTargetAction` | Rotate to face a target | `targetActorKey` |
|
|
1257
|
+
| `WaitAction` | Wait for a specified duration | `duration` |
|
|
1258
|
+
| `CalculateTacticalPositionAction` | Calculate tactical positions relative to targets | `targetActorKey`, `outputPositionKey`, `distance` |
|
|
1259
|
+
|
|
1260
|
+
### Conditions
|
|
1261
|
+
|
|
1262
|
+
All conditions use **blackboard keys** for actor references and support **invert** functionality.
|
|
1263
|
+
|
|
1264
|
+
| Condition | Description | Key Properties |
|
|
1265
|
+
|-----------|-------------|----------------|
|
|
1266
|
+
| `IsPlayerNearCondition` | Check player distance | `range` |
|
|
1267
|
+
| `CanSeeTargetCondition` | Line-of-sight check | `targetActorKey`, `maxDistance` |
|
|
1268
|
+
| `TargetInConeCondition` | Check target in field of view | `targetActorKey`, `coneAngle`, `maxDistance` |
|
|
1269
|
+
| `HpAbovePercentCondition` | Check HP above threshold | `percentage`, `checkOwner` |
|
|
1270
|
+
| `TargetBelowHpPercentCondition` | Check target HP below threshold | `targetActorKey`, `percentage` |
|
|
1271
|
+
| `TimeLimitCondition` | Check within time limit | `timeLimit` |
|
|
1272
|
+
| `HasLastKnownPositionCondition` | Check if position is known | `positionKey` |
|
|
1273
|
+
|
|
1274
|
+
---
|
|
1275
|
+
|
|
1276
|
+
## 11. Best Practices
|
|
1277
|
+
|
|
1278
|
+
1. **Prefer code-based behavior trees**: Use TypeScript/JavaScript for full type safety and IDE support
|
|
1279
|
+
2. **Use JSON for data-driven workflows**: Reserve JSON for when designers need to modify AI without code changes
|
|
1280
|
+
3. **Choose appropriate movement component**: Use `NpcMovementComponent` for ground-based NPCs, `AerialMovementComponent` for flying enemies
|
|
1281
|
+
4. **Use appropriate update intervals**: Balance AI responsiveness with performance
|
|
1282
|
+
5. **Start simple**: Begin with basic behaviors and build complexity gradually
|
|
1283
|
+
6. **Test incrementally**: Test each AI component individually before combining
|
|
1284
|
+
7. **Use modular design**: Prefer composing behaviors from simple actions
|
|
1285
|
+
8. **Set up blackboard properly**: Initialize all required actor references and values before starting behavior trees
|
|
1286
|
+
9. **Debug visually**: Use comprehensive debugging methods to understand AI behavior
|
|
1287
|
+
10. **Attach conditions wisely**: Use attached conditions to control when actions execute
|
|
1288
|
+
11. **Reuse condition evaluators**: Create reusable condition evaluators for common checks
|
|
1289
|
+
12. **Consistent naming**: Use consistent blackboard key names across behavior trees
|
|
1290
|
+
13. **Document blackboard schema**: Define expected blackboard values in behavior tree comments
|
|
1291
|
+
14. **Avoid indefinitely running custom actions**: Ensure all custom actions have completion conditions to prevent blocking the behavior tree
|
|
1292
|
+
15. **Use debugging tools extensively**: Leverage the comprehensive debugging methods to understand AI behavior and identify issues quickly
|
|
1293
|
+
16. **Monitor performance**: Track behavior tree execution times and optimize slow-running actions or conditions
|
|
1294
|
+
17. **Organize by action categories**: Use the organized action structure (ground, aerial, combat, utility) for better code organization
|
|
1295
|
+
|
|
1296
|
+
---
|
|
1297
|
+
|
|
1298
|
+
## Next Steps
|
|
1299
|
+
|
|
1300
|
+
Now that you understand AI and behavior trees, you can combine them with navigation for complete AI systems. See the **[Navigation and Pathfinding Guide](15-navigation-and-pathfinding.md)** to learn about:
|
|
1301
|
+
|
|
1302
|
+
- NavMesh generation and configuration
|
|
1303
|
+
- Ground-based pathfinding for NPCs
|
|
1304
|
+
- Performance optimization for navigation
|
|
1305
|
+
- Troubleshooting navigation issues
|
|
1306
|
+
|
|
1307
|
+
This AI system provides sophisticated decision-making capabilities for your Genesys.js projects.
|
|
1308
|
+
|
|
1309
|
+
---
|
|
1310
|
+
|
|
1311
|
+
## Source Code
|
|
1312
|
+
Below are relevant engine source code you MUST digest in order to get complete understanding of the topic. Read them carefully.
|
|
1313
|
+
|
|
1314
|
+
```
|
|
1315
|
+
<file path={src/npc/behavior-tree/BehaviorTreeComponent.ts}>
|
|
1316
|
+
<file path={src/components/movement/AerialMovementComponent.ts}>
|