BIG MAPS and Anti-Lag
#1
Okay, I tested this script in my game and tried to connect the 25 120x120 maps of my first area to one big map.
The result is kinda odd: The game begins to lag but only when I move vertically. Moving right or left doesn't create any lag.
And the lag seems to be caused by events (especially moving events) so maybe my anti lag script has issues with the Bigmap script. 25 500x500 maps without any event was no problem. x.x
Reply }
#2
Hm. I guess that depends on the Anti-Lag script.... and how many events you have running. Well, I haven't tested it with all anti-Lag, nor tested event capacity.

You went to a full 2500x2500 tile map? Schweet!

But I have to say that I've never encountered the issue you're having with vertical movement. There should be no difference with movement at all as the system literally crafts a new virtual map and doesn't actually alter the movement system other than teleporting. Character speed and movement is typically governed by the Game_Character class, and I touched neither Game_Character, Game_Player nor their related sprites and spriteset systems.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#3
I'm using the one from Near Fantastica. I'm not sure if it works together with the new big map so maybe all events are being updated all the time.
There are around 300 events on one map so there should be ~7500 in total. Some of them are moving plus updating dynamic sound effects and light effects. But usually the anti lag script only updates the stuff in range of the player so my guess is it's not working properly. A normal 500x500 map with 999 moving events is no problem at all.
If I include only 10 or 15 of the maps it runs smooth without any lag and even 25 or even more empty maps don't cause any lag. So it's definetely an event issue.

The vertical movement thing is weird. While moving horizontal the game runs in 60 fps. When moving vertical it drops down to 19-20.^^

This is the script, if you are interested.

Content Hidden
Reply }
#4
As it is more akin to getting two scripts to work together, code support seemed more fitting. Winking

Yeah, Jaime's work is excellent for a jumping off point. Some of it still has valid uses, and way less complicated. This being very much different to over-complicated works that do the job super well... but only a freakin' NASA Technicians can figure it out. Tongue sticking out

There are a number of anti-lag systems. And if I were to have around 1000 events, sure. Granted, you are limited to 999 events per map anyway, and they never thought anyone would go beyond. Oh, you edited it... and made it extend out to grab MORE events in a shot. It didn't restrict but went the other way.

Now I coulda brought up Amaranth's... or Lambchop's when she was at RMXP.Org (now HBGames)> Wow, I'm going back a decade there. And I still have her on facebook. But, her system does not really go beyond 1000 events either.

So enter Zeriab's. Yep, the Huggin' King's Anti-Lag system did MUCH better than the others. Compared to the others, it is massive, hitting Game_Map... Character... Player... and more. But it did much much better. Oh, and what I said about NASA Technicians????

What was my test? It was a 9x9 grid of 500x500 tile maps. Of those, five have 998 chicken events all walking around. That's a lot of chickens. Well, they all had 998 events, but lag hit. Each re-test, I deleted a map and recreated one without events. First all 9 with 998.... on down.

With Zeriab's Anti-Lag, I suffer no lag with 5 maps of 998. And with 6 maps of 998, I suffer only 20% lag. So I think 5000 events is the magic number. And 6000 is pushing it. Just remember that Big Maps is making one array of ALL of the events of all your maps. It's not sorting through one batch of 999 and another of 999. It is sorting through them ALL in one shot every so often.

And here's Zeriab's script. Definitely have it before Big Maps:
Are you a NASA Technician?
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#5
Okay I did some testing and it's insane. Together with the HiddenChest Engine I can run 37000 events with Zeriabs anti lag system. So I had 7x5 maps with 999 events plus 2 more full and 3 empty maps in the bigmap.
And even beyond 37000 the lag isn't that much but makes playing too annoying for my taste. And it can crash if too many stuff is on the screen so I think keeping it below 35000~37000 might be a good idea.
With the Near Fantastica script it ended at around 5000 events.

I had to comment out the following lines because they throw this error in HiddenChest

[Image: pSkXaNd.png]

(693-705)
Code:
#  Checks if the event is never to be updated. (For decoration)
    for pattern in NEVER_UPDATE_NAME_PATTERNS
      if (pattern.is_a?(String) && name.include?(pattern)) ||
        !(pattern =~ name).nil?
        self.never_update = true
      end
    end
  #   Checks if the event is to be always updated.
    for pattern in ALWAYS_UPDATE_NAME_PATTERNS
      if (pattern.is_a?(String) && name.include?(pattern)) ||
        !(pattern =~ name).nil?
        self.always_update = true
      end
    end

Now I only need to make Zeriabs script compatible with my game. There are some nasty errors so far but I will try to fix them now.
Reply }
#6
Something people usually forget is that operators in Ruby are a bit weird.

and follows the logical order, i.e. if check1 and check2

&& does it in the reverse order, e.g. if check2 && check1

There operator precedence DOES matter! && has a higher precedence than and.

So print name and pattern to verify which one isn't a string and when one of them is a regular expression or Regexp instead. Why? That's because the scripter forgot that passing a single string, whether it's the first or second parameter, to a match operator will always throw a TypeError in Ruby. That should NOT happen at all. This happens when you include strings and regular expressions. Laughing In my humble opinion he should have picked just one of them to reduce the number of tests needed to run the method.

Solution? I guess it could be something like...

Code:
if (pattern.is_a?(String) and name.include?(pattern)) ||
        (pattern.is_a?(Regexp) and !(pattern =~ name).nil?)

I don't think name should ever be a Regexp. Not even a mad scientist like Mad Scientist would ever dare to make it a regular expression.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply }
#7
That block of code is what allows you to add the codes [N] and [A] which lets you make events 'Never' update and 'Always' update. That should be quite simple. Odd.
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }
#8
Thank you for that fix. Now it also works with HiddenChest. The newer ruby version seems to be more sensitive. It worked with the normal RMXP exe before.
I was also able to fix most of the incompatibilities. Now I only need to figure out how to make it work with the higher resolution fix.

Edit: Fixed ^^

Now my first area is one big map and it's fantastic. It feels so much better to fly around when everything is seamless. Thank you very for your help :)
Reply }
#9
Just a little heads up. The "SPECIAL_UPDATE_IDS" feature that Zeriab added seems a bit... iffy to me. Doesn't really work so well. BUT hey, tell me I'm wrong here. But make an event and erase its name. It acts as if it is a 'Never Update' event too, right?
Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)

[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png]    [Image: liM4ikn.png]    [Image: fdzKgZA.png]    [Image: sj0H81z.png]
[Image: QL7oRau.png]    [Image: uSqjY09.png]    [Image: GAA3qE9.png]    [Image: 2Hmnx1G.png]    [Image: BwtNdKw.png%5B]
  Above are clickable links
Reply }


Possibly Related Threads…
Thread Author Replies Views Last Post
   Making Forest Maps with the Random Map Generator ShadowIce 16 22,353 02-02-2014, 08:18 PM
Last Post: ShadowIce
   XP maps saved in RB files kyonides 1 6,111 05-02-2010, 04:43 AM
Last Post: vgvgf
   Help Making Random Maps ShadowIce 0 3,301 02-02-2010, 03:28 PM
Last Post: ShadowIce
   Using animations in a scene (unrelated to battles and maps) PK8 4 9,120 11-17-2009, 10:54 AM
Last Post: PK8



Users browsing this thread: 1 Guest(s)