Graal Forums  

Go Back   Graal Forums > Development Forums > Tech Support
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-31-2003, 04:22 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
cpuusage bug?

In the debugger there is a variable called cpuusage. It was never documented in newfeatures.txt but its basic function is pretty obvious from the name. Now, it's possible that the command is supposed to work how it does. If so then I have a future improvement, and if not then I have a bug to report

My interpretation was that it is meant to show what percentage of the cpu's max power is being used by the npc. With this in mind, I set out to test how Graal performs when rendering high numbers of polygons. I wanted to see if the size of the polygons had a large effect and if overlapping polygons were all still fully drawn. So, I created the level attached below.

When using it, you can press left/right to change the square sizes and up/down to change the counts. If you play around with it for a while and monitor cpuusage as you do so, you'll probably notice these factors:
  • The size of the polygons makes a difference but only a very small one.
  • The number of polygons makes a much bigger difference (but is this because of more iterations in the script or more images?)
  • It's very difficult to get the cpuusage above a loose maximum. For me this was somewhere around 32. My system was running at a crawl as I ramped up the poly number to 5000 but still Graal insisted it was using only 32%. To balance the test, I loaded up my 3D demo and put it to the highest setting. Immediately the cpuusage rocketed to 70+

Now, I may have drawn false conclusions, but it seems to me that the rendering times aren't included in the calculations for cpu usage. This would explain the results of the 3D test - the transformation/projection/lighting calculations in the 3D application are far more CPU-intensive than the simple drawing algorithm for the poly test, even though the latter draws more polygons.

If this is true then I would argue that it should include the rendering times too. Of all the NPCs that would push the cpu usage to dangerous heights, 90% of them are heavily graphical. Things like fireworks or minigames or suchlike. It's important for scripters of such things to know how much power they're burning so they can scale the number of images they use.

On a similar note, I propose that NPCs should be able to access their own cpuusage variable. That way they can dynamically scale their algorithms to match the situation. If somebody has a slow computer then the firework shouldn't create as many particles as if they have a superfast computer.
Attached Files
File Type: nw cpuusage test.nw (10.0 KB, 137 views)
__________________
Reply With Quote
  #2  
Old 01-31-2003, 10:30 PM
Falcor Falcor is offline
Darth Cucumber
Falcor's Avatar
Join Date: Mar 2001
Location: At School
Posts: 2,874
Falcor is on a distinguished road
Send a message via ICQ to Falcor Send a message via AIM to Falcor Send a message via MSN to Falcor Send a message via Yahoo to Falcor
Perhaps CPU usage is measured in time? Like how long it took to execute the code compleatly. So it took it 32 seconds or so. *shrugs*. I havnt experimented, so I really can't draw conclusions, but thats my take on bug. (I also noted that at one point I had CPU usage at 106.whatever, so I dont think its perecent, or maybe that is just part of the bug.)
__________________

subliminal message: 1+1=3
Reply With Quote
  #3  
Old 02-01-2003, 06:43 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by Falcor
Perhaps CPU usage is measured in time? Like how long it took to execute the code compleatly. So it took it 32 seconds or so. *shrugs*. I havnt experimented, so I really can't draw conclusions, but thats my take on bug. (I also noted that at one point I had CPU usage at 106.whatever, so I dont think its perecent, or maybe that is just part of the bug.)
Maybe you're right, but 32 seconds to do what? Clearly it isn't taking half a minute to render each frame. And it's still strange that rendering times don't seem to be taken into account.
__________________
Reply With Quote
  #4  
Old 02-01-2003, 09:03 AM
Soul-Blade Soul-Blade is offline
US Marine
Soul-Blade's Avatar
Join Date: Jul 2001
Location: Coeur d'Alene, ID
Posts: 945
Soul-Blade is an unknown quantity at this point
Send a message via AIM to Soul-Blade
Really weird...probably a bug.

Heh, just curious...but what made you want to create this experiment? . Seems like a waste of time (not to be taken offensively)
Reply With Quote
  #5  
