Good Anti-Lag for parellel processes?

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Ok intersting you 2.

I thought the Interpreter irretates through all the Events Every Frame in any case?

If that is true an extra update while switch change would be strange, because it would be checked in the next frame anyways!(?).
While that would be ideal, the engine doesn't know about that.

The logic is simple

1. Change Switch Value2. Tell engine that things need to be refreshedIt doesn't know anything about whether it's going to be called again in the near-future.As far as the engine is concerned, if a switch has changed, it wants to know that ASAP so it can update things accordingly so things are consistent for the player.
 
Last edited by a moderator:

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
So if i change one switch value in 1Frame i have less updates

than when i Change 100?

Because if just one need to be changed to cause the update function to run before the next Frame, it would not matter if 1 or 100 Values are Changed, it would iterate through all anyways(?)

But

If every change switch command would call the update methode the moment it is running, than i understand you. (Is it this Case?)
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
So if i change one switch value in 1Frame i have less updates

than when i Change 100?

Because if just one need to be changed to cause the update function to run before the next Frame, it would not matter if 1 or 100 Values are Changed, it would iterate through all anyways(?)

But

If every change switch command would call the update methode the moment it is running, than i understand you. (Is it this Case?)
Simple test:

Code:
# Switch 1 is currently OFFChange Switch 1 = ONif Switch 1 is ON  # do somethingelse  Switch 1 is not ONend
 
Last edited by a moderator:

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Dont play Games with me, you quoted my question, so please answer it if you want to help someone who wants to understand :)
 

♥SOURCE♥

Too sexy for your party.
Veteran
Joined
Mar 14, 2012
Messages
693
Reaction score
411
Primarily Uses
So if i change one switch value in 1Frame i have less updates

than when i Change 100?

Because if just one need to be changed to cause the update function to run before the next Frame, it would not matter if 1 or 100 Values are Changed, it would iterate through all anyways(?)

But

If every change switch command would call the update methode the moment it is running, than i understand you. (Is it this Case?)
Hello. You are correct in the first example, it doesn't matter if you change 1 or 100. When you change the state of a switch or a variable, the "need refresh" flag from $game_map is set to true. That flag is used in the update method from Game_Map to know if events must be refreshed before updating them:

def update(main = false) refresh if @need_refresh update_interpreter if main update_scroll update_events update_vehicles update_parallax @screen.update endThen, the flag is set to false in the refresh method:

def refresh @events.each_value {|event| event.refresh } @common_events.each {|event| event.refresh } refresh_tile_events @need_refresh = false endThat ensures that the method will only be called one time when needed, until a change of state for any switch or variable makes it necessary to call it again.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Thanks for the answer. I will get back to Codecademy starter workshop again, after that i hope they teach such stuff there too.
 

Seriel

Veteran
Veteran
Joined
Aug 16, 2014
Messages
3,013
Reaction score
504
First Language
English
Primarily Uses
Other
Also if you want to test performance issues, get a low end PC with crappy specs. That way you will see every little performance issue easily. On a high specs PC you might not see every issue.

I know, I have a crappy laptop, after all. :D
Soooo...... the one i'm using now? :)

 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top