FOnline Development > Questions and Answers
Animated background and lag
(1/1)
Zinthos:
hello
i have created a small mod whicih seems to cause huge performance issues and i cant find out why
i am curious if it is an engine limitation or i did something wrong
https://i.gyazo.com/f1ea69d577600d2613519c49e01a2137.mp4
i basically created 86 low-quality jpeg files, each around 40kb and 1440x900 resolution, then loaded them as main menu background using .fofrm format
now the problem is that using this mod FOnline.exe eats up around 1000mb of ram instead of the normal 240
based on the number and the size of the JPGs i used, if i calculated correctly the difference in RAM usage should be around 4mb
reducing the amount of pictures used also reduces the ram usage but still insane values
Slowhand:
I do not know the answer, just have some ideas:
- The idea is interesting, expand on the main screens to be able to use animations.
- Your design skills seems to match mine (this is not a compliment, mine suck)
- 1440 * 900 * 4 * 86 ~400MB, hm, let's say that the engine decompresses the JPG files to Bitmaps in memory and then uses those, the increases in memory requirement seems close to valid.
- Try to make another .fofrm with Bitmaps and see it that changes anything lag and memory wise. (If it decompresses the JPG real time (and does not cache it, but then why the huge memory drain), and is really shit at it, maybe that explains the FPS lag?
Vice Dice:
I think it's possible to create a special object class that will represent the sprites you are using to "animate" the screen, that will move itself each frame by some delta in some direction, until they reach some screen position and then destroy it when it's time to. Ask the client to load your sprite you want to being drawn when the client is on login screen, it might probably solve the lag issue and you wont have to create a fully animated background picture for different resolutions on top of that.
Wipe:
Why destroy? Just change object position when it's out of view ;)
Navigation
[0] Message Index
Go to full version