hytopia 0.1.96 → 0.1.98

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.
Files changed (71) hide show
  1. package/docs/server.md +66 -0
  2. package/docs/server.pathfindabortcallback.md +13 -0
  3. package/docs/server.pathfindcompletecallback.md +13 -0
  4. package/docs/server.pathfindingentitycontroller.debug.md +13 -0
  5. package/docs/server.pathfindingentitycontroller.maxfall.md +13 -0
  6. package/docs/server.pathfindingentitycontroller.maxjump.md +13 -0
  7. package/docs/server.pathfindingentitycontroller.maxopensetiterations.md +13 -0
  8. package/docs/server.pathfindingentitycontroller.md +287 -0
  9. package/docs/server.pathfindingentitycontroller.pathfind.md +87 -0
  10. package/docs/server.pathfindingentitycontroller.speed.md +13 -0
  11. package/docs/server.pathfindingentitycontroller.target.md +13 -0
  12. package/docs/server.pathfindingentitycontroller.verticalpenalty.md +13 -0
  13. package/docs/server.pathfindingentitycontroller.waypointnextindex.md +13 -0
  14. package/docs/server.pathfindingentitycontroller.waypoints.md +13 -0
  15. package/docs/server.pathfindingentitycontroller.waypointtimeoutms.md +13 -0
  16. package/docs/server.pathfindingoptions.md +26 -0
  17. package/docs/server.playerentitycontroller.autocancelmouseleftclick.md +13 -0
  18. package/docs/server.playerentitycontroller.md +19 -0
  19. package/docs/server.playerentitycontrolleroptions.autocancelmouseleftclick.md +13 -0
  20. package/docs/server.playerentitycontrolleroptions.md +19 -0
  21. package/docs/server.simpleentitycontroller.jump.md +53 -0
  22. package/docs/server.simpleentitycontroller.md +14 -0
  23. package/docs/server.waypointmovecompletecallback.md +15 -0
  24. package/docs/server.waypointmoveskippedcallback.md +15 -0
  25. package/examples/ai-agents/.env.example +2 -0
  26. package/examples/ai-agents/README.md +17 -0
  27. package/examples/ai-agents/bun.lockb +0 -0
  28. package/examples/ai-agents/package.json +2 -2
  29. package/examples/big-world/bun.lockb +0 -0
  30. package/examples/big-world/package.json +2 -2
  31. package/examples/block-entity/bun.lockb +0 -0
  32. package/examples/block-entity/package.json +2 -2
  33. package/examples/child-entity/bun.lockb +0 -0
  34. package/examples/child-entity/package-lock.json +30 -0
  35. package/examples/child-entity/package.json +2 -2
  36. package/examples/custom-ui/bun.lockb +0 -0
  37. package/examples/custom-ui/package.json +2 -2
  38. package/examples/entity-controller/bun.lockb +0 -0
  39. package/examples/entity-spawn/bun.lockb +0 -0
  40. package/examples/entity-spawn/package.json +1 -1
  41. package/examples/hole-in-wall-game/bun.lockb +0 -0
  42. package/examples/hole-in-wall-game/package.json +2 -2
  43. package/examples/lighting/bun.lockb +0 -0
  44. package/examples/lighting/package.json +3 -2
  45. package/examples/pathfinding/README.md +3 -0
  46. package/examples/pathfinding/assets/map.json +25828 -0
  47. package/examples/pathfinding/bun.lockb +0 -0
  48. package/examples/pathfinding/index.ts +113 -0
  49. package/examples/pathfinding/package.json +16 -0
  50. package/examples/payload-game/bun.lockb +0 -0
  51. package/examples/payload-game/package.json +3 -2
  52. package/examples/wall-dodge-game/bun.lockb +0 -0
  53. package/examples/wall-dodge-game/package-lock.json +30 -0
  54. package/examples/wall-dodge-game/package.json +2 -2
  55. package/examples/zombies-fps/assets/audio/sfx/pistol-shoot-1.mp3 +0 -0
  56. package/examples/zombies-fps/assets/audio/sfx/pistol-shoot-2.mp3 +0 -0
  57. package/examples/zombies-fps/assets/audio/sfx/pistol-shoot.mp3 +0 -0
  58. package/examples/zombies-fps/assets/maps/terrain.json +0 -12
  59. package/examples/zombies-fps/assets/ui/index.html +35 -0
  60. package/examples/zombies-fps/bun.lockb +0 -0
  61. package/examples/zombies-fps/classes/GamePlayerEntity.ts +49 -16
  62. package/examples/zombies-fps/classes/GunEntity.ts +66 -0
  63. package/examples/zombies-fps/classes/guns/BulletEntity.ts +0 -0
  64. package/examples/zombies-fps/classes/guns/PistolEntity.ts +49 -0
  65. package/examples/zombies-fps/index.ts +5 -1
  66. package/examples/zombies-fps/package.json +2 -2
  67. package/package.json +1 -1
  68. package/server.api.json +713 -0
  69. package/server.d.ts +136 -0
  70. package/server.js +87 -87
  71. package/examples/zombies-fps/classes/WeaponEntity.ts +0 -32
