← All posts

Project archive

Getting the largest game data transfer into JSON

The most important thing is in the top left corner, and it's what I had to do to make the small “tojson: true” label appear. Why does it matter? It confirms that the largest data transfer in the game has taken place and been received correctly in a usable format. What's difficult about that? The engine has no ready-made tools that handle it correctly.

And that's the short version. The rabbit hole goes much deeper. Even if you receive the bytes, for example, you can't easily turn them into a useful logical structure. When the client tries to process a 3.5-megabyte block using nodes, it simply freezes completely. No surprise there: it has to run 3.5 million cycles of appending one character at a time to a string.

All of this also made it necessary to store the database data in compressed form; otherwise no database would be large enough. The data must be sent compressed and then decompressed. Our current 6,000 systems take up about 18 GB, compressed. Uncompressed, that would be about 45 GB. And we have not 6,000 systems, but 50,000: about 400 GB of uncompressed information on planetary surfaces. The larger each packet, the more traffic it generates and the longer it takes to reach the client, and so on.

It is probably worth mentioning the obvious: nodes cannot decompress the archive either. In short, every direction seemed to lead to a dead end, but the information still had to be transferred. Avatar images and other things also fall into this category. Small messages that were essentially text worked smoothly, but this is almost a different problem altogether. And the only apparent solution was to write components in C++, which would immediately move the project to compilation with Visual Studio. My experience with that has been difficult; I've tried it more than once. It's better to stay with Blueprints for as long as possible.

So what do we do? Write C++ plugins, but control them using nodes. That gives us the code and the flexibility. In short, I've become absorbed in making plugins, especially with AI helping. Since I gave away the ending at the start: it all works now, and it takes... fractions of a second. Anyone need plugins for Unreal Engine 5? )))

Project Facebook profile ↗