![]() |
![]() |
#1 |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 688
|
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! |
![]() |
![]() |
#2 |
Guru Meditating
Join Date: Jun 2014
Location: England
Posts: 2,367
|
Amazing work!
|
![]() |
![]() |
#3 |
Thalion Webshrine
Join Date: Jan 2004
Location: Oxford
Posts: 14,631
|
Great work. Does it make binary identical executable files to the commercial version?
|
![]() |
![]() |
#4 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,445
|
just GREAT!!
as 99% of game source code remains private or is lost... |
![]() |
![]() |
#5 | |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 688
|
Quote:
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. |
|
![]() |
![]() |
#6 |
Thalion Webshrine
Join Date: Jan 2004
Location: Oxford
Posts: 14,631
|
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. |
![]() |
![]() |
#7 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,445
|
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. |
![]() |
![]() |
#8 |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 688
|
@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... |
![]() |
![]() |
#9 | |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 688
|
Quote:
|
|
![]() |
![]() |
#10 | |
Global Moderator
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 32,517
|
Quote:
|
|
![]() |
![]() |
#11 |
Global Moderator
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 32,517
|
Ah, okay. I thought that https://github.com/Pyrdacor/Ambermoo...rseEngineering contained the source code, but I don't understand enough about it
![]() |
![]() |
![]() |
#12 | |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,445
|
Quote:
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. |
|
![]() |
![]() |
#13 |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,301
|
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 ![]() |
![]() |
![]() |
#14 |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 688
|
NEWCHUNKYTEL very likely implements the “teleporting shimmer effect” which in game looks like a distorted TV signal
|
![]() |
![]() |
#15 | |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,301
|
Quote:
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 Last edited by paraj; 02 July 2022 at 19:19. |
|
![]() |
![]() |
#16 |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 688
|
I updated the source to use Kalm's 040/060 routine for the fullscreen C2P. Fullscreen also now drops the left and right borders.
|
![]() |
![]() |
#17 |
Registered User
Join Date: Aug 2005
Location: Skarabörg, Sweden
Age: 45
Posts: 1,038
|
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 |
![]() |
![]() |
#18 |
Registered User
Join Date: Jul 2017
Location: San Jose
Posts: 688
|
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. |
![]() |
![]() |
#19 | |
Registered User
Join Date: Aug 2005
Location: Skarabörg, Sweden
Age: 45
Posts: 1,038
|
Quote:
|
|
![]() |
![]() |
#20 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,464
|
Cool stuff, thanks OP
![]() |
![]() |
Currently Active Users Viewing This Thread: 9 (0 members and 9 guests) | |
Thread Tools | |
![]() |
||||
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 |
|
|