AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Go also has a syntactic shortcut which is similar to inheritence, but more explicit. We can make both Food and Animal statisfy the "Animateable" interface. I'm slightly confused about what you're trying to describe, but maybe it's something like this? Once the interfaces between your objects are values instead of references you're free to connect your objects together in any way you need and are not stuck with the fixed graph as originally designed. Your better off making the interface between objects values rather than having hard references between objects as described in this talk. The bigger point though is when you have networks of objects that are relying on each other to perform functions, that's where the problem is, and where you start to rely on mocks and stubs for testing, which really should be considered a smell in its own right. You could also separate out the value from the graph behavior and have a GraphNode object that wraps each value object. If performance was more of a concern you could do it as a map where each object was a key and the values were a list of the connected objects. You could model your graph as a set of pairs, ie edges. You still don't necessarily need to model the graph at the object level though. I have certainly committed all of these sins, too. We do a lot of procedural generation, and if we wanted to, say, generate an item that acts partially like one thing and partially like another, it’s just way harder to do that when you are locked down in a class hierarchy. I started using a “tool” item in the hierarchy, which started to get various functionality, and can now support anything from a stepladder to a beehive to a mortar (and pestle, separately, ha ha), and it just feels more flexible, and I wish every crafted item in the game were under that umbrella. It’s nice to be able to use virtual functions and that kind of thing, but the tradeoffs are just too much. Making the item system polymorphic was ultimately a mistake, but that was a big one.Ī: When you declare a class that’s a kind of item, it locks you into that structure much more tightly than if you just have member elements. The bug surrounds the vagueness of liquid sizes.Īnd it was fixed accordingly! Cats are still vulnerable to the effects of self-cleaned alcohol, but the strength is now proportional. So, putting all this together: The problem was that cats pick up a whole “serving size” of alcohol and proceed to clean themselves, ingesting the entire serving. The catch with them is that they ingest whatever they have cleaned off of them. Dwarves covered in a vomit item will (hopefully) put any available soap in their inventory and use it to clean themselves in water, for example.Ĭats are simple and just clean themselves with no water or soap needed. They’re not just static inventories for the fun of a story, creatures do interact with them and use them. Among the things you’d expect to find like armor, weapons, and books, you might also find a “coating of tears” on a crying dwarf, or perhaps a “spattering of blood” on a murderous elf. You also have barrels and pots that hold stacks of “Mead”.Ĭreatures are kind of like walking containers and have their own detailed inventories. You have mugs and goblets that hold one quantity of “Mead”, giving the impression that one count of mead is like a generic serving size. When you look at an item listing and you see something like “Mead”, that is truly all the item is - it isn’t a cup of mead, it’s just a vague amount of the liquid mead itself, as if your hand was the only thing keeping it from hitting the ground.īut there are containers that can hold your liquid. (They do however do it for self-referential jokes and such, but these aren’t persistence so much as temporary anomalies) At best, they’re allowed to forget something exists altogether. It’s why simpsons can revert (nearly) all damages every episode (that’s simply the rule of the world), but if it tried to violate that rule and persisted those changes in any meaningful way, it would feel like complete nonsense. But once done, it must continue to hold true - else the rules are bullshit, and we expect nothing to behave in a manner that isn’t arbitrary.Įven fortnite has a kind of logic to it, haphazard as they may be (though it’s also so loosely defined, that I find it completely uninteresting - it’s a dumpster fire of cosmetic items with no real theme or nuance this is because its more a modern shopping mall than a game system). gravity presumably exists, because all objects shown have been affected by it), then you’re free to do whatever (e.g. If a world hasn’t said something about it (or hasn’t shown a derivation of it - e.g. I think it’s more about internal consistency.
0 Comments
Read More
Leave a Reply. |