unitystation / unitystation

The original unitystation
https://unitystation.org
GNU Affero General Public License v3.0
704 stars 648 forks source link

End-of-round-score screen B: 100 #5817

Closed PerfectTangent closed 1 year ago

PerfectTangent commented 3 years ago

An often talked about subject is the lack of motivation for the station personnel to do anything. Antagonists have greentext, but the majority of players in a given sessions aren't explicitly rewarded or punished for good or bad behaviour. I think it would have a measureable positive effect on the game if there were objectives for the crew to accomplish.

the Station should get greentext just like antagonists, having a randomly chosen objective to accomplish. For now, it will just be filling the plasma sheet quota that is printed out at the communications console at the start of every round (track how much plasma ore has been processed by the ore smelter). Perhaps we can have objectives for other ore types as well?

What is Expected:

Screenshot_2020-11-26_093425

germanFid commented 3 years ago

I came here to fix it!

germanFid commented 3 years ago

Let's think how to make a registration of some activities.

germanFid commented 3 years ago

Let's think how to make a registration of some activities.

Maybe I should refer to another game's achievement systems?

NoooneyDude commented 3 years ago

Hmm. I don't know how other games go about doing this sort of thing. I'd be interested if you find something.

We probably want to allow for the registration of these activities, or the updating state of statistics or an objective, during the round progression, and at roundend. That way, the activity in question can decide which method is most suitable. For example, tracking total deaths may be easiest during round progression, whereas station damage might best be done in one go at roundend. It would be desirable for the stat sources to leave a small footprint for ease of implementation and code readability. We may also want to make this data persistent at some point.

One way would be to create a "StatsManager" similar to the game's other managers. The manager would be responsible for generating station objectives and storing statistics. Perhaps these could be stored as some "Statistic" object in a collection, which the rest of the codebase can update if they have knowledge of some identifier.

Some scripts might want to control their own statistics at roundend. For these, perhaps an interface might be useful, say, "IStatsCollectable". MonoBehaviours that implement this interface would register themselves to StatsManager so that when roundend comes, the manager runs through the list of registered interfaces, collecting the Statistics objects for processing, along with the aformentioned existing collection of Statistics objects. Processing would involve displaying the statistic as a string in the roundend stats window, for now. Each Statistic object could be responsible for generating its own string.

I imagine objectives could be construed in a similar fashion. Take a look at Objective.cs

Update: could consider using ScriptableObjects as statistic object. Type, name, description etc could all be serialized for the inspector.

DTraitor commented 3 years ago

If we will take scores from station if it is damaged, how the game should decided if station was damaged or just rebuild?

germanFid commented 3 years ago

If we will take scores from station if it is damaged, how the game should decided if station was damaged or just rebuild?

In my opinion, that’s odd. Cause it doesn’t matters how’s the state of station, if everyone was evacuated.

But we can look at atmos in suspicious region. If it doesn’t exists, region is damaged.

corp-0 commented 3 years ago

In my opinion, that’s odd. Cause it doesn’t matters how’s the state of station, if everyone was evacuated.

It is more about rewarding a crew that kept the station tiddy and in good shape.

But we can look at atmos in suspicious region. If it doesn’t exists, region is damaged.

Tiles have integrity, we could just check for all of them and see how damaged they are.

germanFid commented 3 years ago

In my opinion, that’s odd. Cause it doesn’t matters how’s the state of station, if everyone was evacuated.

It is more about rewarding a crew that kept the station tiddy and in good shape.

But we can look at atmos in suspicious region. If it doesn’t exists, region is damaged.

Tiles have integrity, we could just check for all of them and see how damaged they are.

Thanks for clueing!

PerfectTangent commented 3 years ago

We could take an image of the station scene somehow at the start of the round and compare the state of things at the end of the round. This would also allow us to reward expanding the station

corp-0 commented 3 years ago

We could take an image of the station scene somehow at the start of the round and compare the state of things at the end of the round.

how would you compare? Machine learning? How would it evaluate re-structuring the station? Probably the simplest is the best bet here, just check all station tiles and see they health.

PerfectTangent commented 3 years ago

Count the number of tiles, machines, and walls that the station matrix has at the start and the number at the end. If it's higher, then bonus points. If it's lower, then apply a penalty

