• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code Regarding External resource handling

Hello !
First of all congratulations for GMS2. A new era is beginning which may give Game Maker even more popularity and new ways to create games.
I wanted to ask some questions about the new engine.
I saw that a new set of functions starting with gpu are being added, which suggests we will have more flexibility to use every aspect of performance we can, and create beautiful games. Also for the moment, Texture Groups and external graphics are locked and cannot be played with.
I am creating a fighting game with big 2D sprites. They are 3D renders with some special color filtering (made by Xor many thanks to him) allowing to recolor the characters with custom player palettes. The game also uses a lot of onscreen VFX coupling shaders and blending mode mostly. I do not want to use skeletal animated sprites.

On GM1, I had a lot of problems with this system because it is obviously impossible to couple this with GM's original loading system, which packs every graphic asset in RAM at launch. I do not want to have the game keep every stage and every character in memory when I am only using 2 characters and 1 stage at a time.
So I used a brilliant script collection made by Braffolk (many thanks to him too) which creates custom Texture Pages and groups, which you can load and unload from memory. Those things actually were big background pages added via background_add and drawn partly to make them look like sprites. So the system is perfect, but the big problem is that external resources always took 4 times more RAM (and probably more VRAM too but I didn't track this) than the starting IDE resources. So currently my game sits at 2.X GB of used ram when I correctly load my 2 characters and the stage. And the game still lacks a lot of animations for the stage and the characters. I used a special exe editor to flag the runner.exe so it goes beyond 1.5GB of ram but it makes the game really unstable, it is the temporary fix until something clean appears and saves our lives.

Talking a bit with Mike, it appeared that the system was doing a lot of copies of textures added externally and that was why it took that much ram.
Mike.Dailly said:

Okay... the the long and short of it is that currently all textures are ARGB, 32 bit uncompressed. When loading in. we have in memory the compressed PNG, the uncompressed PNG, and then DirectX itself takes a copy, and will make a texture from that - but keeps the copy. This means initially there are 3 copies. I'm not sure if GaneMakers copy is kept once loaded into DirectX - it's been a while since I looked in that code.



For 1.x, this isn't something we're looking to change.


So the question is :

Seeing that Tex Groups and everything related to external loading is locked for the moment, can we hope a new resource loading system which lets you load and unload without taking so much more ram compared to included assets ?

Is it even possible that external graphics would just be only loaded on vram (gpu) with the new functions, and are you planning to do it ?
 
Last edited:

saga55555

Member
Help dig

No answer for this question yet. I want to know it too D:
Any change with "sprite_add" or load in/out external resources?

And what max memory for GMS2? more than 1.7GB?
 
Last edited:

JeffJ

Member
Yes, please. Personally my biggest wish for GMS2 has always been better abilities to handle external resources. I would be crazy excited for this.
 

HammerOn

Member
Try these:
draw_texture_flush
sprite_flush
sprite_flush_multi
sprite_prefetch
sprite_prefetch_multi

I also had issues with this behavior. It makes hard to word in high resolution games.
It didn't work in 1.4 but the documentation on draw_texture_flush in 2.0 indicates that it works on Windows now.
It seems like we can control it better now.
 
Hello and thanks for your answer, but these things only free the VIDEO MEMORY (VRAM used in video card) and are not related to the MEMORY (RAM taken by the app) which is still eaten by sprites and stuff.

Hopîng to get an answer from GM staff, at least for a nice texture group unloading from memory, as video memory management is already on point.
 
Top