as much as it's pissing me off, i have to respect the Hex Casting dev's idea to base their canonically mind-breaking magic on vector algebra. It is giving me a headache in real life. Now that's immersion for you.
Anyway, I JUST WANT TO CAST FIREBALL LET ME CAST FIREBALL.
i fucking love multi track drifting magic systems . my armor is repairing itself with mana, my tools are empowered by the will of demons, im grappling around with souls and causing ginormous explosions with the energy of thought
For the last 2 or so weeks (as of first writing), I have been slowly chipping away at a large Hex Casting project; some of y'all might remember this project, World Slate. As a quick summary, a spell circle gets "ambit" (or the area it can cast) by the smallest cube formed in its bounds. Like this one below will start up and end safely because it only needs to scan for possible routes; however, it doesn't check if the possible routes are runnable.
This post is not about cursed spell circle tech exactly, though. If y'all want to learn more about spell circle tech, my whole guide can be found here. Going back to the main topic, World Slate is the logical extreme of this, taking a spell circle, and scaling to the size of a whole minecraft world. Unfortunately, this is not the real full size minecraft world, but the whole world of HexxyTest (which has a world boarder of 10k to -10k).
Ok, but fine, what does World Slate look like? Well, its main "core" is quite small! Only ~6 blocks, it is just a Looper (a Spell Circle that never ends), a Hex on a pedestal, and a slate to clear the stack. The one in the middle is just my personal Teleportation System that uses Displace, which is free if the entity and vector is in the bounds of the Spell Circle.
The "scary" part of World Slate comes into play when you consider the scale. The small red arrow in the top is the main core of World Slate is, the small line at the top and left side are the ambit rods. Both rods extend out 20,000 blocks in the X and Z directions, placed down with mainly Hex and Sentinel Walking. What this totals to is that a single Spell Circle that has ambit on the Whole World, meaning an "Eye of Sauron" (A hex that can get true names at an instant) is not just a hypothetical, it could be running right now.
So, what were the main challenges of building this? Surprisingly? Building it was almost no problem, after making a quick hex to place the blocks down automatically, it was just spam clicking that. The main problems were with the Spell Circles themselves, or well, how they were implemented. That's right! Its Java time!
So one of the problems I think I covered in the old post was a Memory Leak of sorts Spell Circles had. TLDR: Spell Circles keep a list of vectors to "turn off" when the Spell Circle is finish (so slates can stop glowing and such), but this was a list, not a set. So it would keep adding the same vectors if the same slate got ran over. So my fix was to make that list a set (and keep track of how many slates have been "ran over" via a number)
Another problem was that Spell Circles stored Every slate they could run on. Meaning, for World Slate, it would need to keep ~40,000 Block Positions (or 120,000 integers) in a single block. So I made a quick tweak of it only storing the highest, and lowest, block positions (so it stored the corners, rather than everything). These 2 things are already large performance boosts! But, unfortunately, these are peanuts compared to the main problem. Chunk loading.
When a "copied" (IE: singleplayer with only Hex) World Slate was started up, it would load about 30,000-40,000 chunks when it was looking for Slate to run on. For some context, HexxyTest has ~30,000 chunks loaded at peak hours, with people having tons of chunk loads. So something had to be going strange and or wrong. After poking through the code for a bit, I found the singular problem line:
All this does is ask the Server Level what the block is at "herePos," but under the hood, Minecraft is loading a 14x14 (iirc) cube of chunks around that. Since, if you are loading chunks in most cases, it won't hurt to preload a few more. This is not most cases.
After banging my head on this problem, using a debugger to step through Every part of chunk loading, and getting slapped around silly by this for a week or 2, I found an odd thing, a method called "getChunkFuture." What this does is return an evaluable future that holds a single chunk's data. After poking around, I learned of a way to only load the blocks and as little chunks required.
What this chunk of code does is checks if it has already scanned this chunk, if so, uses the found one! If not, tries to get a future and runs it. While this is not perfect, it MASSIVELY increases chunk loading speed. What used to take ~10 seconds in that singleplayer world, took Two seconds. What used to crash the whole HexxyTest server? 10 seconds at peak hours. 10. Seconds.
Being perfectly honest, I have No Clue why that works; according to Chloe (who helped me test this) that method is used in World Gen only. But I couldn't find any errors or bugs with it in this case, and it has been working well on the HexxyTest server!
After fixing a few bugs, some made by me, some made by Hex (like forgetting the Slate Limit....)
Its ready to be merged into Hex! Right now, the HexxyTest server is using a modified build of Hex that uses this. And it is also sitting as a PR to the main Hex GH Repo too!
Overall, really quite proud of my self for making this whole World Slate system, and optimizing base Hex Casting Spell Circles too! Hopefully this encourages people to use Spell Circles, since they are fun, and extremely useful.
Now to work on my addon, Slate Works, and make Spell Circles even better...
Also, thank you for reaching the end! This is less of an essay, and more of an info-dump on stuff that I find really cool. Hope you enjoyed it too!
ultrakill marksman hex!
i saw a mod was adding coins so i had to make this lol
it's configured to deal 4 damage per coin bounce
it picks the coin ordering by distance, and attacks the closest living non-animal non-self entity to the last coin, or shoots off in a random direction if there isn't one
it uses complexhex to render the coins, hexal to make the particles, and hexcassettes to do the delays (and the coins are from createdeco)
this could theoretically deal up to 1040 damage (assuming no armor) with 26 coins, but any more than that would mishap