AutumnNova commented 3 years ago

im not entirely sure that would work considering the entireity of space counts as the station matrix also not sure thats possible with how tilemaps are currently handled

PerfectTangent commented 3 years ago

Others have done exact same thing with the unity tilemap system before. I found a sample script that was only 50 lines of code that'd allow data to be stored and collected from individual tiles.

corp-0 commented 3 years ago

so by image you don't mean a literal image

PerfectTangent commented 3 years ago

No, not a literal image file

germanFid commented 3 years ago

If we will take scores from station if it is damaged, how the game should decided if station was damaged or just rebuild?

Well, if it was rebuilt badly, we should pay attention to it. Because of that, I'd use an integrity like a criterion

NoooneyDude commented 3 years ago

Related to issue #5499.

germanFid commented 3 years ago

@PerfectTangent @corp-0

Made a template system, collecting data from another script and representing it like UI.Text.

Here are some schemes, showing how it works:

Frame 3 Frame 4

Well, next step is waiting me. I need to integrate my template with UnityStaton and write some docs for other contributors, that are supposed to use it and create some statistics for us.

P.S. I plan to make some kind of tracking by myself to present an example how to use my system.

corp-0 commented 3 years ago

Sounds pretty good already. Keep us informed as you progress.

PerfectTangent commented 3 years ago

@germanFid how is it coming along?

germanFid commented 3 years ago

@germanFid how is it coming along?

@PerfectTangent Hello. I'm very sorry about delays. I'm going to deal with UI Manager in two next days.


P.S. I have some truolbles connected with my education and most of mt time goes there. Let me know if the others are really waiting for me. Sorry one more time.

corp-0 commented 3 years ago

This bounty is free to claim again.

MoonTheBird commented 3 years ago

is anyone currently working on this

MoonTheBird commented 3 years ago

since it seems like nobody's working on this (and i was given confirmation by @corp-0) i guess i'm gonna start working on this

MoonTheBird commented 3 years ago

got some good progress on this today but i require sleep

MoonTheBird commented 3 years ago

aight, #6081 should complete the greentext half of this onto the scoring bit

PerfectTangent commented 3 years ago

@MoonTheBird is unable to complete the second half of this bounty related to the scoreboard and has asked to be unassigned. #6081 will complete the first requirement once it's merged.

PerfectTangent commented 3 years ago

This bounty will be free to claim again once the feature freeze is over. See #6275.

PerfectTangent commented 3 years ago

I appreciate your determinism. I would like to acknowledge that Moon completed the first objective for station greentext in #6081, and so they are entitled to 25.00 USD (half) of the bounty. However, given that the second objective is a time consuming process, we were going to break it off and add to its bounty. If you are still game, then I will assign you.

PerfectTangent commented 3 years ago

Price for completing the remaining requirement of adding the score screen evaluated at 45.00 USD.

AlexMorgan3817 commented 3 years ago

I appreciate your determinism. I would like to acknowledge that Moon completed the first objective for station greentext in #6081, and so they are entitled to 25.00 USD (half) of the bounty. However, given that the second objective is a time consuming process, we were going to break it off and add to its bounty. If you are still game, then I will assign you.

I though that this is freezed cause of this https://github.com/unitystation/unitystation/issues/5817#issuecomment-821719229 🐸

AlexMorgan3817 commented 3 years ago

And if first part done, than why you don't mark with mark? image

PerfectTangent commented 3 years ago

And if first part done, than why you don't mark with mark?

because it hasn't been merged yet.

PerfectTangent commented 3 years ago

I though that this is freezed cause of this #5817 (comment) 🐸

this bounty currently is subject to the feature freeze, yes, so it can't be merged until it's over.

MoonTheBird commented 2 years ago

this is still open, yeah? i might try to do this second half- hopefully all-the-way, this time!

corp-0 commented 2 years ago

go for it, should I assign you?

MoonTheBird commented 2 years ago

that'd be nice, thanks!

PerfectTangent commented 2 years ago

@MoonTheBird any progress with this?

PerfectTangent commented 2 years ago

@MoonTheBird I am going to unassign you again. Can reassign if you've actually made progress.