Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - SpoonBender

#1
Help / Help building mod with TaleManager
May 07, 2019, 03:13:59 PM
I'm a novice programmer, but want to try my hand at making a Rimworld mod. I hope to get some help on how to realise my idea.

Epitaphs
For every pawn that enters the map I want to log relevant life events to create an epitaph on the tombstone if the pawn is buried in a grave or sarcophagus.  The life events should look something like this:
- <date>: <pawn> entered the map to attack <colony name>
- <date>: <pawn> was taken prisoner by <colony name>
- <date>: <pawn> was recruited by <other pawn> and joined <colony name>
- <date>: <pawn> married <other pawn>
- <date>: <pawn> survived <disease>
- <date>: <pawn> died from <cause of death>
- <date>: <pawn> was put to rest by <other pawn>

The epitaph itself will be loosely based on the life events. Of course, in Rimworld fashion, there should be some creative storytelling.

How to build it?
The last couple of days I spend setting up my environment, doing the tutorials, decompiling and reading the source code and installing the debugger tool. Thanks to everyone on this forum and the wiki for providing massive amounts of information. To get a feel of things I used the 'Tale Log Tab' mod, because it does something similar to what I want to do. This mod is outdated, but I fixed it and managed to get it running in debugger mode.
https://steamcommunity.com/sharedfiles/filedetails/?id=1188524738

So, I have a basic understanding of how to mod and how the game handles storytelling. I studied the TaleRecorder and I think I can use it for my purposes, because lots of events I need are logged in there already. What I did so far:

