import{s as Ge,a as ye,n as ze,o as Se}from"../chunks/scheduler.be7fe76e.js";import{S as ke,i as Ne,e as s,s as a,c as N,h as Ue,a as o,d as i,b as l,f as He,g as U,j as r,k as z,l as qe,m as n,n as q,t as A,o as I,p as E}from"../chunks/index.0ce520ff.js";import{H as ue,E as Ae}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.a207c8e3.js";function Ie(he){let p,j,S,B,u,W,h,D,g,ge="To create this demo, the teams used three main tools:",F,m,me='<li><p><a href="https://github.com/cubzh/cubzh" rel="nofollow">Cubzh</a>: the cross-platform UGC (User Generated Content) game engine.</p></li> <li><p><a href="https://github.com/GigaxGames/gigax" rel="nofollow">Gigax</a>: the engine for smart NPCs.</p></li> <li><p><a href="https://huggingface.co/spaces" rel="nofollow">Hugging Face Spaces</a>: the most convenient online environment to host and iterate on game concepts in an open-source fashion.</p></li>',O,f,R,c,fe='<a href="https://github.com/cubzh/cubzh" rel="nofollow">Cubzh</a> is a cross-platform UGC game engine, that aims to provide an open-source alternative to Roblox.',Y,d,ce="It offers a <strong>rich gaming environment where users can create their own game experiences and play with friends</strong>.",K,x,de,J,v,xe="In Cubzh, you can:",Q,b,ve="<li><p><strong>Create your own worlds items and avatars</strong>.</p></li> <li><p>Build fast, using community <strong>made voxel items</strong> (+25K so far in the library) and <strong>open-source Lua modules</strong>.</p></li> <li><p><strong>Code games using a simple yet powerful Lua scripting API</strong>.</p></li>",V,C,be='Cubzh is in public Alpha. You can download and play Cubzh for free on Desktop via <a href="https://store.steampowered.com/app/1386770/Cubzh_Open_Alpha/" rel="nofollow">Steam</a>, <a href="https://store.epicgames.com/en-US/p/cubzh-3cc767" rel="nofollow">Epic Game Store</a>, or on Mobile via <a href="https://apps.apple.com/th/app/cubzh/id1478257849" rel="nofollow">Apple’s App Store</a>, <a href="https://play.google.com/store/apps/details?id=com.voxowl.pcubes.android&amp;hl=en&amp;gl=US&amp;pli=1" rel="nofollow">Google Play Store</a> or even play directly from your <a href="https://app.cu.bzh/" rel="nofollow">browser</a>.',X,w,Ce="In this demo, Cubzh serves as the <strong>game engine</strong> running directly within a Hugging Face Space, users can easily clone it to experiment with custom scripts and NPC personas.",Z,$,ee,_,we='<a href="https://github.com/GigaxGames/gigax" rel="nofollow">Gigax</a> is the platform game developers use to run <strong>LLM-powered NPCs at scale</strong>.',te,L,$e="Gigax has fine-tuned large language models for NPC interactions, <strong>using the “function calling” principle.</strong>",ie,T,_e="It’s easier to think about this in terms of input/output flow:",ne,M,Le='<li><p>In <strong>input</strong>, the model reads <a href="https://github.com/GigaxGames/gigax/blob/main/gigax/prompt.py" rel="nofollow">a text description</a> of a 3D scene, alongside a description of the recent events and a list of the NPC’s available actions (e.g., <code>&lt;say&gt;</code>, <code>&lt;jump&gt;</code>, <code>&lt;attack&gt;</code>, etc.).</p></li> <li><p>The model then <strong>outputs</strong> one of these actions using parameters that refer to 3D entities that exist in the scene, e.g. <code>say NPC1 &quot;Hello, Captain!&quot;</code>.</p></li>',ae,P,Te,le,y,Me=`Gigax has <strong>open-sourced their stack!</strong>
You can clone their <a href="https://github.com/GigaxGames/gigax" rel="nofollow">inference stack on Github</a>.
For this demo, their models are hosted in the cloud, but you can <a href="https://huggingface.co/Gigax" rel="nofollow">download them yourself on the 🤗 Hub</a>:`,se,H,Pe='<li><a href="https://huggingface.co/Gigax/NPC-LLM-3_8B" rel="nofollow">Phi-3 fine-tuned model</a></li> <li><a href="https://huggingface.co/Gigax/NPC-LLM-7B" rel="nofollow">Mistral-7B fine-tuned model</a></li>',oe,G,re,k,pe;return u=new ue({props:{title:"A deep dive on the NPC-Playground",local:"a-deep-dive-on-the-npc-playground",headingTag:"h1"}}),h=new ue({props:{title:"The Tech Stack",local:"the-tech-stack",headingTag:"h2"}}),f=new ue({props:{title:"What is Cubzh?",local:"what-is-cubzh",headingTag:"h2"}}),$=new ue({props:{title:"What is Gigax?",local:"what-is-gigax",headingTag:"h2"}}),G=new Ae({props:{source:"https://github.com/huggingface/making-games-with-ai-course/blob/main/units/en/unit3/demo.mdx"}}),{c(){p=s("meta"),j=a(),S=s("p"),B=a(),N(u.$$.fragment),W=a(),N(h.$$.fragment),D=a(),g=s("p"),g.textContent=ge,F=a(),m=s("ul"),m.innerHTML=me,O=a(),N(f.$$.fragment),R=a(),c=s("p"),c.innerHTML=fe,Y=a(),d=s("p"),d.innerHTML=ce,K=a(),x=s("img"),J=a(),v=s("p"),v.textContent=xe,Q=a(),b=s("ul"),b.innerHTML=ve,V=a(),C=s("p"),C.innerHTML=be,X=a(),w=s("p"),w.innerHTML=Ce,Z=a(),N($.$$.fragment),ee=a(),_=s("p"),_.innerHTML=we,te=a(),L=s("p"),L.innerHTML=$e,ie=a(),T=s("p"),T.textContent=_e,ne=a(),M=s("ul"),M.innerHTML=Le,ae=a(),P=s("img"),le=a(),y=s("p"),y.innerHTML=Me,se=a(),H=s("ul"),H.innerHTML=Pe,oe=a(),N(G.$$.fragment),re=a(),k=s("p"),this.h()},l(e){const t=Ue("svelte-u9bgzb",document.head);p=o(t,"META",{name:!0,content:!0}),t.forEach(i),j=l(e),S=o(e,"P",{}),He(S).forEach(i),B=l(e),U(u.$$.fragment,e),W=l(e),U(h.$$.fragment,e),D=l(e),g=o(e,"P",{"data-svelte-h":!0}),r(g)!=="svelte-3d7j1i"&&(g.textContent=ge),F=l(e),m=o(e,"UL",{"data-svelte-h":!0}),r(m)!=="svelte-1mox5ai"&&(m.innerHTML=me),O=l(e),U(f.$$.fragment,e),R=l(e),c=o(e,"P",{"data-svelte-h":!0}),r(c)!=="svelte-kqptim"&&(c.innerHTML=fe),Y=l(e),d=o(e,"P",{"data-svelte-h":!0}),r(d)!=="svelte-1v3vjdu"&&(d.innerHTML=ce),K=l(e),x=o(e,"IMG",{src:!0,alt:!0}),J=l(e),v=o(e,"P",{"data-svelte-h":!0}),r(v)!=="svelte-1nsc1hq"&&(v.textContent=xe),Q=l(e),b=o(e,"UL",{"data-svelte-h":!0}),r(b)!=="svelte-1oz1oqj"&&(b.innerHTML=ve),V=l(e),C=o(e,"P",{"data-svelte-h":!0}),r(C)!=="svelte-hfi50n"&&(C.innerHTML=be),X=l(e),w=o(e,"P",{"data-svelte-h":!0}),r(w)!=="svelte-qhgduy"&&(w.innerHTML=Ce),Z=l(e),U($.$$.fragment,e),ee=l(e),_=o(e,"P",{"data-svelte-h":!0}),r(_)!=="svelte-14bui5r"&&(_.innerHTML=we),te=l(e),L=o(e,"P",{"data-svelte-h":!0}),r(L)!=="svelte-12h40hm"&&(L.innerHTML=$e),ie=l(e),T=o(e,"P",{"data-svelte-h":!0}),r(T)!=="svelte-f7e37x"&&(T.textContent=_e),ne=l(e),M=o(e,"UL",{"data-svelte-h":!0}),r(M)!=="svelte-17awa7i"&&(M.innerHTML=Le),ae=l(e),P=o(e,"IMG",{src:!0,alt:!0}),le=l(e),y=o(e,"P",{"data-svelte-h":!0}),r(y)!=="svelte-gxyyu6"&&(y.innerHTML=Me),se=l(e),H=o(e,"UL",{"data-svelte-h":!0}),r(H)!=="svelte-3tiee4"&&(H.innerHTML=Pe),oe=l(e),U(G.$$.fragment,e),re=l(e),k=o(e,"P",{}),He(k).forEach(i),this.h()},h(){z(p,"name","hf:doc:metadata"),z(p,"content",Ee),ye(x.src,de="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/181_npc-gigax-cubzh/gigax.gif")||z(x,"src",de),z(x,"alt","Cubzh"),ye(P.src,Te="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/blog/181_npc-gigax-cubzh/gigax.png")||z(P,"src",Te),z(P,"alt","gigax")},m(e,t){qe(document.head,p),n(e,j,t),n(e,S,t),n(e,B,t),q(u,e,t),n(e,W,t),q(h,e,t),n(e,D,t),n(e,g,t),n(e,F,t),n(e,m,t),n(e,O,t),q(f,e,t),n(e,R,t),n(e,c,t),n(e,Y,t),n(e,d,t),n(e,K,t),n(e,x,t),n(e,J,t),n(e,v,t),n(e,Q,t),n(e,b,t),n(e,V,t),n(e,C,t),n(e,X,t),n(e,w,t),n(e,Z,t),q($,e,t),n(e,ee,t),n(e,_,t),n(e,te,t),n(e,L,t),n(e,ie,t),n(e,T,t),n(e,ne,t),n(e,M,t),n(e,ae,t),n(e,P,t),n(e,le,t),n(e,y,t),n(e,se,t),n(e,H,t),n(e,oe,t),q(G,e,t),n(e,re,t),n(e,k,t),pe=!0},p:ze,i(e){pe||(A(u.$$.fragment,e),A(h.$$.fragment,e),A(f.$$.fragment,e),A($.$$.fragment,e),A(G.$$.fragment,e),pe=!0)},o(e){I(u.$$.fragment,e),I(h.$$.fragment,e),I(f.$$.fragment,e),I($.$$.fragment,e),I(G.$$.fragment,e),pe=!1},d(e){e&&(i(j),i(S),i(B),i(W),i(D),i(g),i(F),i(m),i(O),i(R),i(c),i(Y),i(d),i(K),i(x),i(J),i(v),i(Q),i(b),i(V),i(C),i(X),i(w),i(Z),i(ee),i(_),i(te),i(L),i(ie),i(T),i(ne),i(M),i(ae),i(P),i(le),i(y),i(se),i(H),i(oe),i(re),i(k)),i(p),E(u,e),E(h,e),E(f,e),E($,e),E(G,e)}}}const Ee='{"title":"A deep dive on the NPC-Playground","local":"a-deep-dive-on-the-npc-playground","sections":[{"title":"The Tech Stack","local":"the-tech-stack","sections":[],"depth":2},{"title":"What is Cubzh?","local":"what-is-cubzh","sections":[],"depth":2},{"title":"What is Gigax?","local":"what-is-gigax","sections":[],"depth":2}],"depth":1}';function je(he){return Se(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Fe extends ke{constructor(p){super(),Ne(this,p,je,Ie,Ge,{})}}export{Fe as component};
