Skip to content

feat: Overhaul BaseAI Movement, AI, Bug Fixes, and Performance #2079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 122 commits into
base: main
Choose a base branch
from

Conversation

Bohicatv
Copy link
Contributor

@Bohicatv Bohicatv commented Jan 19, 2025

This is a full rewrite of BaseAI.cs.

Improvements:

  1. Previous memory was 230MB > Now around 131MB on full spawners.
  2. Far less CPU work load overhead as far as movement is concerned.
  3. Addressed areas that causes CPU spikes.
  4. Mobile movement speeds are now smoother in engine/client.
  5. AI timer handling is less cumbersome and more straight forward.
  6. Timers are also throttled appropriately.
  7. Movement fluidity has improved significantly.
  8. Combat logic is overall better as well as pathing.
  9. Pet context menu is now OSI accurate.
  10. Guard command is now more initiative and useful.
  11. Improvements to how Follow order is handled.

Currently Broken/Needs Attention:

  1. On speech handlers. For example, all kill, all follow me, etc.
  2. Secure trade on pet transfers. Needs trade gump logic.
  3. Mobile (wild) wander state refactoring after combat. (pets are fine)
  4. A few/certain clilocs are missing from era files.
  5. OSI accurate features.
  6. Anything else not mentioned.

TODO:

  1. Implement rename command logic in BaseCreature.cs Not technically needed.
  2. Refactor how mobiles disengage combat so they are not being dragged across towns.
  3. Other bug fixes, improvements, etc.

I've put a lot of work into this, so feel free to give a thumbs up. :)
https://discord.com/channels/751317910504603701/1329631466690318426

@Bohicatv Bohicatv marked this pull request as draft January 20, 2025 08:01
m_Mobile.Combatant = null;
break;
}
m_Mobile.Home = m_Mobile.ControlMaster.Location;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a functionality change. We are not setting Home for HandlePassiveOrder(), for stop/none, but we do set it for Guard? Is this on purpose?

Copy link
Contributor Author

@Bohicatv Bohicatv May 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original guard had a timer m_NextStopGuard = Core.TickCount + (int)TimeSpan.FromSeconds(10).TotalMilliseconds; which I got rid of. Home is set to controlmaster for guard order, because its guarding that target. If we set a new home for passive or none, it may mess with home locations on spawners.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants