Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add notable events #7

Open
AamuLumi opened this issue Nov 24, 2022 · 5 comments
Open

Add notable events #7

AamuLumi opened this issue Nov 24, 2022 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@AamuLumi
Copy link
Owner

AamuLumi commented Nov 24, 2022

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 AamuLumi added the enhancement New feature or request label Nov 24, 2022
@AamuLumi AamuLumi added the help wanted Extra attention is needed label Mar 3, 2023
@AamuLumi
Copy link
Owner Author

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
Copy link

Kalmorph commented May 9, 2023

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:

  • colonist ranged combat log entry X animal as target = hunting activity
  • colonist any combat log entry X another human = duel
  • several colonists combat log entries X several targets = shotout

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:

  • Expand the social diary entries adding the current activity, to include context.
    John spoke about caves with Mark while <current_activity>.
    John spoke about caves with Mark while hauling rice to storage.
  • Add raw combat logs to the diary entries.
    John chopped the cougar with a knife's blade, lacerating his right lung and front right log while smirking
  • Add diary entries when a new room is created.
    A new <newroom_type> is created. A <oldroom_type> changed to a <newroom_type>.
    A new bedroom is created. A bedroom changed to a prison cell.
  • Add specific actions to be logged (sleep, eat, pray, convert a prisoner, tend a colonist, lovin', etc) and options to player to choose which one they want to log or not.
    John is going to <current_activity> John is going to cook fine meals x4

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
Copy link
Owner Author

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 :

  • currently, I use logs generated by Rimworld for the display in the Diary window. Maybe I can override the current Rimworld logs to fix that, but I don't remember how these logs are generated. I have to take a look to understand if it's easily doable.
  • I have to check where combat logs are stored. I remember we can normally consult these logs somewhere in the vanilla UI, so it should be not that hard.
  • specific actions (or "not logged by Rimworld" actions) are covered by notable events. I'll use your list to create basic notable events. To be honest, I stopped to work on this because I didn't know what events are useful to log, so with your help, I can probably continue that. :)

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
Copy link

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 AamuLumi added this to the 1.2.0 milestone May 11, 2023
@AamuLumi
Copy link
Owner Author

AamuLumi commented May 11, 2023

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 :

  • create a system to identify similar logs to avoid logs duplication.
  • create a new UI to display Grouped Log Entry.

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants