English Amiga Board


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

 
 
Thread Tools
Old 01 July 2022, 11:26   #1
pipper
Registered User

 
Join Date: Jul 2017
Location: San Jose
Posts: 479
Compileable version of Alien Breed 3D II - The Killing Grounds

Hi all,

I put a compileable version of Alien Breed 3D II - The Killing Grounds under:
https://github.com/mheyer32/alienbreed3d2
This may be the first time in 25 odd years that the code had been compiled into a working executable :-)
(With the notable exception of John Girvin's AB3D-RTG, also preserved here: https://github.com/mheyer32/ab3d-rtg )

The source is to be cross-compiled via vasm/vlink. Apart from making it run and changing the control scheme to AWSD+mouse I have not made any particular changes yet. Faster C2P, RTG, AHI, system friendly takeover & exit are all venues that should be explored, but I have very little time. Merge requests are welcome :-)
Happy hacking!
pipper is offline  
Old 01 July 2022, 11:37   #2
trixster
Guru Meditating

 
Join Date: Jun 2014
Location: England
Posts: 2,215
Amazing work!
trixster is offline  
Old 01 July 2022, 15:18   #3
alexh
Thalion Webshrine
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 13,396
Great work. Does it make binary identical executable files to the commercial version?
alexh is online now  
Old 01 July 2022, 17:41   #4
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 51
Posts: 6,737
just GREAT!!

as 99% of game source code remains private or is lost...
jotd is offline  
Old 01 July 2022, 20:03   #5
pipper
Registered User

 
Join Date: Jul 2017
Location: San Jose
Posts: 479
Quote:
Originally Posted by alexh View Post
Great work. Does it make binary identical executable files to the commercial version?

They are not binary identical, so don’t assume existing patches will work.
I removed all the scattered copy protection stuff and had to do some arm twisting to get the Load Game menu to work.
But from observed behavior, it looks like they at least behave the same.
I used Ghidra on the executable that came with the WHDLoad slave for TKG(I wish they had released the resourced/disassembled version!) and compared a few key functions - they were the same.

The original source archives contains multiple copies of the source folder - all in a different state of disarray. The source_4000/hires.a main source file is the one that I had most success in compiling and running. I don’t know if that is 100% the released version of the game, but it seems very very close.
pipper is offline  
Old 01 July 2022, 21:56   #6
alexh
Thalion Webshrine
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 13,396
It is a great job you've done and I hope you continue to tinker with it. There are coders on this forum that have "retired" that might be pursuaded to come forward to give suggestions if you're continuing.

I used to like playing this game on my A4000 + Picasso IV using the RTG Master patch but it was very buggy and crashed a lot but it was soooo much faster than AGA so the occaisional crash was not enough to put me off using it.
alexh is online now  
Old 02 July 2022, 00:27   #7
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 51
Posts: 6,737
looking at it quickly, there are still micro-optimizations that could be done, for instance here:

https://github.com/mheyer32/alienbre...ource/chunky.s

lsl #2,d2 => add d2,d2 (x2)

There are other examples. Maybe it could be even faster than it is.
jotd is offline  
Old 02 July 2022, 00:43   #8
pipper
Registered User

 
Join Date: Jul 2017
Location: San Jose
Posts: 479
@Alexh, you are actually the reason this release got this far :-D

I had shelved this project for years in a semi-compilable state, but I was always under the impression I need once specific file that was incbin'd into the source ("shadefile"), but missing from the source release. Now recently I followed a thread of yours where you were talking about how Ambermoon was completely resourced, disassembled and fixed up via Ghidra (btw, is this project open somewhere?). So I had the idea "maybe I can find that table and its size by disassembling the original executable and thus reconstruct the missing file?!" and started tinkering with Ghidra.
I slowly started matching up the source code with what I can see in Ghidra and eventually realized I don't even need this file - d'oh!

Older versions (I _think_ the ones based on the copper chunky rendering) may still need it.
Since the AB3D2 source release also contains the original AB3D source, it may be possible to get it to compile, too. It is missing quite a few media files, though (some vector objects).
I think that is what John Girvin did. I should probably take a look at his ab3d-rtg source first on how he achieved that.


This whole endeavor made me also play the game some more, in WinUAE, set to "fastest". Actually, when it plays fluently it is a good game and the lighting effects like "bullets lighting up walls and objects", "search lights on robots illuminating the environment" and the bumpmapping on the enemies start to shine (literally). Play it with headphones on and in a dark room and it becomes outright creepy.