@@ -0,0 +1,13 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [PlayerEntityControllerOptions](./server.playerentitycontrolleroptions.md) &gt; [autoCancelMouseLeftClick](./server.playerentitycontrolleroptions.autocancelmouseleftclick.md)
4
+
5
+ ## PlayerEntityControllerOptions.autoCancelMouseLeftClick property
6
+
7
+ Whether to automatically cancel left click input after first processed tick, defaults to true.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ autoCancelMouseLeftClick?: boolean;
13
+ ```
@@ -37,6 +37,25 @@ Description
37
37
  </th></tr></thead>
38
38
  <tbody><tr><td>
39
39
 
40
+ [autoCancelMouseLeftClick?](./server.playerentitycontrolleroptions.autocancelmouseleftclick.md)
41
+
42
+
43
+ </td><td>
44
+
45
+
46
+ </td><td>
47
+
48
+ boolean
49
+
50
+
51
+ </td><td>
52
+
53
+ _(Optional)_ Whether to automatically cancel left click input after first processed tick, defaults to true.
54
+
55
+
56
+ </td></tr>
57
+ <tr><td>
58
+
40
59
  [canJump?](./server.playerentitycontrolleroptions.canjump.md)
41
60
 
42
61
 
@@ -0,0 +1,53 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [SimpleEntityController](./server.simpleentitycontroller.md) &gt; [jump](./server.simpleentitycontroller.jump.md)
4
+
5
+ ## SimpleEntityController.jump() method
6
+
7
+ Applies an upwards impulse to the entity to simulate a jump, only supported for entities with dynamic rigid body types.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ jump(height: number): void;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ <table><thead><tr><th>
18
+
19
+ Parameter
20
+
21
+
22
+ </th><th>
23
+
24
+ Type
25
+
26
+
27
+ </th><th>
28
+
29
+ Description
30
+
31
+
32
+ </th></tr></thead>
33
+ <tbody><tr><td>
34
+
35
+ height
36
+
37
+
38
+ </td><td>
39
+
40
+ number
41
+
42
+
43
+ </td><td>
44
+
45
+ The height to jump to.
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+ **Returns:**
51
+
52
+ void
53
+
@@ -68,6 +68,20 @@ Description
68
68
  Rotates the entity at a given speed to face a target coordinate.
69
69
 
70
70
 
71
+ </td></tr>
72
+ <tr><td>
73
+
74
+ [jump(height)](./server.simpleentitycontroller.jump.md)
75
+
76
+
77
+ </td><td>
78
+
79
+
80
+ </td><td>
81
+
82
+ Applies an upwards impulse to the entity to simulate a jump, only supported for entities with dynamic rigid body types.
83
+
84
+
71
85
  </td></tr>
72
86
  <tr><td>
73
87
 
@@ -0,0 +1,15 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [WaypointMoveCompleteCallback](./server.waypointmovecompletecallback.md)
4
+
5
+ ## WaypointMoveCompleteCallback type
6
+
7
+ A callback function called when the entity associated with the PathfindingEntityController finishes moving to a calculate waypoint of its current path.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export type WaypointMoveCompleteCallback = (waypoint: Vector3Like, waypointIndex: number) => void;
13
+ ```
14
+ **References:** [Vector3Like](./server.vector3like.md)
15
+
@@ -0,0 +1,15 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [server](./server.md) &gt; [WaypointMoveSkippedCallback](./server.waypointmoveskippedcallback.md)
4
+
5
+ ## WaypointMoveSkippedCallback type
6
+
7
+ A callback function called when the entity associated with the PathfindingEntityController skips a waypoint because it took too long to reach.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export type WaypointMoveSkippedCallback = (waypoint: Vector3Like, waypointIndex: number) => void;
13
+ ```
14
+ **References:** [Vector3Like](./server.vector3like.md)
15
+
@@ -0,0 +1,2 @@
1
+ # OpenAI API Key for agent inference
2
+ OPENAI_API_KEY=your_openai_api_key_here
@@ -5,6 +5,23 @@ This demo codebase provides an example for building multi Agent AI systems in Hy
5
5
  - Chat bubbles for agent speech
6
6
  - Side bar UI for viewing Agent actions
7
7
 
8
+ ## Setup
9
+
10
+ ### Environment Variables
11
+ This demo requires an OpenAI API key to function. Create a `.env` file in the ai-agents directory with the following variables:
12
+
13
+ ```env
14
+ OPENAI_API_KEY=your_openai_api_key_here
15
+ ```
16
+
17
+ You can copy the `.env.example` file and fill in your API key:
18
+ ```bash
19
+ cd examples/ai-agents
20
+ cp .env.example .env
21
+ ```
22
+
23
+ The OpenAI API key is used for agent inference - the agents use GPT-4o to make decisions and respond to interactions. Make sure your OpenAI account has access to GPT-4o API.
24
+
8
25
  ## How do Agents work in Hytopia?
9
26
  Game Agents are driven by a combination of game-specific action logic, world state representation, and Large Language Models.
10
27
 
Binary file
@@ -9,8 +9,8 @@
9
9
  "typescript": "^5.0.0"
10
10
  },
11
11
  "dependencies": {
12
- "@hytopia.com/assets": "^0.2.5",
13
- "hytopia": "^0.1.86",
12
+ "@hytopia.com/assets": "latest",
13
+ "hytopia": "latest",
14
14
  "openai": "^4.77.3"
15
15
  }
16
16
  }
Binary file
@@ -9,7 +9,7 @@
9
9
  "author": "",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
- "@hytopia.com/assets": "^0.2.5",
13
- "hytopia": "^0.1.86"
12
+ "@hytopia.com/assets": "latest",
13
+ "hytopia": "latest"
14
14
  }
15
15
  }
Binary file
@@ -10,7 +10,7 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@hytopia.com/assets": "^0.2.5",
14
- "hytopia": "^0.1.86"
13
+ "@hytopia.com/assets": "latest",
14
+ "hytopia": "latest"
15
15
  }
16
16
  }
Binary file
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "child-entity",
3
+ "version": "1.0.0",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "child-entity",
9
+ "version": "1.0.0",
10
+ "license": "ISC",
11
+ "dependencies": {
12
+ "@hytopia.com/assets": "latest",
13
+ "hytopia": "latest"
14
+ }
15
+ },
16
+ "node_modules/@hytopia.com/assets": {
17
+ "version": "0.1.7",
18
+ "resolved": "https://registry.npmjs.org/@hytopia.com/assets/-/assets-0.1.7.tgz",
19
+ "integrity": "sha512-gC113cIIVKp97cDX3u9n3ats8qS1kuaKPStQXOf1wNxuRs36yBvHM8NJWArfzzk8SG3ilfSZtc7qMYHod2ngcg=="
20
+ },
21
+ "node_modules/hytopia": {
22
+ "version": "0.1.80",
23
+ "resolved": "https://registry.npmjs.org/hytopia/-/hytopia-0.1.80.tgz",
24
+ "integrity": "sha512-Teu+dfY/24k8AfkeZYBtNue4KxIPFJsQEKwiG2LPOlS/ecosedqidxiehmSGS4ujyKH+zJZy0MqJnqNNIA9R3A==",
25
+ "bin": {
26
+ "hytopia": "bin/scripts.js"
27
+ }
28
+ }
29
+ }
30
+ }
@@ -10,7 +10,7 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@hytopia.com/assets": "^0.2.5",
14
- "hytopia": "^0.1.86"
13
+ "@hytopia.com/assets": "latest",
14
+ "hytopia": "latest"
15
15
  }
16
16
  }
Binary file
@@ -10,7 +10,7 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@hytopia.com/assets": "^0.2.5",
14
- "hytopia": "^0.1.86"
13
+ "@hytopia.com/assets": "latest",
14
+ "hytopia": "latest"
15
15
  }
16
16
  }
Binary file
@@ -10,7 +10,7 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@hytopia.com/assets": "^0.2.5",
13
+ "@hytopia.com/assets": "latest",
14
14
  "hytopia": "latest"
15
15
  }
16
16
  }
@@ -10,7 +10,7 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@hytopia.com/assets": "^0.2.5",
14
- "hytopia": "^0.1.86"
13
+ "@hytopia.com/assets": "latest",
14
+ "hytopia": "latest"
15
15
  }
16
16
  }
Binary file
@@ -10,7 +10,8 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@hytopia.com/assets": "^0.2.5",
14
- "hytopia": "^0.1.86"
13
+ "@hytopia.com/assets": "latest",
14
+ "hytopia": "latest"
15
+
15
16
  }
16
17
  }
@@ -0,0 +1,3 @@
1
+ # pathfinding
2
+
3
+ A PathfindingEntityController example with zombies that chase the player and pathfind around complex terrain obstacles.