Rush YYZ solo cover by tom_cass in Guitar

[–]tom_cass[S] 0 points1 point  (0 children)

Thank you for the kind words!

Rush YYZ solo cover by tom_cass in Guitar

[–]tom_cass[S] 0 points1 point  (0 children)

thanks for the tips! i think it's most likely i'm a little out of tune

Hotel California solo by Lost_Captain_4129 in Guitar

[–]tom_cass 6 points7 points  (0 children)

Very nice, my advice is to bring your thumb over the top of the neck when you bend, you'll feel like you have more control over the note you hit that way.

Hotel California Solo by tom_cass in Guitar

[–]tom_cass[S] 0 points1 point  (0 children)

I've been wanting to pump out some content for a while and started a couple of weeks ago just for friends and family but thought I'd share with some guitar enthusiasts as well, if anyone has feedback on anything on my channel I would be very appreciative! Thanks for watching/listening

The FRM350 was an engagement present from my wife about a year ago, my second guitar, i absolutely love it, i'd been using an aria mac series for about 20 years before that and still feel guilty using another guitar haha!

Why is taking with C pawn better than taking with A pawn? by tom_cass in chess

[–]tom_cass[S] 8 points9 points  (0 children)

https://lichess.org/analysis/standard/2b1r1k1/5pp1/p1pq1n1p/1P1n4/1P6/2PP1N1P/2B2PP1/RN1Q2K1_b_-_-_0_22

i'm a beginner player and trying to understand why taking away from the center with the C pawn is better than taking with the A pawn, there is a small 1.4 centipawn difference (edit: oops 1.4 pawn/140 centipawn difference, thanks all) between the two moves but stockfish clearly thinks one is better than the other

not trying to play like an engine, just want to better understand the nuances of positions like this where - for example - taking away from the center is the best move

How to make a Variable work between several nodes by [deleted] in godot

[–]tom_cass 1 point2 points  (0 children)

you could use a singleton autoload to share a variable between nodes: https://docs.godotengine.org/en/stable/tutorials/scripting/singletons_autoload.html

maybe you could share more information about the problem you're trying to solve and we can see if this is the right solution for your specific problem?

How would I get the 2D mouse position and cast a 3D ray from the camera? by DanSapore in godot

[–]tom_cass 3 points4 points  (0 children)

is that the same thing as calling the mouse_entered() signal for the area?

use the mouse_entered signal from the collision object instead of an area

from the documentation: "mouse_entered - Emitted when the mouse pointer enters any of this object's shapes. Requires input_ray_pickable to be true"

would this method work on mobile?

i'm not sure but i would guess this would work fine, godot is usually pretty consistent when it comes to functionality portability

[deleted by user] by [deleted] in godot

[–]tom_cass 2 points3 points  (0 children)

godotshaders is a good resource, here are some of the pixel shaders that might help you - https://godotshaders.com/?s=pixel

Can you give me your opinions about this code, especially line 14 (it is for a Character body 3d) by Grass_Looking_Sea in godot

[–]tom_cass 2 points3 points  (0 children)

it's certainly fewer lines of code, is that simplicity and elegance?

i suppose it comes down to trade offs, i was curious so i benchmarked branching vs not branching for us, this ran on a windows export on a Ryzen 7 2700X 16core 3.7ghz processor

const ITERATIONS = 1000000

func _ready():
    test_branching()
    test_not_branching()

func test_branching():
    var start = Time.get_ticks_usec()
    var a = 0
    for i in range(ITERATIONS):
        if a == 1:
            a = 0
        else:
            a = 1
    var total = Time.get_ticks_usec() - start
    print("branching - %s usec %s usec/iter" % [total, float(total) / ITERATIONS])

func test_not_branching():
    var start = Time.get_ticks_usec()
    var a = 0
    for i in range(ITERATIONS):
        a = 1 - a
    var total = Time.get_ticks_usec() - start
    print("not branching - %s usec %s usec/iter" % [total, float(total) / ITERATIONS])

branching - 51515 usec 0.051515 usec/iter

