vgstation-coders / vgstation13

Butts
GNU Affero General Public License v3.0
265 stars 542 forks source link

Antag Datums. #13014

Closed 9600bauds closed 5 years ago

9600bauds commented 7 years ago

Everyone knows we need antag datums. Nobody knows what antag datums are.

We simply don't have any document written down on how antag datums should be implemented. We need to think this through before we start doing anything. So let's talk about antag datums.

What are the goals of antag datums to begin with? Besides procs such as generating objectives, generating equipment, etc etc... How much information should be moved into the datum itself? How could we tie the mind of the antag player itself to the antag datum? How could we transfer it? What about cases such as changelings, which currently do almost everything on the mob's mind? How do we handle "team" gamemodes such as Cult and their objectives? It seems logical to make a "gamemode" datum itself, but how would those be structured, should there be a singleton datum for each gamemode that is not initialized until necessary?

For the admins-not-coders here: What is something you hope antag datums will let you do?

At the end of all this I'm hoping we can make at least a flowchart with the final structure of the datums themselves.

ghost commented 7 years ago

Had me excited there for a moment

9600bauds commented 7 years ago

I'm making it happen as soon as we figure out what "it" even is.

PJB3005 commented 7 years ago

Nobody knows what antag datums are.

I disagree.

Anyways, real talk:

There would be 2 sections to antag datums. Singleton types that define the spawning, requirements, equipping, etc... of antag, and an according datum type that's used to store data for an individual mind, see changelings.

Bay currently does the former where the antag datums specify almost everything, including player counts for when to spawn the antags, equipment, etc... They are singletons and gamemodes mostly are just presets that select which antag datums to use. For stuff like Cult, these antag datum singletons also store all data related to cult such as words, which is basically the same as using global variables everywhere except not.

Their system is mostly 🆗 but I don't think they have the second part.

Second part being objects on the mind of a player for every antag type they are. Stuff like changeling and vamp are primary targets for refactoring here, see also wizard spell points. Probably just have a generic abstract class that does nothing but point back to the mind, and then have the mind store an associative list of antag type = antag data.

That does leave an issue with how mind transfers work, because should vampire and changeling logically transfer when a mind gets swapped?

9600bauds commented 7 years ago

The singleton datums would make sense for me to be the "gamemode" itself which handles team objectives and such and such, why have a singleton datum to handle antag equipment and such though? Why not just have those procs in the antagonist datum itself?

I'm assuming here of course that we're not doing Bay's system of one singleton datum per antagonist, but rather one singleton datum per gamemode and then one datum per antagonist. "Gamemode" being "the controller-ish thing that handles everything about cult", not the roundstart gamemode which would be a glorified "just like make cult".

PJB3005 commented 7 years ago

Bay's system is one singleton datum per antagonist type, they have no per-mind types AFAIK.

why have a singleton datum to handle antag equipment and such though?

The singleton still has access to the data needed for doing the equipping. The individual datums (data?) should be more variables stores than anything.

Exxion commented 7 years ago

I feel like having the mind one do the equipping might be better for handling things like race-specific equipment

It would also mean that a bussed-in antag might not need the whole gamemode datum to operate

9600bauds commented 7 years ago

I think that the gamemode datum would also be the best place to handle things like the round-end screen, which would be the easiest bookkeeping

So if you make one lone cultist in a wizard round, the cult gamemode datum gets initialized, gives the guy his objectives, gives him official cult status, and then not much else. No need to look for other players to convert to cult or anything, it's just bookkeeping.

Exxion commented 7 years ago

Definitely. Though I guess that would mean bussed antags would still need the singleton to show up there

9600bauds commented 7 years ago

Relevant links of previous discussion

https://github.com/d3athrow/vgstation13/issues/9762#issuecomment-215823178 https://github.com/d3athrow/vgstation13/issues/9762#issuecomment-215827453

Kurfursten commented 7 years ago

