13 votes

What programming/technical projects have you been working on?

This is a recurring post to discuss programming or other technical projects that we've been working on. Tell us about one of your recent projects, either at work or personal projects. What's interesting about it? Are you having trouble with anything?

12 comments

  1. [3]
    feanne
    Link
    I've just released a major update for my tiny cozy virtual pet sim game and I'm really pleased with what I've been able to learn and practice as a newbie gamedev while developing this! (Made with...

    I've just released a major update for my tiny cozy virtual pet sim game and I'm really pleased with what I've been able to learn and practice as a newbie gamedev while developing this! (Made with Godot using GDscript)

    • Observer pattern using signals and a signal bus
    • Saving and loading game data (including building in compatibility with save files from some previous game versions)
    • Mod support! So excited to try implementing this for the first time. My favorite games support mods and I'm happy to learn how to support them in my own games too.
    • Technical design-- specifically, implementing lighting effects that look nice without causing the game to lag on mobile (real lighting apparently uses a lot of processing power in Godot 3.5, so I'm using pseudo lighting)

    Overall, I still write garbage spaghetti code but it's just a tiny bit less garbage and a tiny bit less spaghetti now 😂

    7 votes
    1. [2]
      zoroa
      (edited )
      Link Parent
      Hell yeah, congrats on the milestone! It's been cool seeing the updates on your game. edit: Ignore me haha. Commented before I clicked through, and thought the lighting bullet point was a planned...

      Hell yeah, congrats on the milestone! It's been cool seeing the updates on your game.

      Technical design-- specifically, implementing lighting effects that look nice without causing the game to lag on mobile (real lighting apparently uses a lot of processing power in Godot 3.5, so I'm using pseudo lighting)

      What kind of lighting effects are you interested in adding? Would this just be sprite work to give the illusion of "brightness" to light emitting objects?

      Or is the goal to some form of dynamic lighting where cats and items are shaded different based on light sources on the screen?

      edit: Ignore me haha. Commented before I clicked through, and thought the lighting bullet point was a planned feature vs something you already did.

      2 votes
      1. feanne
        Link Parent
        Thanks so much! And happy to talk about the lighting hehe :D I'm actually planning to do a youtube tutorial on this, but in the meantime I have a quick tweet thread on it. But yes, sprites that...

        Thanks so much! And happy to talk about the lighting hehe :D I'm actually planning to do a youtube tutorial on this, but in the meantime I have a quick tweet thread on it.

        But yes, sprites that add brightness are a part of my pseudo lighting!

        Basically, I noticed that real lighting was causing my game to lag on mobile browser, and I also wasn't too happy with the how the lighting looked. It was a bit too intense sometimes, especially when multiple lights overlapped. I was also looking for a more "neutral" lighting effect where the light "punches a hole" in the darkness to show you the "true colors" of the scene, rather than just adding a brightness and color overlay. So my pseudo lighting is a combination of masks (using a shader script and Godot's "BackBufferCopy" node) and sprites with "add" and "mix" blend modes.

        2 votes
  2. [3]
    streblo
    Link
    I’ve fallen into a rabbit hole and have been making a hacked together isboxer equivalent for X11/gnome. It started when I realized someone had posted a patch to make wine work with Vanguard: Saga...

    I’ve fallen into a rabbit hole and have been making a hacked together isboxer equivalent for X11/gnome.

    It started when I realized someone had posted a patch to make wine work with Vanguard: Saga of Heroes which has been broken in wine since 2013 or so. I had been meaning to look into patching myself but never got around to it it as the issue was pretty straightforward, it was resolving paths to the dlls with extraneous '.'s in the path and they wouldn't load. Anyways, Vanguard now runs in a patched wine but then I quickly realized that since only about ~10 people are playing the emulator, mostly in eurotime, I'd need to multibox to relive most of the content and didn't feel like a) wrestling with isboxer in wine and b) paying for it.

    Thus I've written a key broadcaster in C using libxdotool, which I need to flesh out a D-Bus service for. That will be for communicating with a gnome shell extension I've partially written to do picture-in-picture style scaled views of the relevant windows with mouse click passthrough via my application for interacting with the windows. Gnome shell still has an embedded copy of clutter in it, which provides a low cost way to clone and scale window given an X window id.

    The picture-in-picture stuff makes multi-boxing easier to do with less screen real estate, particularly because Vanguard doesn't render at all in virtual desktop mode beyond a few predefined resolutions. Virtual desktop is required to keep windows in focus while minimized both in order to actually get key down events to windows not in focus via x test extension and because, without patching d3d9 (which I know can be done but I'd have no idea where to start) Vanguard is limited to ~10 fps when not in focus.

    Anyways, I haven't been working on it a lot, just a little here and there. Maybe I'll wrap it up before the fall hits but that's unlikely. I don’t think it’s something I could package, having an X11+Gnome dependency, but I might put the source out there when I’m done. Doing it correctly likely requires abstracting away compositor and DE dependencies. Key events you could probably do similar how hawck does by looking at /dev/uinput but I'm not sure how you'd do the window stuff in an agnostic way.

    5 votes
    1. [2]
      asymptotically
      Link Parent
      Cool! Do you run a new X server for each Vanguard instance? I tried something similar with RuneScape, but it was easy enough to embed the applet into my own application and send fake events to it,...

      Cool! Do you run a new X server for each Vanguard instance? I tried something similar with RuneScape, but it was easy enough to embed the applet into my own application and send fake events to it, so I didn't have to go very low level.

      1. streblo
        Link Parent
        Nope, just one X server. The program is really simple, it takes a list of window ids and treats the first as the host. I have a shell script that launches all the windows and logs them in for me,...

        Nope, just one X server. The program is really simple, it takes a list of window ids and treats the first as the host. I have a shell script that launches all the windows and logs them in for me, which also grabs the relevant window IDs and starts the broadcaster. The wine virtual desktop comes in handy again because we can search by desktop name, and then find the vanguard process in it's children. There's a loadable config where you can specify a list of keys to broadcast, but I should probably add a key to enable/disable as well.

        broadcast loop
            // set focus to host window
            XSelectInput(d, window_ids[0], KeyPressMask|KeyReleaseMask);
        
            while (1)
            {
                XEvent ev;
                XNextEvent(d, &ev);
                switch (ev.type)
                {
                    case KeyPress:
                    {
                        KeySym ks = XLookupKeysym(&ev.xkey, 0);
                        if (ks == XK_Alt_L) {
                            alt = true;
                        } else if (ks == XK_Shift_L || ks == XK_Shift_R) {
                            shift = true;
                        } else if (ks == XK_Control_L) {
                            ctrl = true;
                        } else if (keymap.find(ks) != keymap.end()) {
                            std::string out;
                            if (alt) {
                                out += alt_s;
                            }
                            if (shift) {
                                out += shift_s;
                            }
                            if (ctrl) {
                                out += ctrl_s;
                            }
                            out += keymap.at(ks);
                            for (std::size_t i = 1; i < window_ids.size(); i++) {
                                std::cout << "Sending " << out << " to " << window_ids[i] << std::endl;
                                xdo_send_keysequence_window(xdo, window_ids[i], out.c_str(), useconds_t(0));
                            }
                        }
                        break;
                    }
        
                    case KeyRelease:
                    {
                        KeySym ks = XLookupKeysym(&ev.xkey, 0);
                        if (alt && ks == XK_Alt_L) {
                            alt = false;
                        } else if (shift && (ks == XK_Shift_L || ks == XK_Shift_R)) {
                            shift = false;
                        } else if (ctrl && ks == XK_Control_L) {
                            ctrl = false;
                        }
                        break;
                    }
                    
                }
        
            }
        
        1 vote
  3. [3]
    ahq
    Link
    I'm building a new publicly-accessible matrix server, with community features on top of chat. The idea is to essentially have a FOSS alternative to Discord that can be indexed by search engines,...

    I'm building a new publicly-accessible matrix server, with community features on top of chat. The idea is to essentially have a FOSS alternative to Discord that can be indexed by search engines, self-hosted, federated etc. Here are a couple of links:

    Discord channels are of a distinct type, but Shpong channels can be toggled between forum and chat views. We have nested comment threads, topics and a bunch of other things.

    I'm running a couple of instances that federated with each other. Adding in some ActivityPub compatibility too.

    Obviously, heavy work in progress with lots to do until we can get to feature parity...

    3 votes
    1. [2]
      talklittle
      Link Parent
      This is quite neat and I can definitely appreciate how it addresses one of the common complaints about Discord: information isn't always easily searchable, and answers are lost while questions may...

      can be indexed by search engines

      This is quite neat and I can definitely appreciate how it addresses one of the common complaints about Discord: information isn't always easily searchable, and answers are lost while questions may be repeated again and again.

      Curious if there is a specific set of use cases—or existing communities—that would be an ideal fit for the project, that have been kept in mind while building the project? Publicly visible chat is useful for some, but certainly not all communities, so just curious if there are any ones that inspired this project. (I also assume the visibility is toggleable and not forced public, but there are already plenty of solutions for private chat so I'm ignoring that use case.)

      1 vote
      1. ahq
        Link Parent
        Ideal use case would be for FOSS projects primarily. I find it worrying that so many of them are already on discord or moving to discord. All the information there is forever closed off from the...

        Ideal use case would be for FOSS projects primarily. I find it worrying that so many of them are already on discord or moving to discord. All the information there is forever closed off from the web, hidden behind authentication.

        I also assume the visibility is toggleable and not forced public

        Yes, visibility is toggleable - with the option to have communities with full matrix encryption.

        2 votes
  4. UP8
    Link
    Bringing up a blog with the Pelican static site generator. I have a lot of projects like YOShInOn and three-sided cards that people are asking me about and I have to start writing it all up. I...

    Bringing up a blog with the Pelican static site generator. I have a lot of projects like YOShInOn and three-sided cards that people are asking me about and I have to start writing it all up.

    I made a stab at Hugo a few months back but switched to Pelican because it is important to me that I be able to do everything a technical blog might need to do and that means writing my own plugins and I’d rather do that in Python (and reuse stuff I have) as opposed to learning Go.

    3 votes
  5. Plik
    Link
    After a few random conversations online (here and Discord), and being inspired by BattleBit I decided to start learning Unity. I am doing the exact "wrong" thing and focusing on The Most Awesome...

    After a few random conversations online (here and Discord), and being inspired by BattleBit I decided to start learning Unity.

    I am doing the exact "wrong" thing and focusing on The Most Awesome Game Ever (TM) right off the bat. So far it has pretty fun, slow, but fun. It is surprising how easy Unity scripting is in C#,​ although guides, ​tutorials, Google, and ChatGPT have been misleading on some very simple topics.

    So far I have somewhat completed a first person controller with jetpack, and dash movement, which at this point will mostly simply require tweaking physics values and camera effects to make the feel....​Feel right.

    Playing with variable values got kinda boring, so I also started on a mech controller, which has been really fun. Not even close to finished though as I need to work on the joints and rotation limits for the arms. I am hoping for the finished product to have upper and lower arm actuators that allow for faster vertical and horizontal aiming, while allowing the arms to rotate to target the object the cursor is aimed at, but also start to rotate the mech torso after the arms have moved outside a certain angle limit (basically a copy of MWO). I also need to add auto zeroing so the weapons fire from the appropriate locations, but will adjust their firing angle to converge on the object the cursor is aimed at (since you can't have good mech combat with your bullets firing from the center of the screen).

    It's a huge project... But I am kinda ok spending years chipping away at it as a hobby.

    2 votes
  6. Aurimus
    Link
    This week I’ve decided to start working on my own TUI text editor. I’ve spent the week evaluating languages and TUI libraries and today I started working on a version using rust and ratatui. I...

    This week I’ve decided to start working on my own TUI text editor. I’ve spent the week evaluating languages and TUI libraries and today I started working on a version using rust and ratatui. I don’t know if this will be the final form, but it should be a fun project nonetheless

    1 vote