How exactly is the Viewport Z and Sprite Z factored into drawing?

Started by ForeverZer0, August 13, 2014, 09:40:43 am

Previous topic - Next topic

ForeverZer0

Quote from: winkio on August 13, 2014, 07:41:30 pm
The draw calls from RMXP work as a tree.  A sprite without a viewport is a leaf node, and gets drawn based on it's z value.  A viewport acts as a subtree, with all of it's child sprites being drawn together, regardless of other viewports or sprites without viewports.  I'm pretty sure that's all the explanation you need, but if it's unclear let me know.


Yes, thank you, I think I have it understood it now. Luckily I don't think I need to change anything in regards to the Tilemap, and creating a sprite for each tile, as I previously thought. I really only need to adjust the Window class, and of course finish implementing drawing each Viewport as it's own separate RenderTarget, so that's good news.


EDIT:
I am pleased to say that I got it all figured out and behaving correctly, and even managed to make some improvements along the way. It's actually quite a bit simpler than I was making it out to be, for some reason it has really been causing me some issues, but now that I have it done, it's no big deal, and I don't know why I didn't have it like this in the first place.

Getting close to maybe just throwing up a demo. Still need to factor in blending and stuff, but graphically it the hardest parts are over. The audio is pretty basic right now, I haven't really expanded anything beyond RMXP's audio at the moment, and the same goes with input.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Blizzard

Quote from: winkio on August 13, 2014, 07:41:30 pm
The draw calls from RMXP work as a tree.  A sprite without a viewport is a leaf node, and gets drawn based on it's z value.  A viewport acts as a subtree, with all of it's child sprites being drawn together, regardless of other viewports or sprites without viewports.  I'm pretty sure that's all the explanation you need, but if it's unclear let me know.


Lol, I literally imagined a tree-like render queue while explaining things earlier without actually mentioning trees.
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.

G_G


Soulshaker3

I actually didn't know that about RM XP while reading Blizz explanation i always imagined a list with blocks with their contents inside
Hellow?

KK20

Quote from: gameus on August 13, 2014, 09:38:02 pm
I want it first.

Um, no. You're not entitled to firsties.

I just hope this is our lord and savior~

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!

Zexion

Quote from: KK20 on August 13, 2014, 10:12:27 pm
Um, no. You're not entitled to firsties.

:knight:

Praying to the cloud that this demo is everything I've ever wanted
all hail the cloud?