GithubHelp home page GithubHelp logo

cai-5000's People

Contributors

kbatbouta avatar m00nl1ght-dev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cai-5000's Issues

Idk if related but, after naming the Bang Bus vehicle from VVE after construction

Exception filling window for Verse.ImmediateWindow: System.NullReferenceException: Object reference not set to an instance of an object
at Verse.GenText.TruncateHeight (System.String str, System.Single width, System.Single height, System.Collections.Generic.Dictionary`2[TKey,TValue] cache) [0x00029] in :0
at RimWorld.ArchitectCategoryTab+<>c__DisplayClass22_0.b__0 () [0x000df] in :0
at Verse.ImmediateWindow.DoWindowContents (UnityEngine.Rect inRect) [0x00000] in :0
at (wrapper dynamic-method) Verse.Window.Verse.Window.InnerWindowOnGUI_Patch0(Verse.Window,int)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch4 (string)
(wrapper dynamic-method) Verse.Window:Verse.Window.InnerWindowOnGUI_Patch0 (Verse.Window,int)
UnityEngine.GUI:CallWindowDelegate (UnityEngine.GUI/WindowFunction,int,int,UnityEngine.GUISkin,int,single,single,UnityEngine.GUIStyle)

image

Incompatibility with SOS2: Unable to control shuttlecraft when used with CAI 5000 enabled

When drafting any of the hover-mode spacecraft, no command gizmos appear and the pawn is unable to be told to move.

System.NullReferenceException: Object reference not set to an instance of an object
at CombatAI.Comps.ThingComp_CombatAI+d__52.MoveNext () [0x00162] in <7e881e4c5c4b45e8b2d527bd09a260df>:0
at Verse.ThingWithComps+d__33.MoveNext () [0x000f3] in :0
at Verse.Pawn+d__274.MoveNext () [0x000ec] in :0
at SaveOurShip2.ShuttleGizmoFix.Postfix (Verse.Pawn __instance, System.Collections.Generic.IEnumerable1[Verse.Gizmo]& __result) [0x0004c] in <2b87be45ea37494aa5e517e8ef8a0c77>:0 at (wrapper dynamic-method) Verse.Pawn.Verse.Pawn.GetGizmos_Patch11(Verse.Pawn) at (wrapper dynamic-method) RimWorld.InspectGizmoGrid.RimWorld.InspectGizmoGrid.DrawInspectGizmoGridFor_Patch0(System.Collections.Generic.IEnumerable1,Verse.Gizmo&) currentSelectable: ShuttleDropshipRace21388
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch4 (string)
Verse.Log:ErrorOnce (string,int)
(wrapper dynamic-method) RimWorld.InspectGizmoGrid:RimWorld.InspectGizmoGrid.DrawInspectGizmoGridFor_Patch0 (System.Collections.Generic.IEnumerable`1,Verse.Gizmo&)
RimWorld.MainTabWindow_Inspect:DrawInspectGizmos ()
RimWorld.InspectPaneUtility:ExtraOnGUI (RimWorld.IInspectPane)
RimWorld.MainTabWindow_Inspect:ExtraOnGUI ()
Verse.WindowStack:WindowStackOnGUI ()
(wrapper dynamic-method) RimWorld.UIRoot_Play:RimWorld.UIRoot_Play.UIRootOnGUI_Patch4 (RimWorld.UIRoot_Play)
(wrapper dynamic-method) Verse.Root:Verse.Root.OnGUI_Patch2 (Verse.Root)

Background threads are busy-waiting, leaking, and maxing out CPU cores

This mod starts 7 background threads whenever a new map is generated or loaded, one of them is constantly maxing out a CPU core, the other 6 are busy-waiting. And none of them are stopped/removed when returning to the main menu.

Busy-waiting

Based on the source code this seems to be intentional, happening here:

private void OffMainThreadActionLoop()
{
    while (Alive)
    {
        Action action = DequeueOffThreadAction();
        if (action != null)
        {
            try
            {
                action();
            }
            catch (Exception er)
            {
                Log.Error(er.ToString());
            }
        }
        else
        {
            Thread.Sleep(1);
        }
    }
}

This code should really use a WaitHandle rather than checking for new actions every millisecond.

Maxed out CPU core

Seems to be caused by this code.
With the fog of war feature disabled, this is essentially while (true) { }.

Leaking threads

You are stopping the background threads in MapComponent.MapRemoved, which is only called when maps are removed during an ongoing game, e.g. when a quest map expires. It is not called when loading a different save or returning to the main menu.