- made a new MainTabWindow called Epitaph, based on the Tale Log Tab
- made a DefModExtension to extend TaleDef with a new field useForEpitaph, default false
- made a PatchOperation to add the new field to the LandedInPod TaleDef (because it's the first tale that is generated)
- display all events in the Epitaph Tab that have useForEpitaph = true

So far I'm satisfied with my progress, but I'm not sure how to proceed. What I need to do now:

- Patch all existing TaleDefs for the epitaph with the new field useForEpitaph
--> I know how to do this
- Remove the Epitaph MainTabWindow and add an Epitaph tab to graves and sarcophagus
--> I have a vague idea how to do this
- Move functionality to new grave tab and filter for tales concerning the buried pawn
--> Not sure how to pass the buried pawn as input to my new class
- Make sure the TaleManager doesn't purge the tales where useForEpitaph = true
--> I tried to use TaleType.PermanentHistorical but this has too many unwanted consequences (clutters the history graph). I think I need to add a new TaleType, but not sure how to change the existing Tale functionality to take this into account.
- Insert custom Tale events by calling TaleRecorder.RecordTale, for instance when a raider spawns on the map.
--> I have no idea, yet. Do I need Harmony?
- Add more creative storytelling for the epitaph texts
--> of later concern

I'm sure I'll figure things out if I struggle along, but I was hoping to get some advice. Maybe someone can point out a mod that does a similar thing for reference. Is using the TaleManager even a good idea to build this mod? Should I create my own EpitaphManager?
#2
I'm still learning myself, but from the examples I saw I think you need to do something like this:


Rect main = new Rect(x, y, width, height);
GUI.BeginGroup(main);
GUI.color = Color.white;
Text.Font = GameFont.Medium;
Rect label = new Rect(x, y, width, height);
Widgets.Label(label, "your label name");
GUI.EndGroup();
#3
About killboxes: Last week I posted that walls and killboxes were pretty much useless. After playing some more I reverted back to building them. They still solve a lot of problems for you.
- normal raids
- wild animals and manhunter packs
- mechanoid raids
- sieges, they decide to attack your colony after taking just a little damage from mortars or long range rifles.

The only thing is that you have to prepare for other threats as well, being sappers and drop pods. I keep more space between the walls and the buildings and build more defensive lines throughout my base. I have never used much turrets, because I like my pawns to do the damage. So I haven't tried the auto-cannons yet. In my next base I will use more space between my buildings to make firing lanes for the auto-cannons.

In my last run I've had this insane sapper raid. Five guys with doomsday rocket launchers walked into my base, 8 guys with frag grenades and then some. I was sure it was all over, but thanks to well placed defenses and some intense melee combat I managed to limit the damage. Three brawlers with good armour, shield belts and plasteel longswords cut them down really fast. None of the doomsday rocket launchers had managed to fire a shot, so I had 5 of them laying around. The next tribal raid was over with just one shot: 24 dead 12 downed.

So I'd say that walls and killboxes are still pretty strong, but you can't solely rely on them anymore and have to be much more creative in setting up your defenses. Which is a good thing.

BTW We should have mechanoid melee sapper raids. A bunch of scythers rushing through a gap in the wall would be my ultimate nightmare.

Edit, forgot to mention: In the screenshot, if you look closely you can see the centre pillar of the bedroom buildings is actually a door, which I usually forbid. But in close combat they are useful to make your escape or relocate quickly to better firing positions. I also use a Borg-like base structure of 17x17 blocks to create firing lanes and multiple cover positions for my pawns. This worked out pretty well for me.

Edit 2: About cocoa, as you can see I've tried a rather large cocoa plantation, but found the profits are rather lackluster compared to the labour. I think planting potatoes or corn is more profitable. It's nice to have some cocoa for your own consumption, but for trade it doesn't seem worthwhile.

[attachment deleted due to age]
#4
Ok, this new 'Run wild' mental break really made me laugh like the first time I played this game. Juliette the Gatherer decided to leave the colony and go live with the animals. The final straw was: Someone's organs harvested. Can't say I blame her, but you know, some things need to be done. She revenged after the second failed taming attempt and she died in the fight. I tried to bury her in a sarcophagus, but couldn't assign her. I know, she probably wouldn't have wanted that anyway, but civilization must be forced on people sometimes, be it post mortem.

I noticed that all pawns have a 'Revenge chance on tame fail' stat now, which is always 0%, even for the wild man. But when I assigned her to be tamed a message popped up saying there was a 10% chance for revenge, and sure Juliette did revenge. And if we go that way, the wild man should also have a 'wildness' stat, indicating how difficult it is to tame them.

Also the new 'jailbreaker' mental break got me by surprise. Woodward freed two prisoners and proceeded to hide in his room. So this seems a combination of two mental breaks. Probably to prevent using the same pawn to arrest/beat the prisoners he just released.
#5
I'd go for the 'refill on low stock' option for stockpiles, just like the 'pause when satisfied' option on bills. I want 150 neutroamine in a 1x1 stockpile next to the drug lab and it should only be refilled when it reaches below 75. So basically we want the Hauling Hysteresis mod functionality implemented into the base game, just like Crafting Hysteresis.

We really need this, because hauling becomes quite a problem when you have a lot of crafting tables with designated stockpiles. The dogs are constantly hauling 1 item from stockpile a to b and you'd have to changes stockpile priorities or area restrictions all the time to prevent this.
#6
Found this in the last patch notes:

Fix 3461: Escape pod notification befriending text is still present if there's a pirate inside

Thanks!
#7
Bugs / Re: [1.0] Toxic fallout hunting
June 28, 2018, 06:02:36 AM
I noticed the same, but assumed it was a debuff/feature. The toxic fallout event was a bit OP imo. Just an easy grab of all animals on the map to stock your freezer for months. 
#8
Indeed, he was hostile so I see why I couldn't rescue him now. Still the message shouldn't say I can rescue him while i can't. That is confusing.
#9
Bugs / Re: Can't rescue escape pod refugee
June 27, 2018, 06:15:19 AM
I added the version info in the topic title.
#10
Bugs / [1.0.1947] Can't rescue escape pod refugee
June 27, 2018, 06:13:08 AM
An escape pod crashed on my map with a space refugee from a neutral faction. The message said capturing him will anger the faction and rescuing him will improve relations. But I can't rescue the refugee, only capture or strip him. I have medical and prisoner beds available. Never seen this happen before. I'm playing 1.0.1947, no mods active.

I noticed the name of the pawn is now displayed above the right click menu. That is nice.

#11
Quote from: Tynan on June 24, 2018, 12:32:34 AM
For the main gameplay modes I think the overall challenge is lowered, but critically, the cheese tactics you were depending on before have been countered. Especially at Extreme.

So the result is, normal tactics work better, and cheese tactics don't work as well. Which means if you were using cheese, it'll seem harder, and if you were using normal tactics, it'll seem easier. Since you were using cheese, it seems a lot harder.

Honestly the way you describe it is how I want Extreme to be. It's supposed to be really fucking hard. Finishing on that level should be a serious achievement not possible without some dedicated play and a dose of luck.
All those hours of playing, only to be called a cheeser by the dev.  :D

But you are correct. Since caravaning was introduced my goal has always been to set up an easily defendable colony, so I could focus on raiding the pirates. I aimed to wipe all pirates camps of the map and achieve world  peace. I never intend to actually leave the Rimworld, I want to rule it.

There was no real challenge in defending the main base anymore and once you got advanced enough the pirate camps weren't that hard either. So my interest dropped and I didn't play much last year. Now I'm back at it, cursing at the game like a newby and rethinking my strategies. So you did a very good job!
#12
I've been playing the unstable branch for a few days now and it seems the game got A LOT harder. I have almost 1200 hours experience in this game and I've always played on extreme difficulty. But now I've not been able to set up a successful colony on extreme difficulty. I have been killed by sappers and mechanoids mostly.

I admit I was a bit reliant on walls and a killbox. I don't use turrets, just a construction to feed them nicely to my gunners. But now there seems to be no use in building walls or a killbox whatsoever. I rarely get 'normal' raiders, mostly sappers, sieges and mechanoid ships.

Early game raids seem to have gotten a lot stronger too. Once I was up against 4 centipedes and 2 lancers with just 6 great bows to shoot at them. That didn't work out very well. One colony was destroyed by 6 raiders when I had just a short bow and 2 pawns, of which one was incapable of violence.

Walls get destroyed a lot quicker. I used to build granite defense pillars around the mechanoid ships, but now a burst from a heavy charge blaster destroys them and my pawns are without cover.

Then there's this change: "--Missed shots now have a 50% extra chance of hitting nothing; this will make missed shots less likely to hit random things (but doesn't change the chance of missing).". I think this is actually a pretty big thing. With many enemies clustered together missed shots used to have a good chance of hitting other enemies. This 'miss damage' is now reduced with 50%, which reduces the total damage output a lot.

