Skip to content

[CRITICAL] core script makes lots of cache textures #208

@Creta5164

Description

@Creta5164

image
image
iOS application debug log

2019-09-21 19:22:39.039393+0900 StarryNight_swift[12541:3674519] [ProcessSuspension]  0x2834ca780 - ProcessAssertion() Unable to acquire assertion for process with PID 0
2019-09-21 19:23:09.041738+0900 StarryNight_swift[12541:3674258] Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service

JS console debug log

[Error] Failed to load resource: The requested URL was not found on this server. (pixi.js.map, line 0)
[Error] Failed to load resource: The requested URL was not found on this server. (pixi-tilemap.js.map, line 0)
[Error] Failed to load resource: The requested URL was not found on this server. (pixi-picture.js.map, line 0)
[Warning] Total canvas memory use exceeds the maximum limit (288 MB). (rpg_core.js, line 1481, x2)
[Warning] Total canvas memory use exceeds the maximum limit (288 MB). (rpg_core.js, line 754)
[Warning] Total canvas memory use exceeds the maximum limit (288 MB). (rpg_core.js, line 754)

We are porting MV games to iOS and found the following flaws in the core script.

This problem is quite serious and is not very well suited to RAM optimization and modern GPU rendering methods.
Our game dev team have confirmed while porting to iOS, core script makes cache texture just one time uses for making every windows. (even when moving window cursor too...)
This approach is extremely inefficient.
Because of this problem, the web view we used to port to iOS, WkWebView, opens and closes the menu dozens of times, causing the web view will refresh page by cannot handle the huge memory heaps. It's very serious.

Here is reason:

  1. Making cache texture (using canvas) are makes huge memory heaps, so it'll needs more huge memory space and garbage collector(GC) will takes cleaning for long time. The real problem is that only GC knows when to clean. (GC will clean even playing game, that makes freezing the game)
  2. Make every window using instant texture, then GPU will wait for next uploaded texture from CPU for drawing, every each frame! this is must be avoided with optimization.

There are two alternatives:

image

  1. Create a blank canvas of 2048x2048 size, and draw in here and display it every time create a window. This is called dynamic texture. (only use one texture for displaying everything.)
  2. Representing every window elements as Pixi's default objects. Because Pixi's assets are all managed objects.

Dev team should know why need to be more concerned about VRAM and RAM optimization issues, please check the link below.

What is a sprite sheet?
What is a sprite sheet? - Performance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions