@ -15,25 +15,3 @@ You must clone with git lfs is, and download git lfs files in this repository. I
Open `art.blend`, go to the scripting tab and hit the play button run the script and export all the 3d assets. Then, make sure that when you build, you also build and run the codegen so that said assets and other files are copied and imported. For debug builds on windows, that's `call build_desktop_debug.bat codegen`, the codegen argument to the build script causing it to run codegen
Open `art.blend`, go to the scripting tab and hit the play button run the script and export all the 3d assets. Then, make sure that when you build, you also build and run the codegen so that said assets and other files are copied and imported. For debug builds on windows, that's `call build_desktop_debug.bat codegen`, the codegen argument to the build script causing it to run codegen
To enable codegen error messages, change @echo off to @echo on in run_codegen.bat
To enable codegen error messages, change @echo off to @echo on in run_codegen.bat
# Debugging in the web
To get this working, you're going to need to follow flooh's answer linked [here](https://groups.google.com/g/emscripten-discuss/c/DEmpyGoq6kE/m/Bx44ZmfmAAAJ), and copy pasted for redundancy here:
```
It should definitely work on Vanilla Chrome, but setting everything up can be a bit finicky:
- install the Debugging extension: https://chrome.google.com/webstore/detail/cc%20%20-devtools-support-dwa/pdcpmagijalfljmkmjngeonclgbbannb
- in the Dev Tools settings, search for 'WebAssembly Debugging' and check that box
- compile your code with '-O0 -g' (no optimization, and debug info enabled'
- IMPORTANT: in the Chrome debugger, there's a 'Filesystem' tab on the left side which is very easy to miss. Here you need to navigate to your project directory and allow Chrome to access that area of your filesystem.
(I think/hope these are all steps)
When you load your application you should see something like this on the Dev Tools console:
[C/C++ DevTools Support (DWARF)] Loading debug symbols for http://localhost:8080/cube-sapp.wasm...
[C/C++ DevTools Support (DWARF)] Loaded debug symbols for http://localhost:8080/cube-sapp.wasm, found 91 source file(s)
...and if everything works it should look roughly like this in the debugger:
{enum: Raphael, dialog: "What a psycho...", to: Daniel}
{enum: Raphael, dialog: "What a psycho...", to: Daniel}
{can_hear: [Daniel, Raphael, Passerby]}
{can_hear: [Daniel, Raphael, Passerby]}
{enum: Passerby, dialog: "Yo?", to: Daniel}
{enum: Passerby, dialog: "Yo", to: Raphael}
{enum: Daniel, dialog: "Are you askin' a question", to: Passerby}
{enum: Raphael, dialog: "What's up", to: Passerby}
{enum: Passerby, dialog: "I guess so? What do you think of farmers?", to: Daniel}
{enum: Passerby, dialog: "What do you think of farmers", to: Raphael}
{enum: Daniel, dialog: "I don't tolerate questions. Get out of my sight before I make you!", to: Passerby, action: ACT_aim_shotgun, action_argument: "Passerby"}
{enum: Raphael, dialog: "What?", to: Passerby}
{enum: Raphael, dialog: "What's going on here?", to: Daniel}
{enum: Daniel, dialog: "Let me 'say somthin here. Farmers are the backbone of this town, so you'd best give them some respect", to: Passerby}
{enum: Raphael, dialog: "I mean, scientists really are what's most important", to: Daniel}
{enum: Raphael, dialog: "Easy man, easy.", to: Daniel}
{enum: Daniel, dialog: "First of all, what the hell is a scientist? Second of all, whoever they are, if they can't eat they're worthless!", to: Raphael}
{enum: Daniel, dialog: "I WON'T TOLERATE IT", to: Raphael}
{enum: Raphael, dialog: "FIne fine whatever, no need to get heated...", to: Daniel}
{enum: Passerby, dialog: "Hey man woah, just put down the gun", to: Daniel}
{enum: Daniel, dialog: "Anyways, sorry about that. What's your name?", to: Passerby}
{enum: Daniel, dialog: "YOU BETTER MAKE ME!", to: Passerby}
{enum: Passerby, dialog: "Nevermind I'll just take my leave, later.", to: Daniel}
{enum: Passerby, dialog: "Why do you have the gun anyways?", to: Daniel}
{enum: Daniel, dialog: "ANOTHER QUESTION??? YOU HAD THIS COMING TO YOU!", to: Passerby, action: ACT_fire_shotgun}
{enum: Raphael, dialog: "Oh God! What have you done??", to: Daniel}
{enum: Daniel, dialog: "Exactly what I'll do to you if you don't keep your mouth shut", to: Raphael, action: ACT_put_shotgun_away}
{enum: Raphael, dialog: "Y-y-y-yes sir.", to: Daniel}
// @TODO allow AI to prefix out of character statemetns with [ooc], this is a well khnown thing on role playing forums so gpt would pick up on it.
// @TODO allow AI to prefix out of character statemetns with [ooc], this is a well khnown thing on role playing forums so gpt would pick up on it.
constchar*global_prompt=
constchar*global_prompt=
"You are a character in a simple western video game. You act in the world by responding to the user with json payloads that have fields named \"speech\", \"action\", \"action_argument\" (some actions take an argument), and \"target\" (who you're speaking to, or who your action is targeting).\n"
"You are a character in a simple western video game. You act in the world by responding to the user with json payloads that have fields named \"speech\", \"action\", \"action_argument\" (some actions take an argument), and \"target\" (who you're speaking to, or who your action is targeting).\n"
"You speak only when you have something to say, or are responding to somebody, and use short, concise, punchy language. If you're just overhearing what other people are saying, you only say something when absolutely compelled to do so.\n"
"You speak only when you have something to say, or are responding to somebody, and use short, concise, punchy language. If you're just overhearing what other people are saying, you only say something when absolutely compelled to do so"
"But if somebody talks directly to you, you usually say someting."
.sample_count=1,// bumping this back to 4 is troublesome for web, because there's a mismatch in sample counts. Perhaps we must upgrade to gles3, in doing so, we should upgrade to the newest sokol gfx.
.sample_count=4,
.width=800,
.width=800,
.height=600,
.height=600,
//.gl_force_gles2 = true, not sure why this was here in example, look into
//.gl_force_gles2 = true, not sure why this was here in example, look into
// Never expected such a stupid stuff from such a great director. If there is 0 stari can give that or -200 to this movie. Its worst to see and unnecessary loss of money
// Never expected such a stupid stuff from such a great director. If there is 0 stari can give that or -200 to this movie. Its worst to see and unnecessary loss of money
// dump a human understandable sentence description of what happened in this memory
// dump a human understandable sentence description of what happened in this memory
if(it->action_taken!=ACT_none)
if(it->action_taken!=ACT_none)
{
{
switch(it->action_taken)
if(it->action_taken ==ACT_join)
{
{
caseACT_none:
break;
caseACT_join:
AddFmt("%s joined %s\n",characters[it->context.author_npc_kind].name,characters[it->action_argument.targeting].name);
AddFmt("%s joined %s\n",characters[it->context.author_npc_kind].name,characters[it->action_argument.targeting].name);
break;
}
caseACT_leave:
elseif(it->action_taken==ACT_leave)
{
// Needs better handling of when you leave, because the person you were following died. Maybe entities don't die anymore?
AddFmt("%s left their party\n",characters[it->context.author_npc_kind].name);
AddFmt("%s left their party\n",characters[it->context.author_npc_kind].name);
break;
}
caseACT_aim_shotgun:
elseif(it->action_taken==ACT_aim_shotgun)
{
AddFmt("%s aimed their shotgun at %s\n",characters[it->context.author_npc_kind].name,characters[it->action_argument.targeting].name);
AddFmt("%s aimed their shotgun at %s\n",characters[it->context.author_npc_kind].name,characters[it->action_argument.targeting].name);
break;
}
caseACT_fire_shotgun:
elseif(it->action_taken==ACT_fire_shotgun)
{
AddFmt("%s fired their shotgun at %s, brutally murdering them.\n",characters[it->context.author_npc_kind].name,characters[it->action_argument.targeting].name);
AddFmt("%s fired their shotgun at %s, brutally murdering them.\n",characters[it->context.author_npc_kind].name,characters[it->action_argument.targeting].name);
break;
}
case ACT_put_shotgun_away:
else
AddFmt("%s holstered their shotgun, no longer threatening anybody\n",characters[it->context.author_npc_kind].name);