hytopia 0.1.96 → 0.1.97
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/docs/server.md +66 -0
- package/docs/server.pathfindabortcallback.md +13 -0
- package/docs/server.pathfindcompletecallback.md +13 -0
- package/docs/server.pathfindingentitycontroller.debug.md +13 -0
- package/docs/server.pathfindingentitycontroller.maxfall.md +13 -0
- package/docs/server.pathfindingentitycontroller.maxjump.md +13 -0
- package/docs/server.pathfindingentitycontroller.maxopensetiterations.md +13 -0
- package/docs/server.pathfindingentitycontroller.md +287 -0
- package/docs/server.pathfindingentitycontroller.pathfind.md +87 -0
- package/docs/server.pathfindingentitycontroller.speed.md +13 -0
- package/docs/server.pathfindingentitycontroller.target.md +13 -0
- package/docs/server.pathfindingentitycontroller.verticalpenalty.md +13 -0
- package/docs/server.pathfindingentitycontroller.waypointnextindex.md +13 -0
- package/docs/server.pathfindingentitycontroller.waypoints.md +13 -0
- package/docs/server.pathfindingentitycontroller.waypointtimeoutms.md +13 -0
- package/docs/server.pathfindingoptions.md +26 -0
- package/docs/server.playerentitycontroller.autocancelmouseleftclick.md +13 -0
- package/docs/server.playerentitycontroller.md +19 -0
- package/docs/server.playerentitycontrolleroptions.autocancelmouseleftclick.md +13 -0
- package/docs/server.playerentitycontrolleroptions.md +19 -0
- package/docs/server.simpleentitycontroller.jump.md +53 -0
- package/docs/server.simpleentitycontroller.md +14 -0
- package/docs/server.waypointmovecompletecallback.md +15 -0
- package/docs/server.waypointmoveskippedcallback.md +15 -0
- package/examples/ai-agents/.env.example +2 -0
- package/examples/ai-agents/README.md +17 -0
- package/examples/ai-agents/bun.lockb +0 -0
- package/examples/big-world/bun.lockb +0 -0
- package/examples/block-entity/bun.lockb +0 -0
- package/examples/child-entity/bun.lockb +0 -0
- package/examples/child-entity/package-lock.json +30 -0
- package/examples/custom-ui/bun.lockb +0 -0
- package/examples/entity-controller/bun.lockb +0 -0
- package/examples/entity-spawn/bun.lockb +0 -0
- package/examples/hole-in-wall-game/bun.lockb +0 -0
- package/examples/lighting/bun.lockb +0 -0
- package/examples/pathfinding/README.md +3 -0
- package/examples/pathfinding/assets/map.json +25828 -0
- package/examples/pathfinding/bun.lockb +0 -0
- package/examples/pathfinding/index.ts +113 -0
- package/examples/pathfinding/package.json +16 -0
- package/examples/payload-game/bun.lockb +0 -0
- package/examples/wall-dodge-game/bun.lockb +0 -0
- package/examples/wall-dodge-game/package-lock.json +30 -0
- package/examples/zombies-fps/assets/audio/sfx/pistol-shoot-1.mp3 +0 -0
- package/examples/zombies-fps/assets/audio/sfx/pistol-shoot-2.mp3 +0 -0
- package/examples/zombies-fps/assets/audio/sfx/pistol-shoot.mp3 +0 -0
- package/examples/zombies-fps/assets/maps/terrain.json +0 -12
- package/examples/zombies-fps/assets/ui/index.html +35 -0
- package/examples/zombies-fps/bun.lockb +0 -0
- package/examples/zombies-fps/classes/GamePlayerEntity.ts +49 -16
- package/examples/zombies-fps/classes/GunEntity.ts +66 -0
- package/examples/zombies-fps/classes/guns/BulletEntity.ts +0 -0
- package/examples/zombies-fps/classes/guns/PistolEntity.ts +49 -0
- package/examples/zombies-fps/index.ts +5 -1
- package/package.json +1 -1
- package/server.api.json +713 -0
- package/server.d.ts +136 -0
- package/server.js +87 -87
- 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) > [server](./server.md) > [PlayerEntityControllerOptions](./server.playerentitycontrolleroptions.md) > [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) > [server](./server.md) > [SimpleEntityController](./server.simpleentitycontroller.md) > [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) > [server](./server.md) > [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) > [server](./server.md) > [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
|
+
|
@@ -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
|
Binary file
|
Binary file
|
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
|
+
}
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|