Jump to content

[LE] Multidimensional Arrays in Skyrim


PeterMartyr

Recommended Posts

This uses code released for Skyrim near as I can ascertain in May of 2015, in 2016 I attempted to create problematic Fake 2D Ragged Array, in a skyrim 1D Array, that exceeded the 128 limit, rightly so I was utterly defeated.

That one Array that Fakes a 2D multidimensional ragged array, and breaks the 128 element limit. You read right, and 2016 too.

 

Now I have not touch this game since early 2017. But my Google-Fu is strong, and I also search the wiki, pttttf the wiki...... not much help there, either it was non-practical, and static, but a real fake 2D array, or a pretend CSV file, not even an example an of fake 2D Array

Then I came across another of 2D example made in 2018 of multidimensional arrays in Skyrim on Nexus Mod, another example of CSV file. An application that uses CSV files saved to PC is Microsoft Excel. Honestly if you need a String Text Data Storage for your mod? Do not use arrays to store Strings on users game save, use the real thing with either J-Containers or PapyrusUtil for Pete Sake!! I will not link or name anything, how strong is your Google-Fu, read below to discover what CSV file is

A CSV is Comma Separated Value https://en.wikipedia.org/wiki/Comma-separated_values

I realise I made better progress back in 2016, but totally lacked the skill to pull off my design, so I revisited it, could I create problematic Fake 2D Ragged Array, that exceeded the 128 Array limit, using a single array.

Yep I did, and will post the code here, BUT..... it will be censored, these arrays use unsigned integer, that increase the Array length of 128 to over 4,000, 000, 000, also how to create an array problematically of various different lengths, on the fly will be censored too. If clever you works out code I used and go the Official Creation Wiki, you find NADA, NOTHING.. No one filled it out since May of 2015, no joke.But you will find examples of non practical static 2D arrays or CSV files

When I got introduce to multidimensional arrays, I given the choice of using the real deal or faking it with single array, it is not that hard, OFC I chose the real deal, this first time I am using a fake one since 2016. Why there is no good examples of how, I got no idea, unless, people just move on get professional, and don't look back.

 

 

  Reveal hidden contents

 

 

next came unit testing, let me say Equivalent testing and Boundary testing in a game like Skyrim is very annoying, I gave up and did not complete it :laugh: here some of the code

 

 

  Reveal hidden contents

 

 

which required a MCM so I could have button to fired the tests... Plus the maximum custom trace output is 4 files :huh: :down: poor me

 

 

  Reveal hidden contents

 

 

Yeah, I made a Unit Test Mod, what did you expect me to run around in the game like moron ? not gonna happen

 

Here the result of one test, which displays the data dumped in a single array and in a Virtual 2D Array

 

 

  Reveal hidden contents

 

 

 

  Reveal hidden contents

 

 

Yes I made a Virtual 2D Ragged Array Management System so it could have practical application in the Game. You may say I am happy with my FormList mate, all that show is you not know Lists are heaps slower than Arrays. While using more more PC memory allocation.

 

It had one major issue I could not pass the array from one object to another object, it seem Skyrim is hardcoded to 128 in more ways than one, but I made the "Rows" maximum of a 128, so one row at time anyone? in Virtual Ragged 2D array that supports over 4 billion data elements?

 

Would I recommend to use this ? HELL NO :devil: Skyrim is old buggy game, my weekend was free, and hated the Fact it beat me.. but multiple arrays capable of 4 Billion, in Skyrim, are you crazy ?

What was the hardest part ? using Papyrus. OGM how I hated using it, no wonder people don't look back :laugh: :laugh:

 

 

Now you know why I censored the code. :geek:

Link to comment
Share on other sites

Hi guys just let me say it is a rule of thumb that you do not do with a List what you can do with an Array. Array sizes are static once declared and there size allocation cannot be change in the memory. BUT that does does mean you cannot resize an Array. Made a new one, that bigger, copy that data over, overwrite the old Array variable memory pointer with the new bigger array with the same Data. The PC OP will delete the old memory, and the pointer now points to bigger array with the same data, waiting to be filled with more data.

 

Ultimately it is up to you which one you use.. but an Array is faster.

 

A List will reject duplicates, how does it know it is a duplicate ? a list cannot snap to the end of the list, it as to always start at the beginning and illiterate thru the entire List, if it is found, reject it, or keep going, when it is at the end of the list it will add a new item. Every time.

 

Another example Get(20) a list goes 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 alliterating through to 20 there you go

 

This is an Array item[20] there you go, see why it is faster? Or add at item[20] Done

 

List add at 20 a list goes 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 alliterating through to 20 now let's add this.

 

Now you make informed decision... I use both.. A list is more versatile but that comes at a performance cost, if you don't need the versatility of a list you should be using an array, it is that simple.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...