Drawing multiple sides of a building in a topdown RPG world

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Drawing multiple sides of a building in a topdown RPG world
by on (#196014)
In games like ROM City Rampage, you can only see one side of the building. In my game, you should be able to enter all sides of the building. I'm not sure how to draw the building then. I'm thinking about whether the map should have a 16x16 or a 32x32 block resolution. The game isn't for the NES, but for a DIY gaming console called Pokitto which has a 220x178 resolution if I'm not mistaken. The game is an RPG in which you can enter buildings by walking on the map, but when you enter the building, it turns into a 2D platformer like in Zelda 2. Since the map is based on a real city in which there can be buildings facing any direction, the player should be able to enter any of them from any direction and see their front face even if it faces north. So I'm thinking about if a building's block should be a square split into 4 triangles for each side of the building and have a smaller square in the middle for the roof; it would look like SMB1 stairway blocks in SMB1. I just hope it doesn't look messy. Chained buildings would have the intersecting sides removed and connected via the smaller square in the middle which stretches into a rectangle.

How would you draw a building that's enterable on multiple sides?
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#196018)
Draw pathways of some sort toward the entrances.

Image
The path next to the well between the houses draws the eye to the back of the houses
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#196020)
You could do something like how the game Prison Architect does it? In that picture, they show the building interior, but you could just cover it with roof, but still leaving the sides and doors visible?
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#196021)
tepples wrote:
Draw pathways of some sort toward the entrances.


Years of training of JRPGs has taught us that, despite the paths, there's probably not entrances there (unless it's a secret room).
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#196048)
^^^ I haven't seen any of those…

Traditional side- and back-exits whose doors can't be seen have a dirt area around the entry, to suggest traffic wearing out grass, etc.
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198379)
These are some of your perspective options:
Image

Personally I'd go with the normal one visible wall perspective and go roofless.
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198388)
nesrocks wrote:
These are some of your perspective options:

You forgot a full trapezoidal perspective:
Attachment:
trapzeoid.png
trapzeoid.png [ 1.26 KiB | Viewed 5081 times ]


I started to mock-up a "remake" of an older project of mine, but I haven't worked on it, in a while...
Image

For those of you who recognize the color palette, yes, it's exactly what you think it is:
Image
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198394)
I "forgot" many other perspectives, I was just showing a few very different types. The one you showed isn't all that much different from the bottom right one.
Btw, really good graphics there, nice!
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198435)
I like this! I was thinking about something like that! Just not trapezoidal projection. But since you've mentioned it, I'll do it! :D
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198460)
Looks very Zelda 3-esque.

Personally I find it strange and I prefer the more traditional top-down perspective, although I understand in some cases another perspective is necessary to show more details.
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198641)
This is something i'm working on for the compo.

Attachment:
1c3.bmp
1c3.bmp [ 30.12 KiB | Viewed 4830 times ]


The pros:
-Pushes the limit of what is expected from a perspective standpoint on the nes.
-Gives a nice sense of depth
-Can help tell the player something about the height axis
-You can place points of interest in more varied locations than in the JRPG perspective
-More easily enables tactical level layouts compared to the JRPG perspective

The cons
-Will require another layer of cases in your map drawing algorithm, if you use one, or if the screens are hand-drawn and hard-coded, they will be prone to the human factor (bending perspective rules by mistake).
-Moving Sprites either have to 1) beconfined to a floor-level 2d plane, 2)break perspective noticeably, or 3)have lots of work done to them, graphics and code wise.

Because of the cons, we might actually roll back to the classic JRPG perspective, depending on how it goes. We'll need to factor in time, convenience, to some extent cpu bandwidth. and if the wow-factor is large enough. We've already rolled back some ROM expenses in the form of another nuance of perspective, taking up another subset of tiles. That adds up when having multiple sceneries. In one end, JRPG perspectives are the simplest things that could possibly work, and in the other, it has been done so many times that you need to go further in order to succeed making something fresh.

Other things to note:
-The perspective and scale must be made to match the active play area. If 1 screen with screen by screen switching/scrolling when trespassing borders, no problem. If for example 2x2 free-scroll screens, you need to scale the perspective accordingly.

This mockup has been through quite a few iterations in a short development cycle, with the perspectives changing. I plan to do a full writeup comparing snapshots once the design has solidified enough.
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198643)
Are you using "traditional JRPG" to mean a cavalier projection, or cross-sectional?
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198644)
I associate cavalier projection with (mostly western?) MSDOS era CRPG:s.

What i meant with "classic JRPG" was a forced perspective where you see front and top of a cube, but not the sides.

This is what i call Cross-sectional perspective, which is what the project in its current shape is approximating, but with compromises due to level drawing complexity, storage, attribute grid, and sprite handling. Hypothetically, a truer form of cross-sectional would require many attribute masking sprites, subsequently locking a sprite subpalette, a more careful/constricted layout, and Solstice-like sprite masking tricks, which amounts to an enormous task.

