English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General > Coders. Releases

 
 
Thread Tools
Old 05 May 2023, 22:20   #2461
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,260
Quote:
Originally Posted by grond View Post
Storing row pixels together only makes sense with mip-mapping where the probability is high that the next texel will be one of the two subsequent ones. Storing rows in one set implies shifting and masking which wastes precious clock cycles per pixel.
The current implementation is clearly a memory saving device. The inner loops of wall and bitmap drawing render vertical pixel strips that read successive words of the texture using one of three custom sets of code depending on which packed 5-bit texel is needed.

The code would be a lot simpler if this was dispensed with and we just used 1 byte per pixel and allow walls to use the whole palette.

To gain performance with large textures at a distance, we need mip mapping. However, due to the way the columnar rendering works, you'll only get a performance increase by using vertically halved MIP maps. Horizontal reduction doesn't help performance as much but it could definitely improve visual quality as you would reduce moiré and aliasing artefacts. However due to the palette based rendering you would likely want to precompute all mip maps to ensure they are good.

One thing I really like the idea of is computing the shade table without mapping back to the palette and just having RGB values that can be rendered to an RTG display. There are 21 brightness levels, 256 basic colours, allowing for over 5000 colours. Direct render to RGB16 is probably within reach of 040/060.
Karlos is offline  
Old 06 May 2023, 11:41   #2462
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,260
@pipper

Regarding C, I was thinking about coming at the problem from the opposite direction. For example, writing a self contained C module for video. This could assume the responsibility for opening the screen, flipping buffers and transferring the fast buffer to the display. It could also collect idcmp events and all that stuff, in theory, but the main impetus is for a clean room reimplementation of the display logic so that RTG can be fitted easily.

From the assembler side it would have very simple call hooks that work the same whether you are on an AGA/C2P screen or an 8-bit RTG one.

Something similar could be done for audio, allowing AHI and proper audio mixing perhaps.
Karlos is offline  
Old 06 May 2023, 12:01   #2463
vroom6sri
Registered User
 
Join Date: Sep 2005
Location: Peterborough
Age: 47
Posts: 849
Is there a new engine file and/or level designs to test? I’ve got some spare time for a change!
vroom6sri is offline  
Old 06 May 2023, 12:29   #2464
Jacques
Registered User
 
Jacques's Avatar
 
Join Date: Oct 2013
Location: Wrocław, Poland
Posts: 202
Quote:
Originally Posted by abu_the_monkey View Post
a .lha of the latest build from main

includes both a dev and release version, and a readme.

Thanks! Would it be possible to add a description of new keyboard functions to the future readme files, please?
Jacques is offline  
Old 06 May 2023, 12:36   #2465
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,260
Quote:
Originally Posted by vroom6sri View Post
Is there a new engine file and/or level designs to test? I’ve got some spare time for a change!
The level reworking is an ongoing thing in a branch. I'm only halfway through getting rid of a pair of wall textures that I wanted to free up.
Karlos is offline  
Old 08 May 2023, 01:46   #2466
amipal
Registered User
 
amipal's Avatar
 
Join Date: Jun 2019
Location: Saltdean, United Kingdom
Posts: 146
Quote:
Originally Posted by vroom6sri View Post
Is there a new engine file and/or level designs to test? I’ve got some spare time for a change!
See post https://eab.abime.net/showpost.php?p...postcount=2449
amipal is offline  
Old 08 May 2023, 01:51   #2467
abu_the_monkey
Registered User
 
Join Date: Oct 2020
Location: Bicester
Posts: 1,988
Quote:
Originally Posted by amipal View Post
and here for a (wip) reimagined version of TKG by Karlos

https://github.com/0xABADCAFE/karlos-tkg/tree/main

and the thread for it here

https://eab.abime.net/showthread.php?t=111637

Last edited by abu_the_monkey; 08 May 2023 at 03:41.
abu_the_monkey is offline  
Old 10 May 2023, 02:35   #2468
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,260
I've been having a look at the wall rendering code again, trying to make a bit more sense about a few things. I can't be sure just yet, but I think the lack of dithering on Gouraud shaded walls might be an unintentional defect and not as I initially assumed a performance trade off. If that's true, then fixing it could result in some overall improvement to the render quality, especially where complex lighting arrangements are in effect.
Karlos is offline  
Old 11 May 2023, 08:19   #2469
pipper
Registered User
 
