AbyssalCraft

AbyssalCraft

20M Downloads

How often are demon animals generating fire?

Divineaspect opened this issue ยท 9 comments

commented

I'm asking because they seem to create a lot of nether lag.

commented

In the nether they always generate fire, while there's about a 20% chance in the overworld (unless the fire spread has been disabled in the config). The fire mechanic in them could use a bit of improvement,
How about the chance of them burning in the nether is 50% for each separate entity (whereas the overworld ways remain the same). Alternatively, the fire spread chance could be configurable, if that suits you better.

commented

are they checking to see if they are already standing in fire?
If that's already a thing dialing it down to once every 20-60 ticks could help.
also there's the lighting updates the fire causes, maybe an alternate fire which isn't a light source?

commented

BTW this is the same issue as #63

commented

It appears that some of the code for generating the fire is pretty makeshift (wrote it several years ago, and didn't bother to implement performance tweaks at that time).
I'll toss in that check, then perhaps even set a timer for how long they can spread the fire (so that they set the ground on fire for n ticks, then have a cooldown for m ticks where fire spreading stops). Could easily be controlled so that the timer only runs if said entity is set to spread fire.
As much as adding a new fire block that doesn't emit light would deal with lightning updates, I'd like to avoid adding new fire blocks (I'll have to dig into Forge's custom block model JSON format, might be something there allowing me to bypass adding 92 JSON files for handling the fire block model). If I find a simple way of rendering a fire block like the vanilla one, then I'll do that right away.

commented

how similar is the shoggoth ooze transformation in code? as I'm now noticing heavy lag when they get to new terrain.

commented

That code is a lot different. It has 3 conditions that needs to be met before the block is placed (4 if you count the master config for ooze spread):

  1. The block's material can't be liquid nor air, the block can't have a tile entity, the block is opaque, is a full cube and has a bounding box.
  2. It compares the block's material to the materials that can be blacklisted (if said material is indeed blacklisted, it will not replace the block). This is determined by the config options in the Shoggoth Ooze config category.
  3. Checks if the block isn't in the block blacklist (this is a separate blacklist used for specific blocks that shouldn't be converted, the ooze block itself is part of this blacklist).

If any of those fail, the block won't be replaced by ooze.

commented

I was more wondering about the frequency of these checks.

commented

The checks run every tick. However, if you're experiencing lag with the Lesser Shoggoths, you should in theory also experience lag if you were to spawn 4 Snow Golems and let them wander about (since the frequency of block replacement is the same for both, except that adult Lesser Shoggoths spread the ooze on 4 blocks at a time).

commented

I've added a mimic fire block (behaves like regular fire, except it has a lifespan of 6 seconds, and can't be sustained by any means).