Automatia Update: Better Living Through Alchemy | RISC-V sandbox
Skip to main content<br>Player effects have arrived in Automatia! Buffs, potions, a new alchemy station, and many other things.
Player effects
Players can now have effects applied to them: buffs, debuffs, permanent (equipment) and temporary (flasks). Effects can stack. The system is open-ended in the underlying architecture, but limited in current implementation. Only a few things can be buffed, for example.
This opens the door to a lot of things later, but for now I'm using it for the simple stuff: extra speed, jumping, falling slower. All the basic things, so I didn't have implement anything new to test.
Potions
Potions are (currently) just data on top of the effect system, which let me spam potions:
I expect the list to grow. In order to debug it from the servers perspective, I had to keep F5'ing the dashboard to see my updated attributes, and then I eventually folded and added an effects sub-tab:
The alchemy station
I made a basic alchemy station to brew things in. It ended up fairly OK, but I do feel that I'm a bit over "small machines". I might convert it to a bigger machine eventually. For now, it's very mobile.
The graphics are temporary, as always. I recorded a test run here.
I also ended up migrating recipes in the engine out into JSON. They are now easily readable and editable for those who want to get spoiled. However, I will say that the recipes get shipped into the script and executed along with the "real" recipe API, so .. it's possible for me to implement hidden recipes that you won't be able to see without inspecting the ELF.
Two horror bugs
I fixed two horrendous bugs that were (thankfully) rare, and also so old they are probably from back in 2015, probably. Both are on the client-side. It turns out that when you teleport I had forgotten to clear a flag that should have been cleared on work sectors. If a sector was being generated async, arrived after the teleport cleared the GENERATED bit on sectors but forgot to clear GENERATING, the sector would enter a stuck state where it was unable to build scheduled objects. If those objects were large (and they often are), a big area around the player would be unable to progress and stay empty. The second bug has to do with the GUI, and it was just a blindspot. I am using NanoVG to draw things and NanoGUI for GUI widgets, and it turns out that (and of course I knew this) NanoGUI also uses NanoVG internally to draw things. So, things like measuring text and other commands needed to generate measurements needed by item rendering (among others) was using the same NanoVG instance, and that was simply not going to work well. It would trample something and crash in FMOD to maximally irritate me.
World tool
I also made a "world tool" Python script for maintenance of persisted worlds outside of the server. It can validate sectors and whole worlds, make precise edits and normalize hash tables.
I also made it accessible in a new Maintenance sub-tab in the Web UI. Note that maintenance of persisted files (obviously) requires an empty server.
You absolutely cannot access the Maintenance panel while people are on the server, or with loaded regions. It will predictably fail to exclusively lock the databases. Restart the server, close it, go to the panel and it will load.
Weighted OIT for transparent blocks
This is transparent glass using order-independent transparency (OIT). Instead of sorting, each transparent fragment contributes a weighted color and the result is resolved in a single pass. Block entities can also use transparent glass:
It's now easy to make diamond-shaped color class, for example:
NPC sequences & daily schedules
I've started experimenting with NPC sequences. Here is Beardy refilling the magic tank a bit every day for the paint machine:
Also, the magic fuel is now a rainbow plasma. Inside, Robin will replenish the stock of the store every working day.
Train travel
Travelling with trains is seamless across worlds now. I am continuing work on another station. People I've shown the train travelling to seem really impressed.
There is still a lot of things to do with the trains, but for now they serve their purpose to allow players to go between two wildly different places on a schedule.
A trend: World editing in-game
I've noticed a trend that I am making more and more blocks whose role is to maintain something for me in-game. The Pond block, NPC spawner and platform manager all let me program something that is painful to hand-write into JSON or script in C++. Instead I can fine-tune it in-game and the "admin" blocks are designed to hide (masquerade) themselves. I added an admin option to visualize admin blocks by strobing magenta:
The NPC spawner block in the picture above is managing 20+ hog NPCs:
And the pond block in the middle of the pond maintains its level:
While the other blinking block is keeping it froggy around there.
Next...