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.

Universal Message Window - Name Window lag?

[RMXP]

Hi hi. ^^

My question is about ccoa's Universal Message System.

The script experiences heavy lag when the name window is being used with a long name, and the window is centered over an event. E.g.:

\e[5]\nm[Fairy Godmotherrrrrr]
Hello?

That will lag a LOT. Like, go from framerate 30 to 8. Because the name window can't be longer than, say, 6 letters, without lagging.

Anyone who knows about this, I'd appreciate it some help. ^^ Thanks so much!!
 
I experienced this problem, but not due to the name box, due to the event placement. Whenever I used \e[n] it dropped the framerate by 80%. I didn't come up with any fix for the problem, but just noting that I never had a problem with the name window. Did you try the same name without the \e[n] command?
 
^

Yea, without \e[n] it works fine. But with \e[n] and not the namebox, it works fine too. So the problem really lies with the placement of the namebox, I guess. Any clues on where I should look? Because I can't think of any reason whatsoever why the namebox would lag with its \e[n] placement, and not the main window.. Maybe I can get rid of an update or something. S_S
 
Twin Matrix":3fuj2nn3 said:
^

Yea, without \e[n] it works fine. But with \e[n] and not the namebox, it works fine too. So the problem really lies with the placement of the namebox, I guess. Any clues on where I should look? Because I can't think of any reason whatsoever why the namebox would lag with its \e[n] placement, and not the main window.. Maybe I can get rid of an update or something. S_S
o_O It lagged for me even without the namebox ans \e[n] for some weird reason.

Anyhow, I'm not sure if this is the cause, but if the event value is higher than -1 (over player or events on map) it refreshes the name constantly. What you would want to do is to replace this:
Code:
# name window
      if $game_system.name != ""
        @name_window.set_name($game_system.name)
        @name_window.x = self.x
        @name_window.y = self.y - 36
      end
with this:
Code:
# name window
      if $game_system.name != @name
        @name_window.set_name($game_system.name)
        @name_window.x = self.x
        @name_window.y = self.y - 36
        @name = $game_system.name
      end
This should prevent constant refreshing of the name window.

The code is under the 'reset_window()' method.

Hope this helps.
 
^

Ooh, I think that fixed it. O_O But how would that work if the message window moves with the screen? Would the name window stop and stay there, but the message window it self move along?

[Edit:] Yup it fixed it!! : D But now the name window stays still when I scroll the map, hmm.

Off-topic question, then: is it possible to do a "wait" command for scrolling the map, like with move event movement? Or is that "wait for all movement" also working for "scroll map'? ^^
 
Twin Matrix":2mmdxwhe said:
Off-topic question, then: is it possible to do a "wait" command for scrolling the map, like with move event movement? Or is that "wait for all movement" also working for "scroll map'? ^^
Off topic answer: Yes, there is.  Immediately after the Scroll Map command, put in another Scroll Map command that doesn't actually contain any movement in the same direction.
 
^

Awesome, thanks.^^

Okay I just tested the name window and it doesn't move along with the screen, but that's fine.

What IS a problem, however, is that if the same character says two or more messages in a row, the name window stays at the location of the first message window, even if the ones after that have different sizes. Also, if a character says something, moves, and then says something again, then the name window is still at the old location.

Any fix on updating the x and y? ^^

Thanks!!
 
I guess this simple fix should do it:
Code:
      if $game_system.name != "" or self.x != @old_x or self.y != @old_y
        @name_window.set_name($game_system.name)
        @name_window.x = self.x
        @name_window.y = self.y - 36
        @old_x = self.x
        @old_y = self.y
      end
If this causes problems with the name window at any later messages at the same location, you might want to nullify the @old_x and @old_y (perhaps @name as well) for every new message pop. Add:
Code:
@name = @old_x = @old_y = nil
After the snippet:
Code:
    self.contents.clear
    self.contents.font.color = normal_color
    @x = @y = 0

Hope this works.
 
@name = @old_x = @old_y = nil
works very nice. The other one makes it lag again, I dunno. Maybe something wrong with the way @old_x is called. Anyways, it works great and it removed the lag.

Thank you so much! =D
 
Wait a minute. You have what problem with the choice window? Does it lag when you place it over an event?
I don't see why it does. I didn't test it to check if I had the same problem, but by looking at the code, it should refresh just as much when it's not placed on an event.

Can you explain a bit better? If I understood correctly, then I'm afraid you're going to have to ask someone else. My head just got shrouded in confusion ><
 
Well, when I use the choice window, it starts to lag immensely. I'm not sure if this is without the event window, though. But if you say that it refreshes the same as when not being placed over an event, then I suppose it lags the same without it being so.

But it's pretty much the same as with the name window, right? Because that one refreshes as much as when being over an event, too?

Basically what I'm trying to fix is that it refreshes all the time. I don't move the screen while there is a message open, as I had to stop the refreshing of the name window to stop the lag from that. So the choice window can stop the refreshing as well. Basically what you did before with the name window, except now with the choice window. ^^

Is that possible?
 
Yes, but it just wouldn't make sense, because mine doesn't lag when it's not over an event, and it's the same process, so I just don't know where to start off. Anyway, if you want to try, just change this:
Code:
@choice_window.set_choices($game_temp.choices)

INTO

unless @choice_set_once
  @choice_window.set_choices($game_temp.choices)
  @choice_set_once = true
end
Now add:
Code:
@choice_set_once = false
right below the:
Code:
@name = @old_x = @old_y = nil
Not sure if it helps in any way, but it should prevent the choices fro resetting constantly.
Now add
 

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