AI building/running a Settlement MOD Idea/Request

Started by PJCzar, May 01, 2018, 11:18:26 PM

Previous topic - Next topic

PJCzar

I was thinking how great it would be if there was an AI that could run a Colony, building, assigning tasks and such, just as a human player would. We have the storytellers, which analyze players colonies and react with events. Why not run a second "storyteller" which does the same things a player would?

You can read this same post in the Steam Community Discussions of Rimworld here:
https://steamcommunity.com/workshop/discussions/18446744073709551615/1696046342849795034/?appid=294100

I am not a coder. Please take what I am writing below as nothing more than ideas and not specific ways to code this idea. Please read the whole thing before bringing up potentially out of context elements of this idea. It is hard to explain in only 1 string of thought and may sound broken at times.

Basic implementation of this idea:
As we play Rimworld the storyteller controls events in our game via, analyzing the wealth and health of the colony and its inhabitants. Storytellers activate events based on these numbers and stats attempting to either hurt or help the colony. I, therefore, put forward that the storyteller AI could be duplicated and modified to assign tasks, building, gathering and draw zones, based on the same stats and numbers.
examples:
Number of sleep spots/beds > or = number of colonists? if no, build more sleep spots/beds in locations suitable.

Food amount > or = the recommended amount (as set by default or designated by mod settings)? if no, assign applicable colonist (within skill threshold) to hunt/harvest/sow/slaughter depending on how immediately food is needed. (hunger of colonists)

