evilight 2653c465d1 world: pace the mob AI and respawn sweeps instead of spinning
MobAIThread and MobRespawnThread both ran `while (true)` around a sweep of every
zone with no delay at all, so each of them pinned a full core for the lifetime of
the world server. Measured in the container: 195% total CPU with

    tid 229  aiThread       106% of one core
    tid 231  respawnThread  106% of one core

and nothing else above 1%. The 100 ms check in the respawn loop only throttles how
often a mob may respawn, it never paused the loop.

Both sweeps now run at a fixed rate (AI_TICK_INTERVAL_MS / RESPAWN_TICK_INTERVAL_MS,
100 ms by default) by sleeping the remainder of each tick. MobAI.DetermineAction
already gates individual actions on timestamps (lastAttackTime, nextCastTime,
patrol delays), so pacing the sweep removes the busy spin without changing the AI
behaviour; raise the constants to trade reaction time for CPU.
2026-10-10 16:23:39 +08:00
2022-04-30 13:11:10 +00:00
2022-04-30 09:36:18 -04:00
2023-07-15 09:23:48 -04:00

Logo

Magicbane Open-Source MMO Project

The Community written Shadowbane emulator

Magicbane
Public Repository
magicbot@magicbane.com

Magicbane is an emulator for the long dead but much beloved Ubisoft MMO, Shadowbane. The project was founded in 2013 with the concept of free availability of gameplay; players unencumbered by any factor other than a desire to again play a game they once loved. A game where the developers do not play is guaranteed to be the fairest game.

The Magicbane Team has wanted to open source Shadowbane for half a decade. We are excited to now finally have the opportunity, along with some new technology, to truly democratize Shadowbane.

  • Written in some 80k lines of Java 8 and bash.
  • Project with real infrastructure; Production and development servers supporting multiple containerized apps.
  • MagicBox container technology enables instant deployment and trouble free development on modest hardware.
  • MagicBox plugin capability allows for new and interesting player experiences.

Contributing

  • Project is released under an MIT license. Please see the LICENSE file.
  • Inbound == Outbound.
  • IntelliJ is the supported IDE.
  • Write code today see it running on the Magicbane production server tomorrow.

Support

Documentation is available through the Magicbane Wiki and Discord server.

S
Description
Public Repository for the Magicbane Shadowbane Emulator
Readme MIT
13 MiB
Languages
Java 100%