Result

Combined, these issues cause the game to completely freeze (taking 100% CPU) after switching between savefiles a few times.

In case it helps, here is a dotTrace profiler snapshot that shows the initial 7 threads: RimWorldWin64.zip

Mechs stand outside base dont attack walls.

Hey mate, love the mod. Was running an old fork from December until now. To deal with the AI in this mod i generally wall my entire base and have individual pawns take snapshots at raiders from various exits (running CE as well). I noticed the new release (lts-stable-a1) and thought i would compare how a particular mech raid that's been troubling me behaved on the new version, however on this new version the mechs dont even try to breach the walls and just afk outside my base until i open a door. If i close the door they go back to afking. Im playing on the hard setting.

Again thanks for the mod cant play rimworld without it :)

Incompatible with Search and Destroy

I tested this with all DLC and just prepatcher, CAI-500, and Tacticowl (for the Search and Destroy module), and this breaks (ranged) Search and Destroy. This mod's presence makes ranged pawns path directly to the enemies' exact location. Then again, no mod that alters path finding seems to work with Search and Destroy.

Please consider giving the new combat AI to player-controlled pawns.

Log gets spamming will null reference in SightGrid during battle

Bunch of errors similar to this one.
No noticeable problem with the behavior of the pawns, just a bunch of log spam

ISMA: base error System.NullReferenceException: Object reference not set to an instance of an object
  at CombatAI.Comps.ThingComp_CombatAI.OnScanFinished () [0x00e50] in <380d0347a1e04937be5a70d7849e9b82>:0 
  at CombatAI.SightGrid+<>c__DisplayClass53_0.<TryCastSight>b__3 () [0x0017a] in <380d0347a1e04937be5a70d7849e9b82>:0 
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
CombatAI.ExceptionUtility:ShowExceptionGui (System.Exception,bool)
CombatAI.SightGrid/<>c__DisplayClass53_0:<TryCastSight>b__3 ()
CombatAI.AsyncActions:MainThreadActionLoop ()
CombatAI.AsyncActions:ExecuteMainThreadActions ()
CombatAI.SightGrid:SightGridUpdate ()
CombatAI.SightTracker:MapComponentUpdate ()
Verse.MapComponentUtility:MapComponentUpdate (Verse.Map)
Verse.Map:MapUpdate ()
(wrapper dynamic-method) Verse.Game:Verse.Game.UpdatePlay_Patch1 (Verse.Game)
Verse.Root_Play:Update ()

An error will occurre when ordering vehicle of PLA Steel Torrent to moving here;

This is contents of that error:

Root level exception in OnGUI(): System.NullReferenceException: Object reference not set to an instance of an object
at CombatAI.Patches.FloatMenuMakerMap_Patch+FloatMenuMakerMap_PawnGotoAction_Patch.Postfix (Verse.Pawn pawn) [0x00018] in <380d0347a1e04937be5a70d7849e9b82>:0
at (wrapper dynamic-method) RimWorld.FloatMenuMakerMap.RimWorld.FloatMenuMakerMap.PawnGotoAction_Patch1(Verse.IntVec3,Verse.Pawn,Verse.IntVec3)
at RimWorld.FloatMenuMakerMap+<>c__DisplayClass14_0.b__0 () [0x0001e] in <95de19971c5d40878d8742747904cdcd>:0
at Verse.FloatMenuOption.Chosen (System.Boolean colonistOrdering, Verse.FloatMenu floatMenu) [0x00030] in <95de19971c5d40878d8742747904cdcd>:0
at RimWorld.FloatMenuMakerMap.TryMakeFloatMenu (Verse.Pawn pawn) [0x00154] in <95de19971c5d40878d8742747904cdcd>:0
at RimWorld.Selector.HandleMapClicks () [0x000ac] in <95de19971c5d40878d8742747904cdcd>:0
at RimWorld.Selector.SelectorOnGUI () [0x00000] in <95de19971c5d40878d8742747904cdcd>:0
at RimWorld.MapInterface.HandleLowPriorityInput () [0x0000f] in <95de19971c5d40878d8742747904cdcd>:0
at (wrapper dynamic-method) RimWorld.UIRoot_Play.RimWorld.UIRoot_Play.UIRootOnGUI_Patch1(RimWorld.UIRoot_Play)
at (wrapper dynamic-method) Verse.Root.Verse.Root.OnGUI_Patch1(Verse.Root)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch2 (string)
(wrapper dynamic-method) Verse.Root:Verse.Root.OnGUI_Patch1 (Verse.Root)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.