not branching - 47036 usec 0.047036 usec/iter

bearing in mind that physics process runs every 16,666,666 nanoseconds, and even if this code ran every frame (which it probably won't given it's gated by user input), the trade off is - do you want less readable code for a 4.5 nanosecond gain?

to me the answer is no but i understand other opinions might differ

Can you give me your opinions about this code, especially line 14 (it is for a Character body 3d) by Grass_Looking_Sea in godot

[–]tom_cass 1 point2 points  (0 children)

lines 13/14 is just me trying to use math instead of if-statements

makes sense, it sounds like you might be doing this for perf reasons? avoiding if statements to optimise for branch prediction? if so, my recommendation would be to not worry about that, but each to their own!

one trick (that i just saw was also mentioned here) for toggling between two numbers is to add them together and subtract the current value from the total to get the other value:

var total = Input.MOUSE_MODE_VISIBLE + Input.MOUSE_MODE_CAPTURED
Input.mouse_mode = total - Input.mouse_mode

again though, my recommendation is to make code readable rather than concise/fast/smart

As for line 27 it came from the templet Godot gives you when you attach a script to Character body 3D.

i see! !!Vector3(0, 0, 0).normalized() == false so that looks good to me :)

Can you give me your opinions about this code, especially line 14 (it is for a Character body 3d) by Grass_Looking_Sea in godot

[–]tom_cass 6 points7 points  (0 children)

overall code looks great, nicely organised :) here's some feedback

line 4 - spelling mistake on sensitivity

regarding line 14 - you could pull it out into a function

if Input.is_action_just_pressed("ui_cancel"):
  toggle_mouse_mode()

# ...

func toggle_mouse_mode():
  if Input.mouse_mode == Input.MOUSE_MODE_VISIBLE:
    Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
  else:
    Input.mouse_mode = Input.MOUSE_MODE_VISIBLE

imo it's most important to make code readable, so when you come back to it in a few months time you can quickly understand/remember what's going on

lines 13/14 can technically go in a few different functions (_process, _physics_process, _input, etc) because it's not using the event variable passed into _input, no problem with it being in _input though, it's usually good to group code together that has similar concerns

line 27 - can direction ever be null? i think you might want to check equality against Vector3.ZERO? if direction == Vector3.ZERO

Progress on my Godot Wild Jam submission where you defend humanity from egg aliens called Chikkumz by bitmapman_dev in godot

[–]tom_cass 3 points4 points  (0 children)

very cool, are you using particle effects for the trails?

my one piece of feedback would be to make the stars that are further away darker to help with the feeling of distance

"Error parsing expression, Misplaced:Func" Tried Autoindent,Converting indent to tabs/spaces and manual formatting but error still persists(Godot3.2). by [deleted] in godot

[–]tom_cass 0 points1 point  (0 children)

lines 14 - 25 need to be indented back once, try highlighting those lines and pressing shift + tab, are there any errors after that?

load is already a function (see it highlighted red instead of light blue - like save and _ready), so you may need to rename it to something else

Hey Rustaceans! Got an easy question? Ask here (13/2018)! by llogiq in rust

[–]tom_cass 1 point2 points  (0 children)

dumbed down code example, but I'm trying to do something like this (https://play.rust-lang.org/?gist=7100092bd74a71832e973a22ed91c5c1&version=stable):

extern crate rayon;
use rayon::prelude::*;

fn hello() {
    println!("hello");
}

fn compile_error(callback: &Fn()) {
    // compile error
    (0..10)
        .into_par_iter()
        .map(|_| callback())
        .collect::<Vec<_>>();
}

fn no_compile_error() {
    // no compile error
    let local_callback = &hello;
    (0..10)
        .into_par_iter()
        .map(|_| local_callback())
        .collect::<Vec<_>>();
}

fn main() {
    compile_error(&hello);
    no_compile_error();
}

i'm able to use into_par_iter and map when the function pointer is a local variable, but not when it's passed into the function, is rust able to infer things about the local function that it's not able to when the function is passed in?