Return

Thoughts about various things 2026-08-06

For the past few months I haven't gotten anything done. In part because I've been playing Realm of the Mad God a lot, in part because I feel like I'm dying (more than usual). The former is parly because of the latter though.

Last time I was working on projects seriously I was extremely demotivated by rendering AGAIN. It was all good when I was just drawing sprites, but now that I want to add lighting, it fell apart again. I need to render a shadow atlas and use that when rendering lights, which in theory isn't difficult, but almost none of it can be attached to the rest of my rendering process. I need multiple new shaders and buffers and everything, and I can't attach them to the existing renderer since I need a different number of textures than before.

So now I need to rework my renderer to support arbitrary amount of textures per object or something. I saw this coming because I knew there's certain things I can't do, I was just hoping it wouldn't be a problem until I want to "make the game look good" later in development. I already had an idea for how to remove this kind of restrictions from the renderer, the actual problem is that I'm on like 7 layers of burnout from trying to put graphics on the screen. I just want to make a game already.

I usually find AI to be very helpful in getting answers to this kind of questions, but even AI can't help with this one. When I try to dig into how to build a renderer, it always sounds so simple and inevitably has a "just sort the objects" part in there somewhere. But I've found that the key to good performance is to cache the data in the GPU as much as possible; to create an instance buffer and only update what's necessary when necessary. The problem then is that this prevents you from "just sorting it", you can't cross-sort between 2 buffers.

I also get the impression that an object having transparency is seen as an extreme edge case that's not properly accounted for, but I don't see how that can be the case. If I look into a direction that's behind walls in Scavgame, all the walls will turn semitransparent. I need to be able to toggle transparency of object in a frame-by-frame basis, and that becomes very awkward when that object is supposed to be in a static/cached instance buffer. I supposed I could have some kind of toggle that makes the object invisible, and then draw the same object a second time as a sortable semi-transparent object..? In the end I have to invent solutions from the ground up myself, this seems like a very fundamental part of rendering so isn't this something that the AI/tutorial should have given me techniques for? I've even gotten into "arguments" with AI because it doesn't understand what I'm saying when I talk about potential ways to solve these problems.

Servers

Adjacent to game development is the other struggle: servers. It has been my long-time dream to make an MMO, and playing RotMG has made me want to do it even more.

The actual latest programming endeavor was me trying to make an MMO. I had an unprecedented amount of motivation but it was all turned into ash when trying to wrangle io_uring on a Linux and IOCP on Windows to do the thing I need. This has to be at least 50% or more of the reason why I can't ever create anything bigger and cooler than the things I typically make. I get so frustrated with things that I lose interest in what I was doing and want to make my own operating system instead, or pivot into hardware design or something.

I can't use a debugger because there's none that can just be downloaded and run on this Windows 7 computer and MingW, and there's none that work on my Linux laptop because there's no useful debuggers on linux, I'd need to buy a Windows 11 computer and probably redo my codebase to not use nested functions (GCC-exclusive extension). I could have nested functions with all compilers if I made my own programming language, but that would create a separate source file and the debugger would show that instead of the file I actually edit. I can't make an IOCP server on this computer because Windows 7 doesn't support AcceptEx which is the only Accept function that can be attached to IOCP, so I can only make the server on my linux laptop or by creating some third server just to accept connections on Windows. I can't make the client on my Linux laptop because Linux has no fucking desktop API so I can't open a window and draw to it nor get clipboard text nor do a bunch of other things that seem obvious. SDL2 has some limitations so I need SDL3, but SDL3 isn't available on the repository so I need to manually download and compile it and install the 7000 different tools required to compile it.

I love programming, but I absolutely fucking hate computers and all this shit that I need to do in order to be able to program. I'm genuinely considering starting to do woodworking or somethng that doesn't involve a computer.

When I click TFF_Paint.exe on this computer, the program starts up and is ready INSTANTANEOUSLY. That's not much of an exaggeration: I cannot perceive any delay inbetween lifting the mouse button and the window opening.

If I open it on a Windows 11 computer, it has a very obvious delay. If I open it through Wine on Linux, it takes a whole second to start up. If I want to make a Linux native program then I need to make multiple programs (see above: no desktop API) and/or glue some massive SDL dependency to it. A lot of new software doesn't work on this computer and it occasionally crashes due to some hardware failing, but even despite that, everything else looks like a downgrade to me. This computer is like lost technology that I don't want to let go of.

Anyway, everything started to go much better when out of frustration I designed a networking/IO API according to how I wish it would work, and then realized it would be viable to implement a backend for it with io_uring/IOCP. Here's how you can make a server with it:

