15 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?

35 comments

  1. [10]
    SethBling
    Link
    I'm writing a Minecraft mod that imports a Java rigid body physics engine and using that engine to create a 3-D version of Angry Birds in Minecraft. It's a server-side mod, so vanilla clients can...

    I'm writing a Minecraft mod that imports a Java rigid body physics engine and using that engine to create a 3-D version of Angry Birds in Minecraft. It's a server-side mod, so vanilla clients can connect and play.

    15 votes
    1. [5]
      brogeroni
      Link Parent
      Is this the real sethbling?

      Is this the real sethbling?

      3 votes
      1. [4]
        SethBling
        Link Parent
        Yep :)

        Yep :)

        3 votes
        1. [2]
          brogeroni
          Link Parent
          Very cool! Well, I'm sure you get this a lot but thanks for making those minecraft vids all these years ago. It was always awe inspiring to see what you made after coming home from school. You're...

          Very cool! Well, I'm sure you get this a lot but thanks for making those minecraft vids all these years ago. It was always awe inspiring to see what you made after coming home from school. You're a big reason why I got into software in the first place, and I guess I make a living off of it now. At the risk of restating the obvious, thanks again for inspiring the next generation of software people!

          3 votes
          1. SethBling
            Link Parent
            In a sense I was just trying to make a living myself, but I'm really grateful that I could do it in a way that would inspire others as well!

            In a sense I was just trying to make a living myself, but I'm really grateful that I could do it in a way that would inspire others as well!

            4 votes
        2. leaK_u
          Link Parent
          This is slightly off topic and I'm sorry about it, but you're the person I first heard about Reddit from and because of you I got hooked on it. It's very eerie seeing you on tildes years after I...

          This is slightly off topic and I'm sorry about it, but you're the person I first heard about Reddit from and because of you I got hooked on it. It's very eerie seeing you on tildes years after I put Reddit behind l haha.

    2. [2]
      TangibleLight
      Link Parent
      Is this an off-the-shelf engine or one you're writing just for this project? Curious how the details might or might not relate to the cbscript implementation.

      imports a Java rigid body physics engine

      Is this an off-the-shelf engine or one you're writing just for this project? Curious how the details might or might not relate to the cbscript implementation.

      2 votes
      1. SethBling
        Link Parent
        Off-the-shelf engine. I'm using the Java Monkey Engine which uses a Java port of the Bullet physics engine. It's an unrelated engine, but they behave pretty similarly (except the Java version can...

        Off-the-shelf engine. I'm using the Java Monkey Engine which uses a Java port of the Bullet physics engine. It's an unrelated engine, but they behave pretty similarly (except the Java version can handle hundreds of objects, more types of geometry and is much more physically stable).

        2 votes
    3. [2]
      Cyber
      Link Parent
      That sounds awesome, I hope to see a video at some point on it :o

      That sounds awesome, I hope to see a video at some point on it :o

  2. [3]
    TangibleLight
    Link
    Making my nth attempt at learning Vulkan on the side out of an interest in rendering engines. I've known OpenGL fairly well for many years now, but always frustrated by the state machine and heard...

    Making my nth attempt at learning Vulkan on the side out of an interest in rendering engines. I've known OpenGL fairly well for many years now, but always frustrated by the state machine and heard good things about Vulkan. All my prior attempts, being hobby projects, have failed somewhere in the swapchain and render pass setup. Why go through the trouble when OpenGL is right there?

    This attempt seems to be going better. These diagrams have been invaluable. Pieces are starting to fit into place and I feel I'm starting to grasp the big picture of things.

    Behold, my greatest achievement: a red box, produced with nothing but the Zig compiler and my bare hands. All written without reference, so I think I'm in good shape!

    Well, not nothing but the Zig compiler. The binding generator and dynamic loader Snektron/vulkan-zig. And GLFW C interface. Dynamically loading libraries and platform-specific windowing APIs are not really something I'm interested in dealing with, especially not for a hobby project.

    8 votes
    1. [2]
      TangibleLight
      (edited )
      Link Parent
      Back at my PC with a bit more time to talk about this. I say my greatest achievement is a red box, but this is obviously reductive. I think it is a very well behaved red box. Some things I'm...

      Back at my PC with a bit more time to talk about this.

      I say my greatest achievement is a red box, but this is obviously reductive. I think it is a very well behaved red box.

      Some things I'm trying to do correctly:

      • Smooth rendering while resizing the window
      • Triple buffering
      • Proper command pool management and single-shot command buffers
      • Validation layers and debug messages
        • Integrate with Zig std.log and Safe/Fast optimization levels.
        • Everything seems compliant, even while rebuilding the swapchain. This was not the case when I followed https://vulkan-tutorial.com/ or https://vkguide.dev/. Resizing the window interrupted rendering and/or caused various validation errors and/or deadlocked the program.
      • Input event bus
        • Zig tagged unions here are nice, instead of glfw's global callbacks.
        • Currently just an ArrayList. Some SoA structure might be better in practice, but I'm not bothering for now.
      • No leaking memory or Vulkan objects.
      On the event bus

      In my past projects I try to be "reactive" and handle events as they come with the GLFW callbacks. This always ends up a nightmare and severely limits my attempts at parallelization; all events originate from the main thread when glfwPollEvents or similar are called, so I'd end up building these little synchronized event buffers everywhere that caused issues. I'm hoping a global buffer will be fast and make handling events on appropriate threads possible.

      I've also thought about making a general event bus for application events. A big mmap ring buffer could be fast, but I'm not sure if this is a good idea or not. If I do want to pursue multithreading I'll need to handle thread communication one way or another. An event queue seems reasonable enough but I'm not sure how that shakes out in practice. What I've gathered from research online is that things tend to use a big global event buffer and that's it... this is surprising to me but I'm not sure.

      On the swapchain and bad tutorials.

      In past attempts at Vulkan, inspired by those tutorials, the swapchain has always been a nightmare, especially to smoothly handle window resizing. The guides I'd seen have this flow like:

      1. Acquire the next image
        • If it's out of date
          • rebuild the swapchain
          • rebuild sync primitives
          • acquire a new image
            • If that image is out of date, drop the frame.
          • record triple-buffered command buffers
      2. Submit command buffer
      3. Present the image
        • If it's out of date (it probably is)
          • rebuild the swapchain
          • rebuild sync primitives
          • acquire a new image
            • if that image is out of date (it probably is), drop the frame
          • record triple-buffered command buffers
      4. Poll events

      Steps "rebuild the swapchain" and "rebuild sync primitives" are doing a lot of heavy lifting here. If you don't do the sync primitives right, your program deadlocks or fails validation. There's all this state you need to manage about the current handle and the previous handle. Sync primitives get invalidated and confused with triple buffering. and and and.... in the past this is where I'd give up.

      My insight this time is: Just keep the create info around, and poll events at the top of the loop. State management and synchronization problems are gone.

      1. Poll events
        • If the framebuffer changed size, set handle = .null_handle
      2. If handle is null
        • Update info.image_extent
        • Rebuild the swapchain and set handle
        • Set info.old_swapchain = handle
      3. Acquire the next image
        • If that image is out of date (I don't think it can be)
          • Set handle = .null_handle and drop the frame.
      4. Reset triple-buffered command pool
      5. Record single-shot command buffers
      6. Submit commands
      7. Present the image
        • If that image is out of date (I don't think it can be)
          • Set handle = .null_handle and drop the frame.

      The resulting code is flatter. There's only a fraction of the state management (handle, info, images, and views). You never have to rebuild sync primitives. Triple buffering the command pools is easier. You can also maintain a "global" command pool that contains reused command buffers, but it's not required as in the guides. You never record a command buffer you don't end up submitting.

      If any Vulkan gurus are out there, I'm curious if you see any issues with this. Are there any references that get this stuff right?

      7 votes
      1. TangibleLight
        Link Parent
        Great success! I've gotten ImGui working here via cimgui. https://i.imgur.com/QV0gvUJ.png This has taught me a ton about the zig build system. I have an in-source wrapper package that pulls imgui...

        Great success! I've gotten ImGui working here via cimgui.

        https://i.imgur.com/QV0gvUJ.png

        This has taught me a ton about the zig build system. I have an in-source wrapper package that pulls imgui and cimgui; the wrapper package's build.zig runs the cimgui generator (for the GLFW and Vulkan backends) and collects all the outputs into a cached directory. It builds a shared library for cimgui and exposes a Zig module for a binding wrapper.

        From the main project, all I need to do is declare that in-source wrapper as a dependency, and add an import. This in-source package approach is new to me, but I like it!

        .dependencies = .{
          .cimgui = .{ .path = "cimgui" }
        }
        
        const dep = b.dependency("cimgui", .{});
        exe.root_module.add_import("cimgui", dep.module("zig-cimgui"));
        
        Linker hell

        Up to this point I've been trying to statically link everything, but doing this I encountered linker issues that I don't yet know how to work around. cimgui needs to link against GLFW to build the backend, but my app also needs to link against GLFW. Building cimgui as a static library causes some issue here.

        I was able to get things work by building cimgui as a shared library, but still statically linking to GLFW. I have a feeling this mixed linkage is going to bite me later on. But since it seems to be working okay, I'll leave it for now and revisit once I've had a bit of a break from fighting the build system.

        1 vote
  3. [5]
    NoobFace
    Link
    Working on a fully IAC/GitOps home kubernetes cluster. Never used kube before. Learning curve is asymptotic. Stuff is up, but the volume of abstractions is like swimming in air. It feels like I'm...

    Working on a fully IAC/GitOps home kubernetes cluster. Never used kube before. Learning curve is asymptotic.

    Stuff is up, but the volume of abstractions is like swimming in air. It feels like I'm flailing a touch.

    7 votes
    1. creesch
      Link Parent
      Oh yeah Kubernetes is abstraction hell as far as I am concerned. Also probably overkill for 80% of the places where it is used.

      Oh yeah Kubernetes is abstraction hell as far as I am concerned. Also probably overkill for 80% of the places where it is used.

      5 votes
    2. [2]
      bo0tzz
      Link Parent
      Maybe you've already found them, but both https://kubesearch.dev/ and the Home-Ops discord community are very helpful when you're finding your way in this!

      Maybe you've already found them, but both https://kubesearch.dev/ and the Home-Ops discord community are very helpful when you're finding your way in this!

      2 votes
      1. NoobFace
        Link Parent
        Thanks. kubesearch has been helpful. I'm in Home Ops, but I'm not quite over the RTFM hump.

        Thanks. kubesearch has been helpful. I'm in Home Ops, but I'm not quite over the RTFM hump.

        1 vote
    3. overbyte
      Link Parent
      Welcome to the club. I've been thrown into the fire building and maintaining production clusters for a few years now at my job with plenty of fancy bells and whistles (ArgoCD, Istio, injecting all...

      Welcome to the club. I've been thrown into the fire building and maintaining production clusters for a few years now at my job with plenty of fancy bells and whistles (ArgoCD, Istio, injecting all secrets and certs from Vault, a few random operators, multiple LBs routing traffic to different things inside the cluster) and I'm happy to say the learning curve never stops. Like wrangling a few hundred apps to route their traffic via Istio with full mTLS, talking to a mix of internal and external services will put plenty of hair on your chest.

      A few random things and unsolicited rambling from my own notes:

      • Pocket busybox container. Never leave home without it. Very useful for poking inside a cluster like testing traffic across namespaces.
      • Statefulsets roll in reverse cardinal order, extremely useful for things like a Consul cluster where the controller/master node needs to be restarted last for minimum headaches.
      • Single pods need to be scaled up or their PDBs temporarily removed during cluster upgrades so the upgrade process doesn't stall.
      • NetworkPolicies are one way, when you apply one you may need to apply the other direction as well. That was a fun few hours when standing up new services and making app pods connect to their databases (outside the cluster) via a DB pooler/proxy (inside the cluster). The Network Policy editor or at the very least a whiteboard was an absolute help figuring out how to get traffic somewhere.
      • We run IP masquerade on all our clusters so traffic shows up from the node IP range. Makes understanding things easy and simpler to lock down on top of all the other things.
      • Home clusters are somewhat annoying since load balancers like MetalLB and kube-vip behave ever so slightly differently compared to the real thing on cloud services.

      The longer I work with kube the more I'm hating how inflexible some Helm charts can be. Inflate the chart and kustomize the YAML barf is my current way. No, I don't want you to create a namespace, we declaratively set that somewhere else.

  4. [4]
    brogeroni
    Link
    I'm making a product to get shoutouts during a livestream (twitch, etc) when you buy merch from their shopify store while they're live. Just a prototype for now, but it'd be very appreciated if...

    I'm making a product to get shoutouts during a livestream (twitch, etc) when you buy merch from their shopify store while they're live.

    Just a prototype for now, but it'd be very appreciated if anyone here wants (or knows someone who wants) to test this!

    5 votes
    1. [3]
      Weldawadyathink
      Link Parent
      Is this like a more widely available version of the merch messages that LTT created for their livestreams?

      Is this like a more widely available version of the merch messages that LTT created for their livestreams?

      2 votes
      1. [2]
        brogeroni
        Link Parent
        Exactly that! I've been a bit stuck with the naming though, do you have any suggestions?

        Exactly that!

        I've been a bit stuck with the naming though, do you have any suggestions?

        1. ShroudedScribe
          Link Parent
          Maybe something that combines two obvious words for what it is? ShopShouts or MallMention?

          Maybe something that combines two obvious words for what it is? ShopShouts or MallMention?

  5. Sage
    Link
    I'm having fun with Astro/Vue for a personal project for a community I'm a part of. I chose Astro because I wanted to mess around with it for fun, and I already knew Vue somewhat. I have to say...

    I'm having fun with Astro/Vue for a personal project for a community I'm a part of. I chose Astro because I wanted to mess around with it for fun, and I already knew Vue somewhat. I have to say the CLI for Astro is absolutely fantastic and I have never had such a smoother experience getting everything set up.

    I've also been messing around with Tailwind and really trying to make things look "pretty", and while I didn't like Tailwind initially, I think once I understood it more I have grown to like it.

    All in all it's been a pretty successful and fun project so far with a lot of learning. I look forward to sharing it with the community it's for and to get their thoughts, but I need to polish a few more things.

    4 votes
  6. themagiulio
    Link
    I'm building a data visualization platform similar to Datawrapper as a portfolio project using Django, D3, Bootstrap and htmx. The webapp is supposed to work in the following way: upload the data,...

    I'm building a data visualization platform similar to Datawrapper as a portfolio project using Django, D3, Bootstrap and htmx. The webapp is supposed to work in the following way: upload the data, create the chart, customize the design and embed it into your website.

    4 votes
  7. Carrow
    (edited )
    Link
    The Bazarr devs responded to my PR, I needed to rebase the recent changes since it has been waiting a while and they had a good refactor suggestion. I'm not good with git so figuring out the...

    The Bazarr devs responded to my PR, I needed to rebase the recent changes since it has been waiting a while and they had a good refactor suggestion. I'm not good with git so figuring out the rebase was a headache. When I went to test, a dependency issue popped up, I'm not really sure how it happened. But I figured it out, a package was deprecated and the other package that absorbed its functionality was not updated in apt to include the deprecated libraries. So I had to force the venv to take pip and update the package in there. I had to dash before I could finish testing, I ought to finish that before I head out of town.

    4 votes
  8. [4]
    Delta0
    Link
    Working on switching over from Arch from Windows. The new Plasma desktop is great

    Working on switching over from Arch from Windows. The new Plasma desktop is great

    4 votes
    1. [3]
      PopeRigby
      Link Parent
      What made you switch to Arch?

      What made you switch to Arch?

      1 vote
      1. [2]
        Delta0
        Link Parent
        I've been trying several times for the last 2 years but the state of Wayland made my change back. But the recent thing was Windows Recall. It wasn't even about the privacy anymore. I realized...

        I've been trying several times for the last 2 years but the state of Wayland made my change back. But the recent thing was Windows Recall. It wasn't even about the privacy anymore. I realized Windows won't even invest in fixing their existing UI, settings experience, or be consistent with anything and chase dumb AI trends to make us into a better product.

        4 votes
        1. Cyber
          Link Parent
          In case its relevant for you or anyone else reading, the new git builds of vesktop work perfectly for screensharing in Discord on Wayland, even with audio.

          In case its relevant for you or anyone else reading, the new git builds of vesktop work perfectly for screensharing in Discord on Wayland, even with audio.

  9. lily
    Link
    Still working on my video game I posted here, like, a year ago (very slowly). I've been trying to get it working better on Wayland, specifically regarding display scaling - I'm having trouble...

    Still working on my video game I posted here, like, a year ago (very slowly). I've been trying to get it working better on Wayland, specifically regarding display scaling - I'm having trouble keeping a 1:1 pixel scale, since ignoring the DPI like that doesn't seem to be something you're supposed to do.

    4 votes
  10. skybrian
    Link
    My property-based testing library for JavaScript (Typescript) is coming along nicely. Still haven't gotten to shrinking yet, but I'm recording the picks made in each playout (which is what I'm...

    My property-based testing library for JavaScript (Typescript) is coming along nicely. Still haven't gotten to shrinking yet, but I'm recording the picks made in each playout (which is what I'm calling a test data generator run) in preparation.

    I also wrote a basic depth-first search that can iterate over all possible variations of an Arbitrary, instead of choosing randomly. This would be kind of absurd for most Arbitraries that have a huge number of possible variations, but it's nice for testing small examples.

    The entry point for the test runner is called repeatTest and I'm thinking of giving the library the same name. It's almost like using a while loop, and I might have it switch to iterating over all variations if the Arbitrary is small enough. There's little point in running a test a thousand times when there are only a hundred possibilities.

    3 votes
  11. caliper
    Link
    Rewriting a Kodi add-on. I was forced to switch to a different ISP a month ago, which meant we lost IPTV from the previous one. Instead of paying money to the new ISP for a similar subscription, I...

    Rewriting a Kodi add-on. I was forced to switch to a different ISP a month ago, which meant we lost IPTV from the previous one. Instead of paying money to the new ISP for a similar subscription, I wanted to do Kodi. I found an abandoned plugin for the new TV streaming service I picked, but it was no longer working.

    First thing I fixed was the EPG. I then started refactoring the plugin because a lot of it I wasn’t going to use. That led me to merge a bunch couple related plugins into one, which is already an improvement. Because this service also offers limited VOD, I’ve now been working on including those in the library and having scrapers add fancy info and images.

    This project has gotten way out of control, but it’s fun. I’d never written anything for Kodi and hadn’t even used it, so it’s been a steep learning curve. I hope to finish it this weekend or the next and publish it when it’s done.

    3 votes
  12. [3]
    RheingoldRiver
    Link
    Wrote a blog post trying to explain one-to-many relations in RDBs (inside of MediaWiki software). This is the kind of thing that (imo) once you know it, it becomes hard to comprehend not...

    Wrote a blog post trying to explain one-to-many relations in RDBs (inside of MediaWiki software). This is the kind of thing that (imo) once you know it, it becomes hard to comprehend not understanding it and as a result I found this post very hard to write, I spent a couple weeks on it & rewrote parts multiple times. I hope it came out okay!

    2 votes
    1. [2]
      jmpavlec
      Link Parent
      I read through most of it, it made sense to me and was well written! I already understood the concept but I think it would help a newbie. I was a bit surprised to see names were used for joins...

      I read through most of it, it made sense to me and was well written! I already understood the concept but I think it would help a newbie. I was a bit surprised to see names were used for joins rather than IDs. Is that typical of this DB language? I think a diagram or two after splitting the tables could also be helpful to drive the point home.

      Great writeup!

      1. RheingoldRiver
        Link Parent
        oh god don't even get me started on this db language lol. yes, actually every table has an automatic PK called _ID that has no relation to your data, just auto incrementing, and even if you know...

        Is that typical of this DB language?

        oh god don't even get me started on this db language lol. yes, actually every table has an automatic PK called _ID that has no relation to your data, just auto incrementing, and even if you know what you are doing & want to set your own PK this is not allowed. Also I believe the software-created PK is subject to change any time you update your data, it's useful really only in one very specific case which is both complex and esoteric and unless you're really curious I'll leave it to your imagination haha. So every time you do a join you're really just pretending that you're joining on a PK-FK relationship, and there's absolutely no reinforcement of consistency here either, so it's on you to ensure that if a PK is deleted from one table, the cascade deletes.

        All of this is done to make working with Cargo easier for complete newbies but it makes it soooooooo frustrating if you know what you are doing. I probably at some point need to write a post called "how to use cargo if you do know sql" talking about the differences/limitations haha

        thanks for the feedback!! I considered diagrams but I wasn't sure how best to draw it and I'm a pretty bad visual artist so I bailed. Do you have an example diagram in some other tutorial that I could emulate?

        1 vote