[XP] XP Ace Tilemap

Started by KK20, November 02, 2014, 05:53:24 am

Previous topic - Next topic

Blizzard

March 05, 2016, 05:46:00 pm #100 Last Edit: March 05, 2016, 05:49:39 pm by Blizzard
Here's a screenshot. Look at the bottom.

Spoiler: ShowHide


I meant that adding a additional sprites with a high z-order at the edges would solve this problem.

EDIT: Here's one at the top.

Spoiler: ShowHide


BTW, I have a customized shaking script which shakes the map vertically as well. You will probably see the manifestation of this only at the left and right edges with the default scripts.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

KK20

Oh that explains it. I only addressed the horizontal shaking, not vertical. I'll have to think about it a bit more then.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Blizzard

March 06, 2016, 03:25:22 am #102 Last Edit: March 06, 2016, 03:29:38 am by Blizzard
I found two more things.

1. The first is a hard crash. o.o It seems that I can reproduce it somewhat consistently. All I have to do is go the to right border of the map and then to the upper border. When I get there and start moving down, after 2-3 tiles it crashes. The error does say that XPATilemap.dll caused the crash. You should probably check if your DLL's bitmap boundary clamping works right when you render the layer sprite's bitmap.

2. I wasn't able to reproduce this one after it happened the first time. I don't have a screenshot, but it looked like one column of autotiles was duplicated and shifted to the left by one tile. It was a water autotile and looked something like this:

/===\                  /===\
|###|                  |###|
|###|                  |###|
|###|                  |###|
|###|                  |###|
|###|                  |###|
\===/                  \===/

I came in from the right side of the map after walking a downward corridor in a previous map, but I couldn't make it happen again, no matter how many times I tried reentering the map. This is how the glitch manifested:

/===\              /=/===\
|###|              |#|###|
|###|              |#|###|
|###|              |#|###|
|###|              |#|###|
|###|              |#|###|
\===/              \=\===/

When I walked left so the water got offscreen and back, it obviously fixed itself. This was Giada Castle so shaking was turned on and this is probably related.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

KK20

I'll have to take a look at the first one. Haven't heard of that one before. Hopefully it's easy to reproduce as you make it sound.

Second is probably the result of screen shaking. I did notice something though. I tried copying your modified Game_Screen from the project when I had horizontal shaking working. I disabled the vertical shaking (tremble) and ran the game only to find out that my fix suddenly didn't work anymore. I haven't looked into it yet, but it baffles me as to what is the cause.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Blizzard

March 06, 2016, 04:44:17 am #104 Last Edit: March 06, 2016, 12:37:03 pm by Blizzard
If you still have my CP project, load a savegame, press F9, teleport to map 254 and turn on switch 004. Hold CTRL to avoid encounters while walking.

EDIT: Aaaaand I might have another one for you. xD Setting Tilemap#tileset to nil doesn't work the same way as in the original. In the original all tiles simply vanish as if it is an empty bitmap.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

KK20

March 07, 2016, 12:13:02 am #105 Last Edit: March 07, 2016, 01:10:42 am by KK20
God I have so much work to do now DX I did contemplate about the whole changing the Tilemap graphics thing before, but I don't remember why I never did it. It should be a simple matter of setting @first_update to true again.

I think I understand the whole screen shaking problem, and it's mainly because the default algorithm of handling it is definitely NOT what I would have done. I should also mention that in your tremble you are subtracting @shake_duration by 1 twice; this was making my Tilemap problem more obvious (for some reason).

There happens to be a desync with autotiles updating and the ground layer's X coordinate. If at the left side of the map, the ground layer starts at X = 0. After shaking, it was somehow ending up at X = -32. I need to rethink my Tilemap#ox= method.

EDIT: I can achieve what I want if we change the viewport's x rather than its ox. I think Spriteset_Map and Spriteset_Battle are the only ones to use Viewport#ox= in the default scripts, and specifically only for shaking.

With default RMXP on a 20x15 map, the tilemap wraps around on both sides, which you can clearly see if you put two different tiles along the edges of the map. Same goes for the panorama. If I can draw some high z-value black rectangles when only along the map edges, then I can continue working around Tilemap#ox. Though this will affect some scripts negatively, specifically map wrap scripts.

I can really go a bunch of different ways with this.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Blizzard

