Jump to content
IGNORED

Can we have tiles of different height?


asdronin

Recommended Posts

Hi all,

Im stil in the process of feeling confortable enough to start making the actual code and graphics for my first game for the 7800, but I found another doubt regarding the plotmap tiles, I notice that yes we can specify normal or double wide for the tiles either for one particular set or for all of them, but I dont see anywhere if we can define different height for these, I mean maybe someone could be interested in using 8x8 tiles and later use plotmap the usual way, of course that would lead to have more tiles on screen but just would be better for some details maybe (unless it has a very important performance hit), so is it possible to have our tiles like 8x8? thanks a lot beforehand and really Im really sorry I find so many doubts in my path of learning

 

PS I forgot to mention that I tried of course to use a image with the tiles that was 64x8 and indeed its plotted on screen fine but the trouble is it separates lines too much so map is crossed by some stripes made of background color so I assumed that its either change somewhere the font size (height actually) or just its not possible

 

Edit: I know we can use zone height but I dont want to limit the height of other images as I think it does

Edited by asdronin
Link to comment
Share on other sites

Everything the 7800 draws is exactly one zone high even if it doesn't look like it. When you're drawing your 8 pixel high tiles it's still drawing them as high as the zone.

 

The 7800 does allow for zones of different heights, and this is actually how vertical scrolling is achieved, but 7800BASIC doesn't give you control over the display-list list which sets it.

  • Like 2
Link to comment
Share on other sites

Thanks a lot SmittyB for the explanation, its quite clarifying then we have to stick with one zone height in everything from tiles to sprites etc well one could find workarounds for this like I have seen in some source codes making the zone height 8 and then using 2 sprites one on top of the other to make sprites of 16 pixels height, more work maybe but depends on the cases I guess

Link to comment
Share on other sites

As you move sprites vertically across the screen that's sort of what already happens in a way. The zones themselves cannot move and all graphics are aligned with the zone, so when a sprite moves across a zone what you're actually seeing is multiple objects, just where they get the graphics from is offset.

  • Like 1
Link to comment
Share on other sites

I see, thanks for the explanation =), I remember I saw something about the zones somewhere, and I went now to the manual and with your explanation I understand everything, but then I wonder is it correct to make vertical scrolling just by applying y-offset when plotting the map? I notice that this way it jumps one line of course as we specify the offset like that not coordinates, but we cant get a smaller offset in plotmap, right? I mention this because you said the way to make vertical scrolling is related to that feature of using different heights, well I dont fully understand how it could be achieved, I know its off-limit for me using the 7800Basic but just wonder about the theory behind what you said, Im sure you know how is everything done so Im not having doubts about your knowledge, dont take me wrong, just want to do things right.

Link to comment
Share on other sites

Not a problem, before a couple of years ago I was clueless on this subject.

 

When I said the zones can't move I should have said the zones will always start immediately after the previous zone. By shrinking the uppermost zone the others will move up to fill the gap. By shrinking the uppermost zone and expanding the lowermost you can shift everything up enough that on the next frame you put everything back and then change which tiles are drawn in the manner you're doing now. Shrinking the lowermost zone etc will let you scroll down.

  • Like 1
Link to comment
Share on other sites

Thanks for explaining yes it makes a lot more sense now, I had no idea it could work that way, but in relation to how it looks like, Im using the y-offset in plotmap you know, but this value seems to always be a integer value, I mean Im using a variable for that of course, but if I declare it as floating point and increment 0.1 it still will make the map jump one line always the same as if I increment it by just 1, according to what you explained the scrolling technique should be able to show intermediate positions to make it not like a jump I mean smoother, or am I missing something in relation to how the plotmap should be used to scroll the background? as said right now the tiles move just one line shift each step, not bad but dont know if this could look better so I hope you can shed some light into this doubt

Link to comment
Share on other sites

When you're using plotmap, you're plotting things with the indirect method for drawing sprites. That method doesn't have the ability to offset it's graphics off of a zone the same way a direct plotting like with plotsprite does. As a result you'll see the graphics jump a full zone up or down when you inc/dec the starting Y position. This is why you have to play tricks with changing the size of the top and bottom zones to make it look like everything's scrolling smoothly.

 

Normally changing the Display List List isn't possible with 7800Basic although if you know what you're doing and where the display list list is stored in memory, you can use assembly to edit them. I did that in at least one of the rpgtile demos. Not easy to accomplish and it required making some edits to 7800Basic's interrupt - which I didn't do a great job with so wasn't able to get a perfect pixel scroll.

 

Likewise if you plan things properly and know how the display lists are stored you can edit the lists directly to get faster results. For example, when you see the walls moving in Graze Suit Alpha, that's done by me knowing where the sprites for the walls are in the display lists and editing their X-coordinate entries. A lot faster than re-plotting them every time I move them. Assuming I ever get back to the game I'll be able to update the walls with animations in a similar way.

  • Like 1
Link to comment
Share on other sites

I see, thanks a lot for the explanation Mord, I had no idea it was like this, so with just 7800Basic we can make the tiles jump one zone each step, my assembly knowledge is really low and its a pitty but I have no plans to learn more assembly right now. then Im ok with the one zone jump I guess, by the way you did a great job in the Rpg tile demo and the Graze Suit Alpha sure looks nice in that movement you implemented.

 

Then as I can somehow see, it could be better to use a zone height of 8 (smaller jumps) but then this way we are limited to use sprites of 8 pixels height, right?

Link to comment
Share on other sites

As 7800BASIC compiles to assembly which is then assembled into the final ROM you can write something in 7800BASIC and then see what the assembly equivalent is.

 

 

If you use banners rather then sprites you can have things taller than one zone. As far as the 7800 is concerned they're the same thing but 7800BASIC makes a distinction between the two because they can be optimised in different ways, for example a sprite will only ever cover 1 or 2 zones and where the graphics are loaded from doesn't have to be changed while setting up the display list.

  • Like 1
Link to comment
Share on other sites

I see, I had no idea assembly code was generated, well I heard something but as my assembly knowledge is really low I tend to ommit all that. Good to know for the moment I find myselft with enough time to deal with assembly =).

 

And I had no idea a banner could be used as a sprite, I mean as you said the 7800Basic makes a clear distinction and I have always seen banners in programs being used for title screen mainly. So according to what you say its ok to make a 16 pixels tall banner and use it in a zone height set to 8 for smaller tiles and there shouldnt be any trouble in terms or performance which is something Im always worried while coding in the 7800Basic

Link to comment
Share on other sites

If you're already drawing multiple sprites to create a large object then a banner would be a more efficient way of drawing as it would cut out some of the overhead, otherwise banners would have an impact on performance just because there's more to calculate and draw.

 

Don't worry about performance too much, if things start to slow down there's usually something you can tweak in your code to speed it up again providing you're not trying to draw tens of objects to the screen.

  • Like 1
Link to comment
Share on other sites

I see, thanks a lot for the explanation, I see that somehow its try and see rather than worry about the possible performance issues. Well I would like to make first a shmup and for that I tend to like those bullet hell type but of course I know the limit here is in the number of bullets I will be able to display added to ships etc so as you said I will try my way and hopefully I will find a way to make it work fast enough =).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...