[1.3] Miscellaneous w MAI+Robots

Started by Haplo, May 16, 2014, 05:54:01 AM

Previous topic - Next topic

threpny

Need a little pointing in the right direction (I'm still playing B18, because I'm used to it)

The Urban Biome is great, but the Bees 'n' Honey mod doesn't play nice with it. You don't get any hollow dead trees generating.
I've tried swapping the load order and adding the line <TreeBeeHive>0.3</TreeBeeHive> to the Biomes_Temperate_UrbanRuins. xml. Nothing worked.
Not vital, I know, but I would like to farm bees in a dead city!

Haplo

I've added an extension mod for Bees'n'Honey + MapGenerator 'Urban' to GitHub.

Edit:
Also I've fixed a bug in Robots that caused the caravan window to crash when there were 2 or more robots active.

Haplo

I've updated my mods for 1.0.1974 because of a breaking change in this version
Additionally Miscellaneous_WeaponRepair is now working.

themadgunman

Hey Haplo, i was working on my update for Robots++ and i ran into a problem with robots failing the WorkIsActive check in Pawn_Worksettings, this causes Unfinished Items to be unbound from the workgiver which is a mess. I can patch round these bugs but i thought might be simpler and cleaner if you wouldnt mind tweaking the framework, i think maybe its just because WorkIsActive is not reflected like you do with priorities ?


Haplo

Can you provide me with the full error (+stack trace) so that I can see the problem?
I haven't had any problems yet, that's why I'm asking..

I'll look into it, but this would make it easier to identify the error cause.

rawrfisher

I tried the B18 version of ++ and aside from the textures and a couple broken job references it seemed to work fine for me
Professional jerk
Want something broken let me know

themadgunman

#2286
Its not an actual Error its more of a bug, its just that when Rimworld.Bill_ProductionWithUFT.Boundworker is called it checks to see if the items creator is still marked as being active with a job of that type (eg. Tailor) using this code -

if (workTypeDef != null && !creator.workSettings.WorkIsActive(workTypeDef))
{
this.boundUftInt = null;
result = null;
return result;
}


However because robots dont have their workSettings set properly it fails, this then sets the bound unfinishedthing in the Bill to null, this orphans the Uft from the Bill and lets the worktable order another Pawn to work on the bill, so you end up with 2 or more items from the same bill

I only notice because i was getting lots of unfinishedthings lying around, if you use a crafter robot from robots++ and then inspect the bill on the worktable as its being crafted you will see the Bill starts out fine, then the BoundUft is nulled whenever the system calls Boundworker for any reason.

I patched Boundworker and put in some debug messages and i can see that .workSettings.WorkIsActive(workTypeDef) is always returning False for robots, for normal pawns it ofc returns true and they dont have this problem, if i patch out that check in Boundworker its also fine so im absolutely sure thats the problem.

I dont have a B18 setup to test, but im pretty sure i remember this being a problem with crafting robots since forever, my bases usually have 2-3 crafter bots locked in a room with 2 Component Assembly benches and i ended up with about 2-3 orphaned unfinished components i have to cancel every few minutes, if its just a short Bill like maybe a Parka or some pants its not noticable cuz the worker never leaves the table, it only matters if the Uft is removed from the table after the Bill's BoundUft is nulled. Interestingly because only the bills bounduft is nulled the uft itself will still get made as long as the bill is still active (ie. do forever)

This bug only really applies to Robots++ crafting robots so i know its not really your problem, I dont mind just leaving my Boundworker patch or i can just make R++ patch your X2_AIRobot_Pawn_WorkSettings with the needed reflections but i thought it would be nice to have it fixed at the source is all.

Oh btw Haplo i discovered robots are too limiting for the new mod im working on so i've been looking at getting MAI working, do you want the 1.0 updated defs ive done ?

rawrfisher

Do you have a ++ version working properly? 
The job names is a quick XML edit I could myself but I dont know the path for textures or anything more detailed
Professional jerk
Want something broken let me know

themadgunman

https://www.dropbox.com/s/r8ar3djecgfvmku/RobotPlusPlus1.0.rar?dl=0

thats what im using right now and apart from the crafting bug i've got no problems or errors showing

Haplo

I think I found the problem.. I used part of the original code and only set the work priorities to 3 for the first 6 worktypes everything else was 0 :(
I'll test it a bit more to check if that really was the reason and will upload it this evening, so that you can test it on your side also :)

Edit: Is on GitHub and can be tested 8)

themadgunman

Quote from: Haplo on July 26, 2018, 11:08:32 AM
I think I found the problem.. I used part of the original code and only set the work priorities to 3 for the first 6 worktypes everything else was 0 :(
I'll test it a bit more to check if that really was the reason and will upload it this evening, so that you can test it on your side also :)

Yeah that sound like it could well be it, shall look forward to testing it :)

Also i have a quick question regarding the MAI code if you dont mind, in Building_AIPawnConstructionStation.cs you define the ConstructionStation from a base building and then add all the storage methods to get items delivered, when i try and make this run the IHaulDestination Manager just dumps itself and crashes the game, however if I define it as a Building_Storage and just override inherited methods its fine, is there a reason why you've definied it from base building not building_storage that im not seeing ?

Haplo

Most likely because at the time that was the easiest implementation and I had it just updated..

themadgunman

#2292
cool, i just wanted to check i wasnt gonna break something else by doing it that way, the whole ISlotGroupParent thing is still new to me, I had an idea for a mod like R++ but for MAI so you could change parts of the MAI depending on what it was doing, kinda like bionic parts for normal pawns and maybe some configurable modules to more specialise them so im just trying to get MAI working so i can get started on that till you have time to do a proper MAI release,

Basically i watched too much BSG recently and now I want a robot with transformable machine gun hands to guard my prisoners lol :D

Haplo

Have fun with it. I always update MAI last, because honestly, she is the most difficult to update every single time :)
Currently I'm tinkering a bit with my colonist selection module of core.. MAI needs to wait a bit longer ;)

themadgunman

#2294
yeah i can see why, i actually got it to build a MAI last night though so thats progress.

If it helps https://www.dropbox.com/s/7lmx8g0h8wv5lzz/Defs.rar?dl=0 these are the MAI Defs that i updated to 1.0,  its basically just the same changes from robots and some name changes to MentalStateDefs  but it might save you some time :)