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
feature: GOAI Urist port v2 #1414
base: baymerge-testing
Are you sure you want to change the base?
Conversation
… AI-enabled proper sim humans work!
… now be GOAI-enabled (the AI similar to human/testmob, but with Shoot being intrinsic rather than sourced from a Gun SO)
…ide for SS13 AI, door and table actions for SS13, tons of log cleanup. Direct port of: SHA-1: 1a7bffad75bb4be52633ad4101a89bf10e1c0943 from GOAI repo
…c using it, allowed groupby-like mean aggregations, fixed raytrace ignores and other stuff. Sync to GOAI commit: SHA-1: 22948c7db2ed5cf98e7ae966f1bae11608c080ac
…sonality (from a dict object) for simplicity. feature: Templated Personality generation, faked melee for dev purposes, added style affinities to appropriate attacks. Port of the following GOAI commits (respectively): SHA-1: e609609c07d9f85011326dc167a697b5c28d6047 SHA-1: a4dbe5178d6fd88085cd71aa48cfd6f3ab68e7a9
…more organic and causes less CPU load spikes. Melee hit-by events. Steadfast personality trait (less Composure loss per hit); basic loss raised to compensate. Fixed Consideration values. Filtering dense turfs in bbox (optionally). Reverse raytraces for enemy-safety checks. fix: Updating/fixing SS13 AIspecs. Ranged SAs can now use their guns correctly! sync to GOAI SHA-1: 8057d06ec0397e9367d01c9854f3db31b62471cc
…xed cover data gen, moved out-in-the-open checks to Vision, tuned cover/fight better, added gentler fuzz Considerations
…es all handled. Weird paths may pop up on occasion. Ignoring dead mobs. Split neutrality threshold into enemy/friend thresholds. Wrapper to call an arbitrary method. Macro-ized smartobject declarations for less boilerplate. Gated off some more dev objects behind Dev-only defines.
…being a bit unsound).
Mostly shouldn't affect SS13 code, but nice to keep 'em synced.
… logging with MOAR MACROS.
…ix indents. Actually 'fixes' the problem. (this is a dumb context-free AWK check seemingly designed for indents on typepaths; nobody seems to have thought anyone will need to pass in a typepath IN CODE)
return user.Move(T) | ||
var/result = user.Move(T) | ||
to_world_log("[user] has climbed [target_ladder] to [T] (Result: [result])") | ||
return result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, dev changes, will revert
code/modules/multiz/structures.dm
Outdated
@@ -206,10 +206,15 @@ | |||
return TRUE | |||
|
|||
/obj/structure/ladder/proc/climbLadder(mob/user, target_ladder, obj/item/I = null) | |||
to_world_log("[user] is climbing [target_ladder]") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, dev changes, will revert
genmap.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not have been committed, will nuke
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stale diagram, will remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stale diagram, will remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEVJUNK: Feel free to ignore this. This is a port of SS13 code to the Dev repo. It's only here to make syncing between repos easier (can do copy/paste without unpicking individual files).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEVJUNK: Feel free to ignore this. This is a port of SS13 code to the Dev repo. It's only here to make syncing between repos easier (can do copy/paste without unpicking individual files).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEVJUNK: Feel free to ignore this. This is a port of SS13 code to the Dev repo. It's only here to make syncing between repos easier (can do copy/paste without unpicking individual files).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEVJUNK: Feel free to ignore this. This is a port of SS13 code to the Dev repo. It's only here to make syncing between repos easier (can do copy/paste without unpicking individual files).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEVJUNK: Feel free to ignore this. This is a port of SS13 code to the Dev repo. It's only here to make syncing between repos easier (can do copy/paste without unpicking individual files).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEVJUNK: Feel free to ignore this. This is a port of SS13 code to the Dev repo. It's only here to make syncing between repos easier (can do copy/paste without unpicking individual files).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEVJUNK: Feel free to ignore this. This is a port of SS13 code to the Dev repo. It's only here to make syncing between repos easier (can do copy/paste without unpicking individual files).
…pile-flag-conditional locations. Updating is now a fully 'drag-n-drop GOAI to GOAI dir' flow.
… necessary and fine.
exactly 1 "world<< uses" 'world<<|world[[:space:]]<<' | ||
exactly 1 "world.log<< uses" 'world.log<<|world.log[[:space:]]<<' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These both had to be bumped to account for a dev-only copy of the macros file.
exactly 14 "<< uses" '(?<!<)<<(?!<)' -P | ||
exactly 3 ">> uses" '(?<!>)>>(?!>)' -P |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar story here: all of the extra uses are just a copy of the macros for use in the library version. Theoretically these could just be yeeted, but that would slow development down quite a bunch.
exactly 0 "incorrect indentations" '^( {4,})' -P | ||
exactly 26 "text2path uses" 'text2path' | ||
exactly 37 "text2path uses" 'text2path' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indispensable, because it's used by the SerDe to lookup procs from the references embedded in the file data, and there's no real alternative to text2path available (at least as of BYOND 514).
exactly 3 "update_icon() override" '/update_icon\((.*)\)' -P | ||
exactly 5 "goto use" 'goto ' | ||
exactly 1 "NOOP match" 'NOOP' | ||
exactly 444 "spawn uses" '^\s*spawn\s*\(\s*(-\s*)?\d*\s*\)' -P | ||
exactly 461 "spawn uses" '^\s*spawn\s*\(\s*(-\s*)?\d*\s*\)' -P |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of these are internal 'ticker-esque' code which cannot use any of the weird Bay timers.
debug_start_state.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can remove this. Might have been added by accident.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, definitely should remove this; snuck in from a previous branch lol
feature: Added macro's Chebyshev distance (since get_dist is weird and procs are slow). feature: Added a new SO macro - grants Action if object is in direct inventory contents (no recursion). feature: Macro-gated drawing beams docs: Added a Utility AI Readme tweak: Reenabled path-following mode tweak: Added source logging to Utility brain fix: Fixed bad SO paths for Dev repo fix: Corrected proc used for movement chore: Fixed some lints/dupes chore: Big ole cleanup of debug verbs. Gated all I could find behind proc-granting procs/verbs or removed.
The concept of a Pawn is now generic; a mob AI drives a mob/atom Pawn, a faction AI drives a faction datum Pawn, a director AI would drive an Event Pawn or sth. Reorganized Actions - split into subdirs where the Action only makes sense for a subtype. Fixed a ton of nullchecks to be typechecks instead. feature: Simplified the AI ecosystem. - Rolled CombatMob AI into normal mob AI. - Moved generic logic into the base class - Removed Abstract AI as a separate entity - the main determinant of a subtype will be the driven Pawn type (e.g. Event data for Director AIs, Faction for Faction AIs, Mobs for Mob AIs) Sync to SHA-1: 40c196d23bf03d071dc4e8190de6f74777f1deb8
Yep. This again. And a cool 10k+ SLOCs to go through!
Featuring an entirely re-done architecture - the heart of the AI is now a Utility AI, blatantly lifting the core design from Infinite Axis Utility System by Dave Mark & Co., with improved and optimized GOAP Planner AI as an optional sidecar for dealing with complex environmental problem-solving (e.g. GODDAMN DOORS REEE).
Fast and smart
A major consequence of that is that this iteration of GOAI is at least as smart as the previous (with a strong argument that it's much more so), but also very, very fast. And that's before AI LODs or any other future optimizations.
Data-driven
The redesign also showcases my progressing conversion to the church of Data-Driven Design. As a result, the AI system is really two things: an AI Engine in DM code (because I am a masochist) and an AI Specification Language in the form of a bunch of JSON schemas.
The AI Engine provides a pile of abstractions and building blocks (curves, Considerations, ContextFetchers...) that can be used in the JSONs to build actual AIs and SmartObjects.
Thanks to that, the AI Specs can be edited without an in-depth knowledge of DM's weird quirks. You don't have to be a full-on coder to make GOAI AIs.
They can also be hot-swapped at runtime without recompiling the whole game as long as you're not extending the AI Engine itself. Should make iteration speed muuuuuuuch faster.
Modular and extentable
Unlike Certain Other SS13 AI Implementations, GOAI provides only a cheap, bare minimum shared framework for any gameobject that opts into having GOAI enabled at all.
Everything else - all behaviors and checks - only runs if an AI Agent uses them for something and they run in whatever sequences they are acquired. The only hardcoded state-machines are either the AI Brain's core decision/execution loop or the scripts powering the actions (if you choose to write them that way). The AI will transition fluidly between combat, idling, chores, and everything in between based on whatever's the next logical priority.
Actions can be added or removed on the fly - in fact, they already are.
To avoid duplicating logic across 20 different mob types, GOAI now includes Sims-style SmartObjects, which are AI Specs attached to gameobjects. Agents can harvest new abilities from those objects - for example, a held gun may provide a Shoot Action, and a nearby Door may provide an OpenDoor Action.
Even the GOAP integration is more flexible than traditional implementations - GOAI plan execution is smart enough to handle third-party interference cancelling out the effects of actions earlier in the plan or short-circuiting the requirements to make the ultimate goal available.