Spaces:
Running
Running
update REAMDE
Browse files
README.md
CHANGED
@@ -16,33 +16,40 @@ custom_headers:
|
|
16 |
|
17 |
# NPC Playground πΉοΈπ€
|
18 |
|
19 |
-
|
20 |
-
[![Discord][discord-badge]][discord]
|
21 |
|
22 |
3D playground to interact with LLM-powered NPCs. </br>
|
23 |
-
|
24 |
|
25 |
-
<
|
|
|
|
|
26 |
|
27 |
-
[
|
28 |
-
[
|
29 |
-
[
|
|
|
30 |
[Credits](#Credits)
|
31 |
|
32 |
-
</div>
|
33 |
|
|
|
34 |
|
35 |
-
|
36 |
|
37 |
-
|
38 |
-
2. Modify the [`world.lua`](https://huggingface.co/spaces/cubzh/ai-npcs/blob/main/world.lua) file to edit NPC skills!
|
39 |
-
3. Deploy on your own Hugging Face space to run your modified version of the playground.
|
40 |
|
|
|
41 |
|
42 |
-
|
|
|
|
|
|
|
|
|
43 |
|
44 |
### **Tweaking NPC Behavior**
|
45 |
-
|
|
|
|
|
46 |
```lua
|
47 |
local NPCs = {
|
48 |
{
|
@@ -60,9 +67,11 @@ local NPCs = {
|
|
60 |
```
|
61 |
|
62 |
### **Teaching NPCs new skills**
|
|
|
63 |
Our NPCs have been trained to use any skill you've defined before running the game. This is achieved by training the LLM powering them to do "function calling".
|
64 |
|
65 |
-
Modify `world.lua`
|
|
|
66 |
```lua
|
67 |
local skills = {
|
68 |
{
|
@@ -80,27 +89,24 @@ local skills = {
|
|
80 |
...
|
81 |
}
|
82 |
```
|
83 |
-
The `callback` will be called whenever an NPC uses this skill, using the parameters defined in the `parameters` field. We've given you some examples in `skills.lua`, feel free to draw inspiration from them!
|
84 |
|
85 |
-
|
86 |
-
|
|
|
|
|
|
|
|
|
|
|
87 |
|
88 |
## Course
|
89 |
|
90 |
-
Together with the HuggingFace staff, we've released a new course to teach you how to create your own
|
91 |
-
You can access it [here](https://huggingface.co/huggingface-ml-4-games-course)
|
92 |
|
93 |
## Credits
|
94 |
|
95 |
- [Hugging Face](https://huggingface.co/) π€
|
96 |
- [Gigax](https://github.com/GigaxGames)
|
97 |
- [Cubzh](https://cu.bzh): A versatile UGC (User-Generated Content) gaming platform.
|
98 |
-
- **You !** You're welcome to
|
99 |
-
|
100 |
-
|
101 |
-
---
|
102 |
|
103 |
-
For detailed documentation, troubleshooting, and contributing guidelines, please refer to the [wiki](https://github.com/Cubzh/ai-npc-world/wiki).
|
104 |
|
105 |
-
[discord]: https://discord.gg/rRBSueTKXg
|
106 |
-
[discord-badge]: https://img.shields.io/discord/1090190447906934825?color=81A1C1&logo=discord&logoColor=white&style=flat-square
|
|
|
16 |
|
17 |
# NPC Playground πΉοΈπ€
|
18 |
|
19 |
+
[![Join the chat at https://cu.bzh/discord](https://img.shields.io/discord/355905150528913409?color=%237289DA&label=cubzh&logo=discord&logoColor=white)](https://cu.bzh/discord)
|
|
|
20 |
|
21 |
3D playground to interact with LLM-powered NPCs. </br>
|
22 |
+
Clone and modify `cubzh.lua` file to teach them new skills with a few lines of code!
|
23 |
|
24 |
+
<div align="center">
|
25 |
+
<img style="max-width: 800px; width: 80%;" alt="cubzh_gigax_hf" src="https://github.com/soliton-x/ai-npc/assets/33256624/e62dd138-c018-4ecf-bc77-a072fadb5c12">
|
26 |
+
</div>
|
27 |
|
28 |
+
[Play](#Play) |
|
29 |
+
[Customize](#Customize) |
|
30 |
+
[Scripting](#Scripting) |
|
31 |
+
[Course](#Course) |
|
32 |
[Credits](#Credits)
|
33 |
|
|
|
34 |
|
35 |
+
## Play
|
36 |
|
37 |
+
Just go to [huggingface.co/spaces/cubzh/ai-npcs](https://huggingface.co/spaces/cubzh/ai-npcs).
|
38 |
|
39 |
+
Engage with NPCs and try to trigger some of those pre-installed skills: `move`, `follow`, `jump`, `explode` (you may need to insist for that one π
).
|
|
|
|
|
40 |
|
41 |
+
## Customize
|
42 |
|
43 |
+
1. Clone [huggingface.co/spaces/cubzh/ai-npcs](https://huggingface.co/spaces/cubzh/ai-npcs) repository. **β οΈ clone needs to be public β οΈ**
|
44 |
+
2. Modify and commit [`world.lua`](https://huggingface.co/spaces/cubzh/ai-npcs/blob/main/world.lua) file to edit NPC skills.
|
45 |
+
3. That's it!
|
46 |
+
|
47 |
+
## Scripting
|
48 |
|
49 |
### **Tweaking NPC Behavior**
|
50 |
+
|
51 |
+
Modify the predifined fields in `world.lua`'s `NPCs` table in order to influence NPC behaviour:
|
52 |
+
|
53 |
```lua
|
54 |
local NPCs = {
|
55 |
{
|
|
|
67 |
```
|
68 |
|
69 |
### **Teaching NPCs new skills**
|
70 |
+
|
71 |
Our NPCs have been trained to use any skill you've defined before running the game. This is achieved by training the LLM powering them to do "function calling".
|
72 |
|
73 |
+
Modify `skills` table in `world.lua` to give your NPCs new skills:
|
74 |
+
|
75 |
```lua
|
76 |
local skills = {
|
77 |
{
|
|
|
89 |
...
|
90 |
}
|
91 |
```
|
|
|
92 |
|
93 |
+
The `callback` function is called whenever an NPC uses the skill, using the parameters defined in the `parameters` field. We've given you some examples in `skills.lua`, feel free to draw inspiration from them!
|
94 |
+
|
95 |
+
If you want to go deeper with Cubzh scripting API, here's the [documentation](https://docs.cu.bzh), the team and community will also be glad to help you on [Discord](https://cu.bzh/discord).
|
96 |
+
|
97 |
+
### Environment Design (π·ββοΈ work in progress ποΈ)
|
98 |
+
|
99 |
+
Cubzh allows you to modify the 3D environment, by importing community-made voxel assets or creating new ones yourself. It's not yet possible to modify the environment yet though in the context of that specific demo, but we're working on making it possible, stay tuned!
|
100 |
|
101 |
## Course
|
102 |
|
103 |
+
Together with the HuggingFace staff, we've released a new course to teach you how to create your own NPC skills with Lua. You can access it [here](https://huggingface.co/huggingface-ml-4-games-course)
|
|
|
104 |
|
105 |
## Credits
|
106 |
|
107 |
- [Hugging Face](https://huggingface.co/) π€
|
108 |
- [Gigax](https://github.com/GigaxGames)
|
109 |
- [Cubzh](https://cu.bzh): A versatile UGC (User-Generated Content) gaming platform.
|
110 |
+
- **You !** You're welcome to **duplicate** the repo, share your creations, and submit PRs here :)
|
|
|
|
|
|
|
111 |
|
|
|
112 |
|
|
|
|