struct Client {
	struct {
		int buffer_size;
		void* buffer;
	} in;
	struct {
		int buffer_size;
		void* buffer;
	} out;
	Socket socket;
	// Insert useful stuff here.
};

Client client_list [1024] = {0};
Iosystem iosystem = {0};

Client* new_client (void) {
	for (int i=0; i<countof(client_list); i++) {
		Client* client = client_list + i;
		if (!client->in.buffer) {
			*client = (Client){
				.in.buffer_size = 8192,
				.out.buffer_size = 8192,
				.in.buffer = malloc(8192),
				.out.buffer = malloc(8192),
			};
			return client;
		}
	}
	return NULL;
}
void release_client (Client* client) {
	if (client->in.buffer) {
		free(client->in.buffer);
		free(client->out.buffer);
	}
	*client = (Client){0};
}

void main () {
	iosystem_init(&iosystem, countof(client_list), countof(client_list), 1); // Maximum event counts for read, write, and listen. You'd need more if you were planning to do multiple of the same operation back-to-back (e.g. send data from multiple sources).
	
	Socket listen_socket = iosystem_listen(&iosystem, 8080);
	iosystem_add_event(&iosystem, IOTYPE_LISTEN, listen_socket, 0, NULL, NULL); // Listen events have no data buffer, and there's only 1 so no need for an ID (last argument).
	
	while (1) {
		Iosystem_event event;
		iosystem_get_completed_event(&iosystem, &event, 1000); // Last argument is timeout, use -1 for infinite.
		
		if (event.type == IOTYPE_ERROR) {
			break;
		}
		else if (event.type == IOTYPE_TIMEOUT) {
			continue;
		}
		else if (event.type == IOTYPE_LISTEN) {
			if (event.status != IOSTATUS_SUCCESS) {
				break;
			}
			Client* client = new_client();
			if (!client) {
				printf("No room for more clients!\n");
				iosystem_close_socket(event.accepted_socket);
			}
			else {
				printf("New client for socket %i\n", event.accepted_socket);
				client->socket = event.accepted_socket;
				iosystem_add_event(&iosystem, IOTYPE_READ, client->socket, client->in.buffer_size, client->in.buffer, client);
				// Keep listening for more connections.
				iosystem_add_event(&iosystem, IOTYPE_LISTEN, listen_socket, 0, NULL, NULL);
			}
		}
		else if (event.type == IOTYPE_READ) {
			Client* client = event.custom;
			if (event.status != IOSTATUS_SUCCESS) {
				iosystem_clear_events(&iosystem, client->socket);
				release_client(client);
			}
			else {
				printf("Received data: %.*s\n", event.bytes_completed, client->in.buffer);
				// Respond.
				int length = snprintf(client->out.buffer, client->out.buffer_size, "Thanks for the message [%.*s]!", event.bytes_completed, client->in.buffer);
				iosystem_add_event(&iosystem, IOTYPE_WRITE, client->socket, length, client->out.buffer, client);
				// Keep reading more.
				iosystem_add_event(&iosystem, IOTYPE_READ, client->socket, client->in.buffer_size, client->in.buffer, client);
			}
		}
		else if (event.type == IOTYPE_WRITE) {
			Client* client = event.custom;
			if (event.status != IOSTATUS_SUCCESS) {
				iosystem_clear_events(&iosystem, client->socket);
				release_client(client);
			}
			else {
				printf("Sent data: %.*s\n", event.bytes_completed, client->out.buffer);
			}
		}
	}
	
	iosystem_quit(&iosystem);
}

I made a chat program with this, and then a program for sharing files between my computers, I used to use a USB stick to transfer files between computers but I've been using that now.

I also started working on the MMO but... I was trying to make an MMO that cannot be datamined, so the client has no data about the game at all, and it would be loaded dynamically as you explore the world. That turned out to be too complicated since I have no experience making multiplayer games, I put too many stumbling blocks in front of me at the same time. I'll try to make something simpler when I get back to it.

Websockets

My ideal MMO would work on the web browser. The ability to just go to a website lowers the barrier of entry immensely, people can link to it from anywhere and curious users only need 1 click to try it out.

Websockets are another layer of cancer on top of networking. The protocol has a bunch of nonsense on it like the fact that messages may be "masked", so you need to process the whole message with some XOR operation, and the fact that you arbitrarily need to do "ping pong" message exchanges, even in-between the chunks of other messages. You also need to implement a HTTP server because websockets need to be initialized through HTTP. And I'm pretty sure TLS (HTTPS) is mandatory, so you can't use websockets at all without cryprography algorithms.

