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

Playtime Tracking #5224

Merged
merged 24 commits into from Jan 4, 2017
Merged

Playtime Tracking #5224

merged 24 commits into from Jan 4, 2017

Conversation

Kyep
Copy link
Contributor

@Kyep Kyep commented Jul 28, 2016

Our current jobs unlock system isn't great, for several reasons:

  • No matter how active you are, you can't unlock jobs any faster.
  • Conversely, no matter how inactive you are, come back in a month and all jobs will be unlocked automatically.
  • This results in players who have older accounts, but are completely new to Paradise, taking jobs like HoS and then trying to act how they do on their home severs - which does not work well here.
  • It also results in new players realizing there is nothing they can do to unlock the jobs they really want any faster, so they tend to "go play another game for awhile" - and often don't come back.

This PR:

  • Enables the tracking of playtime per player. Disabled by default.
  • Adds a new playtime-based job unlock system. Disabled by default. When enabled, heads-of-staff jobs require a few hours of playtime on Paradise to unlock. This prevents people from other servers jumping straight into head jobs on Paradise with no idea how they work on our server.

Please note:

  • This system relies upon the database. It won't work with filesystem-based char profiles.
  • The system can run in tracking-only mode. We can run it this way for a month, before enabling its job unlock system, so that regular players will already have suitable jobs unlocked on day one. EDIT: there is also a SQL query that can be run after patching, to grandfather all existing, active players, and make sure they're counted as having all jobs unlocked.
  • This is not necessarily intended to fully replace the system of unlocking jobs based on your account being X days old. I'd would be very happy if it did, but my more modest goal is to apply it to at least heads-of-staff level jobs. The idea being that people who've never played here before shouldn't be able to hop right into jobs like that, regardless of their account age. They should have to play a little on Paradise before taking jobs with such power/authority/responsibility.

The stats tracking added in this PR could be useful for things other than gating job access. They could also help detect people who cryo every round they don't get antag, for example. It could also be used to identify new players with old accounts.

The main benefit, though, is the new gating system - basing access to jobs on experience, rather than simply account age. This measures playtime far more accurately, and should dramatically reduce the number of cases of people playing Head roles without understanding the department they've signed up to manage.

POST-PATCH INSTALL INSTRUCTIONS

  1. Add the col to the player table:
    ALTER TABLE player ADD exp mediumtext NOT NULL DEFAULT ''

  2. (Optional) Grandfather all active players, so they won't lose any jobs if the unlock system is enabled:
    UPDATE player SET exp='Exempt=1' WHERE lastseen >= '2016-04-01'

  3. Copy the USE_EXP_TRACKING section from config/example/config.txt to config/config.txt
    Be sure to enable the USE_EXP_TRACKING directive.

🆑 Kyep
add: Added tracking for how much playtime each player has.
add: Added the ability to lock jobs based on playtime. E.g: must play for 10 hours to unlock HoS.
/:cl:

@Twinmold93
Copy link
Contributor

A system that is based on the time people having playing the game, rather than just logging in and then not playing just to get full access is a smart move, especially in pushing towards a more reliable set of players for positions whom are expected to know the role, actually giving them time to learn how things on Paradise are done (like SOP, Space Law, and general demeanor) vs pulling their behavior from other servers and expecting nothing to come of it, for people to be the same way.

We have a level of roleplay and competence, and knowing a role well, through playing the lesser roles first, definitely helps us make sure they have time to learn the role first through observation, rather than just doing.

With a system like this, positions can also open up to players far sooner than before, if they show the aptitude to play the game, and the drive to do so, instead of waiting for the day counter to be up. This would actually prove beneficial to players of other servers who know how to do a role, and focus on a role to unlock it in a timely fashion, but theoretically initially focus in a department to do so, which can likely lead to players being better at something singular than just moderate at different roles.