An earlier iteration had more trapezoid elements, like zelda 1, 3 and so on, but it didn't work out for the intended design goals.
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198645)
so, as FF1-6, DQ3-5 (and, though the bricks look more like you're showing 0 sides, DQ1-2), Seiken Densetsu, Chrono Trigger, Wild Arms, Soul Blazer, Illusion of Gaia, Terranigma, etc. etc.

actually Soul Blazer does show trapezoidal southwalls when inside, so not quite.
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198648)
I think that if the characters are chibi enough then they don't need to adjust to perspective. Looking great so far!
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198650)
FrankenGraphics wrote:
I associate cavalier projection with (mostly western?) MSDOS era CRPG:s.

What i meant with "classic JRPG" was a forced perspective where you see front and top of a cube, but not the sides.

That's similar to what this diagram on Wikimedia Commons refers to as "top-down oblique projection".

What I'm planning to do for a future project is show width and height at full size but depth at half size, as if the camera is pointed 26 degrees down. Then speed of movement along the depth axis is halved to compensate.

Image
To illustrate, I drew a crate


Thus 1 m wide is 16 pixels, as is 1 m tall, but 1 m deep is only 8 pixels.
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198657)
Thanks for the link - very illustrative!

That's a very nice take on the top-down oblique perspective. I suppose you don't see that too often because of the 16x16 attribute grid (basically same with isometry or any skewed perspective).

Some solutions:
-2 subpalettes with dupe colours
-Common colour is floor colour
-1 subpalette for bright side, 1 for shadowy side and floor
-ExRAM
-Sprites (worst, since you spend both scanline bandwidth and an extra subpalette for something that still is on a 8x8px grid)
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198667)
^^^ 16x8/8x16 attributes are fairly trivial to implement on a board, if you don't plan to scroll, since you can just switch CIRAM tables based on the LSbit (be it for X or Y) of the preceding NT fetch.

(Or, in software, raster-swapping the NT every 8 scanlines, but that'll crimp your cycles very fast.)
tepples wrote:
That's similar to what this diagram on Wikimedia Commons refers to as "top-down oblique projection".

Thanks, that helps a lot; I was looking for such, but your search-fu is better.
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198757)
So with GTROM:s 2 pages of 4-screen nametables, you could theoretically software-swap them to provide a 16 x 8 (or finer, though it makes little sense) grid with easy free-directional scrolling; provided you have enough cycles to spare. Right? The ease of the scrolling might lend just a little bit to that end.
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198758)
Yes, but the hard part is timing the splits without IRQs. You'd have to run timed code most of the frame and end up with little time left for the bulk of the game logic.
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198761)
Oh yeah, and when you mention it, vertical scrolling would require offsets to the timing.
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198767)
How about making one's own mapper where the mapper changes the attributes and the nametable and bankswitches by counting the scanlines like MMC5 does and then it has a table of scroll values that the IRQ code simply copies into the PPU_SCROLL registers from fixed mapper registers which are updated by the mapper?
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198768)
Or if hardware accelerated on the pcb, can we decouple attribute page switching from nametable pageswitching on a hypothetical new mapper? It seems redundant/fidgety/restrictive to lock all of the nametable RAM on cart to timed toggling when all we want to toggle is the last 64 bytes of each NT. The fact that they're interleaved between nametables rather than sorted last or first in address space rules out the simplest form of masking, though. I have difficulties comprehending what should be used instead.
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198775)
Unfortunately, changing the way the PPU's attribute table is laid out is relatively I/O intensive, more-or-less requiring an FPGA. There are two conventions for making the attribute table have the same layout as the nametable, both targeting 8x8 attributes—MMC5 and Quietust's UNL-DripGame.

On the other hand, if you "just" want the ability to bankswitch the last 64 bytes of the nametable to something else, but retain the same 16x16 pixel granularity and packing ... well, there's no established mapper for that, but it is electrically simple.
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198776)
It feels as if i'm missing a piece here. If toggling/bankswitching the last 64 bytes of a nametable is electrically simple, what's more complicated about doing it a fixed rate, via a timer set at 8 scanlines? This question assumes we don't need to reroute addresses.
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198779)
There's nothing hard about that. That's what Myask was referring to—it's easy to take note of ("latch") the address of the preceding nametable fetch and use that number to automatically bankswitch the attribute table.
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198783)
Oh, right. Thanks for clarifying that.

So basically the features would be
-Scanline based IRQ counter
-Attributes are switchable (rate selects x or y), so we can get 16x8 or 8x16
-a time offset at 0-7 steps so the attribute toggling can fine scroll

Whether it's CIRAM or ExRAM (like GTROM, etc) is arbitrary, even though the latter is of course more convenient and flexible, which is the whole purpose of a new pcb/mapper - to make pretty things work on a NES at a reasonable price.
Re: Drawing multiple sides of a building in a topdown RPG wo
by on (#198786)
no need for the third; it'd line up to the tiles naturally.