Old 02-01-2003, 09:11 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Quote:
Originally posted by Soul-Blade
Really weird...probably a bug.

Heh, just curious...but what made you want to create this experiment? . Seems like a waste of time (not to be taken offensively)
before you ask why, ask yourself 'why not?'
Reply With Quote
  #6  
Old 02-01-2003, 09:14 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by Soul-Blade
Really weird...probably a bug.

Heh, just curious...but what made you want to create this experiment? . Seems like a waste of time (not to be taken offensively)
I was designing the rendering algorithm for my 3D engine. The implementation I choose is heavily dependent on the way Graal handles multiple polygons. For example, if it didn't clip polygons itself then that would be a good reason for me to do so in the code. Things like that. I need to evaluate whether my current method (never draws any invisible polygons ever in a million years but splits some polygons into multiple sections) will be faster than my other idea (draws invisible polygons but only ever once each).
__________________
Reply With Quote
  #7  
Old 02-01-2003, 10:31 AM
Soul-Blade Soul-Blade is offline
US Marine
Soul-Blade's Avatar
Join Date: Jul 2001
Location: Coeur d'Alene, ID
Posts: 945
Soul-Blade is an unknown quantity at this point
Send a message via AIM to Soul-Blade
Quote:
Originally posted by Kaimetsu


I was designing the rendering algorithm for my 3D engine. The implementation I choose is heavily dependent on the way Graal handles multiple polygons. For example, if it didn't clip polygons itself then that would be a good reason for me to do so in the code. Things like that. I need to evaluate whether my current method (never draws any invisible polygons ever in a million years but splits some polygons into multiple sections) will be faster than my other idea (draws invisible polygons but only ever once each).
Ah...so you decided to share your results with the rest/report a possible bug. Alrighty, makes enough sense...just curious about this, will you be releasing a screenshot of your 3d engine when you complete it nicely enough?
Reply With Quote
  #8  
Old 02-01-2003, 11:14 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by Soul-Blade
will you be releasing a screenshot of your 3d engine when you complete it nicely enough?
I'll be releasing the whole thing when it's sufficiently presentable.
__________________
Reply With Quote
  #9  
Old 02-01-2003, 11:46 AM
Soul-Blade Soul-Blade is offline
US Marine
Soul-Blade's Avatar
Join Date: Jul 2001
Location: Coeur d'Alene, ID
Posts: 945
Soul-Blade is an unknown quantity at this point
Send a message via AIM to Soul-Blade
Quote:
Originally posted by Kaimetsu


I'll be releasing the whole thing when it's sufficiently presentable.
Well, I guess you can do that...considering if anyone tried to use it without your permission, it would be clearly obvious.

All else, remember, never show your scripts on the forums
Reply With Quote
  #10  
Old 02-01-2003, 12:00 PM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by Soul-Blade
Well, I guess you can do that...considering if anyone tried to use it without your permission, it would be clearly obvious.
Right. The most they can do is use it for some kind of staff tryout, and any manager with intelligence would be able to see that the person is lying.

Quote:
All else, remember, never show your scripts on the forums
Nah, it's safe enough. What's the worst that can happen? I'd say the benefits outweigh the risks.
__________________
Reply With Quote
  #11  
Old 02-07-2003, 04:21 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
It is displaying the scripting cpu usage in %
I can add another variable for cpu usage while drawing the npc and its showimgs
Reply With Quote
  #12  
Old 02-07-2003, 05:24 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
Quote:
Originally posted by Stefan
It is displaying the scripting cpu usage in %
I can add another variable for cpu usage while drawing the npc and its showimgs
And it'd be great if the NPCs could access the variables too
__________________
Reply With Quote
  #13  
Old 02-09-2003, 09:28 PM
Selzar Selzar is offline
Banned
Join Date: Aug 2002
Location: San Fransisco
Posts: 826
Selzar is on a distinguished road
Send a message via AIM to Selzar Send a message via Yahoo to Selzar
All I got was the annoying, "Graal is running on low frames with Direct7 somehting something.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:49 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.