[1.1] Giddy-up!

Started by Roolo, December 01, 2017, 04:46:29 AM

Previous topic - Next topic

Malacai

I encountered a few bugs in my last game. I am using "pick up and haul" and Combat extended" and a load of other mods, but those two seem to have some compatibility issues. When i told a mounted pawn to pick something up into their inventory they would always dismount first, which can be pretty iritating. I think the usual hauling works fine even with "pick up and haul" active, but once you tell them manualy to pick stuff up they dismount.

The second bug was a typical rimworld bug. I had a few pawns mounted on horses form the animal collab pack and send them on a hunting trip to get rid of those beavers. Now hunting accidents are well known occurrence in rimwolrd, but what i didnt expect was my hunters to shoot their own horse, while they were still sitting on said horse. One even managed to destroy a horse kidney which would technically be located behind the rider.
This didnt happen every shot, just a few times inbetween. Ironically i had just added the "avoid friendly fire" mod to keep my horses safe ...

Edit:
Another thing that bothered had to do with the no mount zone and the mount drop off spot. I have a mountain base with one entrance, and infront of that entrance is my stable with the mount drop off stop. The whole base is a no mount zone. Colonists inside the base would constantly try to mount an animal wandering through my base, ride it to the dropoff spot outside, opposite of the direction they originally wanted to go, and then go back inside they base to do what they wanted to do in the first place. Would it be possible to add a check, so if the destination is in the same no mount area the pawn is already in, they wont attempt to mount an animal on the way?

Roolo

Quote from: Malacai on April 17, 2018, 09:57:53 AM
I encountered a few bugs in my last game. I am using "pick up and haul" and Combat extended" and a load of other mods, but those two seem to have some compatibility issues. When i told a mounted pawn to pick something up into their inventory they would always dismount first, which can be pretty iritating. I think the usual hauling works fine even with "pick up and haul" active, but once you tell them manualy to pick stuff up they dismount.

The second bug was a typical rimworld bug. I had a few pawns mounted on horses form the animal collab pack and send them on a hunting trip to get rid of those beavers. Now hunting accidents are well known occurrence in rimwolrd, but what i didnt expect was my hunters to shoot their own horse, while they were still sitting on said horse. One even managed to destroy a horse kidney which would technically be located behind the rider.
This didnt happen every shot, just a few times inbetween. Ironically i had just added the "avoid friendly fire" mod to keep my horses safe ...

Edit:
Another thing that bothered had to do with the no mount zone and the mount drop off spot. I have a mountain base with one entrance, and infront of that entrance is my stable with the mount drop off stop. The whole base is a no mount zone. Colonists inside the base would constantly try to mount an animal wandering through my base, ride it to the dropoff spot outside, opposite of the direction they originally wanted to go, and then go back inside they base to do what they wanted to do in the first place. Would it be possible to add a check, so if the destination is in the same no mount area the pawn is already in, they wont attempt to mount an animal on the way?

Thanks for your feedback.

"When i told a mounted pawn to pick something up into their inventory they would always dismount first, which can be pretty iritating."
-Hmm I'll look if I can solve this incompatibility problem easily, but it could be that the fix is not easy on my side.

"but what i didnt expect was my hunters to shoot their own horse, while they were still sitting on said horse."
- Yes this is a problem with combat extended. Combat extended changes how bullet collision works, but unfortunately this means pawns can shoot the animal they are riding. I'm curious, does this also happen during battles, so when your cavalry is shooting at enemies? I think it should also happen then, but that's never been reported. While I cannot really solve this bullet collision problem easily, I do plan to add a mod option that allows users to configure what jobs can be done mounted and what jobs cannot. Combat extended users can then use this to disallow hunting to be done mounted.

"Would it be possible to add a check, so if the destination is in the same no mount area the pawn is already in, they wont attempt to mount an animal on the way?"

Good point. Well, right now, the forbid riding area is implemented as just one area (eventhough you can assign multiple patches), making it hard (if not impossible) to perform this check. It being one area has several advantages, so I won't change it to multiple areas. However, I do have two other solutions in mind:

1. I could make sure that the time cost of dropping off an animal at a drop spot, and also the resulting walk are taken into account when the cost of the ride is calculated. While it's not very easy, it should be possible to determine an estimation of this cost before the job is started, and this extra cost estimation will make sure pawns won't ride when it doesn't make sense.

2. I could exclude any animals that are in a forbid riding zone from the mount selection. This way, pawns won't ever start riding from a forbid riding zone. This solves your problem, is simpler to implement than 1, makes a lot of sense, but may be a bit too restrictive. It could be restrictive in the sense that players will have to make sure their animals are not in forbid riding zones if they want any mounting to happen, and it can be a bit unintuitive because some players may not have a clue why their mounts are not being used in case their animals are in a forbid riding zone.

I'll think about the two options. Any opinions about this (by anyone reading this) especially about point 2 being too restrictive or not are welcome.

By the way, did you try assigning your animals to allowed area outside your base? That could already solve the problem, depending on your base layout.







Mehni

Roolo: if you need some info on Pick Up and Haul or some action from my part, I'm easy to get in touch with on the unofficial Discord if you need me.

For what it's worth, the actual "pick up" job in Pick Up and Haul (the manual job, the one that's not part of the hauling itself) is a vanilla functionality. I patched RimWorld.FloatMenuMakerMap.AddHumanlikeOrders to circumvent the check on pawn.Map.IsPlayerHome.

dragon124515

First off I would like to say great mod.

Secondly I believe I have found a minor bug in my last game. The bug seems to be a soft incompatibility between this and trading economy.
When a caravan from trading economy arrives once they dismount the "vehicles" from that mod the logs are filled with this error message
Exception ticking Winter: System.NullReferenceException: Object reference not set to an instance of an object
at GiddyUpRideAndRoll.Harmony.Pawn_Jobtracker_DetermineNextJob.AnimalBusy (Verse.Pawn) <0x0009b>
at GiddyUpRideAndRoll.Harmony.Pawn_Jobtracker_DetermineNextJob.GetBestChoiceAnimal (Verse.Pawn,Verse.LocalTargetInfo,single,single,bool,GiddyUpCore.Storage.ExtendedDataStorage) <0x00261>
at GiddyUpRideAndRoll.Harmony.Pawn_Jobtracker_DetermineNextJob.Postfix (Verse.AI.Pawn_JobTracker,Verse.AI.ThinkResult&) <0x007c6>
at (wrapper dynamic-method) Verse.AI.Pawn_JobTracker.DetermineNextJob_Patch4 (object,Verse.ThinkTreeDef&) <0x0016e>
at Verse.AI.Pawn_JobTracker.TryFindAndStartJob () <0x000f7>
at Verse.AI.Pawn_JobTracker.JobTrackerTick () <0x002c5>
at (wrapper dynamic-method) Verse.Pawn.Tick_Patch1 (object) <0x00155>
at Verse.TickList.Tick () <0x002c6>

Verse.Log:Error(String)
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()

Disabling the vehicles in the giddy up options does fix the problem however. This also only seems to happen with caravans and possessing the vehicles in your own faction does not produce this error and it is only after the caravan dismounts.

Roolo

Thanks Mehni! Good to know.

Quote from: dragon124515 on April 17, 2018, 07:29:07 PM
First off I would like to say great mod.

Secondly I believe I have found a minor bug in my last game. The bug seems to be a soft incompatibility between this and trading economy.
When a caravan from trading economy arrives once they dismount the "vehicles" from that mod the logs are filled with this error message
Exception ticking Winter: System.NullReferenceException: Object reference not set to an instance of an object
at GiddyUpRideAndRoll.Harmony.Pawn_Jobtracker_DetermineNextJob.AnimalBusy (Verse.Pawn) <0x0009b>
at GiddyUpRideAndRoll.Harmony.Pawn_Jobtracker_DetermineNextJob.GetBestChoiceAnimal (Verse.Pawn,Verse.LocalTargetInfo,single,single,bool,GiddyUpCore.Storage.ExtendedDataStorage) <0x00261>
at GiddyUpRideAndRoll.Harmony.Pawn_Jobtracker_DetermineNextJob.Postfix (Verse.AI.Pawn_JobTracker,Verse.AI.ThinkResult&) <0x007c6>
at (wrapper dynamic-method) Verse.AI.Pawn_JobTracker.DetermineNextJob_Patch4 (object,Verse.ThinkTreeDef&) <0x0016e>
at Verse.AI.Pawn_JobTracker.TryFindAndStartJob () <0x000f7>
at Verse.AI.Pawn_JobTracker.JobTrackerTick () <0x002c5>
at (wrapper dynamic-method) Verse.Pawn.Tick_Patch1 (object) <0x00155>
at Verse.TickList.Tick () <0x002c6>

