Page 1 of 1

Seamless dungeon crawler effect

Posted: Fri Aug 02, 2019 6:46 pm
by KanedaFr
For a long time now I wanted to understand how Shining in the Darkness dungeon crawler was made.

I clearly understand the "painter algorithm" and the way to use it to draw the floor, walls, etc...
https://wiki.dungeoneye.net/index.php/Maze_rendering

What missed was how to make it "seamless" when you walk or turn.
From what I see, they used 2 or 3 mid step view, ie rendering 3 steps between current and future position.
OK, I assume DMA is fully used here.
https://www.youtube.com/watch?v=cgwNw3tIMa4

But recently, while googling for more tech details, I discovered the dungeon part of Phantasy Star on SMS.
:shock: :shock: :shock: :shock: :shock:
https://www.youtube.com/watch?v=zw0kqJp3NYw

The effect seems better than SitD and we're on a SMS!
How the hell did they do this ?
Could it be applied to Genny ?

Re: Seamless dungeon crawler effect

Posted: Sat Aug 03, 2019 6:28 am
by cero
http://nesdevcompo.nintendoage.com/contest17/
Inherent Smile was my entry for a NES compo, try it ;)

Re: Seamless dungeon crawler effect

Posted: Sat Aug 03, 2019 8:05 am
by Sik
They aren't rendered on the fly, they're prerendered images (more like predrawn) that get assembled together to make the dungeon. This is a very common thing among all dungeon crawlers. The exception to the rule that comes to my mind is Shin Megami Tensei on Mega CD, that one seems to be using Wolf3D-style raycasting instead.

EDIT: I saw painter's algorithm and for some reason I assumed you were planning to draw polygons on the fly. Yeah no, lol. But yeah, Phantasy Star is using the same technique, how good it looks like really depends on the artist and not much else.

EDIT 2: and in fact, watching and I think the problem with Shining in the Darkness is that the floor doesn't animate when you turn around (it does in Phantasy Star). That's probably the thing tripping you.

Re: Seamless dungeon crawler effect

Posted: Sat Aug 03, 2019 10:46 am
by KanedaFr
I know it's a "very common thing" but i never found someone which explain it ;)
Perhaps it's so basic that it doesn't need to be explained ? :wink:
I could try to do the same but when it was already done hundred of times, why loose my time reinvent the wheel ?

(it's exactly the same problem I had when I was looking for "homing missile" technique and slope : common but noone able to explain it)

For exemple, I discovered 2 days ago the 3 levels crawler ...on NES !
the way to draw it is just..well...logic when you see it....but you have to see it first ;)
https://forums.nesdev.com/viewtopic.php ... fe#p195615

About the key role of the artist, I totally agreed.
It's exactly what was said about PS1. I didn't save the page when I read it but on this interview, they explain how Yuji Naka was very important on the 3D dungeon part.
It's also sad to read it was not possible to get the same effect on MD ("too much memory needed") :(

And thanks for pointing the fact the floor doesn't rotate, it's probably what's bug me...

So...DMA power ? ;)

Re: Seamless dungeon crawler effect

Posted: Sat Aug 03, 2019 11:58 am
by Sik
I mean, when you see it's a few distinct graphics instead of there being obvious hints of some processing going on it becomes clear it's being assembled out of a few pre-existing graphics. I guess I jumped on it because I saw at least somebody attempt to use polygons thinking that Phantasy Star did it that way… (yeah, no)

Transitions are pretty much using a different set of graphics and positioned slightly different, yeah.

I call bullshit on Mega Drive not having enough memory while Master System did. I know that Phantasy Star II also reuses the same background for every battle regardless of your location (unlike IV which makes the background match the map), so maybe running out of memory was in reference to ROM? I recall Yuji Naka had to fight to convince Sega to make it a 768KB game instead of 512KB as originally intended, so they were already short of ROM space.

One question: does Shining in the Darkness put the floor in the same plane as the walls or in its own plane?

EDIT:
KanedaFr wrote:
Sat Aug 03, 2019 10:46 am
(it's exactly the same problem I had when I was looking for "homing missile" technique and slope : common but noone able to explain it)
Every frame you compute the angle to your target (even if loosely) and then adjust your current angle to get closer to that one.

Re: Seamless dungeon crawler effect

Posted: Sat Aug 03, 2019 4:55 pm
by Miquel
Have you tried to run it on an emulator in slow mode/motion?

I mean: to see what happens with gfx when character moves from current cell to the next one.

Re: Seamless dungeon crawler effect

Posted: Sat Aug 10, 2019 10:12 am
by KanedaFr
Of course, i'm able to see how it was done.
My question was more "is there a known/documented way to do ?"

but it seems every game reinvent the wheel every time...for every thing

Re: Seamless dungeon crawler effect

Posted: Sun Aug 11, 2019 4:56 pm
by Chilly Willy
KanedaFr wrote:
Sat Aug 10, 2019 10:12 am
but it seems every game reinvent the wheel every time...for every thing
Unless you license engines and libraries (if the library needs to be licensed), you WILL reinvent the wheel on everything. It's inescapable. Generally, I borrow a lot from my old code, depending on if my current employer owns the rights to the code I do for them. Lots of programmers do that. If you look at Ken Silverman's web pages, he's posted of lot of his base code for folks to use.

Re: Seamless dungeon crawler effect

Posted: Mon Aug 12, 2019 6:05 am
by Sik
Even if you only consider methods, everybody tends to implement things their own way, especially on these consoles where you need to manage different video resources (the two tilemaps and sprites) and pick a trade-off that suits your particular game best (contrast with newer stuff where you get a framebuffer and you can draw anything without worrying much about how it's done).

So yeah, other than "don't do something blatantly stupid" there isn't much left to say. You seem to already understand how to get the basic thing going, anything else you want (including unusual or new effects) is going to build on top of that (i.e. take the existing code and modify it to do something fancier).

If you have figured out how to do smooth transitions when turning around, then you can do something similar when moving forwards and backwards, since the underlying concept is the same (different set of graphics and anchor points, but otherwise same way to build the scene).

Re: Seamless dungeon crawler effect

Posted: Mon Aug 12, 2019 12:01 pm
by Miquel
I was going to say something similar, perhaps no that fancy.

The only thing for me left to say is that the key to smooth transitions is using sprites to draw the walls, temporally or permanently.

Re: Seamless dungeon crawler effect

Posted: Mon Aug 12, 2019 2:37 pm
by Sik
I think that by "seamless" he was just referring to the transitions between positions (a lot of dungeon crawlers just teleport you to the new position and it becomes horribly confusing as a lot of the time it looks like you didn't move), no need to be 100% smooth in that case. Sprites can make them smooth, but I'm not sure how likely it's to cause sprite overflow (and if sprites drop you'll break the illusion).

Re: Seamless dungeon crawler effect

Posted: Mon Aug 12, 2019 4:37 pm
by Miquel
Yes, we both are talking the same.

You can cover the entire screen with sprites, only just, but you can.