AamuLumi / Rimworld-Diary

Rimworld mod to write, read and export colony's tales.
MIT License
7 stars 0 forks source link

Add notable events #7

Open AamuLumi opened 1 year ago

AamuLumi commented 1 year ago

Idea from morryatay on Steam

Notable events are events with specific parameters and conditions.

Example 1 : if the previous action of a pawn was hunting a rat and this pawn get hurt, something like "Jim hunted a rat and ended up in a critical condition" will be added to the diary. Example 2 : "Raided by XXX faction - we lost 4 good people" when raided by XXX, raid finished and 4 paws died.

I have to take a look to the Rimworld event system to check how events are set to done, how I could get previous action before something happen, and how to write translations with custom parameters.

If this is feasible, we'll use something like this pattern to add a new notable event request :

## Conditions
- Pawn previous action was hunting
- Pawn faint

## Output parameters

- <animal_hunted> : animal targeted during pawn hunt

## Output

"Jim hunted <animal_hunted> and ended up in a critical condition"
"Jim tried to hunt <animal_hunted> but got hurt during a tough fight."

System will accept multiple outputs for a notable event to create a diversity in sentences written in Diary. When there's multiple outputs, the system will choose one randomly.

AamuLumi commented 1 year ago

I started working on a prototype on the notable-events branch. It works correctly and I can generate texts with a degree of random. I have to add a lot of situations to have a good system.

Kalmorph commented 1 year ago

Hey, I'm the guy from the ChatGPT experience.

I think the intention of this idea could be more useful to people that wants to keep their diaries with fewer logs. I don't know how far my experience using data exported with your mod can be helpful in this situation, but my idea is to first try to think a way to export these raw logs first, then after that, make the mod identify certain activities based on the data they logged, forming something like a "grouped log".

Examples:

The challenge eventually would be to find a way to "group" these logs in a single diary entry, but since the mod is still in the "raw output" to make diary entries, maybe expanding that way to their best before managing a way to group them up. Raw logs that can be added to the mod currently to expand their functionalities:

Later on, you can find a way for the mod to identify certain things in order to group them up as a single entry. Again, this is more up to those who wants to keep their diaries with fewer logs. I, personally, think that the more context things are given, the more like an actual diary it seems, which turns to be better using raw logs for that purpose.

AamuLumi commented 1 year ago

Hey Kalmorph !

Thanks for coming to Github to continue the discussion.

For the first part, yeah, you're right : we cannot implement this with the current text area I use. I created #13 to track this enhancement. I'll probably do this after notable events.

For the second part, i see three things :

For the third part, it's a good idea, but we needs at least #13 to be done. I added another issue to track this feature (#14).

I don't know exactly when I'll work on this, but I hope at least to add the notable events soon.

Kalmorph commented 1 year ago

I actually thought that "grouped logs" and the notable events was basically the same thing, since they ended having the same purpose (summarize several actions in a single entry), considering that every action has a log. My main point was to orientate which logs/data is more useful to output and, therefore, start looking how to log each of them. Not to mention that keeping logging just raw outputs, you wouldn't need to rework in the UI yet.

AamuLumi commented 1 year ago

Well I re-read your issue, and I didn't understand correctly during my previous comment.

What you're explaining seems indeed related to notable events, except the notable events are based only on one action which is not normally logged by the game. For this kind of grouped log, I can probably listen for the events and when I detect something related which a previous entry, I block the writing of this new event.

I think I'll separate #13 to 2 new tasks :

I think the first task is what you want. And it avoids the pain of the UI reworking.

I let you confirm for the first task. :)