Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: Multiple moving entities slowing down a scene  (Read 4595 times)

0 Members and 1 Guest are viewing this topic.

DocBass

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 136
    • View Profile
Multiple moving entities slowing down a scene
« on: June 28, 2008, 09:29:25 AM »

Greetings all-

I'm needing to create a scene that would have a random number of moving entities, let's say ideally anywhere between 5 and 50. However going above 15, even on a really beefy system is a problem. The reason is apparently the entity.GoTo function (so you probably know what kind of entities I'm loading here). If I use large numbers however this really slows things down until they get moving. So it will drop down to 30 FPS or so, while the game runs very slowly, then once all the entities are moving it picks up speed again and everything runs fine. However mouse clicks are still "slowly" recognized, even if things run ok. It's almost as if I can see them going through a loop as they start moving one by one, even though I've tried the regular GoTo function and the GoToAsync version. Is there any way around this? The code I am running is really not complex at all, so I am wondering if there is anything I can do to speed up these operations, even though I know these calls are built in. It seems like such a simple thing, I am surprised it would slow down the game in this manner. Any suggestions? Thanks!
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Multiple moving entities slowing down a scene
« Reply #1 on: June 28, 2008, 09:55:33 AM »

Your scene probably contains a lot of waypoints and blocked regions. You can try simplifying it.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

DocBass

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 136
    • View Profile
Re: Multiple moving entities slowing down a scene
« Reply #2 on: June 28, 2008, 10:12:37 AM »

Your scene probably contains a lot of waypoints and blocked regions. You can try simplifying it.

Ok. I'll take a look at that. Also I've noticed that even on simple scenes the executable is nearly maxing out one of the cores on my Core2Duo (it shows the executable taking around 46-48% of the cpu) at all times. Things seem to run just great, I get over 1000 fps in windowed mode etc. However that seems strange that there would be that little headroom when I'm running simple scripts most of the time. Is this normal for the engine? I suppose I never paid that close attention to the task manager because I always just watched the FPS and how the game performed basically.

Edit: You were right...when I removed the blocked regions and waypoints everything runs smooth as silk. But that poses some other problems now...anyway that part is explained. Still wondering about the cpu usage issue however. Thanks again Mnemonic!

Another small side question. Is there a way to retrieve random points from within a region?
« Last Edit: June 28, 2008, 11:38:34 AM by DocBass »
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Multiple moving entities slowing down a scene
« Reply #3 on: June 28, 2008, 01:43:17 PM »

Well some operations are more CPU demanding than others, namely theora videos and particles. However, I tested several WME games and on my Core2 Duo/Vista the task manager shows 30% CPU load at most, usually less.

Another small side question. Is there a way to retrieve random points from within a region?
I'm not sure what you mean...
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

DocBass

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 136
    • View Profile
Re: Multiple moving entities slowing down a scene
« Reply #4 on: June 28, 2008, 08:46:12 PM »

Well some operations are more CPU demanding than others, namely theora videos and particles. However, I tested several WME games and on my Core2 Duo/Vista the task manager shows 30% CPU load at most, usually less.

Another small side question. Is there a way to retrieve random points from within a region?
I'm not sure what you mean...

For example, say you have a layout region in the scene named "ground". Is there a way to retrieve a location that lies within this region but do so on a random basis? I don't think it's built in, that's all I'm wondering...
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Multiple moving entities slowing down a scene
« Reply #5 on: June 30, 2008, 07:47:25 AM »

No, there's no such functionality built-in.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.033 seconds with 24 queries.