This would also, very likely, make it so someone who focuses RD or CMO doesn't suddenly get HoP or HoS, but has no actually knowledge of how to do the position, and if they only intend to focus one or two departments, don't get thrown into departments they've not yet played as an expected head role from the positions they normally get getting taken by due to RNG. And if they are in a department they've never played, it'd be in a lesser role than the big one, expected to know how to do everything when they know nothing. This means our players in general are better protected, and people looking to ask questions of their boss on how to do things have a much better chance of getting the pointers they actually need than a 'I don't know' response.

@FreeStylaLT
Copy link
Contributor

FreeStylaLT commented Jul 28, 2016

Feels more of an administration thing here I feel like

@Fox-McCloud
Copy link
Member

Feels more of an administration thing here I feel like

@Fox-McCloud Fox-McCloud added the Administration This PR relates to ingame administration features label Jul 28, 2016
@TheBeoni
Copy link
Contributor

I do not play too often which would lead to me not having unlocked security and forcing me to play something i do not want to so i can get something i want. Just for this aspect i am saying i do not like it.
On the other hand having HoS that is not completely shit would be awesome. And sec officers that actualy know space law.

@tigercat2000
Copy link
Contributor

I really think this is completely unnecessary, and can be infinitely better enforced by administrators doing their job and monitoring for shitty heads/security.

@theColdflame
Copy link
Contributor

👍

This is a needed change- time since first join is a bad metric and there's been a general increasein bad command players recently.

@TheDZD TheDZD added the Work In Progress This PR is work in progress, and unfinished label Jul 28, 2016
@Necaladun
Copy link
Contributor

I'm not 100% sure how we'd implement the locking, or if we'd turn it on at all.

The logging though, please yes so much.

@TullyBurnalot
Copy link
Contributor

@Necaladun @TheBeoni I may be wrong, but I believe that Kyets plan is, if this gets merged, to just let it run in the background for about a month or so without locking anything, to give regulars/semi-regulars plenty of time to get enough time logged on to unlock stuff.

@TullyBurnalot
Copy link
Contributor

@tigercat2000 No, not really. Our current job unlock system is ridiculously faulty. This at least offers a viable solution.

@Fox-McCloud
Copy link
Member

Quite frankly, we don't need an additional system to track which jobs are the most popular; we already have a perfectly viable system that does that, as is..and we don't use it.

Stats tracking is good, but there's no point in cluttering up the code with additional systems that we will likely never use (especially when an existing system is already in place for logging). This has come up before with PDAs and several other things. Invariably the data just sat there and was completely unused, whereupon we yanked said logging out at a later point.

We already don't use the data available to us, this won't be any different.

@tigercat2000
Copy link
Contributor

@TullyBurnalot The concept isn't about player experience. It's about preventing low-effort griefing.
A better system that isn't also ridiculously overcomplicated and tries to instill a forced "experience with role" system would, perhaps, be tracking how many times a player logs in (one per restart)

@Spacemanspark
Copy link
Contributor

👍 I've been requesting this for a long, long time.

@@ -246,6 +246,7 @@
if(!is_job_whitelisted(src, rank)) return 0
if(!job.player_old_enough(src.client)) return 0
if(job.admin_only && !(check_rights(R_EVENT, 0))) return 0
if(!has_exp_for_job(src, rank)) return 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not put the statement on the same lien as the if statement.

@TheDZD TheDZD added the Merge Conflict This PR is merge conflicted label Jul 28, 2016
@TullyBurnalot
Copy link
Contributor

@tigercat2000 So I can log in. Then either sit there doing nothing. And that would count.

@monster860
Copy link
Contributor

@TullyBurnalot Actually, this pr doesn't count time when you are inactive.

@tigercat2000
Copy link
Contributor

@TullyBurnalot that still fucking prevents low-effort griefing
you have to dedicate resources to idle constantly for god knows how long

@davidchan13
Copy link

In theory, I can understand the Captain requirement needing every Command job unlocked first.

In practice, it's dumb too restrictive and sends the wrong the message to Captains on how they should manage the crisis.

Captain job should be unlocked by x hours of play across command in total, a sum that can be reached by playing one job or all 5 (8 if you count karma jobs)

