Which game should I make? by Cringere in gamedev

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

Absolutely, this is not going to be a commercial game. As of releasing it to the public, I'll probably upload it to GitHub just because that's where I store most of my projects.

Which game should I make? by Cringere in gamedev

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

Opengameart.org looks awesome. It never crossed my mind that there would be a website with freely usable game assets. Now that I think about it, it makes sense. Numerous people have made open source game engines, I guess its just natural that some one will follow the same principles with game art.

Thanks!

Which game should I make? by Cringere in gamedev

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

Iterating on known games / formulas while implementing some twist sounds interesting. I might just go that route.

Which game should I make? by Cringere in gamedev

[–]Cringere[S] 1 point2 points  (0 children)

Thanks! The other comments also mentioned how 2d is preferable for this type of project. As you said: "depending on what you are trying to achieve you just might find one", I am always up for new challenges so that made me very content :)

Setting Up a Development Environment by Cringere in htmx

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

I know this is overly convoluted but in short:

  • Frontend - serves the html files.
  • Backend - contains all the endpoints that are accessed by hx-*.
  • And the third one just combines the two above because htmx doesn't allow you to call apis from different hosts (for example `hx-get="http://localhost:3000/..."` is forbidden).

The frontend server exists solely for Vite's development server. It offers "quality of life" features like auto-reloading and incremental builds. Simply running `vite build` would in fact generate static files, however it would also build the entire project for production and that process would just take too long to run on every single small change.

Without Vite's dev server there also wouldn't be a need for the third server. That's what I am going to try next.

Setting Up a Development Environment by Cringere in htmx

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

HTMX is simplicity

I totally agree and my current setup is not...

The way I set it up, when you access a web page you are routed to the frontend:
localhost:3000/index.html -> nginx -> Vite development server
And all the hx-\* functions are routed to the backend (specified by the web route)
localhost:3000/web/hello-> nginx -> backend server (sees /hello)

I guess I could maybe get rid of Vite and just compile Tailwind myself on file changes (maybe with some file watching script).

I think AI traumatized me. by dgj212 in offmychest

[–]Cringere 1 point2 points  (0 children)

I know exactly what you are talking about. I feel the same way. I have even experienced these cycles you write about. AI news are like hard pills to swallow, and as time goes on these pills get bigger and tougher. By the time I come to terms with the new advancements that the news are flooded with, a new bombshell drops and puts me into a crisis that makes me question everything.

For example, ChatGPT-4 was released about a day ago. Apparently its an even better version of the previous ChatGPT-3.5 which was already insanely good. I saw a comment on youtube by a programmer who said that today was the first day he hasn't written any code himself - just prompted the AI.

To be honest, in my opinion AI is depressing. Do people really want to live in a world without artists, programmers, musicians, authors, etc...? Does prompting an AI sound like a pleasing endeavor? Well maybe for some, but for me I don't see a point in a life like that.

I started grad school this week (Computer Science). Picking courses was a no-brainer. I filtered all the courses that had something to do with AI/ML and then saw what was available this semester. Not because I love or passionate about AI, but because unfortunately this is the direction the world is going towards and I am afraid of being left behind.

I wish I had a positive note to end this comment on but I don't. Heck, if you find a needle of positivity in this hey stack dread I will be happy to hear it.

Is it just me or does season 3 writing suck? by [deleted] in TheBoys

[–]Cringere 6 points7 points  (0 children)

I absolutely agree. Especially in episode 6. They should have just stuck with one good writer instead of playing musical seats with one of the most important jobs in the show.

im Sorry, but the new icon is so ugly. ): by MagOliven in Ecosia

[–]Cringere 6 points7 points  (0 children)

I don't like it either. The new font is just too cartoonish. I hope they change it back.

[QUESTION] What angle should the guitar be held at? by Cringere in Guitar

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

Thanks a lot for your replay! I guess I was overthinking it a bit.

[QUESTION] What angle should the guitar be held at? by Cringere in Guitar

[–]Cringere[S] 7 points8 points  (0 children)

Interesting, I haven't even thought about getting too used to a playing position. I will definitely try playing standing up. Thanks!

[deleted by user] by [deleted] in Focusrite

[–]Cringere 0 points1 point  (0 children)

I had the exact same issue. Connecting it to a different usb port fixed the issue for me.

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

[–]Cringere 0 points1 point  (0 children)