But boy - the gameplay... It really shows that it got not much polishing. Repetitive non-sensical texturing, unfair enemy placement, being constantly short of ammo, nonsensical map layouts (that's supposed to be the insides of a spaceship??) really show more of "programmers art" than a game with an art direction.
Maybe one day people could create an "Alien Breed 3D II Remastered" were these issues are fixed...
pipper is offline  
Old 02 July 2022, 00:48   #9
pipper
Registered User

 
Join Date: Jul 2017
Location: San Jose
Posts: 479
Quote:
looking at it quickly, there are still micro-optimizations that could be done, for instance here:
I did not yet attempt to replace the C2P routine with a faster one (I read that the Kalms' ones are good/best?!) yet. From the source its evident that Andrew Clitheroe knew of and may have dabbled with multiple approaches. I do not know if the currently used routine is particularly good or bad...
pipper is offline  
Old 02 July 2022, 05:44   #10
TCD
Registered User

TCD's Avatar
 
Join Date: Sep 2006
Location: Germany
Age: 44
Posts: 25,609
Quote:
Originally Posted by pipper View Post
Now recently I followed a thread of yours where you were talking about how Ambermoon was completely resourced, disassembled and fixed up via Ghidra (btw, is this project open somewhere?).
It's here: https://github.com/Pyrdacor/Ambermoon
TCD is offline  
Old 02 July 2022, 10:12   #11
TCD
Registered User

TCD's Avatar
 
Join Date: Sep 2006
Location: Germany
Age: 44
Posts: 25,609
Quote:
Originally Posted by alexh View Post
The source code isn't in GitHub (I don't believe).
Ah, okay. I thought that https://github.com/Pyrdacor/Ambermoo...rseEngineering contained the source code, but I don't understand enough about it
TCD is offline  
Old 02 July 2022, 11:49   #12
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 51
Posts: 6,737
Quote:
Originally Posted by pipper View Post
I did not yet attempt to replace the C2P routine with a faster one (I read that the Kalms' ones are good/best?!) yet. From the source its evident that Andrew Clitheroe knew of and may have dabbled with multiple approaches. I do not know if the currently used routine is particularly good or bad...
Yes, the coder knows his stuff I'm not going to tell that he sucks because pulling a whole 3D game in asm is something, but in 2022 there are a lot of micro-optimizations that coders weren't aware of at the time

It's well established for instance that 2 add instructions are faster than one lsl #2 for instance.

My reasoning is: if the assembler doesn't optimize that (check the original disassembly to find out) and other stuff (non-PC relative addressing...), it means that if you optimize it manually + assemble with optimizations on + verbose to see what the assembler is actually optimizing, you may speed this up even more. Of course, always make sure that the code you're optimizing is actually called!! with breakpoints or just with "move.w #$F00,$DFF180" to create big flashes when the code is called. If the screen flashes all the time, you can bet that it's called a lot

On the other hand, I would not "replace the c2p routine by another one" because I'm pretty sure that inputs & outputs would need to be adapted. Non trivial task. Micro optimizations are trivial.

It's not because it's in assembly that it's fast. It can be made even faster with more work.
jotd is offline  
Old 02 July 2022, 18:50   #13
paraj
Registered User

 
Join Date: Feb 2017
Location: Denmark
Posts: 425
Had a look, and it doesn't look it would be that much effort to replace the C2P routines (assuming we're talking about ab3d2_source/chunky.s). All of the routines use more or less standard input/output formats. All of the routines read 8 chunky pixels and output 8 planar bytes at a time, so so extra parameter fiddling might be required (all optimized C2P expect to be able to output 32 pixels at a time).

NEWCHUNKY does a standard 1x1 c2p. DOUBWIDTHCHUNK does 2x1, but I think it uses the same buffer format as the 1x1 one (just doubling every other pixel), don't think this is what most 2x1's expect, but shouldn't be hard to adapt if you're OK with just doing a few unnecessary fast ram reads.

NEWCHUNKYTEL is a bit weird. It seems to use the table in "shimmerfile" as offsets into a chunky buffer before converting 8 pixels? Not sure what it's used for, and if it's critical for game speed that could take a bit more work. Looking at where CHUNKYTOPLANAR is called maybe it's only for transitions in which case it'd be easier to just leave it alone.

(Never played the game so I could be off )
paraj is offline  
Old 02 July 2022, 19:42   #14
pipper
Registered User

 
Join Date: Jul 2017
Location: San Jose
Posts: 479
NEWCHUNKYTEL very likely implements the “teleporting shimmer effect” which in game looks like a distorted TV signal
pipper is offline  
Old 02 July 2022, 20:13   #15
paraj
Registered User

 
Join Date: Feb 2017
Location: Denmark
Posts: 425
Quote:
Originally Posted by pipper View Post
NEWCHUNKYTEL very likely implements the “teleporting shimmer effect” which in game looks like a distorted TV signal
Makes sense, guess it's fine if that's kept slow then. Just "found" the gamefiles and had quick go at using Kalms' C2P by replacing NEWCHUNKY with:
Code:
    include c2p1x1_8_c5_040.s
NEWCHUNKY
    movem.l    d2-d7,-(a7)
    move.l  #320,d0
    move.l  #256,d1
    move.l  #0,d2
    move.l  #0,d3
    move.l  #320/8,d4
    move.l  #320*256/8,d5
    move.l  #320,d6
    jsr     c2p1x1_8_c5_040_init
    jsr     c2p1x1_8_c5_040
    movem.l    (a7)+,d2-d7
    rts
and miraculously it seems to work with very light testing. No idea if it'll actually work for all cases or whether it provides a speedup on a real amiga (haven't bothered testing on my 060), but in theory it should be quite a nice improvement (If you adapt it to the screen size).

