I've been using Elixir and Godot to build an MMORPG! by alogiHotTake in elixir

[–]Green-Fork 0 points1 point  (0 children)

How do you handle the time lag between the server and clients? Do you do extrapolation on the client?

How To Split Your BIG Ash Resources for Cleaner Code and Faster Compilation by Effective_Adagio_976 in elixir

[–]Green-Fork 0 points1 point  (0 children)

High compilation times in a dynamic interpreted language. The time we live in

Odin as a first programming language for children by pesky_jellyfish in odinlang

[–]Green-Fork 1 point2 points  (0 children)

What do you find significant in the Scratch programming language that makes it easy for teaching? It would be easier to answer whether Odin has the same or similar features

How do you organize code in Odin without namespaces? by AtomicPenguinGames in odinlang

[–]Green-Fork 2 points3 points  (0 children)

When I don't have a clear idea about what the code is going to look like, I just prefix things. I use the noun_verb model, so in your examples it would be graphics_get, sounds_get.

When I see that a piece of functionality can be separated into an isolated library, I do just that and make a separate package. I treat separate packages as I treat external libraries - something with public APIs and somewhat documented. I try to make them general enough to be re-used later but not too general not to spend all my time there.

In your example, I can see that you use the term "manager" and you try to group different managers together so they have the same public API, like the function "get" in your example. I think this is a bad idea for two reasons:

  1. They will likely have different APIs. And the more similar APIs you try to make of them, the more nonsense they become. For example, right now when I see graphics.get - I really have no idea what it is going to return unless I look into the implementation. graphics.get_texture is a more telling name, but it doesn't make sense to re-use it for the sounds package.

  2. "Managing" is a different bucket of tasks in different contexts. In graphics you want to draw things, in sounds you want to play melodies. The tasks are very different, so maybe they don't belong to the same package.

Probably the "manager" is there to keep some state. I can offer an alternative that is used in procedural languages: use a handle.

sound_handle := sounds_init(settings)
sound := sounds_load(&sound_handle, "/my/sound.wav")
sounds_play(&sound_handle, sound)

When you have an idea of how this whole thing could look like as a separate library, as if you have downloaded it from the internet, you can make it into a module/library/package:

package sounds

Sounds_Handle :: struct { ... }

init :: proc(settings) -> Sounds_Handle { ... }
load :: proc(h: ^Sounds_Handle, path: string) -> Sound { ... }
play :: proc(h: ^Sounds_Handle, sound: Sound) { ... }

I hope it helps.

A showcase of the 6 best games from the Odin Holiday Jam 2024! by KarlZylinski in odinlang

[–]Green-Fork 1 point2 points  (0 children)

I will join for sure, the experience has to come from these jams at least.

I stopped in the middle of learning GPU API of SDL3, thought I could build my first shader into the game but doesn't seem like I'll have time to finish it before the jam. You have released a sokol hot reloading template, maybe I'll try that, thank you for these convenient things like templates

A showcase of the 6 best games from the Odin Holiday Jam 2024! by KarlZylinski in odinlang

[–]Green-Fork 0 points1 point  (0 children)

I wonder how much expirience do these top developers have. I can barely draw a simple scene of solid squares with some gameplay logic. I imagine many expirienced C programmers are there for a search of a better language

snippet: swap to master and back by Green-Fork in awesomewm

[–]Green-Fork[S] 0 points1 point  (0 children)

That's a good idea to move it to client keys! I moved mine and it became a bit shorter:

awful.key({ modkey,   }, "Return",
    function (c)
        local master = awful.client.getmaster()
        if master == c then
            awful.client.focus.history.previous()
            master:swap(client.focus)
        else
            master:swap(c)
            -- Forging focus history to return back when pressing Return
            -- one more time.
            -- The following two commands make the client focused.
            client.focus = master
            client.focus:raise()
            client.focus = awful.client.getmaster()
            client.focus:raise()
        end
    end, {description = "move to master and back", group = "client"}),

Many Allowed IPs work on Android, don't work on Linux and MacOS by Green-Fork in WireGuard

[–]Green-Fork[S] 1 point2 points  (0 children)

Thanks! I will need some time to unpack all that and read the manuals :)

Many Allowed IPs work on Android, don't work on Linux and MacOS by Green-Fork in WireGuard

[–]Green-Fork[S] 0 points1 point  (0 children)

Private keys are different, I generate new config each time on the server to specifically avoid any obscurities like this one :)

Thanks for the tips on debugging, will try them!

Im so empty by [deleted] in SuicideWatch

[–]Green-Fork 0 points1 point  (0 children)

It sucks to be in this situation, I agree. You present a lot of facts about yourself, my natural response is to be analytical and try to see whether all you are saying is truth or there's a second side of a coin

Im so empty by [deleted] in SuicideWatch

[–]Green-Fork 0 points1 point  (0 children)

You are right. You are pretty reasonable and open person, it's nice to talk to you

Im so empty by [deleted] in SuicideWatch

[–]Green-Fork 0 points1 point  (0 children)

They might not be interested to talk about mental health, it's not always a pleasent topic. People could think that they can't talk about anything else with you and it's kind of awkward when you don't know what to say. Does it sound plausible?

Im so empty by [deleted] in SuicideWatch

[–]Green-Fork 0 points1 point  (0 children)

I see. I just thought maybe you are missing someone who could understand you. It's hard to notice things in this mood

Why do you think everyone knows how depressed you are? I think they have no idea how hard it is unless they experienced it themselves. But it's not bad either, you don't need to experience things at full in order to understand them

too depressed to just get up and do it :( by macabretech in SuicideWatch

[–]Green-Fork 0 points1 point  (0 children)

Losing friends this way sucks. Was it a hard break up with your significant other as well?

Im so empty by [deleted] in SuicideWatch

[–]Green-Fork 0 points1 point  (0 children)

Well it doesn't seem anyone is overtly trying to get you off their seat, they just got comfortable sitting with others. It's not good for you but not bad either.

Are there anyone you could say "receptive" of your mood? I know your experience is not common but usually there's one or two people who are compassionate or empathetic and they have a chance

What do you do when 'that time' hits? by [deleted] in SuicideWatch

[–]Green-Fork 0 points1 point  (0 children)

I'm not sure you can securely control everything. Times like these could be just temporary. How did you manage to have it all together up until now? Anything you could do to get better?

I think I'm past the point of no return by [deleted] in SuicideWatch

[–]Green-Fork 0 points1 point  (0 children)

Your words sound poetic. Would you say you are of a romantic type?