Quote from: KK20 on March 07, 2016, 12:13:02 am
With default RMXP on a 20x15 map, the tilemap wraps around on both sides, which you can clearly see if you put two different tiles along the edges of the map. Same goes for the panorama. If I can draw some high z-value black rectangles when only along the map edges, then I can continue working around Tilemap#ox. Though this will affect some scripts negatively, specifically map wrap scripts.


Yeah, that was the solution I had in mind. You could make it an option so it doesn't mess with other scripts. I don't think the Viewport solution is a good one since it would cause the same problem, but you couldn't really turn it off like the black borders.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

KK20

Well I have an idea how to do it, but it involves reworking my DLL which I haven't looked at for well over a year now.

Main idea is to give Viewport a variable that is assigned to the Tilemap instance. Whenever the Viewport's ox/oy change, I can update the Tilemap accordingly. It'll be a while before I finish it though.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Blizzard

I'm coming to San Francisco this weekend so I'm likely not going to work on CP for the next two weeks. You don't have to rush it because of me. xD
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Heretic86

Quote from: Blizzard on March 07, 2016, 02:47:16 pm
I'm coming to San Francisco this weekend so I'm likely not going to work on CP for the next two weeks. You don't have to rush it because of me. xD


You wont be that far from where I live then!  I'll just have to keep my eyes peeled for a black guy thats always nodding their heads (avatar) and is known to be a total Grapist (previous avatar)!  About 4 hours away...
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Blizzard

Aw, man, we're literally sitting in the rent-a-car, ready to get to the airport. ._.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Heretic86

Quote from: Blizzard on March 23, 2016, 10:17:19 am
Aw, man, we're literally sitting in the rent-a-car, ready to get to the airport. ._.


Have fun!  Too damn many people in SF for me...
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

KK20


Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Blizzard

March 25, 2016, 03:02:05 pm #113 Last Edit: March 25, 2016, 03:04:39 pm by Blizzard
I found an inconsistency with the original implementation in RMXP. Fog's ox and oy values are not corrected with the scale. While this is the correct behavior for Sprite classes, it's not the same with the Plane class. You have to change "super(ox % @bitmap.width)" to "super((ox / self.zoom_x) % @bitmap.width)" and the same with oy and self.zoom_y.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

KK20

Just wanna update that I have fixed the whole wrapping issue. If the map has the word [WRAP] inside its name, the map will behave similar to that of RMXP. Otherwise, a black border will be drawn instead.

It now handles float values properly along with viewport adjustments. Shaking the screen vertically will be fine now. Still seeing an issue with panoramas when the resolution is too big for the map, but that requires an edit to a helper script I'm using in conjunction with this.

All that's left are the easy things like refreshing when a bitmap changes and cleaning up.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

orochii

So it works now with the old wrap/looping map scripts?

Anyway, I think I'll update my game. Howdy-ho!

KK20

Quote from: Blizzard on March 06, 2016, 03:25:22 am
1. The first is a hard crash. o.o It seems that I can reproduce it somewhat consistently. All I have to do is go the to right border of the map and then to the upper border. When I get there and start moving down, after 2-3 tiles it crashes. The error does say that XPATilemap.dll caused the crash. You should probably check if your DLL's bitmap boundary clamping works right when you render the layer sprite's bitmap.

I can't seem to reproduce this in your project. I don't know if it's a specific map or any map in general.

Going to be throwing up the next version sometime this weekend. Still beta phase but closer to what I envisioned.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

KK20

So I know I'm like...20 days late on my promise. But it was because I was working on a new Plane rewrite, one that uses a DLL. Turns out that it's actually much better than RMXP's. Not only can it go beyond the 640x480 limit, but zooming works as intended. It's also much more efficient with smaller graphics: using a 9x1 graphic, RMXP frame rate drops to about 30 and drops to single digits when zooming out (no idea why anyone would do this but...for science); the rewrite stays at a crispy 60 (or 59, whatever, it's close enough) regardless.

I still need to test it a bit more before I can give the go ahead and release the Tilemap.

Hopefully Blizz-senpai hasn't given up on me yet :[

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Blizzard

May 23, 2016, 01:06:02 am #118 Last Edit: May 23, 2016, 01:07:10 am by Blizzard
No, I still love you. <3
I'll check this stuff out the next time I work on CP. Though, I'm mostly interested in the black border thingy. xD
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

orochii

Quite sweeeeeeeet ma' boy! <3. I love planes *gets run over by an airplane*.
Me wants this new plane thing. <3<3<3

And tilemap update. Oh my. Such delicacies. Life is such a sweet potato sometimes.