Last edited by paraj; 02 July 2022 at 20:19.
paraj is offline  
Old 05 July 2022, 21:24   #16
pipper
Registered User

 
Join Date: Jul 2017
Location: San Jose
Posts: 479
I updated the source to use Kalm's 040/060 routine for the fullscreen C2P. Fullscreen also now drops the left and right borders.
pipper is offline  
Old 05 July 2022, 22:50   #17
fryguy
Registered User
 
Join Date: Aug 2005
Location: Hjo, Sweden
Age: 43
Posts: 944
Great work!

Something that would be really cool would be of it was possible to get the first AB3D to run in 1x1, but I suppose thats a lot for work. I felt that AB3DII was more of gfx demo than a game that was fun to play.

That said I still think its cool if you can improve the speed and other things of AB3DII too
fryguy is offline  
Old 05 July 2022, 23:10   #18
pipper
Registered User

 
Join Date: Jul 2017
Location: San Jose
Posts: 479
There is something like that out there already,“AB3D-RTG”. I have the sources (kindly provided by the original Author) uploaded to my GitHub page, but did not dive into it yet.
One possible way to achieve this would be to render to a 16bit RTG screen and then just write/translate the chunky copper values from 12 to 16 bit.
pipper is offline  
Old 06 July 2022, 09:50   #19
fryguy
Registered User
 
Join Date: Aug 2005
Location: Hjo, Sweden
Age: 43
Posts: 944
Quote:
Originally Posted by pipper View Post
There is something like that out there already,“AB3D-RTG”. I have the sources (kindly provided by the original Author) uploaded to my GitHub page, but did not dive into it yet.
One possible way to achieve this would be to render to a 16bit RTG screen and then just write/translate the chunky copper values from 12 to 16 bit.
That would be really awesome.
fryguy is offline  
Old 06 July 2022, 13:50   #20
roondar
Registered User

 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,263
Cool stuff, thanks OP
roondar is online now  
 


Currently Active Users Viewing This Thread: 3 (2 members and 1 guests)
BoozerDawg, Solo Kazuki
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Alien Breed 3D II The Killing Grounds RTG patch Angus Retrogaming General Discussion 62 07 July 2021 00:30
Alien Breed & Alien Breed '92: SE - delay when picking up items / opening doors Ian support.WinUAE 16 23 December 2016 16:50
Alien Breed 3D II : The Killing Grounds code booklet alexh support.Games 19 10 October 2012 23:17
Alien Breed 3D 2 - The Killing Grounds Ironclaw support.Games 12 13 September 2005 14:07
HD Version of Alien Breed I ? Kintaro request.Old Rare Games 20 31 July 2003 11: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 17:24.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Page generated in 0.11519 seconds with 14 queries