Join Date: Jul 2017
Location: San Jose
Posts: 667
I made some progress with the C migration stuff. PoC is here
https://github.com/mheyer32/alienbre...e/migrate_to_c
(moving the screen allocation to C)
pipper is offline  
Old 11 May 2023, 09:01   #2470
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,260
Quote:
Originally Posted by pipper View Post
I made some progress with the C migration stuff. PoC is here
https://github.com/mheyer32/alienbre...e/migrate_to_c
(moving the screen allocation to C)
Looking good! Any unintended side effects or issues?

There are a bunch of already refactored functions for system setu and IO that could be moved to C too.
Karlos is offline  
Old 11 May 2023, 09:03   #2471
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,260
It goes without saying that moving the display setup to C should simplify RTG support
Karlos is offline  
Old 11 May 2023, 09:15   #2472
pipper
Registered User
 
Join Date: Jul 2017
Location: San Jose
Posts: 667
I didn’t observe any negative consequences. But I didn’t do a lot of testing either.
Making it so that assembly calls into C function is easy. The other way around we need to be more careful (in ab3d functions generally don’t care much about saving and restoring registers)But maybe some inline assembly to declare “all registers clobbered” will be enough to make the compiler save registers before calling into assembly. We’ll see. I’ll try to pull more stuff over in the next few days.
pipper is offline  
Old 11 May 2023, 10:37   #2473
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,260
Yeah It's even worse than not saving and restoring registers, there are quasi-global registers that contain values that span across multiple calls. Once or twice I've observed that the traditionally volatile registers need to be preserved too.
Karlos is offline  
Old 11 May 2023, 10:45   #2474
daver
Registered User
 
Join Date: Apr 2023
Location: piteå/sverige
Posts: 12
Amazing work ! want to test it on my a4000 with 3660 @ 50mhz, witch files do i need and how do i install it ?
daver is offline  
Old 11 May 2023, 11:01   #2475
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,260
Quote:
Originally Posted by daver View Post
Amazing work ! want to test it on my a4000 with 3660 @ 50mhz, witch files do i need and how do i install it ?
If you have the original game, you just need the replacement engine files from here https://eab.abime.net/showpost.php?p...postcount=2449
Karlos is offline  
Old 11 May 2023, 21:44   #2476
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,260
I've not really done much engine work lately. I've been leveraging the last few bugfixes to tart up my mod a bit
Karlos is offline  
Old 11 May 2023, 22:16   #2477
daver
Registered User
 
Join Date: Apr 2023
Location: piteå/sverige
Posts: 12
no sorry i have the whdload only. always wonder why it never was ported to ppc but your work have made it playable on 68ks
daver is offline  
Old 11 May 2023, 22:23   #2478
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,260
Quote:
Originally Posted by daver View Post
no sorry i have the whdload only. always wonder why it never was ported to ppc but your work have made it playable on 68ks
It was never ported to PPC because it was entirely written in 68K assembler. Except for the editor tools, which were written in AMOS.

However, porting the display and audio components to C, on their own, would pretty much allow for an RTG/AHI version that would run on PPC under emulation.

Last edited by Karlos; 11 May 2023 at 23:30.
Karlos is offline  
Old 12 May 2023, 09:23   #2479
ZyBeR
Registered User
 
Join Date: Dec 2022
Location: Internet
Posts: 26
How much, if any negative impact on performance can we expect porting the code to C would have? I would guess todays compilers generate more optimized binaries compared with what was available when this game originally was developed.

From my understanding by just following the discussions here the original assembly code have room for optimization. If we just play with the thought and compare that with a highly optimized C version, compiled with the tools available back then, how much did they gain by using assembly?
ZyBeR is offline  
Old 12 May 2023, 09:58   #2480
pipper
Registered User
 
Join Date: Jul 2017
Location: San Jose
Posts: 667
The goal is should be to not compromise on speed. Karlos invested lot of time in shaving off cycles - these efforts will not be wasted. At first I’d like to mostly to replace higher level functions like screen setup, system setup etc which are often on-offs. I imagine moving up the outer most game loop to C would also work. The innermost renderloops will very likely stay assembly.
Having the C environment available allows for easier prototyping and testing. I don’t know if anyone has really appetite to move everything to C. But if you did, the game could then also be ported to other platforms… but let’s focus on RTG first.
pipper is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 13:19.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.16234 seconds with 13 queries