We definitely separate mind and mob. Months ago I tried to start a PR to consolidate all our existing mob AI into a mind datum that could flexibly perform different behaviors (flee, fight melee, fight at a range, wander, calm down, etc.) but the project fell apart because of the scale and life getting in the way (for once, this doesn't mean life.dm). It's still on my internal wishlist of things I wish I would do.

I know that's only a tangent - you're talking about player minds, not AI minds, but it's the same sort of thing in the long run, consistencywise.

Exxion commented 7 years ago

Please, for the love of all that is holy, do that, Kurfurst BYOND's built-in pathfinding is just abysmal And our current "AI" for all mobs except xenos is just "RUN AT THING IF SEE"

9600bauds commented 7 years ago

The one thing that has fancier AI than that, spiders, are completely fucked up and essentially just do nothing when transported to the actual station.

But let's not get off-topic

Kurfursten commented 7 years ago

@Exxion Well the clever bit is, even if the AI starts out simple, because it is all in one place instead of spread out across several mob files, it's very easy for people to elaborate on and make better, which simultaneously improves the AI of all mobs that are allowed those behaviors. Since any changes to AI are more important, that also encourages coders to work on it because their work has more value.

@9600bauds Right, no more out of me.

ghost commented 7 years ago

@9600bauds The 'fancy AI' that the spiders have is just a re-itteration of hostile mob targetting.

Every life tick, it searches for something to web up, or a door to force open.

It's certainly nothing fancy, and it has a lack of sanity that going through hostile mob targetting would give it (Currently doesn't care if it has a client, so it'll just force itself towards things regardless of the clients intentions)

Probe1 commented 7 years ago

@Kurfursten Lets all get together and talk about how we can make this happen.

Probe1 commented 7 years ago

I keep thinking this says anime discussion and clicking on it

@clusterfack

Exxion commented 7 years ago

You may have a problem

9600bauds commented 7 years ago

I'm looking through the original diff that PJB went through to try Bay's antag datums: https://github.com/Baystation12/Baystation12/pull/8360/files#diff-0e52030681029993755f95a9e858f335R3

This is not going to work for us at all, they just have singleton antag datums with no ties into mind etc. AND they also did a lot of refactoring for them in the future (https://github.com/Baystation12/Baystation12/commit/ec5e05b9f1835fc65a9d773c1aff2badb6ab0629) so we can't get any clean diff.

So we're going to have to start over from scratch, yeah.

9600bauds commented 7 years ago

I want a comment here from @clusterfack before I whip anything up

mrpain666 commented 7 years ago

To answer the question of "What is something you hope antag datums will let you do?" I need to know what they are first.

PJB3005 commented 7 years ago

Basically make the way antags are stored and managed modular so it's independent on game mode. The only reason you can spawn antags such as cult during a regular traitor round is because of giant messy hacks that are absolute pains to maintain.

Blithering commented 7 years ago

While I have no knowledge of coding, from what I gather antag datums would be the way to solve the dilemma of wizxtended, heist, and any other round that grinds to a halt once it's antagonists are either captured or complete their objective sneaky beaky like. If there was a system to spawn mid-round antagonists complete with objectives and the like, heist, single wizard and (please please) abductors could be reworked into side attractions recruited from the ghost pool (maybe using the system created in https://github.com/d3athrow/vgstation13/pull/12495 ?). In my opinion they would work better like this than as the main event of a round.

mrpain666 commented 7 years ago

Maybe make new GAAAAAAAAAAAAME MOOOOODDDEEESSSSSSS?

Probe1 commented 7 years ago

We are discussing the prerequisite steps to facilitate that.

9600bauds commented 7 years ago

I've been waiting to see if anyone had anything else to add. This is looking like a daunting project here, with little guidance and only a half-proper example from which to start over.

The general idea is this so far:

dfasfdfa Please point out anything you think is missing or should be changed

PJB3005 commented 7 years ago

Looks good.

BobdaBiscuit commented 7 years ago

never ever

9600bauds commented 7 years ago

in February after I'm done with exams

BobdaBiscuit commented 7 years ago

Is there someone's fork that's being worked on or are you starting then?

9600bauds commented 7 years ago

nope, Bay's is incompatible and we can't even get a clear diff anymore, gotta start over

DeityLink commented 5 years ago

@PJB3005 so those singleton types you were talking about are basically what Dynamic Mode's rulesets are. Though in cult's case, data is saved in the faction rather than the ruleset.