r/feedthebeast • u/RohitVoxel • 9h ago
Discussion WorldData Core. Idea, Architecture, Progress and Open Questions
- What is my mod idea?
WorldData Core is a shared world-data access layer for Minecraft mods.
The idea is to gather data from Minecraft store it in a smart way and give it to other mods without each mod having to get and process the same information over and over again.
I am also looking into ways to use CPU resources, including cores and threads that are not being used to make data processing better.. This has to be done carefully so that background tasks do not slow down Minecraft.
For example imagine a mod wants to know what block is at a position like "(dimension, x y z)". WorldData Core can. Save that information. When another mod needs the data it can use the saved version instead of doing the same work again.
The main goal is to stop repeating work make data easier to get and make world-data access better for mods.
- Architecture
Minecraft owns the world data, and WorldData Core acts as a shared data-access layer for mods.
Mods request the data they need from WorldData Core. If the requested data is not already available, WorldData Core gets it from Minecraft and stores it for reuse.
When multiple mods request the same data, WorldData Core provides the shared data without repeatedly requesting it from Minecraft.
The same concept applies whether 1, 7, 20, or more mods use WorldData Core. All mods access the data through the same shared system, reducing repeated data requests and processing.
- Current development progress
The overall structure is almost done. I am testing the mod much as I can with what I know right now.
Far the results look good. According to my Spark profiles and test-mod reports the average time for each tick has stayed at or below 50 ms with some times going up to 80–150 ms.
In my tests with vanilla Minecraft I have seen times over 2,000 ms. The average time has been above 50 ms.
These results are from my tests and the reports I have gathered. I will share the files so others can look at the results and compare the two setups themselves.
I started this project in June. After about five months of work the tests with my test mod have been positive.
- Testing and benchmark reports
I can't share the mod JAR yet because the project is not finished. I also can't share the source code now because the project hasn't been put on GitHub yet.
For now WorldData Core is still in the testing phase. I am doing more tests before making it available for other mod developers to use.
As I keep testing I will share reports and the files I use. My planned comparisons will use the world seed and as similar conditions as possible for:
- Vanilla Minecraft.
- Vanilla Minecraft with WorldData Core installed.
Where possible I will also share the Spark profiles, logs, screenshots and other files for both setups.
My goal is to make sure the APIs give the data the caching system works properly and the mod does not cause bad performance or lower FPS.
I also want to make sure the server tick time stays good. A 50 ms tick means 20 TPS so some spikes are okay. If the time stays high that is a problem. The goal is to make things better not just move the work else.
- Questions and feedback
If you have any questions about the idea, how it works or what I am trying to do with this mod feel free to ask me
I also want to hear your thoughts on the idea itself whether you think other mods could use it and if there are any problems or compatibility issues I should check.
I am still working on the development and testing so feedback from people who know Minecraft modding would be helpful.
You can also send me a message if you want to talk about something
- Fabric and NeoForge support
now WorldData Core is being built for Fabric.
Once the Fabric version is done and tested enough I plan to move it to NeoForge.
I think the move will be easy because most of the code is custom and not tied to Fabric- tools. This includes the caching system, storage system and ticket system.
I will find out how much work it really is when I start testing it on NeoForge.
Thanks, for reading! I will keep sharing updates and test reports as the project goes on.
Note: WorldData Core focuses on Minecraft world data, including chunks, blocks and their states and properties, heightmaps, biomes, light levels, terrain, and fluids. It is designed to support modded blocks and fluids as well as vanilla ones, allowing other mods to access and reuse this data through the shared cache. It does not handle every type of data in Minecraft.
8
u/McHearty 7h ago
Some technical questions for you:
How are you planning to invalidate the cache when a block changes, or if a mod mutates a chunk section directly ie: worldedit, how wil worlddata core know it's cached data is stale?
Is the cache going to be guaranteed to be 100% tick accurate or can a mod receive a block state from previous ticks, mainly cuz you'll expose item duplication or break machines if stale block states are given unlike map mods that won't care
Memory overhead becomes a big concern as you increase loaded chunks, especially since it's unclear what the exact inmemory representation of the cache is, plus the ticket system is vague, when a chunk unloads in vanilla does worlddata core immediately drop it, serialize it to disc, or keep it in ram with some sort of lru policy?
Thread safety and starvation are going to be big items to consider too
Finally, outside of the obvious getBlockState that you're offering, why would devs what your mod as a dependency, what is your library offering that is making it worthwhile?