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?
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.
Is this the real sethbling?
Yep :)
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!
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!
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.
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.
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).
That sounds awesome, I hope to see a video at some point on it :o
Definitely.
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.
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:
std.log
and Safe/Fast optimization levels.ArrayList
. Some SoA structure might be better in practice, but I'm not bothering for now.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:
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.
handle = .null_handle
handle
is nullinfo.image_extent
handle
info.old_swapchain = handle
handle = .null_handle
and drop the frame.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?
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
andcimgui
; the wrapper package'sbuild.zig
runs thecimgui
generator (for the GLFW and Vulkan backends) and collects all the outputs into a cached directory. It builds a shared library forcimgui
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!
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.
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.
Oh yeah Kubernetes is abstraction hell as far as I am concerned. Also probably overkill for 80% of the places where it is used.
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!
Thanks. kubesearch has been helpful. I'm in Home Ops, but I'm not quite over the RTFM hump.
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:
busybox
container. Never leave home without it. Very useful for poking inside a cluster like testing traffic across namespaces.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.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!
Is this like a more widely available version of the merch messages that LTT created for their livestreams?
Exactly that!
I've been a bit stuck with the naming though, do you have any suggestions?
Maybe something that combines two obvious words for what it is? ShopShouts or MallMention?
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.
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.
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.
Working on switching over from Arch from Windows. The new Plasma desktop is great
What made you switch to Arch?
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.
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.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.
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.
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.
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!
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!
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?