Verse.Log:Error(String)
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()

Disabling the vehicles in the giddy up options does fix the problem however. This also only seems to happen with caravans and possessing the vehicles in your own faction does not produce this error and it is only after the caravan dismounts.

Thanks for reporting. Seems like something I can fix on my side. I'll look into it.

ptx

Quote from: Malacai on April 17, 2018, 09:57:53 AM
The second bug was a typical rimworld bug. I had a few pawns mounted on horses form the animal collab pack and send them on a hunting trip to get rid of those beavers. Now hunting accidents are well known occurrence in rimwolrd, but what i didnt expect was my hunters to shoot their own horse, while they were still sitting on said horse. One even managed to destroy a horse kidney which would technically be located behind the rider.
This didnt happen every shot, just a few times inbetween. Ironically i had just added the "avoid friendly fire" mod to keep my horses safe ...

Yeah, happens to me too. Pavel, my trusty caribou kept getting shot at point blank while hunting.
I usually micro manage the hunt, keeps the target animal several tiles away, and it won't happen.
CE gives you the best weapon experience while shitting on you at the same time.  ;D

I also come to report, that in my experience, mounted run and gun does not work in CE. I have to stop my caribou mounted pawn, so the pawn can start shooting at the angry Thrumbo who finally went down to blood lost, after 100 or so bullet from a shitty rifle.

And bringing an animal with caravan pack, but for hauling duty. That way, those resource at the edge of the map can be gathered to the animal's caravan pack, and when it's full, time to go home.
That would be more efficient than hauling a single or two items across the map.

Malacai

"I also come to report, that in my experience, mounted run and gun does not work in CE."
-Hm i am pretty sure my pawns could use run and gun while mounted. Even lost a pawn because of it. He kept slowing down to shoot at that angry horde of manhunter grizzlies on his tail, instead of just riding to safety.

"I'm curious, does this also happen during battles, so when your cavalry is shooting at enemies?"
-I guess not many people make cavalery charges with combat extended enabled because they would probably all die before they reach the enemy. Without proper animal armor battle mounts dont work that well in CE.

"By the way, did you try assigning your animals to allowed area outside your base?"
-Yes i did restrict all my horses to the stable, but i had a bunch of wild boars doing my hauling, which kept getting mounted. I forbid anyone from mounting them, but everytime a juvenile grew up i had to make sure to uncheck the "can be mounted by everyone", which got a little tedious.
I even had one pawn leave the base, go to the stable, mount his horse, ride a circle through the stable, and the return back inside the base to do his job. But that only happened once i think.

Regarding your two options, they both seem pretty good in my opinion. I like the cost estimation because i had a fair share of useless mounting for very short ways that would have been faster without mounting.
If it is not to heavy on performance then i think it is a good solution. But option two seems pretty good too. It doesnt seem too restrictive to me, since the player will surely remember he created a "no mount zone". You only bother with a no mount zones when you want to influence how your pawns ride around the map, and if they suddenly dont ride anymore you know you messed up your zone.
So both options are viable i think, but option 1 is probably a little better because it also cuts down a lot of useless mounting when you dont have a no mount zone active.

Roolo

@ptx
"I also come to report, that in my experience, mounted run and gun does not work in CE."
I think it should work with CE, and I think that it didn't work in that occasion has another cause: RunAndGun depends on the "fire at will" functionality of vanilla Rimworld. I think that in your case, you either tried to manually target the Thrumbo, or the fire at will functionality wasn't enabled or triggered.

"And bringing an animal with caravan pack, but for hauling duty. That way, those resource at the edge of the map can be gathered to the animal's caravan pack, and when it's full, time to go home.That would be more efficient than hauling a single or two items across the map."
Of course, but implementing this really isn't straightforward, and would be as much work as an entire mod. I do plan to create such a mod in the future, but I'll make it a mod separate from Giddy-up, so that animals not being used as a mount can also be used as pack animals. Of course I'd make it play nicely together with Giddy-up.

@Malacai.
"Regarding your two options, they both seem pretty good in my opinion. I like the cost estimation because i had a fair share of useless mounting for very short ways that would have been faster without mounting."
Just for clarity, there's already a cost estimation present at the moment, but it just doesn't take into account the extra cost associated with drop points yet.

Now that I've given it some thought, I think I'll implement option 1, and I might implement both options if option 1 isn't reliable enough on it's own. It won't be heavy on performance, the cost estimation functions I use are computationally very cheap (and therefore slightly inaccurate sometimes).




BlueWinds

I'm also a fan of #1 - as someone who uses Giddy-Up, I didn't realize the mod used zones. I seldom use zones at all, other than for "toxic fallout" events. Any feature that makes me fiddle with them is a feature I'm likely to forget about or not discover in the first place.

Just one data point, I know many other on the forum use them heavily.

ptx

Quote from: Roolo on April 18, 2018, 04:13:44 AM
@ptx
"I also come to report, that in my experience, mounted run and gun does not work in CE."
I think it should work with CE, and I think that it didn't work in that occasion has another cause: RunAndGun depends on the "fire at will" functionality of vanilla Rimworld. I think that in your case, you either tried to manually target the Thrumbo, or the fire at will functionality wasn't enabled or triggered.

yup, that's what happened.

Filthy Orcs mod and Giant Race mod has body size 1.3, it would look weird if they ride animals with body size 1. Maybe body size limit for the rider, the animal should be larger than the rider, or this already implemented and I just don't know it yet, I haven't test it yet.

Roolo

Quote from: ptx on April 19, 2018, 10:21:09 AM
Quote from: Roolo on April 18, 2018, 04:13:44 AM
@ptx
"I also come to report, that in my experience, mounted run and gun does not work in CE."
I think it should work with CE, and I think that it didn't work in that occasion has another cause: RunAndGun depends on the "fire at will" functionality of vanilla Rimworld. I think that in your case, you either tried to manually target the Thrumbo, or the fire at will functionality wasn't enabled or triggered.

yup, that's what happened.

Filthy Orcs mod and Giant Race mod has body size 1.3, it would look weird if they ride animals with body size 1. Maybe body size limit for the rider, the animal should be larger than the rider, or this already implemented and I just don't know it yet, I haven't test it yet.

Hmm, pretty good idea. I could implement that at some point, probably as something that can be toggled on/off in the settings. The list of things I'd like to implement is getting bigger, while the amount of time I have is getting smaller, so it may take some time until you'll see it implemented.

BlueWinds

I'm not sure that this is Giddy-up rather than another mod, but seems possible.

https://gist.github.com/HugsLibRecordKeeper/ae1833cbeea6087ff5bc463d5fad2158

Kay and Osmu (mentioned in the logs) are just standing around, and both have mounts. The target they're trying to feed is a tamed animal (not alien races framework). I'm not sure where the survival meal they're trying to fetch is (none in my stockpiles). If I remove one of them from doctoring, the other still just stands around generating the same error.

I thought this might be related to Smarter Medicine (https://ludeon.com/forums/index.php?topic=39187.0) which I recently installed, but disabling that and loading the save still gives the same errors.

Roolo

Quote from: BlueWinds on April 20, 2018, 02:10:38 PM
I'm not sure that this is Giddy-up rather than another mod, but seems possible.

https://gist.github.com/HugsLibRecordKeeper/ae1833cbeea6087ff5bc463d5fad2158

Kay and Osmu (mentioned in the logs) are just standing around, and both have mounts. The target they're trying to feed is a tamed animal (not alien races framework). I'm not sure where the survival meal they're trying to fetch is (none in my stockpiles). If I remove one of them from doctoring, the other still just stands around generating the same error.

I thought this might be related to Smarter Medicine (https://ludeon.com/forums/index.php?topic=39187.0) which I recently installed, but disabling that and loading the save still gives the same errors.

Thanks for your report. I took a look at it and it doesn't seem te be directly caused by Giddy-up. However it could be that Giddy-up is conflicting with another mod, but I can't even say that with certainty based on the log.

It's something related to feeding patients, that seems likely, so smarter medicine was a good guess, since that does something with the feed patient job. Are you sure you got exactly the same errors when removing the smarter medicine mod, and not different ones popping up at the same rate?

You could try disabling Ride and Roll to see if that resolves the problem, but I'd be surprised if it does.

To fix it (temporarily) you can try to draft the pawns, forbid them from tending in the work tab, undraft the pawns,  and when the errors don't pop up anymore, you can try to enable tending again.

Roolo


Update!

Giddy-up! Core -> v18.7.7

- Added patching possibility to configure custom mount usage for specific PawnKinds.
- Added patching possibility to add overlay images to animals. This can be used by modders to draw certain parts of the animal (for instance horns or the head) in front of the pawn, ensuring it looks pretty.
- Added caribou and ibex overlay images. Both these animals now look good when mounted.
- Now that the graphic issues have been resolved, both Caribou and Ibex are now allowed as mount by default. When you changed any of the drawing settings, they could still be forbidden, in which case you still need to enable them manually if you would like them as mount.
- Animals no longer throw off their rider when their master drafts.
- When riders pick up an item into the inventory, either on an encounter map, or when using a mod like Pick up and Haul, they no longer dismount.
- Slaves can no longer arrive on mounts.

Giddy-up! Ride and Roll -> v18.7.8

- Added mod option to forbid mounted hunting (useful for Combat Extended users to prevent hunting accidents :))
- The time cost to drop off an animal at a drop off spot is now taken into account when a pawn decides to use a mount or not. This prevents unnecessary mounting actions.
- Fixed mod conflict with Trading Economy resulting in Pawns freezing.
- Removed possibility of errors being thrown when an animal suitable for auto-mounting is downed.



Some more context on the new overlay patching possibility:

Before the update, the only thing that could be done to make sure mounting looks natural was using the mod options to configure if the rider should be drawn behind or in front of a given animal, which would work for most animals. However, for some animals with long necks or horns/antlers like the Caribou and the Ibex, this didn't work, since these animals should be drawn only partly in front of the pawn. With the new overlay patching possibility, this can be resolved. I already applied this patch to both the Caribou and Ibex, but other modders can also do this for their own animals, if needed.

Example of caribou unpatched:



This was so ugly that as a default the caribou and the ibex were forbidden to be used as mount. However, with the new patching technique applied the caribou looks like this when mounted:



Much better :)

I'd like to thank Jecrell for providing some of the overlay image code and for proposing these patching possibilities.

Ser Kitteh

Excellent work as always!

Question: when it comes to rescuing "incapacitated refugee" quests, I've always had a bit of an issue with em'. Obviously this requires Core, Caravan, and Battlemounts. One time I sent two colonists on elephants to save a refugee. Short ambush of snakes later, I patch up the refugee, right click and chose "rescue NAME and leave the map" and it's all hunky dory.

Then an infection happens midway and I use the "make a camp" mod to patch the rescued proper.

When done, my elephants refuse to leave with me, and I had to fumble about with my one doctor and she had to carry NAME off the map by herself while her bodyguard rode on his own elephant and left. Sometimes one of the elephants would leave and sometimes they go all leave hunky dory.

I did this "patch at camp and leave" manually, aka not reforming my caravan. Mind this only happened once and I haven't done and rescue refugee quest as of late. It's not a HUGE problem by any stretch but it is finicky. If you have any sort of instructions to avoid this, I'd be happy to use em'.

Good job as always, Roolo. You the man.