I guess all these things were intended by the devs. It creates more dynamic gameplay, instead of the lemming trains into your defenses. I like it; the game is a huge challenge once again and i need to come up with new strategies. But maybe a bit more balancing is needed. Or maybe extreme difficulty should be next to impossible, which it wasn't before. What do you think?

Anyway, congrats to the devs. There's a lot of nice stuff in this update. I'm off playing Phoebe Chillax on rough difficulty now.

Edit: I just read Tynan's post 'The balancing process'. He says overall challenge got lowered, so maybe I'm just on a bad streak or something.
#13
I don't agree with your rejection of the charge rifle. For me it is obviously the weapon with the most DPS stopping power. Check the numbers on https://rimworldwiki.com/wiki/Weapon. Short range the minigun has more DPS, but the warm up time is just too slow, often the target is dead before it starts firing. Also the large miss radius causes too much collateral damage. I don't like weapons with really short range, like the chain shotgun. They will beat your face before you can shoot them and again, it will cause too much collateral damage. Assault rifles are next best, lower DPS, but more time to shoot.

Early
Good shooters: With tribe starts I b-line for the Great Bows tech. They're almost as good as a bolt-action rifle, great range and easy to craft. Also any decent weapons I can scavenge. I prefer Great Bows over low damage firearms like revolvers and autopistols.<text>
Bad shooters: Same thing, best weapon is still the best with low shooters stats. Sometime i use fraggranades on bad shooters, because accuracy isn't as important. I only use melee on pawns with the brawler trait, or with exceptionally high melee and low shooting stat.<text>

Mid
Everyone: Any decent weapon I can scavenge. I b-line for component assembly first, because otherwise you won't be able to craft many weapons anyway. Usually raiders leave weapons like LMG's, Heavy SMG's, assualt rifles, shotguns and sometimes charge rifles. That'll do for a while. I only use sniper rifles for tactical long range combat. Their DPS is just too low.<text>

Late
Everyone: Charge rifles all around. I design my killbox for their optimum range. Nothing passes if enough charge rifles unload. To optimise you can manually set targets to prevent total overkill on one target.<text>
#14
Same thing happened to me. In the screenshot you'll see that Rothaga is restricted to the blue 'Walls' zone, because of a pack of manhunting elk. She is about to go play the game of Ur, but decides to haul an awful steel gladius from my killbox first, which is outside of her allowed area. The elk noticed her, knocked the door down and destroyed my colony.