Using websockets doesn't seem difficult, there's just a ton of pointless complexity that complicates an already complicated and tedious process. But that's not all, an even bigger problem is building the rest of the game for web browsers. Browsers are very inconsistent, WebGL is very limited compared to even OpenGL, WASM is self-contained and can't actually interact with anything that's on the browser so you need to build some kind of translation API between JS/WebGL and WASM. I really don't want to make any complex games with javascript, nevermind complex rendering with the limitations of WebGL. Making a multiplayer game with Javascript may be harder than making it on WASM because it's very complicated to read binary data in Javascript, so you'd need serialization and deserialization for all the network messages or be forced into using a JSON-based message format.

The rendering might not be a problem because when I think of making an MMO, I'm thinking of RotMG, MapleStory, Habbo Hotel, Travian, Neopets... Could do something like that with just html canvas rendering. I'd like to make something like RotMG but I don't want to have to think about cheat protection for my first multiplayer game. I'm thinking something more like Runescape where the server controls player actions, that way there's no way to cheat and thus no need to have anti-cheat mechanics or rollbacks or anything like that. Just reject actions that are not allowed.

AI thoughts

I still find that the primary value of AI is as a search engine. I didn't know how much I had come to hate searching for stuff online until I was able to just get answers from AI. Now I only use search engines for images, getting me to wikipedia-style pages, looking for reviews of products, or verifying something that I really need to be sure is correct.

Using some operating system API or programming library is one of the most tedious and unfun parts of making programs, AI makes this part of programming MUCH easier than it was in the past. io_uring was insurmountably tediously complicated when I first looked into it, but turns out it's very simple when you know exactly what to do and don't have to re-create "cat" or do some stupid file I/O crap and then separately try to connect it to networking (this is what all online resources make you do). The server stuff above wouldn't have been possible if I wasn't able to ask AI to just give me a server example.

I don't like AI for actually producing my code though, it always does everything in a weird way that I don't like to look at, and I end up rewriting most of it. It's sometimes useful for getting the solution, even if I have to modify it. I can see how it would be appealing in many situations though, if you just want to get something done and don't care about programming or quality or have very particular preferences or vision, then it'll probably be great. I'm have very particular preferences myself so it doesn't work.

I can see AI being useful for code analysis. Sometimes you do things that work even if they're somewhat incorrect or flawed or have a much better solution, having AI automatically locate that stuff would be great. Problem is that this requires you to donate your codebase to the AI company, which I don't want to do. Maybe there will be an offline tool some day. Non-AI tools are focused on finding bugs, but not for telling you that you're doing something stupid or illogical or that there's a better algorithm for a thing.

AI is terrible for coming up with ideas, but it's ok for brainstorming. I ask ideas for X, it produces walls of text with 10 bullet point lists, and I get one or two useful ideas from them, neither of which are what the AI was actually saying.

What's useful is that having someone else talk about the subject exposes me angles of thinking that I didn't consider before. For example I was asking AI for ideas how to make MMO skills less singleplayer-y, it said something about root specialists who remove tree roots so new trees can grow, which sounds stupid and forced and tedious, but I hadn't considered roots of trees as being harvestable resources. The idea that the whole tree needs to be removed in parts before a new one grows is interesting since it makes solo woodcutting more tedious (unless you want every material from the tree), but that's not something the AI came up with, it's what I originally gave the AI as an example (specifically that felling, branch removal, and cutting the trunk are separate steps).

The ideas that AI comes up with are terrible and juvenile. It usually starts out reasonable but then very quickly starts veering into stupid crap like "astral starweave fabric" and "ancient magecraft roots", things that are neither good nor useful nor creative nor immersive.

New computer

