New account registration is temporarily disabled.

PARALLAX MAPPING ALGORITHMS

Posts

Pages: 1
Alright, I've been trying to create an algorithm that'll allow me to input a couple of values to get the map size and image size, and calculate where to properly place an image over a map so that it's always in the correct position. If in the wrong position, of course, it looks bad. Even a pixel off renders a horrible result.

My algorithm creation hasn't gone so well. It works in the one position I have my character set up in, but whenever he starts up or enters the map in a different place, it is completely ruined (wasted a half hour fiddling with this, only to have it fail). I'm not nearly as good at creating algorithms with such limited as I have now, so I require further assistance, as I've reached the limit on what I can do alone.

This is my failure of an algorithm:


Can anyone help a guy out?
Rave
Even newspapers have those nowadays.
290
Which maker do you use? If it is something between XP and Ace, wouldn't RGSS script work better?
Rave
Even newspapers have those nowadays.
290
Oh, okay. I guess you use RMUltimate2k9?

In any case, maybe you could write it as DynRPG plugin or if you can't program make someone do it for you? Those things are easier to do in "normal" programming language, than events. I'm not saying it isn't possible with events, because it is as events are Turing-complete, but it's just easier to do it in classic programming language.
I think you're almost there. When I got stuck like this, I would take one of the values and change it dramatically to see what would happen. For example, change the "*4" operation to TEMP to, say, *8. It sounds like TEMP should be variable itself, not always *4.

By doing this kind of trial and error, you might not stumble upon the right answer, but you might stumble into the flash of intuition that leads you there.
How does the event start? AutoStart?
author=Rave
Oh, okay. I guess you use RMUltimate2k9?
In any case, maybe you could write it as DynRPG plugin or if you can't program make someone do it for you? Those things are easier to do in "normal" programming language, than events. I'm not saying it isn't possible with events, because it is as events are Turing-complete, but it's just easier to do it in classic programming language.


I would but I'm having far too much trouble than I should trying to install the C++ compilers.

author=Zachary_Braun
I think you're almost there. When I got stuck like this, I would take one of the values and change it dramatically to see what would happen. For example, change the "*4" operation to TEMP to, say, *8. It sounds like TEMP should be variable itself, not always *4.

By doing this kind of trial and error, you might not stumble upon the right answer, but you might stumble into the flash of intuition that leads you there.


Sadly, I always run into the same issue. It works fine in certain positions, but in others it's off and looks bad. I tried centering it when the player's x and y where 0,0, and then adding onto that when he starts in different places, but that got me nowhere.

author=Large
How does the event start? AutoStart?


Yes, AutoStart. But I don't think that matters since it doesn't largely affect the effect I'm attempting to produce.
For pictures I always make an event, save the coord x-y from the same event and show the picture, and move the event close to the correct position, and if its are 2px more or less of x or y I add it manually
KingArthur
( ̄▽ ̄)ノ De-facto operator of the unofficial RMN IRC channel.
1217
Wouldn't this be solved by creating one huge overlay the size of the map (MapWidth*16, MapHeight*16), arranging all the shadows or whatever it is you're overlaying on that huge overlay, and then rendering the overlay over the map?
author=gadesx
For pictures I always make an event, save the coord x-y from the same event and show the picture, and move the event close to the correct position, and if its are 2px more or less of x or y I add it manually
... Wow, how didn't I think of that? It seems like a great idea.
EDIT: It worked great.

author=KingArthur
Wouldn't this be solved by creating one huge overlay the size of the map (MapWidth*16, MapHeight*16), arranging all the shadows or whatever it is you're overlaying on that huge overlay, and then rendering the overlay over the map?
Probably because it IS one big overlay the size of the map.
dragonheartman
Developer, Starless Umbra / Heroes of Umbra
2966
The problem, as I understand it, is that you want to display a picture that's the same size of the map as an overlay in the center of the map. Getting the coordinates to display the picture is tricky, depending on where you enter the map.

What I do is create a parallel-process event in the center of the map, assign variables to its own PicX and PicY coordinates, then display the picture there. (Note, depending on whether there's an odd/even number of tiles for the width/height, you may need to add or subtract 8 pixels.) Lastly the event should erase itself. :)
Pages: 1