Captain should never feel like the most skilled person on the station, but requiring Captain to have experience in all departments is going to reinforce that feeling. The Captain's job is to command. If there is a problem, direct the departments to fix it, and lacking a Head of Department, find someone capable to do the job. Engine not set up? Ride the CE's ass or have the HoP hire new engineers from other personnel, or maybe ask the RD if any Engi Cyborgs have been made that can wire the solars.

The Captain should never feel "well I can do it myself faster than I can ask someone else to do it." It's bad play, power gaming, and leads to the Captain often nicking gear from various departments to make themselves Super Captains without any real cause or justification for any of it.

tl;dr a good Captain doesn't need to know how to RnD, set up an engine, run cargo or how to do surgery or the various niche parts of Space Law and SoP for every department. A good Captain just needs to know these things exist and where to find people to do these jobs. I.E. COMMAND.

@Kyep
Copy link
Contributor Author

Kyep commented Jul 28, 2016

@TheBeoni

  • The intent behind this system is to run it in stats-tracking-only mode for a month or so, before actually using it to gate access.
  • Thus, if you play HoS for even a single shift during that entire month (with the current settings) you will have HoS/etc unlocked on day one. Even if not, it would only take a shift or two for you to unlock them playing normal Security. That's really not much to ask.

@tigercat2000

  • The question isn't whether it is "necessary". Nothing is "necessary". The question is "is this better than what we have now?" The answer to that is "obviously yes! Look how flawed our current system is!". This sort of job-gating system has many advantages over the one we use now.

@Fox-McCloud

  • The main benefit of this is replacing the old "days since account registered" job gating system, which is terrible for all the reasons outlined in the PR.
  • The stats are just a bonus. Also, "we don't use the data available to us"... I wasn't even aware that data on individual players' experience in departments was available to us, even as admins. On the flipside, with this PR, there will be a button admins can click on for any player, to know how much time they've played in each department. Perhaps we'll use the data more when we are actually able to access it easily within the game.

@Davdichan

  • In this PR as-is, you unlock Captain when you have 240 minutes of total playtime in Command jobs. Any Command jobs. In total. A 2h 4h shift as CE would unlock Captain. So would a 2h 4h shift as any other head job. So would two 1h shifts as the same, or different, Command jobs. All that matters is that your total minutes, in all Command jobs combined, is >= 240.
    The system already works exactly the way you are asking for.

@Vivalas
Copy link
Contributor

Vivalas commented Jul 29, 2016

2h != 240 mins by the way.

I like this, especially since it puts emphasis on actually, you know, playing the game. So if you want to actually be active and try to learn the game you can, and get to have a job with responsibility.

@Necaladun
Copy link
Contributor

If this is linked to an adminverb I see it as a very useful tool for just getting info on a player quickly.

Whether to lock jobs behind it or not is an administrative thing to be discussed elsewhere, the code itself here seems good and useful.

@Earthdivine
Copy link
Contributor

I'd much rather not have Job tracking, unless it's not horribly restrictive in time compared to some of our CURRENT ones (30 days for Antag, seriously?).

But time based tracking entirely something we need. That will keep people from making multiple accounts and having a plethora of accounts open to them to grief with. My only problem are people who are coming back from breaks in the server and suddenly having jobs locked out.

@IcyV
Copy link
Contributor

IcyV commented Jul 29, 2016

I am absolutely in love with the idea of all this being logged. Locking a lot of the jobs behind random timers is...questionable at best to me. Botany has arguably one of the highest potentials for mass-grief, for example. An officer might annoy a few people if they're especially terrible, botany could end a round.

I like the concept of something like the Captain or specific Head roles needing a barrier of entry given they can massively influence a round by doing absolutely nothing. But randomly locking other jobs out just feels like it'll kill off potential interest in the server. Why would I want to play somewhere that has everything I consider interesting locked out to me for a long time? It keeps closing in the community to smaller and smaller sets of people. Not that I'm saying the current system is any better.

but my more modest goal is to apply it to at least heads-of-staff level jobs

