Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Tips on optimizing parallel processes?

I'm using Mr. Mo's ABS and in order to minimize lag, I decided to create spawn points instead of having all of the enemies constantly on the map. The problem is that for each one, I need a parallel process with three nested conditional branches (if player's Y is... if player's X is between here and here....). With only three of these events, it causes noticeable lag. Any suggestions on how I can minimize event lag and check for player location?
 

Zeriab

Sponsor

Why do you have several of these events?

Anyway it does sound like these parallel processes are time critical so I would suggest adding a, say 8 frame wait in the button of each event.
Or to distribute the load I would add a 8 frame wait in the bottom of one event, a 7 frame wait in the bottom and a 1 frame wait in the top of the another event, a 6 frame wait in the bottom and a 2 frame wait in the top of the third event and so on.

The most important part is to have at least a 1 frame wait if you can get away with it, because it decreases the load by almost a factor 3.

*hugs*
- Zeriab
 
Zeriab":36eli1rc said:
Why do you have several of these events?

Anyway it does sound like these parallel processes are time critical so I would suggest adding a, say 8 frame wait in the button of each event.
Or to distribute the load I would add a 8 frame wait in the bottom of one event, a 7 frame wait in the bottom and a 1 frame wait in the top of the another event, a 6 frame wait in the bottom and a 2 frame wait in the top of the third event and so on.

The most important part is to have at least a 1 frame wait if you can get away with it, because it decreases the load by almost a factor 3.

*hugs*
- Zeriab
I have one for each spawn point. If there were spawn points A, B, and C, there's an event for each one that checks to see if the player is at a certain position and then spawns three events there. I tried what you suggested, but I'm still getting lag. It's not as bad, but it's still rather noticeable. Is this a necessary consequence of using a large map? I'd hate to have to break it up into several, but I suppose if it's necessary, I can do it.
 
Could you script this and use common common events? Also out of curiosity how are you getting the monsters to spawn? I'm also using Mr Mo's ABS system and I'd like add add something like a bee hive that ever x frames another bee would come out of it until you go and break the hive, at which point maybe a few more bees will come out, but I can't even get the stupid hive to spawn bees... But as for your problem you could use a wait command at the beginning of one or two of the events, then have it set a self switch couldn't you?

IE: Spawn point A
Wait 4 frames
self switch on
#new page
if self switch is on
spawn monster
wait 10 frames
spawn monster

and then do the same thing with the other events only stagger them, all though I'm not sure how you'd have it track the players location at the same time... Hope that helps :biggrin:
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top