20 October 2023, 16:08 | #3501 | |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,483
|
That's a potential workaround, but it would be nice to fix the root cause as the existing clipping is great when it works as expected.
Quote:
Last edited by Karlos; 20 October 2023 at 16:53. |
|
20 October 2023, 16:10 | #3502 | |
Registered User
Join Date: Dec 2019
Location: North Dakota
Posts: 741
|
Quote:
But if you have the PVS and level data, why don't you spend a single weekend implementing a simple 2D portal code on PC (DiretcX/SDL/whatever engine), inside say, Visual Studio ? You don't need full renderer for that - just the wireframe of the nodes (rooms). And once you have a reference, high-level, C++ based portal code running, you can very quickly replace that entire part of the pipeline. Without having to spend so much time on slow debugging of poorly documented original ASM code. It could literally stay as a C/C++ code and you would simply link it, manually. And later, once everything works, you could port it by hand to ASM in half day. What do you think of that approach ? |
|
20 October 2023, 16:18 | #3503 | |
Registered User
Join Date: Dec 2019
Location: North Dakota
Posts: 741
|
Quote:
The cost of writing a new visibility component might seem daunting at first, but since it's C/C++ and you debug it on PC, it can really be done during a single weekend. Integrating with Amiga codebase might take a bit more, yes. But you will suddenly have an opportunity to scale the engine radically, as you can simply later create better versions for 060 or RPi5, very quickly, in C (and just call different version at run-time based on some bool flag). |
|
20 October 2023, 16:40 | #3504 | |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,483
|
Quote:
That's more or less what I was alluding to a few posts back when I suggested that the mechanism could be replaced in theory. |
|
20 October 2023, 20:39 | #3505 | |
Registered User
Join Date: Dec 2019
Location: North Dakota
Posts: 741
|
Quote:
On the other hand, I don't want to promise much, because of few things:
Is this engine used for some other games ? Or would all work that goes into this project contribute solely to AB 3D II ? |
|
20 October 2023, 20:54 | #3506 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,483
|
Alas no. It's just for the game. However, the ability to mod it is being slowly improved upon.
|
20 October 2023, 22:48 | #3507 | |
Registered User
Join Date: Dec 2019
Location: North Dakota
Posts: 741
|
Quote:
I just went back few pages and re-read your description of how the renderer works and it's most definitely not a Portal-based engine, because if it was, it would be rendering front-to-back, not the other way around. Correct me if I'm wrong, but looks like this is the high-level algorithm: Code:
1. Grab List of all potential zones from the PVS pre-processing 2. Sort by Z (center of zone) : back-to-front 3. Clip&Render each zone |
|
20 October 2023, 23:02 | #3508 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,483
|
The clipping does seem to be portal like when it works, e.g. the nothing is rendered past the horizontal extents of a connecting space.
Running the Dev build and turning off wall either flat or shaded wall rendering, depending on what you are looking at, makes it very apparent that only the visible sections of adjoining zones are being rendered when the solution is working. It just seems to have a lot of failure case. |
23 October 2023, 15:26 | #3509 | |
Registered User
Join Date: Dec 2019
Location: North Dakota
Posts: 741
|
Quote:
Unfortunately, portal-like clipping is not very helpful here given the drastic overdraw. A portal-like engine (e.g. Duke Nukem's Build engine) renders front-to-back and completely avoids the overdraw cluster*uckery of Doom, completely bypassing the need for BSP Compiler, and as a bonus, giving you option of dynamic scenes. An actual portal-like engine, in your particular test case, wouldn't draw all those rooms in the distance (only for them to get overdrawn by huge wall right in front of the player). It would only draw whatever portion of the scene is visible through the door (the portal rectangle) - if (and only if) the door portal would be within the view frustum (and then all other polygons would be clipped against the portal polygon). Have you seen Bisqwit's Portal vid ? He's got an amazing slow-mo of the Portal Traversal algo, wall by wall, starting at 13:42. To avoid recursion, he's using circular queue, you can see that in the slow-mo, after each pass the next portals (red polygons) are added to the end of queue. [ Show youtube player ] Note that his test room is quite a complex case, with lots of small crevices under the stairs and such (plus pillars, plus top room, etc.) that would wreak havoc if they were sorted by simple center of polygon in a non-portal engine. Note, at the end of the traversal, for those distant portals at the top of the stairs, where only couple vertical scanlines are visible, that only those particular scanlines are rasterized. Nothing is wasted, yet it handles such complex case with ease. Brutal Elegance |
|
23 October 2023, 22:26 | #3510 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,483
|
|
24 October 2023, 09:34 | #3511 |
Amiga Games Database
Join Date: Jun 2006
Location: South West England
Posts: 1,291
|
|
25 October 2023, 23:48 | #3512 |
Registered User
Join Date: Oct 2020
Location: Bicester
Posts: 2,023
|
at some point I will have a look at the latest stuff but, work and home life is a little manic at the mo.
not sure I could offer much, but a fresh set of eyes mind. |
26 October 2023, 02:08 | #3513 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,483
|
Busy also. I get bursts of time to look at stuff.
|
27 October 2023, 14:03 | #3514 | |
Registered User
Join Date: Dec 2019
Location: North Dakota
Posts: 741
|
Quote:
The front-to-back rasterizer is just awesome - there's no overdraw of invisible walls (that I can tell). I was worried how would it work with the recursion - say when a room through which you can see into 4 other rooms pops into view, but portal handles that case extremely elegantly (by actually avoiding recursion in the first place!). Just one simple visibility check for the portal XPOS bounds, and if the portal is out of screen, none of the other checks for other connected rooms happen! Which is obvious, when you think about it - it's front-to-back after all. I just spent so much time working with back-to-front algorithms in past, that my brain has been hardwired for Z-sorting, this just blows my mind Another amazing thing, that just happened to be a by-product of the design, is a backface culling. Since the vertices are in clock-wise order, a simple condition (xp1 < xp2) is enough to determine backface culling! And, of course, if you see only 6 pixels wide strip of the 600-px long wall through the portal, you only render those 6 pixels (not 600). And there's no BSP cluster*uckery! And you can adjust the 3D mesh of rooms real-time without the offline pre-processing! You could link windows to outer space or closet doors to caves - there's no real-world limitations - each portal is a separate entity that doesn't have to fit withint the same world-space bounds (as in a regular level editor). I know you are enjoying your hex hacking, but this is waaaay more fun Just scrap the whole old component and rewrite new one in C |
|
28 October 2023, 02:46 | #3515 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,483
|
So, hex hacking isn't just for masochistic kicks, there are still countless unnamed immediate structure offsets, weirdly named ad-hoc identifiers, pointers to pointers, global state and undocumented data in the level files that needs a light shining on it. Have a look at the old source folder to see whT I mean.
While the traversal and rendering code is relatively isolated, I don't think it's completely trivial to replace it just yet - there will be all kinds of screws and bits and pieces left over. Once it's tidied up enough, we can think about replacing it, if that becomes necessary |
28 October 2023, 03:02 | #3516 |
Registered User
Join Date: Apr 2014
Location: Hemet/USA
Posts: 50
|
Excellent Job
|
28 October 2023, 03:33 | #3517 |
Registered User
Join Date: Apr 2014
Location: Hemet/USA
Posts: 50
|
Awesome
|
28 October 2023, 15:02 | #3518 | |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,483
|
@VladR
Quote:
This is why the precalculate PVS data that says which zones are theoretically visible from the current zone is still important. You only need to transform those before testing against your portal algorithm. |
|
29 October 2023, 12:47 | #3519 | |
Registered User
Join Date: Dec 2019
Location: North Dakota
Posts: 741
|
Quote:
Depending on how much time you have, there's many solutions for this, here's just first 5 from the top of my head: 1. [1 hour] Manhattan Distance check Code:
foreach (sector S in LevelSectors) if (Distance (S.Center) < ThresholdDistance) PVS.AddIfNotPresent (S.SectorIndex) 2. [2-4 hours] X-levels deep Node traversal (Breadth-First Search)
3. [1 day] Quadtree
|
|
29 October 2023, 21:15 | #3520 | |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,483
|
You know where the repo is. Now git forking!
Quote:
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Alien Breed 3D II The Killing Grounds RTG patch | Angus | Retrogaming General Discussion | 63 | 14 December 2022 15:20 |
Alien Breed & Alien Breed '92: SE - delay when picking up items / opening doors | Ian | support.WinUAE | 16 | 23 December 2016 15:50 |
Alien Breed 3D II : The Killing Grounds code booklet | alexh | support.Games | 19 | 10 October 2012 22:17 |
Alien Breed 3D 2 - The Killing Grounds | Ironclaw | support.Games | 12 | 13 September 2005 13:07 |
HD Version of Alien Breed I ? | Kintaro | request.Old Rare Games | 20 | 31 July 2003 10:48 |
|
|