I think that's honestly the best use of it, at least at first. Any random schmuck can get a quick transfer or get the materials to grief or be terrible easily enough from pretty much any job but head roles have an extra layer of responsibility and requirement to them. A scientist going and shooting people up with syringes and throwing grenades is a nuisance in the round. Losing the RD is potentially crippling.

See PR comment
@Kyep
Copy link
Contributor Author

Kyep commented Jul 31, 2016

@Earthdivine @IcyV @Necaladun @TullyBurnalot @Vivalas @Spacemanspark @Fox-McCloud @theColdflame @Twinmold93 @FreeStylaLT @monster860 @Davdichan

Changes made today in Update 2:

  • Player Panel now shows general EXP for all players under their CKEY. Clicking this will show a very detailed EXP report for that player. This report includes all their XP totals in all categories, their immunity/grandfather status (see later), a list of every restricted job they've unlocked, and a list of every restricted job they have NOT unlocked (with their progression towards unlocking it). Players also get a verb that shows them the same info for their own account, under Special Verbs->EXP.
  • EXP is now granted automatically every minute, rather than at the end of rounds. This means if you leave part-way through a round, you still get credit for the time you were in the round.
  • Mentors now have an "Check Player XP" verb (under Admin tab) that shows general EXP (ie: relative newness to Paradise) for all connected players.
  • Immunity is now supported. Simply run the SQL "UPDATE player SET exp='imm=1' WHERE lastseen >= '2016-04-01'" after merging, and everyone who'se played on Paradise recently will have all jobs unlocked automatically. The unlocking system will apply only to new players.
  • Split the config flags into use_exp_restrictions_heads and use_exp_restrictions_other. The former applies only to heads/AI, the latter applies to all jobs. This system can be run in tracking-only mode, in restricts-heads-only mode, or in applies-to-most-jobs mode. It is up to you. The suggested configuration is tracking on, heads on, other jobs off, with the SQL applied so that anyone who has played here recently bypasses the time requirement.
  • Changed the timers on jobs to be something realistic, not based on test data. Broadly speaking: Captain requires 10h of command job XP, other heads require 10h of XP in their department, AI requires 5h of silicon XP, warden/IAA require 5 hours of security EXP, and MD/Chemist/Genetecist/Viro/Scientist/Robotocist/Detective/SecOfficer/Borg require 1-5 hours of general EXP (the kind you earn by playing anything at all except ghost). Even with non-head job progression enabled, the great majority of jobs unlock after only a few hours of play. The only jobs with remotely demanding unlock requirements are the head jobs.

Overall:

  • Existing players won't be locked out of any jobs.
  • New players, however, will have to spend some time in a department before playing as the head of that department.
  • The system is highly configurable. You can run it however you like.

@Kyep
Copy link
Contributor Author

Kyep commented Aug 29, 2016

I did look at Yogs' system, but the ideas in Yogs' system were mostly the same ones we'd already discussed and rejected.

@TheDZD TheDZD added the SQL Change This PR modifies the game database. This PR must go through the host. label Aug 31, 2016
@Iamgoofball
Copy link
Contributor

By a few hours how many hours exactly

@Kyep
Copy link
Contributor Author

Kyep commented Oct 1, 2016

@TheDZD Fixed merge conflict that arose recently from changes to admin_verbs.dm in another PR.

goofball: The description was out of date. I have updated it. Non-head jobs like sec officer have no requirements defined in this PR. The only jobs that do are head-level jobs. Even those requirements are disabled by default and have to be specifically enabled. If enabled, 10 hours of playing any combination of crew jobs will unlock all head jobs. That's 5 shifts. Assuming a new player plays only three shifts per week, they'll still pass this 10 hour requirement in two weeks, an entire week faster than they'd pass the existing 21-day account-age requirement.

@mvanalphen
Copy link
Contributor

What's the plan for this PR at this stage?

@Kyep
Copy link
Contributor Author

Kyep commented Oct 25, 2016

My plan: wait for the maintainers to merge it.

