mars-sim / mars-sim

Mars Simulation Project Official Codebase
https://mars-sim.com
GNU General Public License v3.0
107 stars 38 forks source link

Create group activities or trainings #971

Closed mokun closed 6 months ago

mokun commented 1 year ago

Is your feature request related to a problem? Please describe.

Describe the solution you desire to see

Describe the rationale

Specifications

Additional context

bevans2000 commented 1 year ago

It would be difficult to make Task and MetaTask be group orientated because they are driven by the individual. But yes we could look to the new Project concept to provide group training. This would work. I think in 3.7.0 we should convert all the missions to the new approach and then we can expand the reach of Projects

bevans2000 commented 1 year ago

As part of this issue I will convert the TrainingUtils class to be configuration based on an XML file. The current implementation contains a lot of magic numbers.

mokun commented 1 year ago

The current implementation contains a lot of magic numbers.

But how would you do the mapping without 'magic' ? Namely, have each training type provide a weight to each role.

mokun commented 1 year ago

As part of this issue I will convert the TrainingUtils class to be configuration based on an XML file.

Sure. Good idea.

bevans2000 commented 1 year ago

I think it will fit nicely in the Person.xml but I will check tomorrow

mokun commented 1 year ago

How easy is it to create indoor (within settlement) group activities now ?

bevans2000 commented 7 months ago

@mokun I'm liking the progress I've made on this change and think it will be a good addition to what we have.. Agreeability progress is slow because I'm limited for time.

At the moment I have regular Team Meeting running but will extend in to Training, Birthday parties, Funerals, Induction meetings for new Settlers & Promotion Announces as well as social le events like Movie night. They are actually all the same pattern but with different benefits to Persons. But I've got to make a decision how the configuration is done and not make it too onerous. My thoughts are:

mokun commented 7 months ago

So we'll need to work out something new in how to set aside a conference room or an area with tables and chairs, a decent location where a meeting can be designated, right ?

bevans2000 commented 7 months ago

So we'll need to work out something new in how to set aside a conference room or an area with tables and chairs, a decent location where a meeting can be designated, right ?

No because each activity uses the BuildingCategory to select a meeting place when the meeting starts. People will walk to the Building for the meeting

bevans2000 commented 7 months ago

@mokun I'm thinking about what benefits a Person can get attending a group activity. They get increase in some skills if it's training related. But what about Social events, should we have the ability to increase Natural Attributes as well? For example, going to a Movie Night how does that affect a Person?

mokun commented 7 months ago

going to a Movie Night how does that affect a Person?

It should improve moral and the willing to work with others.

Moral as an abstract idea is essentially how positive a person feels about working together with others.

So, it's metric that can be defined by the 2 dimensions of emotion.

bevans2000 commented 7 months ago

going to a Movie Night how does that affect a Person?

It should improve moral and the willing to work with others.

Moral as an abstract idea is essentially how positive a person feels about working together with others.

So, it's metric that can be defined by the 2 dimensions of emotion.

Ok, makes sense. So we need the ability to modify emotions as well as skills.

bevans2000 commented 7 months ago

What I'm thinking is to create a new class ExperienceBenefits that defines what changes to a Workers skills and Natural Attribute occur when doing something for a period of time. For a Person it also includes changes to their emotions/stress. Then a thus is applied to a Person at the end of the Group Activity. Each type of activity will have a different experience profile defined in the Settlements.xml

Then the clever thing is to use the new class in Task so it is all unified for GroupActivity and existing Tasks. For the latter there would be a sharable static instance per Task type. Currently all these attributes are individually passed to the Task constructor.

Same logic could be used any Training and Missions.

This would simplify the Tasks which would be a benefit.

mokun commented 7 months ago

ExperienceBenefits that defines what changes to a Workers skills and Natural Attribute

Same logic could be used any Training and Missions. This would simplify the Tasks which would be a benefit.

Yes. Shall we also describe the outcomes of each group activity in ExperienceBenefits ? Say we have 5 tiers of outcome :

  1. Perfectly Executed
  2. Quite Smoothly Executed with one or two discrepancies
  3. Finished execution with a few hiccups and discrepancies
  4. Poorly executed with many discrepancies
  5. Never quite finished
bevans2000 commented 7 months ago

Tiers of outcome. I hadn't thought of that. Could be useful for training

bevans2000 commented 7 months ago

Right I have a plan now. The root of this is how aTask updates the Worker. Taking part in a Group activity is a Task anyway. There are multiple ways to apply experience across the Tasks plus a total different approach to stress. And no affect on the other emotions. So I am going to create ExperienceImpact that covers all impacts to a Worker, it can replace the multiple add experience implementations. A Task will have a reference to an impact object and used it instead of the internal logic. The key benefit is that this is self contained and stateless which means they can be shared between Tasks of the same type. Secondly different the different Group activity types can also have different impact objects.

This will simplify the Task logic and cut down on the number of fields. First will create the new class with unit tests. Then retrofit to the Task class without changing the existing subclasses. Then we can fully adopt the approach in the Task instructor to start exploiting a richer way to define impact on workers.

Potentially we could expand this to include fatigue as well instead of that being separate.

bevans2000 commented 7 months ago

@mokun Ok, I've look at the EmotionManager and give up. How can we modify the "happiness" impact of someone going to a meeting or Birthday party.

mokun commented 7 months ago

How can we modify the "happiness" impact of someone going to a meeting or Birthday party.

Yay emotion is a 2-D quantity and not a one-axis (1 to 10) metric.

mokun commented 7 months ago

How do I add a group activity in its tab below ?

image

bevans2000 commented 7 months ago

Odd,they should be added automatically based on the settlement size. Check the future events from the Console to see if any are scheduled.

bevans2000 commented 7 months ago

There is a typo in the settlement.xml so only settlement templates with a default-population of 15 or more will work. I will fix it.

mokun commented 7 months ago

But eventually we want to players the options to enroll in their own group meetings and allow them to define the benefits, right?

Speaking of that, I'm also thinking of a "modding" mechanism that offer players to become creative...

This way, we tap into the potential of players to come up with certain simulation interactions in ways we as developers haven't been able to fine-tune.