atl transform high cpu usage question
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
atl transform high cpu usage question
I noticed whenever I run a transform it consumes around 50% of my cpu until it stops (I have a 2 core processor, so I assume it uses a whole core to the max.
This is so even if the transform is something like - slowly moving a random text displayable from left to right. It seems regardless of what I'm transforming, the cpu always goes up to 50%
This seems to be related to the st method(?)
I tried running a custom-made function inside a transform (with some pauses) to move things, when this function used st for calculation I think it also used 50% of my cpu, but when I modified that function to not use st, the cpu fell down to 1-2%, while still performing the same transformation.
Is there any reason why this happens, or a potential way to "fix" this? I've been looking through the forum for a while and I didn't find any explanation for this. Although the explanation will probably be beyond my understanding, I'm still curious.
As far as I can tell, st is used to synchronize renpy's display speed, but other than that I don't know.
I know that if I run the custom function on the software rendered, with a forced limited framerate, it displays with slowdown, while the normal transform displays with correct speed.
This is so even if the transform is something like - slowly moving a random text displayable from left to right. It seems regardless of what I'm transforming, the cpu always goes up to 50%
This seems to be related to the st method(?)
I tried running a custom-made function inside a transform (with some pauses) to move things, when this function used st for calculation I think it also used 50% of my cpu, but when I modified that function to not use st, the cpu fell down to 1-2%, while still performing the same transformation.
Is there any reason why this happens, or a potential way to "fix" this? I've been looking through the forum for a while and I didn't find any explanation for this. Although the explanation will probably be beyond my understanding, I'm still curious.
As far as I can tell, st is used to synchronize renpy's display speed, but other than that I don't know.
I know that if I run the custom function on the software rendered, with a forced limited framerate, it displays with slowdown, while the normal transform displays with correct speed.
-
- Eileen-Class Veteran
- Posts: 1258
- Joined: Fri Sep 21, 2007 7:13 am
- Projects: a battle engine
- Contact:
Re: atl transform high cpu usage question
This still puzzles me, actually. The displayed framerate is tied to vblank so you'd expect transforms to also be evaluated only once per vblank, but it seems like they're run as often as possible.
- nyaatrap
- Crawling Chaos
- Posts: 1824
- Joined: Mon Feb 13, 2012 5:37 am
- Location: Kimashi Tower, Japan
- Contact:
Re: atl transform high cpu usage question
It seems even without using transform, there's a case to use 100% CPU in screens. It stops music in a moment so it's a bit irritating.
-
- Eileen-Class Veteran
- Posts: 1258
- Joined: Fri Sep 21, 2007 7:13 am
- Projects: a battle engine
- Contact:
Re: atl transform high cpu usage question
What case is this? I haven't seen 100% CPU use in screens unless that screen contained an animated transform or there was an animated transform happening at the same time.nyaatrap wrote:It seems even without using transform, there's a case to use 100% CPU in screens. It stops music in a moment so it's a bit irritating.
- nyaatrap
- Crawling Chaos
- Posts: 1824
- Joined: Mon Feb 13, 2012 5:37 am
- Location: Kimashi Tower, Japan
- Contact:
Re: atl transform high cpu usage question
There are several cases, but the most noticeable one is a minimap I made by sprite manager.
Please look a class minimap on http://lemmasoft.renai.us/forums/viewto ... 51&t=19245
It seems showing heavy displayables uses 100% CPU and it blanks music play.
Please look a class minimap on http://lemmasoft.renai.us/forums/viewto ... 51&t=19245
It seems showing heavy displayables uses 100% CPU and it blanks music play.
-
- Eileen-Class Veteran
- Posts: 1258
- Joined: Fri Sep 21, 2007 7:13 am
- Projects: a battle engine
- Contact:
Re: atl transform high cpu usage question
Hmm, wonder what's causing that. A sprite manager without an update method doesn't use 100% CPU in my tests, so it would seem that's not necessarily the issue. I'll grab the sample game and take a peek.
EDIT: The sample game (Dungeon_Crawl 2.0) doesn't use 100% CPU for me. Is there some menu or something I need to trigger?
EDIT: The sample game (Dungeon_Crawl 2.0) doesn't use 100% CPU for me. Is there some menu or something I need to trigger?
Re: atl transform high cpu usage question
I'm my case, I speculated that the transform takes a core and uses it in 100% as long as the transform continues.Hmm, wonder what's causing that. A sprite manager without an update method doesn't use 100% CPU in my tests, so it would seem that's not necessarily the issue. I'll grab the sample game and take a peek.
If that is true, then in case someone has only one core available it could run his whole cpu to 100% and cause a problem/lag. But this is only a speculation and only for this specific case.
If the user has multiple cores he would likely not notice any issues (other than maybe, high cpu usage).
Last edited by neowired on Fri Mar 14, 2014 8:50 am, edited 2 times in total.
Re: atl transform high cpu usage question
6 - 10% even if I move around really quickly... maybe this was valid for old versions of Ren'Py?nyaatrap wrote:There are several cases, but the most noticeable one is a minimap I made by sprite manager.
Please look a class minimap on http://lemmasoft.renai.us/forums/viewto ... 51&t=19245
It seems showing heavy displayables uses 100% CPU and it blanks music play.
- nyaatrap
- Crawling Chaos
- Posts: 1824
- Joined: Mon Feb 13, 2012 5:37 am
- Location: Kimashi Tower, Japan
- Contact:
Re: atl transform high cpu usage question
I made the sample game in safe range.Asceai wrote:Hmm, wonder what's causing that. A sprite manager without an update method doesn't use 100% CPU in my tests, so it would seem that's not necessarily the issue. I'll grab the sample game and take a peek.
EDIT: The sample game (Dungeon_Crawl 2.0) doesn't use 100% CPU for me. Is there some menu or something I need to trigger?
I think when I use png images on sprite manager, and also use a big size map (at least over 20x20 - 30x30 became hell to play), it causes performance problem.
I know this isn't a good code to calculate minimaps. But with recent CPU, even with this my awkward code, it could treat with no delay.
Last edited by nyaatrap on Fri Mar 14, 2014 8:57 am, edited 1 time in total.
Re: atl transform high cpu usage question
neowired wrote:I'm my case, I speculated that the transform takes a core and uses it in 100% as long as the transform continues.Hmm, wonder what's causing that. A sprite manager without an update method doesn't use 100% CPU in my tests, so it would seem that's not necessarily the issue. I'll grab the sample game and take a peek.
If that is true, then in case someone has only one core available it could run his whole cpu to 100% and cause a problem/lag. But this is only a speculation and only for this specific case.
If the user has multiple cores he would likely not notice any issues (other than maybe, high cpu usage).
That might be right... I am on an old quad, CPU load spikes on moving transforms and seem to spike even further if there are a couple of transforms but that does not seem to cause any visible delays to music, code execution or even loading a lot more transforms at the same time... this does suck for laptops that overheat easily but not a big deal otherwise.
Re: atl transform high cpu usage question
I haven't noticed any lag from this 50% cpu usage on my 2 core pc (but I believe some other people who I talked with run into a lag problem in a game when I used a continuous transform, I think this may be the reason)xela wrote: That might be right... I am on an old quad, CPU load spikes on moving transforms and seem to spike even further if there are a couple of transforms but that does not seem to cause any visible delays to music, code execution or even loading a lot more transforms at the same time... this does suck for laptops that overheat easily but not a big deal otherwise.
From what I see this looks like the transform always takes whole core regardless of the type, and the cpu usage stays the same regardless of the transform, if it uses exactly one core then it wouldn't lag on a multicore cpu (and doesn't for me)
but the cpu can go above 50% if other things run on top of the transform.
I think it could cause some problems with laptops and smartphones. In my case it's only a bit annoying, because when I run renpy while doing something else, it can keep my cpu above 50% and then my pc fans get all loud.
Re: atl transform high cpu usage question
Code: Select all
stage1=Stage([
"1111111111111111111111111111111111111",
"1111011000010001000000000000000000011",
"1000000000000000000000000000000000001",
"1110111100000000000000000000000000001",
"1000000000000000000000000000000000001",
"1000000000000000000000000000000000001",
"1000000000000000000000000000000000001",
"1000000000000000000000000000000000001",
"1000000000000001111111101111111100001",
"1000000000000000101010101000000000001",
"1000000000000000000000000000011111111",
"1000000000000000001111110000000000001",
"1111111111111111111111111111111111111",
],
enemy=goblin)
Also that might not be the best way to calc a minimap but it's the most used and convenient way to do so
- nyaatrap
- Crawling Chaos
- Posts: 1824
- Joined: Mon Feb 13, 2012 5:37 am
- Location: Kimashi Tower, Japan
- Contact:
Re: atl transform high cpu usage question
So issue I have might be:
loading png image for minimap
Images I showed on dungeon background (No animation, but multi layered with using Transform xzoom -1)
My GPU
Anyway, there must be an issue which delays my PC somewhere. I'm using core i3 btw.
loading png image for minimap
Images I showed on dungeon background (No animation, but multi layered with using Transform xzoom -1)
My GPU
Anyway, there must be an issue which delays my PC somewhere. I'm using core i3 btw.
Re: atl transform high cpu usage question
nyaatrap wrote:So issue I have might be:
loading png image for minimap
Images I showed on dungeon background (No animation, but multi layered with using Transform xzoom -1)
My GPU
Anyway, there must be an issue which delays my PC somewhere.
Here's something else I just remembered. In the past when I tried using a conditional branch in some Livecomposites I think it also resulted in this constant 50% cpu usage. It could be related.
(I ended up using variables directly in the filenames in a python livecomposite instead, it was a workaround)
Who is online
Users browsing this forum: Ahrefs [Bot]