[DEPRECATED] How-to: decreasing UI memory usage on Windows / Linux

Discussion in 'Support!' started by SXX, August 19, 2014.

  1. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    Most popular UI middleware for last 5 years is Scaleform which is based on Adobe flash and it's basically custom-made GPU accelerated flash player. So movement to HTML5 it's obvious step because it's have a lot higher base of available assets and there is a lot of people who can using this instrumentary well.

    Not sure what you mean as "each object". Basically usage of dedicated renderer for each panel isn't best decision ever and I suppose Uber perfectly understand it.

    One word: mods. In PA UI control everything and it's really powerful so mods can't be trusted by design.

    Basically there is no guarantee Uber will able to fix some bug even if it's won't be closed source. Same valid of other UI solutions.

    You really don't understand game development specifics. Frameworks that created for business GUI applications programming isn't actually suitable to use when you want to render UI with 60+FPS with easy integration into rendering pipeline. There also have to be good API to integrate it into self-build engine while usage of Qt mean you likely want to use it's libs and you can find a lof of reasons why game developers don't like to build their engines on Qt.

    Also just want to leave my random ffuuu for GTK and I hope it's going to die out completely because it's never looks good on Windows or OS X and Qt a lot better in general. GTK2 is dead, it's abandoned by RedHat and GTK3 still unable to work well on other platforms.

    Modding. Most mods we have possible exactly because powerful UI.

    In PA it's different. It's not game engine control UI, but basically UI control game engine. If on start of alpha lot of things was hardcoded over time Uber moved more and more code into UI and hopefully they'll continue it.
    nlaush likes this.
  2. Brokenshakles

    Brokenshakles Active Member

    Messages:
    239
    Likes Received:
    143
    Hmm, I see, so your saying they started with the middleware to track most of their internal engine variables so that they would be moddable/configurable? That actually sounds pretty useful, but the middleware dependency is still killing the Linux end of things right now. I'm getting from SSX that the problem is a lot bigger than just rendering buttons on the screen. As far as I understand, rendering pipeline integration for GUI's is a big problem in the Desktop UI world right now as well, since more and more desktops are just rendering to a DRM sink that dumps to either a GFX card or an Intel Optimus SOC instead of using the CPU to work things out. As far as I know, only EFL has anything approaching an integrated comprehensive rendering pipeline for its rendering and compositing effects, and that took ~7 years to code up (And as you said before, there are several reasons not to use QT's compositing implementation). I wonder how long it will take for CoherentUI to work out its kinks.
    fajitas23 likes this.
  3. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    Actually it's two ways exchange. UI handle settings save/load, game resource load, control connection to servers, part of unit selection and control, and features enablement. Obviously a lot of things done in native code and for example engine supply UI with information about units you see on screen and a lot of other info which make PA Stats for example possible.

    Considering that user input handled by UI it's crash is fatal - yes.

    I suppose most of code needed already bundled within Chromium Browser so they have less work here, but I suppose it's still quite a lot of work to wrap Chromium to make it more or less usable in-game.

    Let's say fair I seriously doubt that EFL actually have code that even 1/3 as stable on Windows and Mac OS X as Qt. And even Qt which being one of best open source projects found likely nowhere near to stability of Chromium which funded by Google.

    I pretty sure that core of Qt designed for business users is rock solid and provide great experience on all OS, but I have serious concerns that for example hardware acceleration or any other rarely used component is bug-free and going to work properly on all OSes.

    Might be one day we'll see something like "Qt4Games", but for now it's not sound seriously.
    fajitas23 likes this.
  4. fajitas23

    fajitas23 Member

    Messages:
    32
    Likes Received:
    4

    Thanks. I am talking of the overall system RAM usage, so OS, PA and what else is running on the machine.
  5. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    Then you have to use planet of exactly same size if you actually want to compare something because change described in this topic only affect number of Coherent process. ;)

    Also keep in mind that you likely will never see even "visual" usage of 100% RAM because OS will be force unload data to page file / virtual memory.
  6. Brokenshakles

    Brokenshakles Active Member

    Messages:
    239
    Likes Received:
    143
    True enough, but once again we are at the same chicken and egg problem so I guess its a wash. The real big thing for me is that there is no way for the community to offer support because of the closed-source nature of the middleware. Which is especially frustrating coming from Google. Hopefully Uber has an API for Middleware <> PA Core Code interfacing so an open-source drop-in alternative could be developed later.
  7. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    This fact doesn't make sense. Even if game was built using Qt it's would remain closed source and even if Uber being really open and happy to accept help they still not going to give us source code any time soon or ever. I suppose everyone understand that so even if this being sad this is how game development work now.

    Added. Still Uber don't have unlimited manpower so everyone able to push improvement ideas like this topic so they can implement them within game without spending tons of time on research and testing. ;)

    It's not. It's just based on Chromium which created by Google.
    Still Google put tons of money into development to make it effective and rock stable.

    I suppose it's technically impossible because it's work this way:

    PA -> Uber UI code -> libCoherentUI.so (closed-source) -> IPC via shared memory -> CoherentUI_Host (closed-source, crash is here). Last time I checked evaluation version of Coherent there was no way to control communicatiom between library and host.
    Last edited: August 30, 2014
  8. Brokenshakles

    Brokenshakles Active Member

    Messages:
    239
    Likes Received:
    143
    Impossible? To have an alternative Uber UI code only needs a config option pointing to the middleware lib name you want to use (libCoherentUI.so VS libOpenCoherentAlternaive.so) with a way to set that option. No one said an API had to be complicated. As long as the alternative lib acted in the same way as the original, things should run. This is not terribly uncommon in the open-source world. In fact, WINE runs on this arrangement. I'm not asking for Uber to come up with an alternative, only to make having an alternative possible.

    Edit: This is not just about things working or not working on Linux, its also about making the modern gaming dev more familiar with open-source and free software practices and standards, which they could benefit greatly from.
    Last edited: August 30, 2014
    fajitas23 likes this.
  9. fajitas23

    fajitas23 Member

    Messages:
    32
    Likes Received:
    4
    Thx. I did test on the same system 'Monday Night Combbat', and yes, the RAM is not at 100% but Harddisk activity is once PA reaches the limit of my machine.
  10. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    Constant support for stable ABI is extremely complicated task to do I personally don't see any reason why would any game developer want to use it.

    Also I personally against any "native" modding for proprietary project "to make it better" because there is too high risk that people going to create addons that's not cross-platform and as result something made for Linux won't work on Windows and vice versa.

    Can you clarify how exactly this benefit the game? Why this should worth it?

    PA client already use number of open source components like Boost, curl, SDL. Uber also use a open source software like Jenkins for their build server, some other UI testing framework and their deploying system written in python (some of devs said that ). Also as far as I understand server-side use one of JS engines for scripting.

    Lead engine architect on PA (@UberWilliam) uses Emacs and @jorgenpt who handle Linux version is contributor to SDL and several other open projects.
  11. flipstone

    flipstone New Member

    Messages:
    4
    Likes Received:
    1
    I've managed to solve the issue, but I was wondering whether Uber have any plans to patch this, because this seems ludicrously simple to solve.
  12. adoghost

    adoghost Active Member

    Messages:
    145
    Likes Received:
    115
    i do everything and now the game dont open
  13. flipstone

    flipstone New Member

    Messages:
    4
    Likes Received:
    1
    I presume you are referring to the 'could not load CoherentUI' error.' You should double-check that the path is right, which can be found under properties by right-clicking the CoherentUI_Host_Real file . You should also check that you have correctly named the copy of the file.

    If all else fails you should remove the new entry from the registry, either by loading an exported backup, or using the method kindly suggested for me earlier on.
    adoghost likes this.
  14. yakcyll

    yakcyll Member

    Messages:
    31
    Likes Received:
    17
    Just dropping by to remind everyone that the launcher also utilizes Coherent (where it's located in the first place, I have no idea - maybe it's embedded in the executable?), so if you'll ever have problems with the launcher crashing on start-up or refusing to update a branch for an absurd reason, try temporarily removing the key from the registry before jumping to conclusions.
  15. dave23

    dave23 New Member

    Messages:
    1
    Likes Received:
    0
    Hey ;)

    is this fix still working cause there are still 10+ processes after every game sometimes even in the lobby the ui fucks my 32bit win with 4 gigs ram every time. Sad really like the game -.-

    I used this path (sure with the \\ ?):
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\CoherentUI_Host.exe]
    "Debugger"="C:\\Games\\Uber Entertainment\\Planetary Annihilation Launcher\\Planetary Annihilation\\stable\\bin_x86\\host\\CoherentUI_Host_Real.exe --renderer-process-limit=5"


    Win7 sp1 is installed ..direct x ..ms.net framework.. graphics driver etc ..all uptodate!!! clean install! --> Sys.specs: 2x2,6 ghz/ 4gb ram/ geforce 440+

    ui log:
    564 16:09:12.680341 W | PID: 6064 | 5076 16:09:10.553905 Shared textures are not properly supported on Windows 7 without Service Pack 1. Please install the latest service pack.
    564 16:09:12.680341 W | PID: 6064 | 5076 16:09:10.553905 [6064:5076:WARNING:resource_bundle.cc(252)] locale_file_path.empty()
    564 16:09:12.841350 W | PID: 6064 | 5824 16:09:12.800348 [5224:5720:WARNING:resource_bundle.cc(252)] locale_file_path.empty()
    564 16:09:12.841350 W | PID: 6064 | 5824 16:09:12.802348 [4448:4464:WARNING:resource_bundle.cc(252)] locale_file_path.empty()
    564 16:09:12.841350 W | PID: 6064 | 5824 16:09:12.832349 [5972:1764:WARNING:resource_bundle.cc(252)] locale_file_path.empty()
    564 16:09:12.890353 W | PID: 6064 | 5824 16:09:12.876352 [5404:1416:WARNING:resource_bundle.cc(252)] locale_file_path.empty()
    564 16:09:14.055419 W | PID: 6064 | 5076 16:09:14.051419 [6064:5076:WARNING:(0)] locale_file_path.empty()
    564 16:09:14.722458 W | PID: 6064 | 5076 16:09:14.716457 Requesting resource read for coui://ui/main/_i18n/locales/de/icon_atlas.json with internal id 41 reported FAIL
    564 16:09:14.739459 W | PID: 6064 | 5076 16:09:14.722458 Requesting resource read for coui://ui/main/_i18n/locales/dev/icon_atlas.json with internal id 42 reported FAIL
    564 16:09:14.741459 W | PID: 6064 | 5076 16:09:14.739459 Requesting resource read for coui://ui/main/_i18n/locales/de/shared.json with internal id 43 reported FAIL
    564 16:09:14.756460 W | PID: 6064 | 5076 16:09:14.756460 Requesting resource read for coui://ui/main/_i18n/locales/de/special_icon_atlas.json with internal id 45 reported FAIL
    564 16:09:14.772460 W | PID: 6064 | 5824 16:09:14.768460 Could not recognize the mime type of coui://ui/main/_i18n/locales/dev/shared.json
    564 16:09:14.789461 W | PID: 6064 | 5076 16:09:14.772460 Requesting resource read for coui://ui/main/_i18n/locales/dev/special_icon_atlas.json with internal id 47 reported FAIL
    564 16:09:14.789461 W | PID: 6064 | 5076 16:09:14.772460 Requesting resource read for coui://ui/mods/ui_mod_list.js with internal id 49 reported FAIL
    564 16:09:14.805462 W | PID: 6064 | 5076 16:09:14.790461 Requesting resource read for coui://ui/main/_i18n/locales/de/shared.json with internal id 50 reported FAIL
    564 16:09:14.807462 W | PID: 6064 | 5076 16:09:14.806462 Requesting resource read for coui://ui/main/_i18n/locales/de/main.json with internal id 51 reported FAIL
    564 16:09:14.807462 W | PID: 6064 | 5824 16:09:14.806462 Could not recognize the mime type of coui://ui/main/_i18n/locales/dev/shared.json
    564 16:09:14.838464 W | PID: 6064 | 5076 16:09:14.822463 Requesting resource read for coui://ui/mods/ui_mod_list.js with internal id 53 reported FAIL
    564 16:09:14.855465 W | PID: 6064 | 5076 16:09:14.839464 Requesting resource read for coui://ui/main/_i18n/locales/dev/main.json with internal id 54 reported FAIL
    564 16:09:14.857465 W | PID: 6064 | 5076 16:09:14.857465 Requesting resource read for coui://ui/main/_i18n/locales/de/shared.json with internal id 56 reported FAIL
    564 16:09:14.880467 W | PID: 6064 | 5076 16:09:14.874466 Requesting resource read for coui://ui/main/atlas/icon_atlas/img/strategic_icons/icon_si_celestial_object.png with internal id 59 reported FAIL
    564 16:09:14.881467 W | PID: 6064 | 5824 16:09:14.879467 Could not recognize the mime type of coui://ui/main/_i18n/locales/dev/shared.json
    564 16:09:14.891467 W | PID: 6064 | 5076 16:09:14.890467 Requesting resource read for coui://ui/mods/ui_mod_list.js with internal id 73 reported FAIL
    564 16:09:14.975472 W | PID: 6064 | 5824 16:09:14.944470 Could not recognize the mime type of coui://ui/main/shared/css/font/Armata-Regular-webfont.ttf
    564 16:09:14.989473 W | PID: 6064 | 5076 16:09:14.977472 Requesting resource read for coui://ui/main/atlas/icon_atlas/img/strategic_icons/icon_si_fighter_adv.png with internal id 103 reported FAIL
    564 16:09:14.997473 W | PID: 6064 | 5076 16:09:14.990473 Requesting resource read for coui://ui/main/atlas/icon_atlas/img/strategic_icons/icon_si_unit_air_generic_adv.png with internal id 108 reported FAIL
    564 16:09:14.997473 W | PID: 6064 | 5076 16:09:14.991473 Requesting resource read for coui://ui/main/atlas/icon_atlas/img/strategic_icons/icon_si_unit_air_generic.png with internal id 109 reported FAIL

    WTF? Any Idea? Don't say buy a better Pc cause I can't afford one atm^^ After every game my screen turns black sometimes pa.exe crashes sometimes game runs normal but screen turns black :/ any help? Restart fixes it until next Load/Gamend

    Every .exe file runs with admin rights and in compatibility mode win7 ..

    I figured out that directly after a game 2 things can happen a) pa.exe crashes - CTD 90% ram usage b) pa.exe continues to run but the c..ui crashes 80% ram usage !

    It could be a windows problem but I think it is ui related cause the game runes sometimes after ui crash ..hmm any thoughts ??
    Last edited: September 1, 2014
  16. spittoon

    spittoon Member

    Messages:
    78
    Likes Received:
    14
    thank you, code monkeys!

    you make our lives so much better!
  17. radongog

    radongog Well-Known Member

    Messages:
    638
    Likes Received:
    295
    Is this also enhancing performance for those with massive Ram (Eight GiB and upwards...) or only for the folks below?
  18. yakcyll

    yakcyll Member

    Messages:
    31
    Likes Received:
    17
    It's not exactly about enhancing performance, but just reducing memory bloat. This saves up to a single gig of memory in extreme cases, but usually about 400-600MB, depends on how responsive you want your UI to be.
  19. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    No, it's completely useless for anyone who have enough RAM. At least in case of 8GB it's possible might be useful (for example on Linux), but 16GB is more than enough for both game and UI.
  20. dleg3nd

    dleg3nd New Member

    Messages:
    2
    Likes Received:
    0
    Hey Mate First of all thanks for that nice fix, your rly great dude!

    I have a high end rig with 8GB and its unexpectable from Uber that 8 isnt rly enough.

    I cant play a Match with 4 Bots because at some Point it reaches the Maximum and it will crash (Mostly on Start of a Match). I hate it so much, with your fix it is nice playable and hits like 6 GB.

    So i ask you all is it worth to get more RAM? I love that game but rly its the only game that reaches that limit, thats unexpectable.

    And could you check my Diag maybe?
    Thank You

    Attached Files:

Share This Page