Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

Starfield Pre-Release Thread [GAME RELEASED, GO TO NEW THREAD]

Lemming42

Arcane
Joined
Nov 4, 2012
Messages
6,806
Location
The Satellite Of Love
Drakortha, I am not only buying Starfield, but I am also buying an extra copy in your name. Alongside this second copy I'll send a personal check directly to Todd, with "FROM YOUR BIGGEST FAN! - DRAKORTHA" written on it.
 

Robotigan

Learned
Joined
Jan 18, 2022
Messages
420
You know whats also not fair, how they got the IP in the first place. Fair doesn't matter.
You do know that Interplay fought to get the IP back so they could make an MMO, right? There's this assumption that Brotherhood of Steel was just a fluke. Nah, literally every studio and IP that wasn't modernizing to 3d action was collapsing because you simply couldn't get the funding for a sizable studio unless you could demonstrate your game could capture the same growth as the broader market. Any Fallout release between 2005 and 2015 was going to be a 3d action title. In some hypothetical universe where Bethesda doesn't purchase Fallout, the best case scenario is something like Baldur's Gate. The franchise goes dormant for 20 years until isometric games are back in vogue and some plucky upstart is awarded the IP. But based on the direction the IP owner was headed in, it's more likely the franchise is driven into the ground by Interplay burning through inexperienced dev teams with fad-chasing mandates. It's possible Obsidian themselves might be put on one of these projects, but at the time they were simply not technically nor financially strong enough to complete a large scale project by themselves.

Codexers don't want to hear this, but Bethesda buying Fallout was a really good outcome for the franchise all things considered. You can hate their writing or streamlining all you want, but that stuff is easily changed between releases. The much bigger lift is the game framework itself and Bethesda is the only studio I'm aware of that has developed a process for creating 3d action games with the same scalable design patterns as old school RPGs. I'm sure Tim Cain and Josh Sawyer are acutely aware of this which is why they speak positively of Bethesda despite clearly disagreeing with the story direction of the franchise. New Vegas, Far Harbor, and Fallout London only exist because Bethesda's frameworks are modular and flexible enough to allow other creatives to stand up their own projects easily. Contrast with Bioware who eventually pursued a more focused, made-to-order development process that isn't so accomodating. You can tweak Mass Effect but you can't rip out and insert game components all willy nilly; you're mostly stuck with the game as shipped.
 

Crispy

I feel... young!
Patron
Staff Member
Joined
Feb 16, 2008
Messages
1,877,258
Location
Future Wasteland
Strap Yourselves In
Codexers don't want to hear this, but Bethesda buying Fallout was a really good outcome for the franchise all things considered.
surprised-surprise.gif
 

Robotigan

Learned
Joined
Jan 18, 2022
Messages
420
If you've got any specifics you want to hear about fine, but if I give you a general overview its this: Bethesda games have become too simplistic, too action based and have lost their core influences from CRPG mechanics, they use list based inventories which suck (and frankly they don't even implement them properly hence the memory leaks Skyrim has STILL)
I'm not a game dev but I did take a few CS classes in college. Assuming you're not referring to some super fancy game-specific application I haven't heard about, there are numerous reasons why one would choose a list based inventory. Lists scale more smoothly whereas resizing a static data structure like an array incurs an expensive copy operation.
 

Cohesion

Codex made me an elephant hater.
Patron
Joined
May 14, 2015
Messages
1,323
Location
Moscow, Russia
Codex+ Now Streaming!
If you've got any specifics you want to hear about fine, but if I give you a general overview its this: Bethesda games have become too simplistic, too action based and have lost their core influences from CRPG mechanics, they use list based inventories which suck (and frankly they don't even implement them properly hence the memory leaks Skyrim has STILL)
I'm not a game dev but I did take a few CS classes in college. Assuming you're not referring to some super fancy game-specific application I haven't heard about, there are numerous reasons why one would choose a list based inventory. Lists scale more smoothly whereas resizing a static data structure like an array incurs an expensive copy operation.

You're talking about data structure while RobotSquirrel was talking about UI presentation (list based).
 

ropetight

Savant
Joined
Dec 9, 2018
Messages
1,730
Location
Lower Wolffuckery
If you've got any specifics you want to hear about fine, but if I give you a general overview its this: Bethesda games have become too simplistic, too action based and have lost their core influences from CRPG mechanics, they use list based inventories which suck (and frankly they don't even implement them properly hence the memory leaks Skyrim has STILL)
I'm not a game dev but I did take a few CS classes in college. Assuming you're not referring to some super fancy game-specific application I haven't heard about, there are numerous reasons why one would choose a list based inventory. Lists scale more smoothly whereas resizing a static data structure like an array incurs an expensive copy operation.

You're talking about data structure while RobotSquirrel was talking about UI presentation (list based).
Even in the case of data structures, resizing of collections doesn't happen that much with inventories - you just reserve more memory for it, since it probably contains only "instance" data, and the general, more massive data like picture or 3d model are only referenced.
 
Last edited:

ropetight

Savant
Joined
Dec 9, 2018
Messages
1,730
Location
Lower Wolffuckery
You know whats also not fair, how they got the IP in the first place. Fair doesn't matter.
You do know that Interplay fought to get the IP back so they could make an MMO, right? There's this assumption that Brotherhood of Steel was just a fluke. Nah, literally every studio and IP that wasn't modernizing to 3d action was collapsing because you simply couldn't get the funding for a sizable studio unless you could demonstrate your game could capture the same growth as the broader market. Any Fallout release between 2005 and 2015 was going to be a 3d action title. In some hypothetical universe where Bethesda doesn't purchase Fallout, the best case scenario is something like Baldur's Gate. The franchise goes dormant for 20 years until isometric games are back in vogue and some plucky upstart is awarded the IP. But based on the direction the IP owner was headed in, it's more likely the franchise is driven into the ground by Interplay burning through inexperienced dev teams with fad-chasing mandates. It's possible Obsidian themselves might be put on one of these projects, but at the time they were simply not technically nor financially strong enough to complete a large scale project by themselves.

Codexers don't want to hear this, but Bethesda buying Fallout was a really good outcome for the franchise all things considered. You can hate their writing or streamlining all you want, but that stuff is easily changed between releases. The much bigger lift is the game framework itself and Bethesda is the only studio I'm aware of that has developed a process for creating 3d action games with the same scalable design patterns as old school RPGs. I'm sure Tim Cain and Josh Sawyer are acutely aware of this which is why they speak positively of Bethesda despite clearly disagreeing with the story direction of the franchise. New Vegas, Far Harbor, and Fallout London only exist because Bethesda's frameworks are modular and flexible enough to allow other creatives to stand up their own projects easily. Contrast with Bioware who eventually pursued a more focused, made-to-order development process that isn't so accomodating. You can tweak Mass Effect but you can't rip out and insert game components all willy nilly; you're mostly stuck with the game as shipped.
Bethesda Fallouts were shitty shooters that had to awkwardly glue VATS on top of it so your SPECIAL isn't useless in combat.
They basically tried to port a turn-based system into real-time and it just doesn't work, to paraphrase Todd.

This problem is present in New Vegas as well, but at least it has some good writing. F3, F4 and the rest had shitty writing, shitty main quest and shitty combat. F4 had a shitty streamlined SPECIAL as well. And let's not start with Bethesda lore.

In the end all you are left with is engine which is friendly to modders. Which it had to be, since it also looks shitty.
Vanilla F3 and New Vegas are one of the ugliest games I ever saw.

You may argue that shitty Fallout games are better than no Fallout games, but we will have to agree to disagree there.

Elder Scrolls don't have Fallout turn-based problem, they were real time game from the beginning and they are better functioning games.
 

Robotigan

Learned
Joined
Jan 18, 2022
Messages
420
If you've got any specifics you want to hear about fine, but if I give you a general overview its this: Bethesda games have become too simplistic, too action based and have lost their core influences from CRPG mechanics, they use list based inventories which suck (and frankly they don't even implement them properly hence the memory leaks Skyrim has STILL)
I'm not a game dev but I did take a few CS classes in college. Assuming you're not referring to some super fancy game-specific application I haven't heard about, there are numerous reasons why one would choose a list based inventory. Lists scale more smoothly whereas resizing a static data structure like an array incurs an expensive copy operation.

You're talking about data structure while RobotSquirrel was talking about UI presentation (list based).
Then why he's talking about memory leaks?
Even in the case of data structures, resizing of collections doesn't happen that much with inventories - you just reserve more memory for it, since it probably contains only "instance" data, and the general, more massive data like picture od 3d model are only referenced.
If you're intentionally sizing bigger array capacities then you'll probably wind up using more memory than lists anyway.
 

Drakortha

Liturgist
Joined
Jan 23, 2016
Messages
1,902
Location
Terra Australis
I never agreed with the "hurr hurr NV is just a Fo3 mod" people, but they're also not entirely off the mark.
They are entirely off the mark.

"This demonstrably true statement isn't true and I will not elaborate."

gigachad.jpg
Why waste my energy when there's others in here who can state the facts in detail for me?

I've got to save my energy for calling Starfield a big pile of dogshit. Only 2 months to go now before I'm proven absolutely right. I'll get my dopamine hit and move onto the next garbage shit game.
 

ropetight

Savant
Joined
Dec 9, 2018
Messages
1,730
Location
Lower Wolffuckery
If you've got any specifics you want to hear about fine, but if I give you a general overview its this: Bethesda games have become too simplistic, too action based and have lost their core influences from CRPG mechanics, they use list based inventories which suck (and frankly they don't even implement them properly hence the memory leaks Skyrim has STILL)
I'm not a game dev but I did take a few CS classes in college. Assuming you're not referring to some super fancy game-specific application I haven't heard about, there are numerous reasons why one would choose a list based inventory. Lists scale more smoothly whereas resizing a static data structure like an array incurs an expensive copy operation.

You're talking about data structure while RobotSquirrel was talking about UI presentation (list based).
Then why he's talking about memory leaks?
Even in the case of data structures, resizing of collections doesn't happen that much with inventories - you just reserve more memory for it, since it probably contains only "instance" data, and the general, more massive data like picture od 3d model are only referenced.
If you're intentionally sizing bigger array capacities then you'll probably wind up using more memory than lists anyway.
You do, but not by much.On big collections of elements you will probably use something like a Flyweight pattern, which reduces memory consumption for repeating elements.
Text processors don't store font glyph for every letter you type, they just reference it, as I said above.

If you use static array, you will not resize array for every new item in it. You will probably resize it for every fifty elements, since all you wrote for the instance of item in your inventory is its state and its quantity.

But for the big collections like items in open world game, Bethesda probably used some kind of Hashmap (Dictionary), since iterating over big list for accessing list entry becomes bigger concern than resizing array.
Which can be prone to memory leaks if objects are not cleaned of references to them before deleting.
 

Drakortha

Liturgist
Joined
Jan 23, 2016
Messages
1,902
Location
Terra Australis
Todd.
Todd never changes.

Just more inexplicable proof that they think you are all retarded.

"our game has rocks and mountains, npcs and creatures"

Wow. Fucking incredible!

Todd frames this shit as if their games are nothing but innovation from top to bottom while they actually serve nothing innovative at all. In fact, ever since Skyrim, Bethesda's whole marketing schtick has been "Look at how much of an innovative company we are!"

Your company is shit, Todd. All your studio has done for over a decade is rest on it's laurels with Skyrim and it shows. You should have focused and honed in on making the games you claim to make instead of merely pretending like you make great games. It's a sad fact, isn't it?
 
Last edited:

thesecret1

Arcane
Joined
Jun 30, 2019
Messages
6,683
You do, but not by much.On big collections of elements you will probably use something like a Flyweight pattern, which reduces memory consumption for repeating elements.
Text processors don't store font glyph for every letter you type, they just reference it, as I said above.

If you use static array, you will not resize array for every new item in it. You will probably resize it for every fifty elements, since all you wrote for the instance of item in your inventory is its state and its quantity.

But for the big collections like items in open world game, Bethesda probably used some kind of Hashmap (Dictionary), since iterating over big list for accessing list entry becomes bigger concern than resizing array.
Which can be prone to memory leaks if objects are not cleaned of references to them before deleting.
How it usually works is you reserve as much memory as you think will be used in worst case scenario (even if it's a list of ten thousand items, you're storing pointers in the array, not the items themselves. Nobody gives a shit about what little memory might be wasted on this). If you go over it, the array will do a really expensive operation and DOUBLE its size (to try and ensure it won't need to resize again later). If you don't reserve memory at the beginning, the array will behave the same, but the initial memory reserve is very low (I think it's like 16 items or something like that?) meaning that if you're working with lots of items, you will be performing that resize operation far more often than you'd like.

Hashmaps are slow as fuck. They pay off over iterating over an array... eventually, but we are talking really large numbers. It is unlikely a player will ever have so many items that it'd become more efficient. A better approach would be to have the items sorted in the array (by some sort of unique ID of the item) and then run a binary search on it whenever you need to look an item up in there. True, it would make inserting into an array slower, but with how rare (in computing terms) adding a new item into the inventory is, it's a non-issue. Alternatively, you could also split the items list into multiple arrays (one for helmets, one for weapons, etc. etc.) and thus iterate over much smaller arrays whenever searching for an item. There's several approaches to use for this, but hashmaps really are just too slow.

Any modern engine should handle garbage collection for you, automatically destroying any objects that are no longer referenced by anything, and nulling any references to objects that you destroyed manually. That is not to say that memory leaks cannot happen, they absolutely can, but it's not as common as one might think.
 

Jackpot

Learned
Joined
Dec 15, 2019
Messages
224
I do wonder what the writing will be like in this game. Fallout 4's writing was so bad that it honestly baffles me.
It's sad that I can only hope its as bland as generic as Skyrim's writing.
 

Zed Duke of Banville

Dungeon Master
Patron
Joined
Oct 3, 2015
Messages
13,110
Oblivion wasn't that bad. They streamlined things and it sucked to lose features but in the grand scheme of things it was a collective step forward. Skyrim turned the streamlining to 11 and it showed in sales with normies slopping it up, I cede that one. Fallout 4, while being the single worst story Emil has ever put to paper, was arguably incline over Skyrim. They seemed to learn their lesson and toned down the streamlining. I'm not even going to bring up the dumpster fire that is 76 because TES/Fallout Bethesda had nothing to do with it outside of the initial world building. Clearly from what we've seen in Starfield it's further incline from Fallout 4 because the gripes most people had with Fallout 4 don't seem to be present anymore.
Oblivion contained a lengthy list of failings relative to Morrowind:
  • Comprehensive creature-leveling such that all monsters and NPCs are set at the same level as the PC, with weaker types of monsters disappearing after the character gains enough levels, and stronger types of monsters not appearing when the character is low-level
  • Comprehensive item-leveling whereby a high-level PC will not only encounter similarly high-level bandits but said bandits will have random pieces of extremely expensive armor and weapons, while a low-level PC will never find weapons/armor of such powerful material; or a weapon on display in a glass case in a castle will be a worthless replica if the PC is low-level but the real thing after the PC gains enough levels.
  • A clunky interface, which was clearly designed for consoles, in sharp contrast to Morrowind's sleek menus.
  • Reduction in the number of joinable guilds/factions offering many quests from 10 in Morrowind to 4 in Oblivion, keeping the more generic ones (Fighters/Mages/Thieves guilds)
  • Factions now centered around quest lines, with 2 of the 4 (Fighters Guild and Mages Guild) being poorly written and boring
  • Full voice-acting for dialogue, which necessitated a drastic reduction in the amount of dialogue per NPC, most of whom have one comment about themselves or their city to offer and nothing else
  • Poor writing in general, with dialogue and books less interesting than in Morrowind
  • Minigames for speechcraft and lockpicking
  • Elimination of certain kinds of items, such as thrown weapons, crossbows, and spears
  • Reduction in the number of skills to the point where axes are considered blunt weapons
  • Regenerating magicka, which effectively means that all health can be easily regained after each combat, thus removing much of the logistics that existed previously
  • Elimination of different physiques (and animations) for Argonians and Khajiits
  • Both in-game and out-of-game world maps that offer far less information than their Morrowind equivalents
  • Automatic fast-travel to any location that's already been visited
  • A quest compass that points to your next destination, the use of which is made necessary by the combination of uninformative journal entries and an inability to ask directions
  • Removal of levitation and teleportation spells, without the re-implementation of climbing that had existed in Daggerfall
  • A lack of aesthetics, especially compared to Morrowind's brilliant art direction
  • A generic, medieval fantasy grab-bag setting, without even the coherence offered by Daggerfall's Iliac Bay region much less the spectacular sui generis setting of Morrowind
  • A dull, poorly-plotted main quest, with the only plane of Oblivion featured in the base game (except at the very end) being a generic hellscape with little variation
  • A half-baked action-oriented combat system, such that success in combat depends greatly on the player's physical skill, yet is boring and tedious
Hardly any improvements were offered relative to Morrowind; even the technical advancements were usually blunders due to the poor implementation, as in the 3D Facegen software for customized faces, the wonky physics engine, or the HDR lighting.
 

Lemming42

Arcane
Joined
Nov 4, 2012
Messages
6,806
Location
The Satellite Of Love
Hardly any improvements were offered relative to Morrowind
The two big improvements Oblivion offers over Morrowind IMO are quest variety and NPC routines. The quests are still bad but they do tend to be somewhat more involved and have more moving parts than Morrowind's insanely dull fetch/kill/occasional escort quests, the tradeoff being that there's far less quests to actually do (and, because Bethesda, a lot of them are still as ultra-linear and boring as the average Morrowind quest anyway - the Fighter's Guild questline in particular is mostly fucking awful, despite every other NPC in the game advertising it to the player). I also wouldn't call Oblivion's combat worse than Morrowind, I think it's a sidegrade more than anything. Combat isn't at all fun in either game unless you're a mage who plays with the spellmaker, at which point you can be amused by your ridiculous power but the game becomes a busted joke. Morrowind has the advantage I suppose in that you become so powerful so fast that the terrible combat tends to at least end more quickly than it does in Oblivion.

The NPC routines is a big deal though. Oblivion's RadiantAI sucked, but for the type of game that Bethesda have wanted to make since Morrowind, it's critical that NPCs move around and inhabit the world. It's still pretty limited - nobody ever seems to go shopping except the player - but just shit like people going to bed is a major gamechanger for thief characters and vampires and such.

I'll very halfheartedly defend the speechcraft minigame, it's not fun in practice but I think the intention was good - instead of Morrowind's endless spamming of Admire (or Bribe if you can't be bothered taking ten minutes to spam-click your way to 100 Speechcraft) or Daggerfall's indecipherable Blunt/Normal/Polite shit, the minigame is supposed to offer a way to tangibly feel your progress at Speechcraft, as the minigame gradually gets easier and the disposition gains get larger as you level up. Sadly though it's dogshit and is a massive chore to actually play, in addition to being laugh-out-loud retarded due to the potato people scowling at you as you deliver your holocaust jokes, then beaming with elation a second later as you threaten their lives.

No defending the lockpicking minigame, which could have been good if it weren't for the fact that time freezes, allowing you to unlock any door without any risk whatsoever even at lvl 1 Security. Obviously the minigame itself is shit too. I think the Fo3/FNV/Skyrim lockpicking minigame would be really good if time didn't freeze.

I'll also defend fast travel, though the debate's obviously already been done to death. I think if the world was truly alive and dynamic and things were constantly changing, then forcing the player to learn and use an in-universe travel system would be great and give the player a constant flow of exciting new content, but in Morrowind, the lack of fast travel just makes the game drag after a while because you're constantly walking over empty areas you've already covered and nothing ever changes because nobody in the world except you ever does anything. Fast travel is sort of a concession, I think - an admission that the world isn't as interesting as it ought to be, that nothing changes, and that one pass-through is enough to see everything, so here's a way to cut down the time you spend walking around bored in an empty world.
 

Robotigan

Learned
Joined
Jan 18, 2022
Messages
420
If you've got any specifics you want to hear about fine, but if I give you a general overview its this: Bethesda games have become too simplistic, too action based and have lost their core influences from CRPG mechanics, they use list based inventories which suck (and frankly they don't even implement them properly hence the memory leaks Skyrim has STILL)
I'm not a game dev but I did take a few CS classes in college. Assuming you're not referring to some super fancy game-specific application I haven't heard about, there are numerous reasons why one would choose a list based inventory. Lists scale more smoothly whereas resizing a static data structure like an array incurs an expensive copy operation.

You're talking about data structure while RobotSquirrel was talking about UI presentation (list based).
Then why he's talking about memory leaks?
Even in the case of data structures, resizing of collections doesn't happen that much with inventories - you just reserve more memory for it, since it probably contains only "instance" data, and the general, more massive data like picture od 3d model are only referenced.
If you're intentionally sizing bigger array capacities then you'll probably wind up using more memory than lists anyway.
You do, but not by much.On big collections of elements you will probably use something like a Flyweight pattern, which reduces memory consumption for repeating elements.
Text processors don't store font glyph for every letter you type, they just reference it, as I said above.

If you use static array, you will not resize array for every new item in it. You will probably resize it for every fifty elements, since all you wrote for the instance of item in your inventory is its state and its quantity.

But for the big collections like items in open world game, Bethesda probably used some kind of Hashmap (Dictionary), since iterating over big list for accessing list entry becomes bigger concern than resizing array.
Which can be prone to memory leaks if objects are not cleaned of references to them before deleting.
It's not just a reference. There's quite a few properties we know Bethesda tracks per entity like uuid, position, name, stats, upgrades/buffs, weapon mods, ownership status, etc. So I think memory optimization does matter here. And intuitively, I'd use a list because when you think about how Bethesda games work, the player is often adding and dropping items to various collections. NPCs even interact that way. It's easier to keep those collections sorted with a list operation. And sometimes the player does add 200 potions and sell them all to the alchemist. Which means for an array pattern, each collection involved in that transaction (home chest, player inventory, shopkeeper) will need to have its inventory resized potentially multiple times.

I think their gamewide item management is far more sophisticated than a hashmap, more like an entire database.

Any modern engine should handle garbage collection for you, automatically destroying any objects that are no longer referenced by anything, and nulling any references to objects that you destroyed manually. That is not to say that memory leaks cannot happen, they absolutely can, but it's not as common as one might think.
I'm guessing intensive games would want control over memory management themselves because the garbage collector is just a process that periodically cleans out dereferenced objects. So you're choked until the garbage collector cycles around, and of course the garbage collection process itself eats into overhead. And at any rate, it's Bethesda's engine anyway. They'd be responsible for implementing garbage collection.
 

ropetight

Savant
Joined
Dec 9, 2018
Messages
1,730
Location
Lower Wolffuckery
You do, but not by much.On big collections of elements you will probably use something like a Flyweight pattern, which reduces memory consumption for repeating elements.
Text processors don't store font glyph for every letter you type, they just reference it, as I said above.

If you use static array, you will not resize array for every new item in it. You will probably resize it for every fifty elements, since all you wrote for the instance of item in your inventory is its state and its quantity.

But for the big collections like items in open world game, Bethesda probably used some kind of Hashmap (Dictionary), since iterating over big list for accessing list entry becomes bigger concern than resizing array.
Which can be prone to memory leaks if objects are not cleaned of references to them before deleting.
How it usually works is you reserve as much memory as you think will be used in worst case scenario (even if it's a list of ten thousand items, you're storing pointers in the array, not the items themselves. Nobody gives a shit about what little memory might be wasted on this). If you go over it, the array will do a really expensive operation and DOUBLE its size (to try and ensure it won't need to resize again later). If you don't reserve memory at the beginning, the array will behave the same, but the initial memory reserve is very low (I think it's like 16 items or something like that?) meaning that if you're working with lots of items, you will be performing that resize operation far more often than you'd like.

Hashmaps are slow as fuck. They pay off over iterating over an array... eventually, but we are talking really large numbers. It is unlikely a player will ever have so many items that it'd become more efficient. A better approach would be to have the items sorted in the array (by some sort of unique ID of the item) and then run a binary search on it whenever you need to look an item up in there. True, it would make inserting into an array slower, but with how rare (in computing terms) adding a new item into the inventory is, it's a non-issue. Alternatively, you could also split the items list into multiple arrays (one for helmets, one for weapons, etc. etc.) and thus iterate over much smaller arrays whenever searching for an item. There's several approaches to use for this, but hashmaps really are just too slow.

Any modern engine should handle garbage collection for you, automatically destroying any objects that are no longer referenced by anything, and nulling any references to objects that you destroyed manually. That is not to say that memory leaks cannot happen, they absolutely can, but it's not as common as one might think.
I agree on arrays memory reserving.

Hashmap performace depends on implementation of hashing algorithm and storage of keys.
Modern implementations use Trees instead of Linked Lists for big collections.
https://www.baeldung.com/java-hashmap-optimize-performance

If you use property of object as a hashed key, lets say its name, you can do hashmap.get("Bozar") and you have it.
Of course, you will probably use more lists/maps - i.e. one for the each group of global items, one for the inventory.

In this concrete case, Gamebryo and Creation Engine were written in (Visual) C++, so no out-of-the-box Garbage Collectors provided by the language/virtual machine and I don't know details about hashmap implementation.
If Bethesda implemented some kind of Garbage collection in engine, it is not functioning very well.
It surely isn't anywhere near to C# or Java Garbage Collectors in terms of reliability and it can hardly ever be.
https://stackoverflow.com/questions/5009869/how-to-implement-garbage-collection-in-c

But their memory leaks problems look like typical for multiple programmers not deallocating memory properly.
 
Last edited:

ropetight

Savant
Joined
Dec 9, 2018
Messages
1,730
Location
Lower Wolffuckery
If you've got any specifics you want to hear about fine, but if I give you a general overview its this: Bethesda games have become too simplistic, too action based and have lost their core influences from CRPG mechanics, they use list based inventories which suck (and frankly they don't even implement them properly hence the memory leaks Skyrim has STILL)
I'm not a game dev but I did take a few CS classes in college. Assuming you're not referring to some super fancy game-specific application I haven't heard about, there are numerous reasons why one would choose a list based inventory. Lists scale more smoothly whereas resizing a static data structure like an array incurs an expensive copy operation.

You're talking about data structure while RobotSquirrel was talking about UI presentation (list based).
Then why he's talking about memory leaks?
Even in the case of data structures, resizing of collections doesn't happen that much with inventories - you just reserve more memory for it, since it probably contains only "instance" data, and the general, more massive data like picture od 3d model are only referenced.
If you're intentionally sizing bigger array capacities then you'll probably wind up using more memory than lists anyway.
You do, but not by much.On big collections of elements you will probably use something like a Flyweight pattern, which reduces memory consumption for repeating elements.
Text processors don't store font glyph for every letter you type, they just reference it, as I said above.

If you use static array, you will not resize array for every new item in it. You will probably resize it for every fifty elements, since all you wrote for the instance of item in your inventory is its state and its quantity.

But for the big collections like items in open world game, Bethesda probably used some kind of Hashmap (Dictionary), since iterating over big list for accessing list entry becomes bigger concern than resizing array.
Which can be prone to memory leaks if objects are not cleaned of references to them before deleting.
It's not just a reference. There's quite a few properties we know Bethesda tracks per entity like uuid, position, name, stats, upgrades/buffs, weapon mods, ownership status, etc. So I think memory optimization does matter here. And intuitively, I'd use a list because when you think about how Bethesda games work, the player is often adding and dropping items to various collections. NPCs even interact that way. It's easier to keep those collections sorted with a list operation. And sometimes the player does add 200 potions and sell them all to the alchemist. Which means for an array pattern, each collection involved in that transaction (home chest, player inventory, shopkeeper) will need to have its inventory resized potentially multiple times.

I think their gamewide item management is far more sophisticated than a hashmap, more like an entire database.
Of course that memory organization is not trivial for such complex system, but you will still use references to common data combined with "instance" data and save memory that way, if possible.
If you have 100 potions of the same type, they probably just change field in object that holds amount of items, if you don't sell them all - in which case they probably move whole instance to another collection.
If I remember correctly, all the objects with same type and status (condition, mods, etc.) are grouped as one, so there is probably optimization with that also.

Bethesda save files are known to grow in size if you access more locations and interact with objects, which probably means they have default state of game objects that is loaded on the start and then overriden with whatever data you changed on that specific instance.

They are maybe using multliple indexes/keys for finding items as you suggested with database approach.
Maybe they have some tree-like structure based on locations and containers.
 

RobotSquirrel

Arcane
Developer
Joined
Aug 9, 2020
Messages
2,122
Location
Adelaide
there are numerous reasons why one would choose a list based inventory. Lists scale more smoothly whereas resizing a static data structure like an array incurs an expensive copy operation.
You're talking about data structure while @RobotSquirrel was talking about UI presentation (list based).
I was mainly referring to it in a UI sense, the way you should do lists is segment them so that you're only loading in what is visible. Most developers don't bother, Worst offender is the Sims games, all of them just dump the entire catalogue in one big list despite it being super inefficient to load and display. I'm not saying lists as a data structure are inherently bad, but the way most developers implement it is. Why load in a list of 1000 items if only 100 can be displayed at any one time. Worst if you have a list that is reliant on render textures then you get StarCitizen and Cyberpunks problem where the UI doesn't immediately load in. UI should be snappy and ready to use you shouldn't have to fight it for control and it should hold up regardless of the use case otherwise you designed it wrong. I shouldve clarified more.
If it is, then Morrowind completely killed the TES series by gutting Daggerfall and reducing its scope to almost nothing. Morrowind, Oblivion and Skyrim have far, far more in common with each other than they do with Daggerfall.
Oh I agree with that. Morrowind was meant to be a lot more ambitious but Bethesda nearly went bankrupt, so it was streamlined because the team couldn't manage.
 

Robotigan

Learned
Joined
Jan 18, 2022
Messages
420
Of course that memory organization is not trivial for such complex system, but you will still use references to common data combined with "instance" data and save memory that way, if possible.
If you have 100 potions of the same type, they probably just change field in object that holds amount of items, if you don't sell them all - in which case they probably move whole instance to another collection.
If I remember correctly, all the objects with same type and status (condition, mods, etc.) are grouped as one, so there is probably optimization with that also.
The entity/object hierarchy is pretty complex because the player can apply all sorts of unique properties. Each alchemy level corresponds to marginally stronger potions which means the stats can't be an inherited property. And then you get enchantments, weapon improvements, weapon naming, and FO4's crazy weapon mod system. Either all of these properties exist per entity or the game has to somehow figure out which entities have identical properties at runtime and group them together. Actually now that I think about it maybe you were on the right track earlier. Maybe they use a hash function on item creation to check if they should create a new entity or increment a counter. Since crafting menus are the most controlled environments in their games, they might be able to hide this more computationally complex check.
Bethesda save files are known to grow in size if you access more locations and interact with objects, which probably means they have default state of game objects that is loaded on the start and then overriden with whatever data you changed on that specific instance.
That's exactly what happens. In fact the save file is referenced in the exact same way as updates, mods, and the game itself. So like Skyrim.esm predefines the default state of the game and is loaded at the base of the stack, then Update.esm, then all your mods in whatever silly load order you have them configured in, then finally your save is loaded at the top of the stack.
I was mainly referring to it in a UI sense, the way you should do lists is segment them so that you're only loading in what is visible. Most developers don't bother, Worst offender is the Sims games, all of them just dump the entire catalogue in one big list despite it being super inefficient to load and display. I'm not saying lists as a data structure are inherently bad, but the way most developers implement it is. Why load in a list of 1000 items if only 100 can be displayed at any one time. Worst if you have a list that is reliant on render textures then you get StarCitizen and Cyberpunks problem where the UI doesn't immediately load in. UI should be snappy and ready to use you shouldn't have to fight it for control and it should hold up regardless of the use case otherwise you designed it wrong. I shouldve clarified more.
I'ma be real wit you. Most game devs probably don't think about UI optimization that much because it's presumed to be the least taxing aspect of their games. This isn't like webdev where project managers monitor page responsiveness and clickthrough rate like a hawk. I'd also imagine Bethesda can get away with bad patterns because they're not loading in image files, they show the game models themselves which should already be loaded in.
 
Last edited:

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom