Parallax maps vs lag/game crash

Status
Not open for further replies.

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
I believe there was a trick for animated pictures in the old rm2k makers. Or also used in Self Build Menus.
Iam not sure if this would help with very huge Animated Pictures for huge maps.

They did not Erase and draw the pictures new everytime the animation changed.
They used the Move Picture Command and just made it total transparent and non transparent when needed.
The standard maker can do this with normal pictures,but for parallaxes you would need a plugin or another plugin to use pictures on different z-layer as parallax.
I mean if you got 3 very huge Pictures, 1 shown than 2frames wait than the next one shown and so on...
Maybe this old thingy helps, or it was just old chatter that we can forget? maybe someone knows.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,124
Reaction score
10,633
First Language
Czech
Primarily Uses
RMMV
Actually, @Andar's calculations are not accurate. Even if they were however, it is nothing to be scared of.

First of all, MV doesn't use 256 color png. It uses RGBA png. Which means it's not 3 bytes per pixel (RGB), but 4 bytes per pixel (RGBA). Also, I don't know where the 8 pixels base come from.

Anyway... I can definitely agree that drawing tiles is more conservative than parallax in terms of RAM. But truth is, it's not just 3 bytes of RAM per tile. If it was, than MV's consumption of RAM would not be so high.
The thing is, the computer spends RAM in order to make and store textures for each tile. Which completely changes the story, because suddenly it means that in order to create a tile you need data from between
48x48x4 (tile width x tile height x colors per pixel - 4, because RGBA)
48x48x4x3 (tile width x tile height x colors per pixel x layers)
bytes worth of data, depending on how many layers the current tile contains.
AND I'm not counting in all the tilesets you have to load and hold in the memory. Which, given that MV's tileset size is 768x576 and a tileset can have 1-9 layers (A1-5, B, C, D, E) can be anywhere between 768x576x4 and 768x576x4x9 (which is up to 15 MB).

