Is there any way to know that the object is "built and placed" on the scene?

Note: I have seen (on rare occasion) that some textures produce issues. I found that by loading them in Gimp, Photoshop, or some other decent editor, then resaving them solved the issue.

What I mean by “not playing” is to respond to your question and comment out the result, that is to say, whether it is playing or not, it will be a black frame.

Small demos are currently not very convenient to make.

But you mentioned that I haven’t tried it on other computers. In short, I will answer your question first

OS: Windows 10 Home Version 1909.18363.836
System Memory: 16GB
Video: GTX 1060 6GB; Driver Rev: 26.21.14.4587
Open GL Rev: 4.6

  1. At present, I will try to run it on Mac to see if it is just a Windows problem.

  2. Not all, I am running in Texture Packer, so it is not always 2n.

  3. This question is quite difficult to answer, because the eighth character black box you see, no matter which other character I replace, the result is the same, regardless of the other table results.

  4. For each character, there are about 13 photos (12 of which are special effect tables).

6.It’s really interesting, I haven’t tried to store them with PS, I will try to see.

I’ll be going offline for what may be the rest of the day, but I’m going to be thinking about this. I will get back to you with additional thoughts.

This is the output of the console.
Normally it will run up to 1700MB, but it seems to be limited.

It seems to be a problem with the emulator. I will use the Mac to check the results recently, and I will report to you later.

It is not clear why two identical ones will be posted at once …

Overall, thank you very much, I have not noticed that it should be run on other computers.
Maybe this will be the point to solve the problem.

I made a demo replicating the issue:

https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2020/05/bigMemory.zip

It works as follows:

  • On first run, it copies ‘ninjaGirlIdle.png’ to the temporary foler, ‘numSheets’ times (see main.lua), giving each copy a unique name.
  • Then, it creates the same number of spritesheets and sprites.

If ‘numSheets’ is 280 (on my machine) it works. Somewhere above that (300 or fewer) I get all black boxes for the sprites.

My Texture Memory usage (as shown by RG Meter) is just below 1.6GB

I have no idea what is causing it, but it is interesting. I’d love to know if others see this on their machines. So, if anyone else runs this please do the following:

  1. Give us your basic machine specs. PC/Mac, OS Rev, GPU type
  2. Run the sample at ‘280’ numsheets
  3. Re run it at ‘300’ numsheets.

Post back with the specs and results for #2 and #3 steps.

1 Like

I believe that using this much memory (texture memory or main memory) is a pretty unfriendly thing and may make the app perform badly. So I suggest:

1 Like

I ran the test on Windows 10 (64-bit 10.0 Build 18363) with NVIDIA GeForce GTX 960 that has 2GB of VRAM. The device also has 16GB of RAM.

The sample worked as expected at 280, but at 300 I also got nothing but black rects.


It would be very strange if Solar2D simulator somehow restricted the amount of VRAM that can be used.

Still, like @roaminggamer said, and like I’ve said multiple times over the course of several months: this level of memory/texture memory usage is really high will likely lead to issues. Think of it like this: Your game and Red Dead Redemption 2 for PC have similar minimum requirements for GPU. Every time we discuss this matter, I am more convinced that you should rethink your animations and memory management.

2 Likes

You are right, so I will compress the other less important Buff effects to a minimum, and let the picture focus on large beautiful effects.

After referring to the running memory results of other large-scale 2D games, I set the battle below the standard of 2G (I originally hoped to be higher but now must give a standard value), I run such a huge memory on my phone or computer There is no drop in FPS at all, even if all special effects run together.

This is a trade-off between the commerce and the engineering must be reduced memory, but it must also be enjoyed visually by the player. :hugs:

Thank you very much for your testing.

But the method mentioned on texture management

texture: releaseSelf ()

My method after insert the spirite into the Group.

for i = Group .numChildren, 1, -1 do
Group [i]: removeSelf ()
Group [i] = nil
end

Does both will clear memory, or are there other differences?

Yes, those are somewhat different (although related) actions.

display.remove(obj) / obj:removeSelf() - Destroy a display object and clear any (internal) reference it has to resources. In this case, if the resource is a texture and that texture is no longer being used by any other display objects, it (the texture) will eventually be released.

Note: The above, release statement is not true if you previously asked for that texture to be loaded via graphics.newTexture(). In this case, even if no objects are using the texture it will stay loaded in memory.

texture:releaseSelf() - This is used to ‘release’ a texture that you previously loaded with graphics.newTexture(). This is used (in combination with the other texture management features) to let you better control when textures are loaded and unloaded on your own.

1 Like

You don’t need to do this:
Group [i] = nil
If you destroy an object and it is in a display group (not a table) it is automatically removed from the group and there is no longer a reference to the object within that group.

1 Like

Thank you very much for the detailed explanation.

I will first modify the clearing group code to what you said.

Then the texture memory that will be used is managed using preloading.

Thanks again and learned another lesson! :hugs: