Player has a custom theme which looks completely different from Niko's, and it would look weird if Niko would be speaking in Player's theme.
Pinned
Activity
pjalsGit issue coppolaemilio/dialogic
Name label disappears after question
The problem
Describe the bug For some reason, when I make a question to a character with a custom theme, the name label of the next character disappears.
To Reproduce Steps to reproduce the behavior:
- Make a question
- Put a text event in the choice branch
- Play timeline
- See that name label disappears
Expected behavior For the name label not to disappear.
Screenshots
Niko's custom theme has "Hide name labels" off. Player's custom theme has "Hide name labels" on.
System (please complete the following information):
- OS: Fedora Linux 35
- Godot Version: 3.
- Dialogic Version: 2efa1a0
Solutions
Workaround
Disable name labels and act like it didn't happen.
Possible fixes
Not sure.
pjalsGit issue coppolaemilio/dialogic
Very short typing sound effects don't stop playing
The problem
When I try to set the typing sound effect to a very short one, it keeps looping and never stops.
Even if I go to another tab, it continues.
To Reproduce Steps to reproduce the behavior:
- Go to the theme editor
- Go to audio tab
- Set a very short audio file
- See that it keeps looping, instead of stopping when dialog stops
Expected behavior The looping should stop as soon as the dialog stops.
Screenshots
This is the audio file I'm using: https://envs.sh/EyA.wav It's around 00.06 seconds long, bitrate: 722 kb/s.
System (please complete the following information):
- OS: Fedora Linux 35
- Godot Version: 3.3.3.stable
- Dialogic Version: 1.4.1
Solutions
Workaround
None yet.
Possible fixes
Not sure.
pjalsGit issue comment coppolaemilio/dialogic
Very short typing sound effects don't stop playing
The problem
When I try to set the typing sound effect to a very short one, it keeps looping and never stops.
Even if I go to another tab, it continues.
To Reproduce Steps to reproduce the behavior:
- Go to the theme editor
- Go to audio tab
- Set a very short audio file
- See that it keeps looping, instead of stopping when dialog stops
Expected behavior The looping should stop as soon as the dialog stops.
Screenshots
This is the audio file I'm using: https://envs.sh/EyA.wav It's around 00.06 seconds long, bitrate: 722 kb/s.
System (please complete the following information):
- OS: Fedora Linux 35
- Godot Version: 3.3.3.stable
- Dialogic Version: 1.4.1
Solutions
Workaround
None yet.
Possible fixes
Not sure.
For some reason, Godot automatically put looping on, thank you!
pjalsGit issue coppolaemilio/dialogic
Very short typing sound effects don't stop playing
The problem
When I try to set the typing sound effect to a very short one, it keeps looping and never stops.
Even if I go to another tab, it continues.
To Reproduce Steps to reproduce the behavior:
- Go to the theme editor
- Go to audio tab
- Set a very short audio file
- See that it keeps looping, instead of stopping when dialog stops
Expected behavior The looping should stop as soon as the dialog stops.
Screenshots
This is the audio file I'm using: https://envs.sh/EyA.wav It's around 00.06 seconds long, bitrate: 722 kb/s.
System (please complete the following information):
- OS: Linux
- Godot Version: 3.3.3.stable
- Dialogic Version: 1.4.1
Solutions
Workaround
None yet.
Possible fixes
Not sure.
pjalsGit issue comment coppolaemilio/dialogic
Choice button styles not saving
The problem
Describe the bug The choice button background textures and text color reset every time I open Godot. It seems to only be the choice buttons that get affected by this.
To Reproduce Steps to reproduce the behavior:
- Go to Choice Buttons and change them.
- Close and open Godot.
- They reset to their default state. (for me, at least)
System (please complete the following information):
- OS: Windows 10
- Godot Version: 3.3.3
- Dialogic Version: 1.4
I also have this problem but with timelines, characters, themes, etc.
pjalsGit issue BrainJS/brain.js
Add Deno support
Summary
This probably would take way too much time, but Deno is a simple, modern and secure runtime for JavaScript, TypeScript, and WebAssembly that uses V8 and is built in Rust and I would like that brain.js would be ported to Deno without a CDN and compatibility mode.
Basic example
import brain from 'https://deno.land/x/brainjs/mod.[ts/js]'
// provide optional config object (or undefined). Defaults shown.
const config = {
binaryThresh: 0.5,
hiddenLayers: [3], // array of ints for the sizes of the hidden layers in the network
activation: 'sigmoid', // supported activation types: ['sigmoid', 'relu', 'leaky-relu', 'tanh'],
leakyReluAlpha: 0.01, // supported for activation type 'leaky-relu'
};
// create a simple feed forward neural network with backpropagation
const net = new brain.NeuralNetwork(config);
net.train([
{ input: [0, 0], output: [0] },
{ input: [0, 1], output: [1] },
{ input: [1, 0], output: [1] },
{ input: [1, 1], output: [0] },
]);
const output = net.run([1, 0]); // [0.987]
Motivation
To add support for Deno so developers that use Deno can use this library easier.
pjalsGit issue TypeScriptToLua/TypeScriptToLua
Transpile _delete to delete
TSTL should transpile _delete to delete because Lua supports having table keys and variables that are named "delete".
For example:
// _G.d.ts
declare namespace fs {
...
export function delete(path: string): void;
...
}
will error in JavaScript, but with this feature, you can replace delete with _delete like:
declare namespace fs {
...
export function _delete(path: string): void;
...
}
Sorry if this is already implemented, it isn't mentioned in the docs.
pjalsGit issue comment TypeScriptToLua/TypeScriptToLua
Transpile _delete to delete
TSTL should transpile _delete to delete because Lua supports having table keys and variables that are named "delete".
For example:
// _G.d.ts
declare namespace fs {
...
export function delete(path: string): void;
...
}
will error in JavaScript, but with this feature, you can replace delete with _delete like:
declare namespace fs {
...
export function _delete(path: string): void;
...
}
Sorry if this is already implemented, it isn't mentioned in the docs.
Apparently you can replace delete
with 'delete'
.
pjalsGit issue comment denoland/deno
Proposal: add `Deno.getUserFullName()`
This function allows you to view the GECOS or "Full/Display Name" of the account.
I'm not sure if it should be Deno.getUserFullName
, Deno.getUserGecos
or Deno.getUserDisplayName
It might be a long name so suggestions appreciated. I actually already did this in this snippet, but this should probably be better as a Deno built-in function:
const getFullName = async (username: string, fullNameDefaultUsername = false, passwdPath: PathLike = '/etc/passwd'): Promise<string | void> => {
if (Deno.build.os === 'windows') {
const fullNameProcess = await Deno.run({
cmd: ['wmic', 'useraccount', 'where', `name='${username}'`, 'get', 'fullname'],
stdout: 'piped'
});
if ((!fullName) && fullNameDefaultUsername) { fullName = username; }
return username
} else if (Deno.build.os === 'linux' || Deno.build.os === 'darwin') {
const decoder = new TextDecoder();
const file = await Deno.readFile(passwdPath);
const data = decoder.decode(file);
const passwdLines = data.split('\n');
passwdLines.shift();
for (const line of passwdLines) {
const parts = line.split(':');
if (parts[0] === username) {
return parts[4]
}
}
}
};
I hate this bot.
pjalsGit issue comment alacritty/alacritty
ANSI not working correctly
System
OS: Fedora 35 Version: alacritty 0.10.1 Protocol: Wayland DE/WM: Gnome TERM env var: alacritty
Screenshots
What am I doing?
I'm trying to print a colored character in Deno with ANSI (with await Deno.stderr.write(new TextEncoder().encode(`\x9B38;2;${r};${g};${b}m${char}`));
), but Alacritty and libvterm doesn't support it. GNOME Terminal, and VSCode does.
Replacing \x9b
with \x1b[
fixes it, Alacritty should support one-character CSI (\x9b
)
pjalsGit issue alacritty/alacritty
ANSI not working correctly
System
OS: Fedora 35 Version: alacritty 0.10.1 Protocol: Wayland DE/WM: Gnome
Screenshots
What am I doing?
I'm trying to print a colored character in Deno with ANSI (with await Deno.stderr.write(new TextEncoder().encode(`\x9B38;2;${r};${g};${b}m${char}`));
), but Alacritty and libvterm doesn't support it. GNOME Terminal, and VSCode does.
pjalsGit issue RayTracing/raytracing.github.io
[Book 1] Dielectric material is transparent black?
I have no idea how I caused this, first it was completely black, then it was transparent but not upside down and then it's transparent black?
My code is (slightly copied because i thought maybe i typed it wrong):
// material.h
class dielectric : public material {
public:
dielectric(double index_of_refraction) : ir(index_of_refraction) {}
bool scatter(const ray& r_in, const hit_record& rec, color& attenuation, ray& scattered)
const override {
attenuation = color(1.0, 1.0, 1.0);
double refraction_ratio = rec.front_face ? (1.0/ir) : ir;
vec3 unit_direction = unit_vector(r_in.direction());
double cos_theta = fmin(dot(-unit_direction, rec.normal), 1.0);
double sin_theta = sqrt(1.0 - cos_theta*cos_theta);
bool cannot_refract = refraction_ratio * sin_theta > 1.0;
vec3 direction;
if (cannot_refract || reflectance(cos_theta, refraction_ratio) > random_double())
direction = reflect(unit_direction, rec.normal);
else
direction = refract(unit_direction, rec.normal, refraction_ratio);
scattered = ray(rec.p, direction);
return true;
}
public:
double ir; // Index of Refraction
private:
static double reflectance(double cosine, double index) {
double r0 = (1 - index) / (1 + index);
r0 = r0 * r0;
return r0 + (1 - r0) * pow((1 - cosine), 5);
}
};
// main.cc
color ray_color(const ray& r, const hittable& world, int depth) {
hit_record rec;
if (depth <= 0)
return color(0, 0, 0);
if (world.hit(r, interval(0.001, infinity), rec)) {
ray scattered;
color attenuation;
if (rec.mat->scatter(r, rec, attenuation, scattered))
return attenuation * ray_color(scattered, world, depth - 1);
return color(0, 0, 0);
}
vec3 unit_direction = unit_vector(r.direction());
auto t = 0.5 * (unit_direction.y() + 1.0);
return (1.0 - t) * color(1.0, 1.0, 1.0) + t * color(0.5, 0.7, 1.0);
}
// ...
auto ground_material = make_shared<lambertian>(color(0.3, 0.7, 0.4));
auto center_material = make_shared<dielectric>(1.5);
auto left_material = make_shared<dielectric>(1.5);
auto right_material = make_shared<metal>(color(0.8, 0.8, 0.8), 0.8);
world.add(make_shared<sphere>(point3(0, -100.5, -1), 100, ground_material));
world.add(make_shared<sphere>(point3(0, 0, -1), 0.5, center_material));
world.add(make_shared<sphere>(point3(-1, 0, -1), 0.5, left_material));
world.add(make_shared<sphere>(point3(1, 0, -1), 0.5, right_material));
// vec3.h
inline vec3 refract(const vec3& uv, const vec3& n, double etai_over_etat) {
auto cos_theta = fmin(dot(-uv, n), 1.0);
vec3 r_out_perp = etai_over_etat * (uv + cos_theta*n);
vec3 r_out_parallel = -sqrt(fabs(1.0 - r_out_perp.length_squared())) * n;
return r_out_parallel + r_out_perp;
}
// sphere.h
bool hit(const ray& r, interval ray_t, hit_record& rec) const override {
vec3 oc = r.origin() - center;
auto a = r.direction().length_squared();
auto half_b = dot(oc, r.direction());
auto c = oc.length_squared() - radius * radius;
auto discriminant = half_b * half_b - a * c;
if (discriminant < 0) return false;
auto sqrtd = sqrt(discriminant);
// Find nearest root that lies in the acceptable range
auto root = (-half_b - sqrtd) / a;
if (!ray_t.contains(root)) {
root = (-half_b + sqrtd) / a;
if (!ray_t.contains(root)) return false;
}
rec.t = root;
rec.p = r.at(rec.t);
vec3 outward_normal = (rec.p - center) / radius;
rec.set_face_normal(r, outward_normal);
rec.normal = (rec.p - center) / radius;
rec.mat = mat;
return true;
}
Those are some places I could think of where this is happening.
pjalsGit issue comment RayTracing/raytracing.github.io
[Book 1] Dielectric material is transparent black?
I have no idea how I caused this, first it was completely black, then it was transparent but not upside down and then it's transparent black?
My code is (slightly copied because i thought maybe i typed it wrong):
// material.h
class dielectric : public material {
public:
dielectric(double index_of_refraction) : ir(index_of_refraction) {}
bool scatter(const ray& r_in, const hit_record& rec, color& attenuation, ray& scattered)
const override {
attenuation = color(1.0, 1.0, 1.0);
double refraction_ratio = rec.front_face ? (1.0/ir) : ir;
vec3 unit_direction = unit_vector(r_in.direction());
double cos_theta = fmin(dot(-unit_direction, rec.normal), 1.0);
double sin_theta = sqrt(1.0 - cos_theta*cos_theta);
bool cannot_refract = refraction_ratio * sin_theta > 1.0;
vec3 direction;
if (cannot_refract || reflectance(cos_theta, refraction_ratio) > random_double())
direction = reflect(unit_direction, rec.normal);
else
direction = refract(unit_direction, rec.normal, refraction_ratio);
scattered = ray(rec.p, direction);
return true;
}
public:
double ir; // Index of Refraction
private:
static double reflectance(double cosine, double index) {
double r0 = (1 - index) / (1 + index);
r0 = r0 * r0;
return r0 + (1 - r0) * pow((1 - cosine), 5);
}
};
// main.cc
color ray_color(const ray& r, const hittable& world, int depth) {
hit_record rec;
if (depth <= 0)
return color(0, 0, 0);
if (world.hit(r, interval(0.001, infinity), rec)) {
ray scattered;
color attenuation;
if (rec.mat->scatter(r, rec, attenuation, scattered))
return attenuation * ray_color(scattered, world, depth - 1);
return color(0, 0, 0);
}
vec3 unit_direction = unit_vector(r.direction());
auto t = 0.5 * (unit_direction.y() + 1.0);
return (1.0 - t) * color(1.0, 1.0, 1.0) + t * color(0.5, 0.7, 1.0);
}
// ...
auto ground_material = make_shared<lambertian>(color(0.3, 0.7, 0.4));
auto center_material = make_shared<dielectric>(1.5);
auto left_material = make_shared<dielectric>(1.5);
auto right_material = make_shared<metal>(color(0.8, 0.8, 0.8), 0.8);
world.add(make_shared<sphere>(point3(0, -100.5, -1), 100, ground_material));
world.add(make_shared<sphere>(point3(0, 0, -1), 0.5, center_material));
world.add(make_shared<sphere>(point3(-1, 0, -1), 0.5, left_material));
world.add(make_shared<sphere>(point3(1, 0, -1), 0.5, right_material));
// vec3.h
inline vec3 refract(const vec3& uv, const vec3& n, double etai_over_etat) {
auto cos_theta = fmin(dot(-uv, n), 1.0);
vec3 r_out_perp = etai_over_etat * (uv + cos_theta*n);
vec3 r_out_parallel = -sqrt(fabs(1.0 - r_out_perp.length_squared())) * n;
return r_out_parallel + r_out_perp;
}
// sphere.h
bool hit(const ray& r, interval ray_t, hit_record& rec) const override {
vec3 oc = r.origin() - center;
auto a = r.direction().length_squared();
auto half_b = dot(oc, r.direction());
auto c = oc.length_squared() - radius * radius;
auto discriminant = half_b * half_b - a * c;
if (discriminant < 0) return false;
auto sqrtd = sqrt(discriminant);
// Find nearest root that lies in the acceptable range
auto root = (-half_b - sqrtd) / a;
if (!ray_t.contains(root)) {
root = (-half_b + sqrtd) / a;
if (!ray_t.contains(root)) return false;
}
rec.t = root;
rec.p = r.at(rec.t);
vec3 outward_normal = (rec.p - center) / radius;
rec.set_face_normal(r, outward_normal);
rec.normal = (rec.p - center) / radius;
rec.mat = mat;
return true;
}
Those are some places I could think of where this is happening.
Fixed by commenting out rec.normal = ...
pjalsGit issue RayTracing/raytracing.github.io
[Book 1] Dielectric material is transparent black?
I have no idea how I caused this, first it was completely black, then it was transparent but not upside down and then it's transparent black?
My code is (slightly copied because i thought maybe i typed it wrong):
// material.h
class dielectric : public material {
public:
dielectric(double index_of_refraction) : ir(index_of_refraction) {}
bool scatter(const ray& r_in, const hit_record& rec, color& attenuation, ray& scattered)
const override {
attenuation = color(1.0, 1.0, 1.0);
double refraction_ratio = rec.front_face ? (1.0/ir) : ir;
vec3 unit_direction = unit_vector(r_in.direction());
double cos_theta = fmin(dot(-unit_direction, rec.normal), 1.0);
double sin_theta = sqrt(1.0 - cos_theta*cos_theta);
bool cannot_refract = refraction_ratio * sin_theta > 1.0;
vec3 direction;
if (cannot_refract || reflectance(cos_theta, refraction_ratio) > random_double())
direction = reflect(unit_direction, rec.normal);
else
direction = refract(unit_direction, rec.normal, refraction_ratio);
scattered = ray(rec.p, direction);
return true;
}
public:
double ir; // Index of Refraction
private:
static double reflectance(double cosine, double index) {
double r0 = (1 - index) / (1 + index);
r0 = r0 * r0;
return r0 + (1 - r0) * pow((1 - cosine), 5);
}
};
// main.cc
color ray_color(const ray& r, const hittable& world, int depth) {
hit_record rec;
if (depth <= 0)
return color(0, 0, 0);
if (world.hit(r, interval(0.001, infinity), rec)) {
ray scattered;
color attenuation;
if (rec.mat->scatter(r, rec, attenuation, scattered))
return attenuation * ray_color(scattered, world, depth - 1);
return color(0, 0, 0);
}
vec3 unit_direction = unit_vector(r.direction());
auto t = 0.5 * (unit_direction.y() + 1.0);
return (1.0 - t) * color(1.0, 1.0, 1.0) + t * color(0.5, 0.7, 1.0);
}
Those are the two places I could think of where this is happening.
pjalsGit issue RayTracing/raytracing.github.io
Lambertian material erroring with "member access into incomplete type ..."
For some reason the Lambertian material is erroring with member access into incomplete type 'const hit_record'
, here is the code that is most relevant:
class lambertian : public material {
public:
lambertian(const color& a) : albedo(a) {}
bool scatter(const ray& r_in, const hit_record& rec, color& attenuation, ray& scattered)
const override {
auto scatter_direction = rec.normal + random_in_unit_sphere();
// error^
// Catch degenerate scatter direction
if (scatter_direction.near_zero())
scatter_direction = rec.normal
//error^
scattered = ray(rec.p, scatter_direction);
// no error here?^
attenuation = albedo;
return true;
}
public:
color albedo;
};
pjalsGit issue comment RayTracing/raytracing.github.io
Lambertian material erroring with "member access into incomplete type ..."
For some reason the Lambertian material is erroring with member access into incomplete type 'const hit_record'
, here is the code that is most relevant:
class lambertian : public material {
public:
lambertian(const color& a) : albedo(a) {}
bool scatter(const ray& r_in, const hit_record& rec, color& attenuation, ray& scattered)
const override {
auto scatter_direction = rec.normal + random_in_unit_sphere();
// error^
// Catch degenerate scatter direction
if (scatter_direction.near_zero())
scatter_direction = rec.normal
//error^
scattered = ray(rec.p, scatter_direction);
// no error here?^
attenuation = albedo;
return true;
}
public:
color albedo;
};
I see that this is not a bug, so I will close this.
Name label disappears after question
The problem
Describe the bug For some reason, when I make a question to a character with a custom theme, the name label of the next character disappears.
To Reproduce Steps to reproduce the behavior:
Expected behavior For the name label not to disappear.
Screenshots
https://user-images.githubusercontent.com/25231103/168756056-e5835b87-894f-4b98-99ea-0e9cf5fc0819.mp4
(yea i had some fun making the bug report)
Niko's custom theme has "Hide name labels" off. Player's custom theme has "Hide name labels" on.
System (please complete the following information):
Solutions
Workaround
Disable name labels and act like it didn't happen.
Possible fixes
Not sure.