-
Notifications
You must be signed in to change notification settings - Fork 0
Hive Mind Social System
| System Parameter | Value |
|---|---|
| Core Class | net.dasik.social.core.GlobalSocialSystem |
| Registry Class | net.dasik.social.core.SocialRegistry |
| Pulse Frequency |
1 tick (Highlander Rule) |
| Lookup Time Complexity |
|
| Memory Cleanup Strategy | Automatic isAlive() & isRemoved() purging |
The Hive Mind Social System is the central pulse engine of Dasik Library. Rather than having hundreds of social entities each executing separate heavy spatial queries every tick, Dasik Library uses a single global pulse coordinator (GlobalSocialSystem).
GlobalSocialSystem enforces that only one global pulse cycle runs per server game tick (GlobalSocialSystem ignores duplicate calls:
[ Server Level Tick ]
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ GlobalSocialSystem โ โโโ Highlander Rule Guard (1 tick per server tick)
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ SocialRegistry โ โโโ O(1) Shard Lookup & Dead Entity Purge
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
โโโโโโโดโโโโโโโโโโโโโโโโโ
โผ โผ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ Entity 1 โ โ Entity N โ
โ Mood Task โ โ Mood Task โ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
SocialRegistry maintains active social entities categorized by species and world UUIDs:
-
$O(1)$ Registration: Entities register viaSocialRegistry.register(SocialEntity entity). -
Automatic Purging: Stale references (unloaded chunks, dead entities) are automatically purged during the pulse cycle using
entity.dasik$asEntity().isAlive()andisRemoved(). -
Species Sharding: Entities are sharded by
dasik$getSpeciesId(), enabling fast localized proximity queries for pack mechanics and flocking without scanning all world entities.
// Registering an entity to the Hive Mind
public class CustomSocialMob extends PathfinderMob implements SocialEntity {
private final EntitySocialScheduler scheduler = new EntitySocialScheduler();
@Override
public void tick() {
super.tick();
if (this.level() instanceof ServerLevel serverLevel) {
SocialRegistry.register(this);
GlobalSocialSystem.pulse(serverLevel);
}
}
@Override
public SocialScheduler dasik$getScheduler() {
return this.scheduler;
}
}
Dasik Library | Social AI & Infrastructure Engine
Developed with โค๏ธ by Dasik (Rifaditya) | Licensed under LGPL-3.0
๐ Documentation reflects active repository source code state.
- Hive Mind Social System
- Social Scheduler & Events
- Animal Genetics Engine
- Genetics API & Pedigree
- Genetics Loot Modifiers
- Leader Follower & Flocking
- Dynamic GameRules Manager
- GameRule Codec & Serialization
- Client GameRule & GUI Helpers
- Dynamic Enchantments & Vision
- Stochastic & Math Utilities
- Stale Attribute Purging & Scale
- ModVersionGuard & Startup Safety
- Developer Setup & Building
- Architecture & Package Layout
- Mixin Reference & Hooks
- Behavior Profiles & Conditions
- Consumer Mods Integration Guide