PDA

View Full Version : Warped walls recreation



burntonion
May 3rd, 2019, 07:44
https://rainlizard.itch.io/warped-walls-recreation

While not the biggest fan of DK2 I do like its terrain, it only has a few different terrain types and yet manages to look pretty fancy. This is the first time I've stepped into 3D development and the first time I've used Godot. A bunch of my interests aligned for me to work on this thing, shaders are fun and I like DK clones.

Apparently the implementation for DK2 was pretty complex: https://github.com/tonihele/OpenKeeper/issues/108
"Incremental Delaunay Triangulation" I have no idea what that is.

From what I can tell DK2 uses simple cube collision boxes for the terrain;
1. In possession mode when you push diagonally against the wall your camera will move in a straight line, no bumps. As a Firefly you are unable to fly all the way up to the ceiling, blocked by a flat collision box.
2. If you possess a warlock and shoot a fireball at the side of a thin distorted rock terrain (dig around a rock tile without claiming to make it thin) your fireball will collide with air. Walk up to distorted terrain and it obviously has a flat collision box.
So I figured a shader that merely manipulates the positions of the vertices is good enough, it's a visual effect that stays within the collision box.

https://simonschreibt.de/gat/dungeon-keeper-2-walls/
https://gamedev.stackexchange.com/questions/67372/how-can-i-apply-a-mesh-distortion-to-walls-like-in-dungeon-keeper-2
Though it was barebones, the code sample in that last link was a good starting point, credit to that guy.

tonihele
May 3rd, 2019, 16:27
Pretty cool! You should contribute to OpenKeeper ;)

codename.cpp
May 4th, 2019, 14:28
Thanks for sharing!

Trass3r
December 27th, 2019, 01:05
Apparently the implementation for DK2 was pretty complex: https://github.com/tonihele/OpenKeeper/issues/108
"Incremental Delaunay Triangulation" I have no idea what that is.
[...]
So I figured a shader that merely manipulates the positions of the vertices is good enough, it's a visual effect that stays within the collision box.

I think that's exactly what they did, it's straightforward and provided good performance. The whole triangulation idea was thought way too complicated.

burntonion
December 27th, 2019, 01:41
I think that's exactly what they did, it's straightforward and provided good performance. The whole triangulation idea was thought way too complicated.

https://simonschreibt.de/gat/dungeon-keeper-2-walls/
If you scroll down there's a post by someone who worked at Bullfrog.


My name is Robin Green and I worked on navigation tech at Bullfrog along with head of R&D Ian Shaw. Ian was the master of the Incremental Delaunay Triangulation system that allowed us to dig out mazes (and the underlying map-and-crowd-nav system was used on both DK2 and Theme Park World)

Notice how the diagonals in adjacent squares flip from top-left/bottom-right to top-right/bottom-left? That’s the key to incremental delaunay, knowing when to split and when to flip.

With that said, I think technology was different back then, shader magic was new stuff and internet solutions weren't widespread. So their implementation was likely much more complex than it needs to be (these days), due to technological restrictions at the time.
https://en.wikipedia.org/wiki/Shader#History

The first video card with a programmable pixel shader was the Nvidia GeForce 3 (NV20), released in 2001.
2 years after DK2 came out.

Side note, I've got this cursed version of DK2 that has no wall warping when I run DKII.exe instead of DKII-DX.exe, which is interesting to see. (maybe it's like this on other people's computers? Otherwise it's a pretty funny coincidence that this happened to me)
1955
1956

YourMaster
December 27th, 2019, 01:44
I always like the clean look of the straight walls (not that first person picture though). In DK1 as well. They made some pretty art there that's hard too see, not just because of the size but because of the warping as well.

burntonion
December 27th, 2019, 02:31
I always like the clean look of the straight walls (not that first person picture though). In DK1 as well. They made some pretty art there that's hard too see, not just because of the size but because of the warping as well.

I doubt you're alone, there's probably quite a few people out there that think it looks old, ugly and would prefer perfect cubes like minecraft. That might be why the look really hasn't been replicated much in other games. Though that does allow DK to stand unique, I especially like DK1's lumpy floor and ceiling in first person. I think the warped look contributes to the evil theme (twisted like my SOUL... lol) and increases atmosphere by better representing cave walls carved roughly out of the earth.

By the way, unrelated to Dungeon Keeper I recently coded this: https://rainlizard.itch.io/another-mc-clone
So I now know how to cull all hidden faces in 3D (there was no culling in the Warped Walls Recreation project). I may work on another DK related project in the future.

YourMaster
December 27th, 2019, 09:12
Well, for DK2 I didn't much care for the graphics when the game was new either.
And yes, in first person it looks better, but the graphics are just all around of low quality, that the warping is too much and it goes beyond realism.

If you're looking for a project, I'm always happy to provide you with something on KeeperFX Unofficial of course.

Trass3r
December 27th, 2019, 14:46
https://simonschreibt.de/gat/dungeon-keeper-2-walls/
If you scroll down there's a post by someone who worked at Bullfrog.


Ha interesting. Wouldn't have expected that.