@@ -250,6 +250,7 @@ CREATE TABLE `player` (
`nanoui_fancy` smallint(4) DEFAULT '1',
`show_ghostitem_attack` smallint(4) DEFAULT '1',
`lastchangelog` varchar(32) NOT NULL DEFAULT '0',
`exp` mediumtext,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will this be? What will be inserted into this row, and why is it ´mediumtext´

Copy link
Contributor Author

@Kyep Kyep Nov 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"exp" is a comma-separated list of name/value pairs. It tracks the number of minutes that the player has spent in each stats category. Example value from my test database: "Living=610&Crew=610&Special=0&Ghost=30&Exempt=0". Translated, this means I've spent 10h10m as a living mob, 10h10m as a crew member, 30 minutes as a ghost, no time as a special role, and I'm not flagged exempt. Records like this will be set for each active player. The field type is 'mediumtext' because that's the type used for similar storage fields like 'be_role'.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, alright, gotcha

@TheDZD TheDZD added the Configuration Change This PR changes the game configuration files. Please run via the host. label Nov 25, 2016
for(var/text in jobs_locked)
return_text += "<LI>[text]</LI>"
return_text += "</UL>"
return return_text
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're going to be making a large string using a bunch of +=, especially for a dynamic matter like this, I recommend you use the List.Join technique to make this work much faster.

else if(href_list["getplaytimewindow"])
if(!check_rights(R_ADMIN))
return
var/mob/M = locate(href_list["getplaytimewindow"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

locateUID is now in use.

if(mob.mind.assigned_role in exp_jobsmap[cat]["titles"])
play_records[cat] += minutes
if(announce_changes)
to_chat(mob,"<span class='notice'>You got: [minutes] [cat] EXP!")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cat XP, the most important experience

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh no, I accidentally got cat xp removed

time to commit sudoku 😢

5 3 _ | _ 7 _ | _ _ _
6 _ _ | 1 9 5 | _ _ _
_ 9 8 | _ _ _ | _ 6 _
------+-------+------
8 _ _ | _ 6 _ | _ _ 3
4 _ _ | 8 _ 3 | _ _ 1
7 _ _ | _ 2 _ | _ _ 6
------+-------+------
_ 6 _ | _ _ _ | 2 8 _
_ _ _ | 4 1 9 | _ _ 5
_ _ _ | _ 8 _ | _ 7 9

@Vivalas
Copy link
Contributor

Vivalas commented Nov 28, 2016

Wow is this the US government or Paradise? Way to see a great idea be watered down to nothing because of useless bureaucracy. Don't have even the slightest of the idea why the staff are so vehemently against job tracking based on department and role.

@Kyep
Copy link
Contributor Author

Kyep commented Nov 29, 2016

@Crazylemon64 All the changes you requested are done.

Kyep added 2 commits December 2, 2016 22:53
Added 5h playtime requirement to play sec officer, warden, or borg.
Discussed on staff chat, proposed as easy way to mitigate recent tide of
bad security play.
@Kyep
Copy link
Contributor Author

Kyep commented Dec 3, 2016

Two small updates:

  • Fixed a new merge conflict that arose after the Patreon PR was merged.
  • Added an optional 5h playtime requirement to the officer/det/warden/borg jobs, to combat recent trend of people with no Paradise experience whatsoever attempting to play security. This was discussed on staff and player discords, everyone supported the idea, so, added. @FreeStylaLT

@marlyn-x86
Copy link
Member

Clean by me - nothing looks like it's become obsolete, either, so I'll go ahead and get the database prepared for the change, then merge this

##Unhash this to enable playtime requirements for jobs that have them defined.
#USE_EXP_RESTRICTIONS
##Unhash this to allow admins to bypass job playtime requirements.
#USE_EXP_RESTRICTIONS_ADMIN_BYPASS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should either be
A) Uncommented by default
B) Changed to be an option of "DISABLE_EXP_RESTRICTION_ADMIN_BYPASS", and make the bypass on by default in the configuration controller.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

@Kyep
Copy link
Contributor Author

Kyep commented Jan 1, 2017

@tigercat2000 Changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Administration This PR relates to ingame administration features Configuration Change This PR changes the game configuration files. Please run via the host. SQL Change This PR modifies the game database. This PR must go through the host.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet