YouDoNotKnowMyName Posted June 15, 2021 Share Posted June 15, 2021 Good evening everybody! So the whole "128 element array size limit" - thing came up agian recently ...Basically, for those who don't know what I am talking about: An array in FO4 scripting can only have 128 elements. Why? Why 128 (2^7 or 7 bits)? Why not 256 (2^8 or 8 bits)?That would make much more sense, data types are usually 8, 16, 32 or 64 bits in size.So what could possibly be the reason for using a "7 bit" integer as an index for the arrays.Possible reasons could be that it actually is an 8 bit value but one bit is used as some sort of "status flag" (but for what?) ... And besides, why even use such "low bit" values at all, are we still living in the 80s ?Yeah, performance optimization and all of that, but REALLY? Just another thing that confuses me ...If anybody has any explainations for this, let me know here ... Link to comment Share on other sites More sharing options...
DieFeM Posted June 15, 2021 Share Posted June 15, 2021 Since some functions can return arrays bigger than 128 Í deduce that is not a technical limitation but a imposed limitation to avoid that an infinite loop tries to create an infinite array and therefore a memory leak. Or most likely bethesda not trusting their own software or the programmers. Link to comment Share on other sites More sharing options...
aurreth Posted June 15, 2021 Share Posted June 15, 2021 Might be using the 8th bit for error checking. Link to comment Share on other sites More sharing options...
YouDoNotKnowMyName Posted June 15, 2021 Author Share Posted June 15, 2021 Since some functions can return arrays bigger than 128 Í deduce that is not a technical limitation but a imposed limitation to avoid that an infinite loop tries to create an infinite array and therefore a memory leak. Or most likely bethesda not trusting their own software or the programmers.I know why there is a limit, every array has to have a defined "size".It just is weird that it is so small ... Link to comment Share on other sites More sharing options...
DieFeM Posted June 16, 2021 Share Posted June 16, 2021 (edited) Since some functions can return arrays bigger than 128 Í deduce that is not a technical limitation but a imposed limitation to avoid that an infinite loop tries to create an infinite array and therefore a memory leak. Or most likely bethesda not trusting their own software or the programmers.I know why there is a limit, every array has to have a defined "size".It just is weird that it is so small ... Arrays don't have to, you can dynamically increase the size, in the case of Fallout 4's papyrus, through the use of Add().But anyway that doesn't have anything to do with what I'm talking about. I'm saying it is an imposed limitation, nothing to do with the limit one gives to the array when it is declared.And I guess it is so small because you can have many of them, and 128 seems the smallest square of 2 that results in a number near of 100, which looks like an acceptable value to manage game thingies for any developer.And I would add that if you need more than that you're probably trespassing the boundaries of a sane developing, in a papyrus context. Edited June 16, 2021 by DieFeM Link to comment Share on other sites More sharing options...
SKKmods Posted June 16, 2021 Share Posted June 16, 2021 How much more dev/test complxity would have been created to generate ZERO additional sofware license REVENUE for Bethesda ? Infact if the base game doesnt need/use that, what would the system test case look like ... It's simply how software products are specified to meet a commercial need. "But, I want it in pink." Link to comment Share on other sites More sharing options...
YouDoNotKnowMyName Posted June 16, 2021 Author Share Posted June 16, 2021 How much more dev/test complxity would have been created to generate ZERO additional sofware license REVENUE for Bethesda ? Infact if the base game doesnt need/use that, what would the system test case look like ... It's simply how software products are specified to meet a commercial need. Well, as far as I know, software stuff can be tested automatically, so it would just take some more time (letting an automated test run over night, it wouldn't matter if that took a few hours longer ...)But I am not really familliar with SW testing and SW QA. If somebody would tell me to develop something with these weird and crazy restrictions, I would say "if you can't give me state-of-the-art tools & functions to work with, then go f##k off".But that is just me, maybe I have too high expectations of what "professional (SW) development" is ... Or maybe I am just too used to doing my own stuff in C and C++, where I can do whatever I want. (You want an array with 1000000000 elements? Sure, as long as you have the RAM for it!) "But, I want it in pink." Let's use that example:We don't even get colours, only 128 shades of gray ;-) Link to comment Share on other sites More sharing options...
SKKmods Posted June 16, 2021 Share Posted June 16, 2021 I have run commercial software development contracts like that, where the techs ran wild gold plating everything for no additional fees/revenue. And lost A LOT of money. As we seem to have different perspectives on how the world actually works I'll save my breath. Link to comment Share on other sites More sharing options...
niston Posted June 16, 2021 Share Posted June 16, 2021 The limit is arbitrary and imposed by Papyrus runtime, when creating or adding to array.I've already posted about the LL_FourPlay plugin that offers a function to increase that limit. On the reason why, I don't know. I've read that it's been like this since Oblivion or whatever. But its probably due to a) consoles and b) the average skill level of the average scripter who often doesn't know wtf they are doing. Essentially the same thing as to why Structs can't contain Arrays or other Structs - But even for that there is a compiler patch. Link to comment Share on other sites More sharing options...
YouDoNotKnowMyName Posted June 16, 2021 Author Share Posted June 16, 2021 I have run commercial software development contracts like that, where the techs ran wild gold plating everything for no additional fees/revenue. And lost A LOT of money. As we seem to have different perspectives on how the world actually works I'll save my breath.I know how the world works, I just don't want to acknowledge the fact that it works the way it does. Not when it comes to my "hobby projects", since they are what I use to "get away" from everything that's wrong with the world ... The limit is arbitrary and imposed by Papyrus runtime, when creating or adding to array.I've already posted about the LL_FourPlay plugin that offers a function to increase that limit. On the reason why, I don't know. I've read that it's been like this since Oblivion or whatever. But its probably due to a) consoles and b) the average skill level of the average scripter who often doesn't know wtf they are doing. Essentially the same thing as to why Structs can't contain Arrays or other Structs - But even for that there is a compiler patch.Oh, yes, I keep forgetting that all this papyrus stuff runs in kind of a "virtual machine" inside of the game engine. (or something like that) And yes, I know that the "core" of the engine has not been touched since like a decade or two :laugh:.And I can't think of a single script and or quest in TES Oblivion that would have a use for a large array. So, there is a reason for this low limit:Back when the engine was made, there was no need for it.And since the engine was not really touched since then, all these "historical limitations" are still there.Makes sense! Link to comment Share on other sites More sharing options...
Recommended Posts