The only advantage of tile rendering compared to parallax mapping is, there's only a certain threshold of RAM your map can consume, because you're only holding tilesets and pixels on screen (along with a couple, I think it's 6, adjacent tiles off screen in each direction) in RAM, which would be the same regardless if the map is 30x30 or 100x100, while if you have a 50x50 parallaxed map, you need to load 50x48x50x48x4 bytes (or 31 MB) of images per layer. Which you need to evaluate by yourself if the RAM sacrifice is worth the free CPU power or not.
 

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
741
Reaction score
2,404
First Language
English
Primarily Uses
RMMV
Thank you regardless for these information. This is making me more careful with parallax maps. It's kind of sad because parallax are more flexible than editor, but oh well.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,124
Reaction score
10,633
First Language
Czech
Primarily Uses
RMMV
Well, right now I just got an idea for a perfect plugin that would rectify this issue. It's also much simpler than my parallax mapping engine!
 

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
741
Reaction score
2,404
First Language
English
Primarily Uses
RMMV
.................................................................................................................... Can I have it?
 

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,077
Reaction score
2,654
First Language
Greek
Primarily Uses
RMMZ
@Elliot404 I suggest you one thing, if it is possible. Why not create parallaxed maps 17x13. No parallax lock needed (it is exactly one camera screen) and it will help you make decent maps fast, because you deal with small spaces. The trade is many many many teleports, but it can work great on some games, limiting yourself to a 17x13 grid and 816x624 pictures for above and bottom parallaxing.
And you can trust what @Andar says, he knows what he is talking about, so since my suggestion is way smaller than 20x20 it might be optimal for you.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,952
Reaction score
7,464
First Language
German
Primarily Uses
RMMV
hich, given that MV's tileset size is 768x576 and a tileset can have 1-9 layers (A1-5, B, C, D, E)
wrong - the tilesheets are NOT different layers. A1 to A5 combine into the bottom layer tileset, and B to E combine into the upper layer tileset from which there are two in MV, for a total of 3 layers on the map.
First of all, MV doesn't use 256 color png. It uses RGBA png. Which means it's not 3 bytes per pixel (RGB), but 4 bytes per pixel (RGBA). Also, I don't know where the 8 pixels base come from.
you misread several things here - I was talking about 24-bit-color(or 3 bytes per color), NOT 256 colors, and of the 24 bits there are 8 bits per color (each red, green, blue). You're correct that I forgot the transparency channel however, that makes it 4 bytes per pixel instead of 3 for the parallax pictures.
tileset can have 1-9 layers (A1-5, B, C, D, E) can be anywhere between 768x576x4 and 768x576x4x9
A tileset has no layers at all. You completely messed up here. The tileset storage is the overhead I think I mentioned, but because that is every tilesheet (several of which are smaller) together only once, it is still a lot smaller than most parallax maps - especially if the tilesets are not using every tilesheetslot.
Also don't forget that the tiles do not vanish just because I ignored them for calculating the RAM requirement. The Parallax maps still have the entire tilemap storage in addition to the parallax picture itself (even if they use an empty tileset), it's just a lot less than the rest of the picture. And if people use A1 for animations in addition to making parallax maps (as the OP here does), then they still have to add the tilesheet RAM in addition to parallax RAM.

As I said the calculation I made uses some shortcuts simply because I didn't want to go into extreme detailed calculations. And you've also shown why, because that extreme calculation has a lot of specific problem cases that are only applicable part of the time.
As for the tileset itself, even a complete tileset is less RAM than a single layer 50x50 parallax map.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,124
Reaction score
10,633
First Language
Czech
Primarily Uses
RMMV
wrong - the tilesheets are NOT different layers. A1 to A5 combine into the bottom layer tileset, and B to E combine into the upper layer tileset from which there are two in MV, for a total of 3 layers on the map.
Sorry. I had only three hours of sleep after a night shift, so I mistyped. I meant to say files, not layers.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,573
Reaction score
6,498
First Language
Indonesian
Primarily Uses
RMVXA
wrong - the tilesheets are NOT different layers. A1 to A5 combine into the bottom layer tileset, and B to E combine into the upper layer tileset from which there are two in MV, for a total of 3 layers on the map.
Are you sure it is not actually 5 layers?
1. Bottom layers for A1 ~ A5
2. Middle layer for grass/fence/table, in A2
3. Upper layer for B ~ E
4. Stacked layer for B ~ E because you can stack two tile B ~ E
5. Shadow layer (Yes, this does exist and has its own layer).
This is based on VXA, but since there's a lot of straightforward conversion of the code, I'm expecting the base code is also the same.
 

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
741
Reaction score
2,404
First Language
English
Primarily Uses
RMMV
@Dreadshadow
I think I can handle my issue for now. I thought I could use a low parallax as a base/floor tiles, while the rest of the layers would be done by editor, and/or yanfly's doodads.
 

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
741
Reaction score
2,404
First Language
English
Primarily Uses
RMMV
Okay, I still couldn't find a problem of lagging (I don't know how-sorry-), but, I've managed to reduce the lagging by setting a wait command for 10 frames when loading the parallax tilemap.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Please show that Event , tripple please =).
I guess the Command, its executed way to often when condition is true. That would explain why the 10Frames Wait helped.
If thats the case we can solve that easily.
 

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
741
Reaction score
2,404
First Language
English
Primarily Uses
RMMV
Here you go:
Untitled.png
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Oh that looks easy on the first glimpse, i assume you want this Event to happen only once everytime the Player enters the Map?
Remove the Wait 10Frames and add, after the Pink Command Line (Change Parallax Blue Sky), the Eventcommand: Erase Event.
The Event will be gone until the Map is reentered.
 
Last edited:

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
741
Reaction score
2,404
First Language
English
Primarily Uses
RMMV
OMG! All the stress I've put myself through when I could just solve the problem by using erase event command! :kaodes:
Thank you very much! And I'm terribly sorry for all the unnecessary troubles!
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
The cause of your Problem wasn't Clear in the beginning, there were several possibilities.
But gladly this could be solved very easy thistime.
Dont worry its a common starter mistake, and i did not know it either when i started.
 

Elliott404

Game404
Veteran
Joined
Jul 4, 2018
Messages
741
Reaction score
2,404
First Language
English
Primarily Uses
RMMV
I forgot that it even existed after constant use in experimenting period--
 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

I think in the pursuit of making the game look and sound custom, we never really start making a game. Finish the game first using all necessary plugins (with placeholder assets), then replace it with the real ones.

I haven't finished a game, but I try this method. Progress seems to be faster. :D
Every now and then I think about all the things I need in my project, and get overwhelmed. Just focus on your tilesets, me. You can't build your maps without 'em!
If a picture speaks 1000 words, how many pictures does a video speak??
I don't really get the "Pass Interference" Flag in (American) Football. Aren't you SUPPOSED to interfere with passes in Defense?? What exactly is the threshold that warrants a Flag?
TS Zeta.. blow your ass east... I cant take a round 3.

Forum statistics

Threads
104,433
Messages
1,006,322
Members
135,956
Latest member
Geffron
Top