I've been playing RotMG on my Linux laptop since it doesn't work on Windows 7, however even a game like that runs poorly on the laptop. I want to play it (and other games that don't work on Windows 7) with a higher resolution and framerate, I never thought a pixelated 2D game would be the straw that breaks the camel's back and makes me buy a new computer. The fact that I feel like I'm dying played a part too though, I figured that I shouldn't just save money forever because maybe I'll never get to use it.

It's a huge pain to find a good monitor. My current desktop monitor is a 1440p 144hz monitor from Eizo, I've been very satisfied with it but Eizo no longer produces high refresh rate monitors. I could put this monitor on the new computer but then I can't use this computer anymore unless I use a really shitty monitor I have lying around. I wanted an upgrade in either refresh rate or resolution, and ended up getting a 144-160hz 4k monitor, I couldn't really find anything better than that because everything else is stupid hideous gamer shit for 12 year olds and covered in LGBT-lights.

I don't want OLED because I don't want a monitor that's designed to be consumable, but a lot of IPS monitors have been discontinued, and TN/VA panels tend to have worse colors and viewing angles. Colors are more important than refresh rate for me, IPS is notoriously bad at contrast which makes me waver between it and VA, but I had a VA monitor once and it had completely unacceptable colors, like I was seeing blocky green/yellow shapes in shadows when playing dark games. Maybe I just got a bad one though.

There's just no good options until microled becomes a thing in the year 2060. I was considering getting a very high refresh rate (500hz+) monitor but couldn't find one that wasn't 1080p and/or OLED and/or with poor colors, I'm very curious what it looks like. I heard there's 1000hz monitors coming up and I'm tempted to get one even if it's 1080p. I'm usually the opposite of interested in new technology, but this is probably the only exception because it's an actually useful thing that hasn't been possible before.

Anyway, the computer. I ended up with a small form factor high end computer. It's very very expensive (and I'm lamenting it here, not bragging about it), but I can't be bothered to wait just in case AI companies stop buying all the hardware, it seems like all hardware people are just raising prices for no reason since they smell gold in the water, or maybe other global reasons I won't rant about here are related. If I keep waiting for this to stop then I'll never have the computer I've been thinking of buying for years now. It also went up in price by about 150€ between when I first configured it and when I decided to buy it a few weeks later.

I may have gone overboard. For example I went with 64GB of RAM which is probably way too much and the worst possible time to buy it, but the computer is already so damn expensive that I'm like "why not just pay a bit more so I don't have to think about upgrading later". I was also biased towards 64 because this computer has 32 and I wanted everything to be upgraded. Plus maybe I'll want to make videos in the future, more about that below.

It will be my second ever desktop computer, I'm hoping it will last as long as this one has. I'll put Linux on it though so at least I shouldn't run into a "nothing works on this OS anymore" problems, I'll keep this one as a Windows 7 computer forever.

I don't think I've ever bought anything so expensive before now that I think about it, though I've never bought a car or a house. Hopefully it arrives, and in one piece. Should be around next week.

Streaming and content creation

Something I've been thinking about for many years is streaming. I don't even know where to begin with my thought about this, but the TL;DR is something like: despite being very introverted, I am a very socially motivated person, for example I lost interest in art as soon as I lost all communities to post art in. For many reasons I believe I would be more productive in a more social environment, and streaming could be a way to emulate that. And I couldn't just start refreshing websites and reading manga for 2 hours when I'm on stream.

I also suck at speaking because I speak so little in real life, I may go months without saying anything but "hi" "yeah" and "bye" a couple times per week, I want to have an excuse to just speak. I'm rather talkative as you may see from this blogpost, but I struggle to express even a tiny fraction of my thoughts through speech when the time comes for it.

Relatedly, sometimes I look for a video on youtube and can't find it. Most recently I was looking at some kind of beginner guides or introductions to RotMG, not because I need it, but just as a curiosity of what new people see, and the ones I found were TERRIBLE. I want to make a video like "What is Realm of the Mad God?" and try to explain what makes it cool and how to get into it, I think it would be very easy considering what videos are out there currently.

I don't have a microphone though, and I don't feel comfortable putting my voice (and even less face) on the modern datamining surveillance state internet in an age where every single government is becoming more and more tyrannical. I think I would be ok with voice only, maybe I could even use a voice changer, but the bigger problem is that my neighbors would probably hear me very easily. So either I want some kind of very expensive voice dampening setup, or to move to my own house. Houses are actually pretty cheap because nobody wants to live here and most of the houses are very very old, but I live in a country where the roads become unusable in the winter. I live within walking distance from where I work, I don't want to buy a car and riding a bicycle in 20 centimeters of slush every day in the winter would make my life a huge pain, so it's complicated as long as I have to go to work.

If I could figure out a way to make enough money to pay for electricity and food, I would probably just buy a crappy house with cash, some of the houses are just that cheap. That said, my plan for a long time has been to make and sell a game, and then figure all this stuff out when I have my own source of money. I'm struggling to make that happen due to combination of health problems and programming frustrations and lack of time and energy. If I didn't have to go to work I'd have more time to get things done. I was just starting to adjust to being free of work, and then my summer vacation ended, and as soon as I went to work I was slapped with a bunch of obnoxious cancer that made me want to quit on the spot. I did decide to quit this at the end of the year, but now I'm considering pushing that forward by a couple months.

It's a big circle, I need A to make B easier, I need C to make B easier, I need C to make A easier...