Storage space > or = the number of objects designated of value to the colony? if no, place more storage locations, such as shelves or stockpile zones, depending on the type of objects found to be valuable but not stored in a stockpile or off the ground/under roof cover. (such settings could include making sure food items are on shelves or other such containers, while steel and stone blocks only placed in stockpiles, roofed or not. Wood and other valuables that do deteriorate but don't need to be off the ground can be designated to be stored in simple roofed stockpiles.)

The AI would rely on human building designs and blueprints which could be uploaded to the workshop and downloaded as independent modpacks of blueprints with potential uses attached in a manner the AI can choose from based on its needs at the time of placing the blueprint. Currently, there is a mod created by Steam user 'Fluffy' which I use that deals with Blueprints and saving them for later use in that game session. However, the blueprints do not survive closing that game, regardless of saving. I believe that with permission from that mod writer and some tweaking of the save functionality of the "blueprints" within a short period of time a wide spectrum of user-designed buildings and floorplans could be utilized by the AI to effectively create a fully functional AI managed Settlement.

Why would a player want an AI to be capable of this?
1 - Simulated Cooperative Gameplay
2 - Competition between colonies
3 - Living inside Friendly Colony in purchased Zones

1 - Simulated Cooperative Gameplay:
The AI faction settlements are not really settlements on par with the player colony due to lack of self-sufficiency and inability to change that. By implementing a modified storyteller AI that can add that player like building and expansion goals, a human player can find themselves either working against or alongside an expanding and goal oriented faction.We will never get full Cooperative multiplayer experience in Rimworld as much as that pains me to admit. The next step is to have an AI running non-player settlements that isn't on the same level of intelligence as the animals. Which honestly is what we have right now.
Obviously, this whole mod would be rather harsh on the players CPU. A simple fix for this would be that since we are now allowing an AI to effectively act as a player, leading to expansion and further colonization of unsettled hexes, the number of settlements at first generation of the Rimworld must be brought down to match the number of factions. Each starting with only 1 settlement unless otherwise designated by the user in mod options.
Just like a human player, the AI could send out scout parties to find and analyze the colonization value of unsettled hexes, taking into the equation the type of faction and their most needed resources. When I say "the type of faction" I am referring to its hostility, tech level, and terrain already settled, showing a preference for similar hexes to those already occupied except when a base resource is becoming scarce in already settled hexes. Say, for example, a human player that has a colony in an arid shrubland may have a lot of farmland but little wood or stone. We know that if we want to settle another hex it makes sense for the human player to settle a forested or mountainous hex in order to attain inaccessible resources. And unless accessible technology can negate it, there is an obvious preference for temperate climates as well. All these factors could be input into a modified storyteller AI to effectively simulate a player-like management of AI faction settlements providing the illusion of Cooperative Multiplayer in Rimworld.

2 - Competition between colonies:
While playing Rimworld There are prebuilt, procedurally generated settlements occupied by AI factions. If you visit one of these and watch the colonists there you will see that these buildings and colonists are not really a colony. The AI faction colonists eventually starve or die to an event which only happens because you are there and the storyteller is reacting to your presence. They do not sow or harvest or hunt. They do sleep in the beds, but there is usually either not enough or an unnecessary amount. They start with a couple piles of food which are just sitting on the ground and due to the way the food is labeled within the game, nothing is keeping wild animals, or the player, from walking up at eating or stealing it all.
With each faction starting with only one or a very few numbers of settlements, (due to a users CPU capabilities) the Player will find themselves in a race for military, resource, and terrain dominance, adding to Rimworld a Grand Campaign-like RTS experience.
These AI settlements are not a challenge for a human player with exception to the mob rush like defense they have when attacked. Whether or not Raids sent to attack player colonies, which are events activated by the storyteller, are actually made of colonists actually from a settlement, I don't know. I doubt it though considering the other corners cut in this game for very good reasons such as simplicity of the game.
That's why this should be a mod, as this may not be wanted by every player.

3 - Living inside Friendly Colony in purchased Zones:
In Rimworld there are zones that can designate allowed access to certain pawns. These are creatable and modifiable by the player and with this mod, by the AI. On the edges of each play area, there is a border zone where a player cannot build. I must imagine it is possible to designate all Home area, occupied by an AI faction as a no building zone for the player. On top of that, it would be possible that an AI settlement could reach a point in its own life that one of the "building types" constructed by the AI which would act as "Plots of Land" available for "Rent" or "Sale" to the player, depending on faction relations.
Let me elaborate further.
As per the user-defined mod settings, generation of the Rimworld could contain an AI faction settlement which would be far enough along in its life to have an efficient community with land to spare. This settlements management AI would designate a Zone of unimproved or otherwise not needed cells as being connected to a "Lease" or "Deed" item crafted by a settlement leadership at the location. The settlements leadership pawn could be traded with by the player to exchange a large amount of silver once, or a smaller amount each Quadrum, for complete control over one or more of these such Zones by way of possession of a "Lease" or "Deed" item which could be linked to the zones permission settings. The zone would no longer be designated as a part of the "Home Area" of the AI faction Settlement but rather listed as the "Home Area" of the players faction while also unexpandable.
The point of this is to create a playable area within the now self-sustaining AI settlements for a players pawns to live and maybe run a business in order to pay the "Rent", either producing goods on site to sell back to the community or by providing a lodging for your caravaneers brings goods from your other settlements to be sold on site. Ideally, the locals would pay even more for goods from such a "Lease" or "Deed" holder since the relations would be increased as long as they are held in good esteem.

Thank you for reading this post about my idea for a probably impossible and quite large and I'm sure, a laborious mod that would surely be a huge feat for a modder or even a team to create. As it is dependent on already existing mods, and would require permission from those modders to be implemented at all, which can always be troublesome.
I hope we can have a discussion about the possibilities of this idea and I hope all the responses aren't just filled with "its impossible!" "it'd be too hard to do!".

Umbreon117

I'd fully support whoever did this.

The reason I'd want this is because I don't want to always split my attention between two or more colonies, but I don't want to drag down another colony just because I'm not paying attention to it.

The only times I'd want to be forced into looking at the other colony is if one of the colonists are being attacked, are at risk of dying from a sickness, or that colony is being attacked. Otherwise I'd I would only occasionally hop over to it to see how things are going, and maybe change some things to how I want them to go. (Making a pump shotgun instead of a chain, jacket instead of parka, etc.
I'll shoot your colonists...After a long nap.

Tober6fire

It is a good idea and would work for simple mechanics such as building, farming, and mining but for fighting and dealing with some of the storytellers aI events Such as man-hunter it would probably kill the colonies by keeping them in their room (because in man-hunter event the storyteller would recommend to keep the colonists inside) and killing them from starvation. As I said the building, farming, and mining probably won't be that hard To do including if you use the blueprint idea. I am just more worried about the fighting mechanics you got any idea for that
I love stories and I hope that everyone try's to contribute in telling their stories as it is interesting and intriguing to see people connect through the tales they create.

Canute

An AI running colony might work, but not like you main colony as detailed map.
As plain colony that can grow and produce resources, and that start event's like defend the colony from raid/manhunter.
But these event map don't reflect colony stats, they are just like regular outpost maps.

A detailed map, like your main colony would need an alot more clever AI script, not to speak about cpu power, while most people allready encounter lags.