- Schematics115 (#4421)
Fix hospital symbols * Update zh_cn.json (#4438)
Chinese translation update * Updating the PathFinding Heuristics. (#4442)
This PR updates the path finding heuristics to be more concise and much more efficient.
A* Background In A* (The path finding algorithm used by us) the next evaluated node is determined by its node-value, called the f-value. This f-value is composed out of two factors. The c-value, known as the cost. This is the cost it would take an entity to walk from the starting position of the path (usually the current position of the entity) to the node in question. And the second factor is the h-value, known as the heuristic. This value is an indication for the algorithm, and indicates how much it would cost an entity using the path to walk from the current node to a destination. Now if the h-value is not accurate a lot of nodes will have the same f-value and as such the algorithm has to consider a lot of them, if it wants to make progress. As such the correct heuristic is very important.
Current situation: To calculate the heuristic we currently use: -(startEndDist - destination.manhattanDistance(pos)) this heuristic is not very usable in a 3D world, since it produces a lot of the same f-values, making the system search more blocks then it needs to. Also using the manhattan distance causes the citizens to walk in L-Shaped routes. Not going actually the shortest route: which would be diagonally.
New situation: In the new situation we use the squared euclidian distance, which produces a much more accurate heuristic h-value across the board. Additionally this now actually causes the algorithm to produce pathing results which go diagonally.
Screenshots before: * Rework citizen entity handling, should avoid fake citizens. (#4439)
Rework citizen entity handling, should avoid fake citizens. * Showing error locations when placing supplyships.
- fix #4435
- Friendly fire (#4432)
Remove friendly fire Fix NPE Remove not necessary logging Avoid early disease * Moar fixes (#4429)
Fix stuck fisherman Fix baker losing res Fix pasting doesn't reregister blocks Fix baker not complaining about furnaces Fixes recipe loading (Recipes won't get missing on the server anymore) * Again fixes (#4428)
- fix rack placement #4423
- fix inventory handling
Fix citizen limit calculation (#4228) (#4426)
Fix citizen limit calculation (#4228)
- Schematics115 (#4419)
Fortress schematic fixes * Fix postbox shape, fix crusher crafting (#4409)
Fix postbox shape Fix crusher crafting on request Allow multiple supplycamps/ships styles Fix dman model Extend decoration block limit * Update zh_cn.json (#4401)
Fix chinese translation * Schematics115 (#4417)
Update and add building schematics * reset check to fix fuel issues * hotfix #4411 * Builder fixes (#4404)
This PR aims to improve some builder handling:
Always call the connectBlockToBuilding even if we already have it. This allows to re-register things if they failed earlier.
Some blocks like glasspains might get lost in an upgrade only because the new glasspane got a different blockstate. We should avoid this. * hotfix hospital recipe * hotfix raider crash * add loottable and recipe * Feature/hospital (#4396)
This adds some new mechanic to the game: Diseases
Citizens may now get certain diseases.
What kind of diseases and what they can be cured with can be configured in the config file. How often a citizen gets a disease can also be configured Certain jobs have an increased risk The more citizens a colony have the higher the risk is too. There is a random chance for citizens to heal miraculously There is now a hospital:
Healer worker heals citizens with illnesses For that he requests the cure items from the colony There is a random chance (depending on his level) to heal citizens without needing the cure Citizens with low HP < 2 hearts also go to the hospital to get healed Healer also heals players with low HP if the healer has nothing to do it will go visit the colony to find citizens with low HP closeby (40 blocks distance per building level). Changes proposed in this pull request: Adds diseases and healer Fix placement handler for barrackstower substitution blocks Fix University Research switching * hotfix inventory call from merge issue, fixing build * Inventoryutils issues (#4385)
Fixes a multitude of inventory issues, from dupes to lost stacks. Few cases of unhandled remainders, bugged comparisons etc.
These are all bugfixes for the current inventory utils, though I'll probably rework the class as whole aswell later, squishing it down to usecases and avoiding duplicate implementations/unused stuff * Raiders rework for 1.15 (#4393)
Originally this was to fix loading/unloading/counting issues with the raiders, but ended up reworking it a bit and creating a new event system which can be used for future colony events as well.
Whats new: We now have ColonyEvents, which are registered through a forge registry for them, so other mods can add events aswell. Colonyevents are managed through a new EventManager, which updates them and saves/reads them from nbt. Those events receive a regular tick from the colony,albeit pretty slow(each 500 ticks) to update their status and do whatever update logic they need to. Colony events can also register/unregister entities related to them and spawn temporary structures. For managing the structures the EventManager has an EventStructureManager. The structure manager allows spawning structures for a given event and takes a backup schematic of the surroindings. Once the event is removed(or was not loaded during colony load) the backup schematic is put back in place.
I've translated both the raider and pirate events over as colonyevents, which also allows us now to spawn multiple ones seperatly if we want to. Atm I've added that once a raid succeeds the biggest raid size it gets split up into an additional raid from another spawn pos.
Both raid events now keep track of their entities and respawn them if those were not actually killed(onDeath triggered), but removed by other means, e.g. minecraft itself removing it, this also includes chunk unloads. The respawn is limited to the previous position, or a max distance of the original spawn position, so that when the colony is still active, but the raiders happen to be unloaded it tries to place them a bit closer in a loaded chunk.
The PirateEvent now has a maximum amount of pirates it can have active, depending on the amount of spawners remaining(spawnercount * 2 +10). It also now spawns additional pirates,depending on shipsize, without a player beeing close to the spawners,... * exp fixes (#4390)
-raids drop exp -When guard is following you, gives you effect without particles -Fixed infinite loop when citizen earns too much exp too quickly * hotfix import * Fix rack/chest placement (#4384)
Fix rack placement * Hotfix damage and home happiness indicators beeing displayed incorrectly. (#4387) * fix loot of mobs (#4383)
- fixed loot tables
- Adds stacktraces to error-level issues. (#4375)
Adds stacktraces to error-level issues. Should help for stuff like the building is null issue. Also removed a case where we returned an existing colony on an attempt to create a new one, as followup logic is certainly aimed at a new colony and would corrupt the existing one. * Bump forge and structurize requirements (#4370)
- Bump forge and structurize requirements
Fix organization (#4360)
- Correct naming for Fortress
- Add universal placeholder (#4365)
Adds the universal placeholder block functionality Fix complete pasting out of colonies * hotfix, disable button if building level doesn't permit research * Fix/several (#4351)
Unregister event handlers properly Vastly improve jump pathfinding (for half and not full blocks) Improves scan tool issues Fix scaffolding use Fix rack placement Fix building hut rotation * All hut schematics updated for 1.15 as of today * Hotfix to avoid info loss on pathpoint * remove e * add loottable