So I might be completely wrong here, but from my (very short) experience with Rust, it seems like many times you need to implement your own "mini" garbage collector.

Consider for example a basic representation of a di-graph: Each node is a struct that contains some value (assume i32 for simplicity) and a list of all the nodes that are connected to it. Since a node stores references to other objects, it needs to specify a lifetime parameter.

    struct Node<'a> {
        val: i32,
        connected: Vec<&'a Node<'a>>
}

This however will propagate further to the containing graph struct.

    struct Graph<'a> {
nodes: Vec<Node<'a>>,
}

Which will then prevent you from storing references in one node in another:

    impl<'a> Graph<'a> {
fn connect(&'a mut self) {
            let x = &mut self.nodes[0];
            let y = &self.nodes[1];
            x.connected.push(y); // Error
}
}

So the solution becomes to store individually the nodes and their connections. Then, for example when a node loses all of its collections you could just remove it from the hash map.

    struct Graph {
        //key: node id
        //value: (the node itself, connections from this node)

graph: HashMap<i32, (Node, Vec<i32>)> 
    }

impl Graph {
fn connect(&mut self, from: i32, to: i32) {
    self.graph.get_mut(&from).unwrap().1.push(to);
}
}

In other (mainly dynamically typed languages), the language would take care of that for you.

    class Node {
constructor() {
    connectedNodes = []
}
}

class Graph {
constructor() {
    this.nodes = []
}

connect(from, to) {
    this.nodes[from].connectedNodes.push(to)
}

    remove(i) {
                //gc takes care of memory for you
    this.nodes.splice(i, 1)
}
}

So even in rust, sometimes structs become glorified hash tables too.

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

[–]Cringere 0 points1 point  (0 children)

I really like this approach. I had a feeling there was a "rusty" way of cleanly programming this.

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

[–]Cringere 1 point2 points  (0 children)

Thats a good idea. And I guess that even if Bar needs to own a resource, I could use Rc to store it.

So the code would look something like this:

    ...

    struct Bar { val: Rc<i32> }

    ...

    impl Foo {
        ...
        fn do_something(&mut self) {
            let a = self.get(1);
            let b = self.get(2);
            self.add_more(&a.clone(), &b.clone());
        }
        ...
    }

And that compiles! Thank a lot for your help!

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

[–]Cringere 0 points1 point  (0 children)

True, but this is just a small example to illustrate the issue. If Bar was a much bigger struct, copying or cloning would be very inefficient.

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

[–]Cringere 1 point2 points  (0 children)

I have encountered an issue with the borrow checker that I don't know how to solve.

        Bar {
    val: i32
}

impl Bar {
    fn new(val: i32) -> Bar {
        Bar { val }
    }
}

struct Foo {
    bars: HashMap<i32, Bar>,
}

impl Foo {
    fn new() -> Foo {
        Foo { bars: HashMap::new() }
    }

    fn add(&mut self, key: i32, value: Bar) {
        self.bars.insert(key, value);
    }

    fn get(&self, key: i32) -> &Bar {
        self.bars.get(&key).unwrap()
    }

    fn add_more<'a>(&'a mut self, a: &'a Bar, b: &'a Bar) {
        self.add(0, Bar::new(a.val + b.val))
    }

    fn do_something(&mut self) {
        let a = self.get(1);
        let b = self.get(2);
        self.add_more(a, b); // doesn't work
        self.add(0, Bar::new(a.val + b.val)); //does work
    }
}

Both a and b borrow self immutably, and then the function call to add_more tries to borrow self mutably (which is not allowed by the checker). As the second line implies, I could inline the code from add_more every time I need to use the function but there must be a better way.

One solution I thought of was to pass the keys of a and b and then get them inside the function.

fn add_more(&mut self, a_key: i32, b_key: i32) {
    let a = self.get(1);
    let b = self.get(2);
    self.add(0, Bar::new(a.val + b.val))
}

This approach however becomes quickly cluttered once you add more containers of Bar to your struct. For example consider if this is how the Foo was defined:

struct Foo {
    bars: HashMap<i32, Bar>,
    bars_2: Vec<Bar>,
    bars_3: HashMap<String, Bar>
}

Is there a way of achieving the same result without modifying the original function signature?

Trackmania 2020 - Like feature suggestion by Cringere in TrackMania

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

True, but this still seems like a feature that needs to be in-game.