Event processing range

Status
Not open for further replies.

Kurisu

game dev, pilot, cat lover
Veteran
Joined
Aug 14, 2013
Messages
77
Reaction score
18
First Language
non-english
Primarily Uses
Hello,

I have a map with two events purely for decoration (player doesn't get to interact with them). They have a very specific custom move route (loop). The problem is, player needs to get within a certain range for them to trigger and start moving. How could I keep those events active all the time no matter what the distance from player is?

I could use parallel processing I guess, but I'd like to avoid that so if there is another way to do it, please give me some advice :)

I do not use any anti-lag scripts (yet).
 
Last edited by a moderator:

EtphTheElephant

Advanced Elephant
Veteran
Joined
Oct 18, 2013
Messages
516
Reaction score
34
First Language
English
Primarily Uses
I suppose parallel process is the only way to go. I can't think of any other way at the moment.
 

Alexander Amnell

Jaded Optimist
Veteran
Joined
Mar 17, 2012
Messages
3,404
Reaction score
1,733
First Language
English
Primarily Uses
N/A
What's your problem with using parallel processes? I mean they can be finicky at first but they are the only way to do a lot of cool stuff in your games. I generally have between 5-12 parallel processes running at any given time in my game... so many custom systems and it still handles fine.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Parallel processes are powerful, but a lot of people use them just because they don't want to have to think about how to accomplish the same thing WITHOUT constantly checking whether the conditions are met or not. Some things can only be done with something like a parallel process, but there are plenty of things that could, but don't.


If something can be done without using a parallel process, that would always be more desirable than having your event constantly running in the background running the same checks forever.
 
Last edited by a moderator:

Kurisu

game dev, pilot, cat lover
Veteran
Joined
Aug 14, 2013
Messages
77
Reaction score
18
First Language
non-english
Primarily Uses
I see. I guess I will just use a parallel process then :)

Alexander: I agree with Tsukihime. I tend to avoid parallel processes until it's really necessary. I used to work with one of the older makers where a fair amount of parallel processes running at the same time caused your game to lag badly. I do not want to use up precious resources for decoration :D
 

Liak

Veteran
Veteran
Joined
Mar 13, 2012
Messages
1,788
Reaction score
270
First Language
German
Primarily Uses
# Put [update] in the event's name and the move route will always update.## ~Kreadclass Game_Event < Game_Character  #--------------------------------------------------------------------------  # * Determine if Near Visible Area of Screen  #--------------------------------------------------------------------------  alias_method:)krx_alfix_ge_nts?, :near_the_screen?)  def near_the_screen?(dx = 12, dy = 8)    # YEA compatibility    if $imported && $imported["YEA-CoreEngine"]      dx = dy = nil    end # YEA compatibility    return true if @event.name.include?('[update]')    return krx_alfix_ge_nts?(dx, dy)  endend
Does this help? :)
 

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
^ Isn't that the exact same result since it still has to check for the event (and process it) every frame?
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
^ Isn't that the exact same result since it still has to check for the event (and process it) every frame?
By default, all events are checked at every update regardless whether they have a parallel process trigger or not. The difference is that the event commands themselves are not executed. When people say "parallel process" they explicitly refer to the event interpreter running in the background.


Autonomous movement does not occur if an event is outside of the screen, and a parallel process movement would actually solve the problem, but may not be desirable (isn't the whole point of autonomous movement supposed to be just that?)
 
Last edited by a moderator:

Kurisu

game dev, pilot, cat lover
Veteran
Joined
Aug 14, 2013
Messages
77
Reaction score
18
First Language
non-english
Primarily Uses
It does indeed work so I might use it instead of parallel process, Liak. Thank you :)

What are the terms of use?
 

Alexander Amnell

Jaded Optimist
Veteran
Joined
Mar 17, 2012
Messages
3,404
Reaction score
1,733
First Language
English
Primarily Uses
N/A
I see. I guess I will just use a parallel process then :)

Alexander: I agree with Tsukihime. I tend to avoid parallel processes until it's really necessary. I used to work with one of the older makers where a fair amount of parallel processes running at the same time caused your game to lag badly. I do not want to use up precious resources for decoration :D
I wasn't really saying use them for everything, I agree with Tsukihime as well, but in this case it seemed a parallel process would be the way to go, as I wasn't aware of Kred's script at the time I posted it.
 

Kurisu

game dev, pilot, cat lover
Veteran
Joined
Aug 14, 2013
Messages
77
Reaction score
18
First Language
non-english
Primarily Uses
It is ok, Alexander. I actually did use a parallel process before Liak posted a script. Both solutions work perfectly so I guess my problem is now solved :)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Parallel processes are not quite as bad if you remember to add a wait for a few frames with each iteration.


If you were still searching for a solution, I'd ask you more about the actual move route on your event. But since you've got it working in a way you're happy with now, I'll go ahead and close this.


This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
 
Status
Not open for further replies.

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