my friend came up with this idea while we were talking about the game. (I was on starlight, they were outside lighting matches cause they were bored.)
but they want a deck of cards. some cargo rooms allready allude to gambling. why not add the cards and finish it. also chips would be nice but not required. (we could use lizard plushies instead)
From what I remember, a “real” deck of cards would be considered somewhat problematic, since it’s basically comprised of 52 different entities, which if used commonly could cause performance issues or something like that.
A deck of cards could be just one entity, similar to how a stack of 30 steel is also only one entity.
steel you only need to track how many are in the stack. Cards you need to track how many cards, the individual characteristics of the card (which is what makes the cards separate entities, with steel you don’t need to keep the individual entities), and their position in the deck. This is signficantly more information. Not saying it isn’t possible, just that its more prone to performance issues, and could be prone to entity spamming
The other problem is legal in nature, many terrotries consider virtualized gambling, gambling which would force an 18 Rating in certain regions. this is also why the pokemon remakes remove the gambling from places like game corner.
But an array of 52 things isn’t exactly computationally taxing. You get the position in the deck for free anyway if it’s an ordered list, which it would be, and they only have two properties - suit and value - which can be stored in way less space than the 2 ints you’d use anyway just for the sake of practicality. Plus a boolean if you want to track face up vs face down.
Suit has 4 possible values - that’s 2 bits.
Value has 13 possible values - that’s 4 bits.
Face up/down has 2 values, which is one more bit.
If you really want to be hardcore about optimization, that’s under a byte total per card. You’d need an awful lot of decks before that even begins to look like anything remotely resembling the vague possibility of a memory issue.
If people use them to play 52 Pickup all the time, thereby spawning every single card as a separate entity, then yeah, I guess maybe that could cause performance issues? Presumably not because it’s more data, but because it has to check them every frame or something for behavioral stuff, so it’s more computation. But I don’t figure a single deck would be any more of a problem than any other single entity. It’s just the ability to spawn a bunch more entities from it that’s maybe a problem.
So if there’s a way to have a deck that doesn’t spawn separate entities while still functioning as a deck, then it’s probably fine. Like how chessboards don’t have separate chess pieces as entities. (They totally should, though. You should be able to flip the board and send little chess pieces everywhere.) (Yunno what also spawns entities a lot? Guns which eject bullet casings. If that’s workable, then card decks and chess pieces surely are too, right?)
I’d like to note that while you could fit a representation of a card within the deck in a byte, each card that’s outside the deck is now its own entity with at least a few components to make it a functioning item. And, mind you, the “fits in a byte” estimate assumes A) the implementing programmer decides to do that and B) the deck only stores the mentioned data of each card instead of the cards themselves.
From what I understand, the maintainers don’t or at least didn’t want to have too many entities to be too easily spawnable. Bullet casings are indeed confusing in that context.
I don’t know if a deck would really be that much of an issue, but I recall it being brought up as a concern, so I noted that.
if your looking at it from a programing perspective its really not too hard. the deck would have an array containing values 0-51
each card would have a variable connected to it and off that card display the graphics for said card for example 0=ace of shades 1=two of spaces ect.
and then you remove the value from the array
if you put cards into the desk you add it back into the array
The real issue is rendering all the cards.
Tracking even 1000 cards (which is like 1 byte per card as explained) above is trivial, RAM is measured in GBs and that would not even be a single KB of cards (and that is assuming you NEED to track each card separetly).
But if you have people opening packs and throwing cards in the ground. It could be problematic when you reach hundreds of sprites because of 4-5 decks.
But considering this was never a problem with cigarretes, mats, wires, etc. I doubt it would be with cards. No one is going to manually separate each card and lay it on the floor for shits and giggles, and if they do, it would probably be for a funny enough reason. Some servers already have decks of cards.
I dont think it would be too much of an issue unless a gravity anom got close to alot of them as they wouldn’t need physics calculation it would be the same as having potentiually 52 sci print outs on the floor per a completely emptied deck.
and with the way I suggested to code it, only cards outside of the deck would have to worry about physicals anyway. the biggest issue would be time to make the card graphics (espically K,Q,J and Joker who normally have involved artworks.) and the legal issues it would introduce.
Rendering is not really an issue. Having lots of card entities that need to be networked to every player in range can be a problem, but that’s mostly due to how bad the networking/pvs code is. And it’s only really an issue if you have hundreds cards on the ground.
Sure, the scenarios where each card in a deck being a separate entity are unlikely, but unlikely scenarios and edge cases are important to consider in game design. I could absolutely see a clown or tider taking every card out of multiple decks and throwing them around, or laying them down in patterns. And gravity anomalies spawning in places where those happen is also a distinct possibility.
I don’t know how feasible this is to program, but I think a better way to handle this would be to have a deck of cards as a single discrete object that cannot be separated, and allow multiple people to interact with it to play, like a chessboard.
Dont think that’ll be too much of an issue. botany for example can easily have large clusters of plants dropping at one time (20 per a plant bag) on chems or cargos desks and that doesn’t cause issues. Even when i filled botany with auto-havest 6 yeild melons we didn’t have much issues despite having over 400 melons in one tile.
From what i’ve experianced in game though, Admins had to step in and stop 600 mothroaches on a station as that caused server side lag. So lets say the limit for Enities with AI is in the 500s range before it effects the sever and items way higher (as melons didn’t even give me a notice)
I think this is a solid idea, but it should definitely work like chess. Maybe have a UI you can click into and a few preset games (blackjack would be relatively simple to implement, as would poker and maybe solitaire). If each card was an entity, and, let’s face it, given cargonia shenanigans there’d be a couple decks at least, I think performance would nosedive off a cliff.
It won’t nosedive just from a couple decks. If you take all the cards out of a deck it’s 52 entities, so it’s no more problematic than a crate of steel which is 90 entities.
a crate of steel is 4 entities.
- the crate
- 3x stack of 30 steel
Yeah and a deck of cards would just be one entity. When you deal cards from it, or split a stack of steel, it spawns new entities.
a crate of steel can be 90 entities is what you mean inwhich case that is true but there is no quick split keybinding is there. making it so splitting out 90 steel would be slow…
then again I have also seen the engine be able to handle over 100 weh plushies being pushed around by a gravity anom so 52 card pickup isn’t that bad.
i feel like also if someone is knowlingly spamming cards out of a deck that would be when a ahelp would be involved…
hmm put cards a garbage bag items so janiborgs can clean them up… also mabey give service borgs a card pack of their own and clicking on cards outside the deck puts them back into the deck
Yeah that’s what I mean, a deck of cards should work in the same way but with a comp that tracks which cards are in the card stack.
There’s a keybind to split stacks it in half I’m pretty sure. You could intentionally try to lag the server if you order like 10 crates and split them all, and playing cards would have the same problem if you could order them en masse from cargo.
I think the concern here is more about PVS than physics?