stop rendering in background

User avatar
Hairy Phil
Automaton
Automaton
Posts: 153
Contact:

stop rendering in background

Post#1 » 06 Sep 2018, 18:00

Based on the frames-per-second counter on my Steam version of the game, it looks like you continue to render the main menu underneath the AI editor, which is bad for the mobile version. Is it possible to pause that part of the rendering during editing, which would greatly improve phone FPS, battery drain, and heat. I never understood why staring at a static 2D editing screen caused my phone to get so hot.

Jeffrey Harpen
Automaton
Automaton
Posts: 122

Re: stop rendering in background

Post#2 » 06 Sep 2018, 19:27

+1

Ed-209
Algorithm
Algorithm
Posts: 53

Re: stop rendering in background

Post#3 » 07 Sep 2018, 06:10

+1

User avatar
GFX47
Dev
Dev
Posts: 2914

Re: stop rendering in background

Post#4 » 07 Sep 2018, 09:42

Hairy Phil wrote:Based on the frames-per-second counter on my Steam version of the game, it looks like you continue to render the main menu underneath the AI editor


That's actually not the case but I'm very curious to know the reasoning behind this.

User avatar
Hairy Phil
Automaton
Automaton
Posts: 153
Contact:

Re: stop rendering in background

Post#5 » 07 Sep 2018, 19:50

Because I get the same FPS (say 30FPS) both during a match and during editing (editor launched from the main menu, not during a match). Considering that my FPS does fluctuate depending what's on screen, such as many bullets being fired at the same time, or when it zooms out to view the whole arena, I would expect the 2D editor to have a much higher FPS than during a match, but it's the same, which makes me think that the 3D models are still being rendered. My FPS is double (60FPS) while launching the game from Steam, before any rendering has occurred. There shouldn't be any processing going on when I'm just staring at the editor and thinking for 5 minutes, it's like a screenshot, so I don't understand why my phone would be processing at maximum for that period. The only other explanation that I can think of is the decoding of the music (which does stutter when my FPS is low), or maybe background updating of adverts?

User avatar
GFX47
Dev
Dev
Posts: 2914

Re: stop rendering in background

Post#6 » 07 Sep 2018, 23:18

Oh so you mean the combat is rendered (after going to the editor in the middle of a multiplayer match), not the main menu as you said in your first post.
Anyway, just checked, no 3D is rendered and game execution/update is paused.
Maybe your AI is too big enough to make your FPS drop?

Jeffrey Harpen
Automaton
Automaton
Posts: 122

Re: stop rendering in background

Post#7 » 08 Sep 2018, 10:25

I performed a simple test: I started the game, went straight to the AI editor (without running any match) and let it run for about 10 minutes. My device got warm in a similar way that it does when running a match and the battery also decreased quite quickly (3% / 10 minutes in my case). If there wasn't any rendering, it shouldn't, I guess. So why?

User avatar
GFX47
Dev
Dev
Posts: 2914

Re: stop rendering in background

Post#8 » 08 Sep 2018, 10:31

Once again it depends on the size of your AI.
UI is pretty expensive in Unity :/

User avatar
Hairy Phil
Automaton
Automaton
Posts: 153
Contact:

Re: stop rendering in background

Post#9 » 08 Sep 2018, 15:01

Frames Per Second:

Steam on Windows 10.
Screen resolution: 2560x1600.
Graphics quality: good.
Full-screen, not windowed.

loading screen: 57
main menu: 36
team setup: 32
start of match: 30
during match, zoomed in: 30
during match, zoomed out: 30
editor, from main menu: 35
editor, during match: 32 > 24 > 19 > 11

Match was Campaign level 6.3.
Editor has 32 nodes visible.

While writing this, I had the editor open during the match, and when I returned to the editor I noticed that the FPS had decreased and the music had started crackling. The FPS decreased by about 5FPS for each minute that passed. So after 4 minutes, the FPS of the editor during a match had dropped from 32FPS to 11FPS, with no interaction from me. I waited, but it didn't go lower than this. Exiting the editor restarted the match, which now ran at 20FPS instead of the original 30FPS. Exiting to the main menu, it now ran at 19FPS, half of the original 36FPS, with crackling music.

User avatar
Hairy Phil
Automaton
Automaton
Posts: 153
Contact:

Re: stop rendering in background

Post#10 » 08 Sep 2018, 15:02

I would expect the FPS in the 2D editor to be around 50FPS because there is no movement on screen and no interactions to process.

ElvenMonk
Neural Network
Neural Network
Posts: 238

Re: stop rendering in background

Post#11 » 08 Sep 2018, 16:17

2D scene could be quite expensive to render too, as It also consists of a lot of objects that are subject to z-ordring (for correct blending), hit on click calculations and so on.
I can't say if "scene image buffer" and "click map" caching could help, but it can be really difficult to implement. And I wouldn't expect good performance here with "naive" implementation.

User avatar
GFX47
Dev
Dev
Posts: 2914

Re: stop rendering in background

Post#12 » 08 Sep 2018, 18:10

Wait, so now you're talking about the AI debugger or the AI editor?
What's your PC specs?

User avatar
Hairy Phil
Automaton
Automaton
Posts: 153
Contact:

Re: stop rendering in background

Post#13 » 08 Sep 2018, 18:31

I'm only talking about the full-screen editor, not the in-match debugger.

I'm on a Dell ultrabook, so no discrete graphics card, so I expect poor FPS for most 3D games, but not 2D apps. It's an Intel Core m7-6Y75 with 8GB RAM and a native resolution of 3200x1800, graphics are Intel HD Graphics 515 (which can run GTA V for example). https://ark.intel.com/products/88199/In ... o-3_10-GHz

User avatar
Hairy Phil
Automaton
Automaton
Posts: 153
Contact:

Re: stop rendering in background

Post#14 » 08 Sep 2018, 18:35

Just to be clear, the reason that I quote the two different methods of launching the editor is because of my theory that things are being rendered underneath, so I would expect editor launched from match to have a worse FPS than editor launched from main menu.

sollniss
Automaton
Automaton
Posts: 178

Re: stop rendering in background

Post#15 » 08 Sep 2018, 18:57

Unity UI can be a real bitch to optimize. Did you try to split up the canvases? I think when you put everything into one canvas the whole thing gets dirtied when you change something. I'm not really sure how I would split up the canvas inside the AI editor though. Maybe define regions in the editor?

Or maybe you are doing it already anyways.

@Phil How many nodes are you viewing in the editor? Maybe compare the fps for an empty AI and one with 100 nodes.

User avatar
Hairy Phil
Automaton
Automaton
Posts: 153
Contact:

Re: stop rendering in background

Post#16 » 08 Sep 2018, 19:03

Just tested. Editor launched from main menu with 32 nodes = 31FPS. New empty AI = 33FPS. So number of nodes doesn't affect it.

User avatar
GFX47
Dev
Dev
Posts: 2914

Re: stop rendering in background

Post#17 » 08 Sep 2018, 19:04

I'm already doing this and a lot of other tricks to optimize UI rendering.
True, trying different AI sizes could be interesting.

User avatar
GFX47
Dev
Dev
Posts: 2914

Re: stop rendering in background

Post#18 » 08 Sep 2018, 19:06

Could you check the logs to see if there's not something spamming?
Can you also check your task manager to see what is at 100%? CPU, GPU or disk?

User avatar
Hairy Phil
Automaton
Automaton
Posts: 153
Contact:

Re: stop rendering in background

Post#19 » 08 Sep 2018, 22:42

CPU 40%
RAM 422MB
Disk 0%
GPU 99% 3D (Direct3D v11.1, 2111 MB of VRAM)

Nothing wrong showing in:
C:\Users\___\AppData\LocalLow\GFX47\Gladiabots\output_log.txt
Is that the log file you mean? If not, where is it?

User avatar
GFX47
Dev
Dev
Posts: 2914

Re: stop rendering in background

Post#20 » 19 Sep 2018, 12:32

That's the one.
Could you make some tests loading increasingly bigger AIs and monitor the performances?

Return to “Questions”

Who is online

Users browsing this forum: No registered users and 2 guests