I guess the memory use would go down to around 300 to 500 MB.
the game simply works all graphic resources to RAM upon startup.
Ive determined that the real problem is the .OGG music is being converted into some raw format while its being loaded into memory.
Its unnecessary even modern-day to do that, and pretty sickening, because various MP3 and video players will decode the OGG in real time because its such a low overhead, far less than displaying video. This is the main stumbling block to being able to get X-Piratez to run under Android due to the huge amount of ram this takes up.
(I figured this out by replacing the music selection with low quality/frequency versions that had a smaller file size, and also truncating some tracks that weren't immediately referenced by the ruleset, and the memory footprint went from about 1 GB to around 750 MB just because of this alone. My main intention doing it was to decrease load times since every startup for x-piratez was taking well over a minute, and it still takes over a minute but its noticeably less now)Makes me wonder if there is any way to make to load .mid files to run adlib music.
Although its "easier" to decompress everything into memory upon loading its very inefficient, especially since running it under android is a potential target. What you can do is load the resources, and whenever they are referenced as needed, you decompress them into reserved memory. Since there's no heavy lifting involved here, for a mission or loading the ufopedia, all it is is just a small set of images at a time and very short if any loading delay during the game. Besides when you start a mission, it autosaves the map anyway and that automatically incurs a pretty hefty load delay.
(trade 30+seconds initial game load for maybe 1-2 seconds on the front end per new mission)Toaster? Should this imply my PC from 2001 would be, like, old?
I feel ya man. Ive got 2Gb ram and its not going to increase.
One important note is that they
are still using 8bit and locking the game to a palette just like the original. No color translation tables or palette remaps like zdoom does, no 24-bit post-processing color adjustments, no alpha layers or anything like that. So it is pretty true to the old days on that account (maybe painfully...)
I wonder what the native data formats are that they're decoding media into for the images, sounds, and music...
It still contains all of the features and most of the code of OXC, so in order to prevent merge conflicts on a massive scale, changing how images are loaded into RAM needs to come from the OXC developers.
Its a sign of a
need to make a change. If not because of the example of X-Piratez getting so large, a big resource overhead probably wasnt anticipated in the early days of openxcom but now its becoming a problem. So a new resource handling module should be on the drawing board.
Forking it wont be an issue if its done right, it can be dropped in and adopted for all versions.