English Amiga Board


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

 
 
Thread Tools
Old 07 November 2023, 20:07   #1
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,105
Breathless

Prompted by a request from Dunny to make Breathless run faster on pistorm, I've picked up the torch from pipper (https://eab.abime.net/showthread.php?t=103741) and replaced the C2P routines with more modern ones (from Kalms) done a few bugfixes etc.


In the zone is Breathless_20231107.zip that you should be able to unzip and use without doing anything other than the usual (protect xxx +E stuff). Use the 060 version if you have a normal 060 (with FPU), LC060 if you have an 060 without FPU, and the last version otherwise.


Press F8 to show FPS (times 100), F9 to give all weapons/items/health, F10 to toggle invincibility, 8/9 to skip arena/world.
Source code is available here: https://github.com/mras0/Breathless/ (based on pipper's work, again based on http://aminet.net/game/shoot/Breathless-1996-Source.zip)

On the (maybe) TODO list:
- Mouselook
- RTG
- Limit enemy movement to 25pfs?
paraj is offline  
Old 07 November 2023, 21:08   #2
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,197
Great work again! Does it run faster on 68060 too?
jotd is offline  
Old 07 November 2023, 21:21   #3
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,105
Quote:
Originally Posted by jotd View Post
Great work again! Does it run faster on 68060 too?
Of course Speed up is more like 5-frame (10 fps) to 3-frame (17 fps) on 060/50 fpu rather than to 50 fps though. Might be better on something like overclocked TF1260 w/o FPU which is why I included no-fpu 060 version.
paraj is offline  
Old 07 November 2023, 22:13   #4
Aardvark
Registered User
 
Join Date: Jan 2019
Location: Finland
Posts: 635
Comparison video on TF1260 100mhz. Huge performance boost, the old version was only really playable in 1x2 pixel mode.
[ Show youtube player ]
Aardvark is offline  
Old 08 November 2023, 07:15   #5
TCD
HOL/FTP busy bee
 
TCD's Avatar
 
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 31,606
Great work paraj Also thank you for the video Aardvark It looks really a lot smoother.
TCD is offline  
Old 08 November 2023, 08:09   #6
alexh
Thalion Webshrine
 
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 14,354
Amazing work. As always.
alexh is offline  
Old 08 November 2023, 10:20   #7
pipper
Registered User
 
Join Date: Jul 2017
Location: San Jose
Posts: 653
Great example of what could have been. The engine was certainly capable, but the game is typical “programmers art”. The textures are repetitive and boring grey, the enemies are a blurry mess. If you look at Dread/Grind and see how much care is put into choosing the palette, textures and enemy sprites, one can only imagine how good Breathless could have been…
And having the gun literally shoot bullets - facepalm…

Excellent work, though, Paraj!!
pipper is offline  
Old 08 November 2023, 10:27   #8
derSammler
Senior Member
 
Join Date: Jun 2001
Location: Germany
Posts: 1,648
From HOL:
Quote:
** BREATHLESS 3D ENGINE V1.1 68060 improves the sluggish speed of the graphics engine on 060 machines (dir: game/patch/Breathless060.lha). The sluggishness of the original is due to the 68060 being unable to directly execute 64bit divisions and multiplications, which are instructions that the 3D engine uses a lot.
Given the game is from 1995, they probably had high intentions but no way of doing it on a dying platform.
derSammler is offline  
Old 08 November 2023, 14:01   #9
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,165
What does it use the long divisions for? If it's primarily for geometry then I'm sure alternatives are possible. Even a table of FP reciprocals and a floating point multiplication might be faster.
Karlos is online now  
Old 08 November 2023, 14:05   #10
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,165
Quote:
Originally Posted by pipper View Post
Great example of what could have been. The engine was certainly capable, but the game is typical “programmers art”. The textures are repetitive and boring grey, the enemies are a blurry mess. If you look at Dread/Grind and see how much care is put into choosing the palette, textures and enemy sprites, one can only imagine how good Breathless could have been…
And having the gun literally shoot bullets - facepalm
Is it moddable? I imagine lots of grey and was chosen to make the shading easier to do. I felt like TKG has the same problem. The same 3 big metal tile textures are used over and over and over and over and over...
Karlos is online now  
Old 08 November 2023, 14:06   #11
vroom6sri
Registered User
 
Join Date: Sep 2005
Location: Peterborough
Age: 47
Posts: 845
Thanks so much to you and others on here that have the knowledge and skills to develop/improve software for us users. It's so generous of you.

I notice you say "use the last version" if don't have an 060. Does that mean the file just called "Breathless" in the zip file you zoned and has that non-060 version been given any performance tweaks?
vroom6sri is offline  
Old 08 November 2023, 14:28   #12
Dunny
Registered User
 
Dunny's Avatar
 
Join Date: Aug 2006
Location: Scunthorpe/United Kingdom
Posts: 1,994
Quote:
Originally Posted by vroom6sri View Post
Thanks so much to you and others on here that have the knowledge and skills to develop/improve software for us users. It's so generous of you.

I notice you say "use the last version" if don't have an 060. Does that mean the file just called "Breathless" in the zip file you zoned and has that non-060 version been given any performance tweaks?
The none-060 version has a new c2p routine baked in so should also be much faster for other Amigas. Give it a try and see!
Dunny is offline  
Old 08 November 2023, 14:35   #13
derSammler
Senior Member
 
Join Date: Jun 2001
Location: Germany
Posts: 1,648
Quote:
Originally Posted by Karlos View Post
If it's primarily for geometry then I'm sure alternatives are possible.
That's exactly what the Aminet update does: it removes the 64-bit stuff and uses alternatives.

From what I understand, that is an 060 issue only. The 040 can apparently do it in hardware.
derSammler is offline  
Old 08 November 2023, 14:38   #14
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,165
Quote:
Originally Posted by derSammler View Post
That's exactly what the Aminet update does: it removes the 64-bit stuff and uses alternatives.

From what I understand, that is an 060 issue only. The 040 can apparently do it in hardware.
Sure but division still sucks, whether it's done on hardware or not. Getting rid of a lot of it in TKG gave a conspicuous improvement on 060 (also on on 030 but the relative improvement is less there since the 060 has such fast multiplication compared to previous 68K)
Karlos is online now  
Old 08 November 2023, 16:42   #15
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,105
Thanks guys! The source code is pretty clean, so it wasn't too much work to replace the C2P routines since pipper had already done the work of getting it to assemble.
The plain "Breathless" executable doesn't have any performance tweaks other than using newer, CPU-only, C2P routines. If you don't have at least an 040 it might be slower than the original game though.

The game uses 16.16 fixpoint, which is why it relies on 64-bit math. The expensive divisions are only used in the raycasting part though. I'm sure it can be sped up, but I wanted to get a working version done first.

You should not believe everything you read on the internet. The main reason it's sluggish on fast machines is primarily because it uses a blitter-assisted C2P routine. A decent choice for the targeted machine (020+fast RAM), but it means that it's severely handicapped on 040+.
I suspect that whoever did the "060 optimized" version did not have access to a real 060 machine, as they dun goofed. The replacement routines (macros really) for multiplication are fine, but the division routine uses shift and subtract!! (https://github.com/mheyer32/Breathle...ulDiv64.i#L213). This takes >400 cycles/division which is much slower than simply letting 060.lib handled it (measured)!!

So what I did to speed it up further is to correct that mistake (LC060) and use the FPU when available for the 64-bit stuff (060 version). The latter is not much of a win for division, but gives quite a nice boost for multiplication. More speed-up could be gained by using the FPU even more. Maybe I'll look at that at some point. I also applied some quick microoptimizations to the rendering loops.
On my B1260/50Mhz raycast/render takes roughly 15/35ms for the plain version (i.e. letting 060.lib handle divs.l/muls.l), 10/30 for lc060 and 5/30 for 060 (i.e. with FPU). The original "060 optimized" routines uses 17/30... So they lose almost all performance gain with their shift-and-sub routine.
paraj is offline  
Old 08 November 2023, 16:54   #16
derSammler
Senior Member
 
Join Date: Jun 2001
Location: Germany
Posts: 1,648
Quote:
Originally Posted by paraj View Post
You should not believe everything you read on the internet.
True, but take note that this is from the mouth of the developers. HOL mirrored the text, but it is included in the update itself. See the full text here:

https://aminet.net/package/game/patch/Breathless060

Also, maybe the 060 libs at that time (early 1996) were not as good/fast as what we have today.
derSammler is offline  
Old 08 November 2023, 17:13   #17
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
@paraj so in the FPU case you convert 16.16 to ieee754 and use the fpu to multiply, then convert back to 16.16?
hooverphonique is offline  
Old 08 November 2023, 17:14   #18
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,105
Quote:
Originally Posted by derSammler View Post
True, but take note that this is from the mouth of the developers. HOL mirrored the text, but it is included in the update itself. See the full text here:

https://aminet.net/package/game/patch/Breathless060

Also, maybe the 060 libs at that time (early 1996) were not as good/fast as what we have today.

Quote:
This version of the engine doesn't use 64bit instructions and was developed without a 68060. I want to emphasize that this is NOT an optimized version for the 68060 microprocessor.
As I suspected. Not blaming the devs, they had no way of measuring or testing their code. Probably didn't even have the UM.


I don't know what the state of 060 libraries in 1996 were, but board makers would have had access to MC's ISP which uses "Algorithm D" from TAOCP, so there would be no excuse for them.


Still, the sluggish performance on 060 (and probably 040) and certainly on pistorm is due to the C2P, not 64-bit integer math.
paraj is offline  
Old 08 November 2023, 17:18   #19
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,105
Quote:
Originally Posted by hooverphonique View Post
@paraj so in the FPU case you convert 16.16 to ieee754 and use the fpu to multiply, then convert back to 16.16?
Something like that, it's a bit of a hack job for now. The devs were nice enough to convert all uses of 64-bit mul/div to macros for their 1.1 release, so it was easy to target.

Commit that changed it: https://github.com/mras0/Breathless/...7f0ba4034b8966
paraj is offline  
Old 08 November 2023, 17:32   #20
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,165
Does the game support RTG?
Karlos is online now  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Breathless Arnie support.Games 4 11 May 2015 00:44
Breathless 1.1? cracked AmigaNeverDie request.Old Rare Games 10 23 February 2011 11:40
Breathless problem djcasey support.Games 15 15 June 2010 22:21
Codes for Breathless Bad Mr Frosty support.Games 2 20 January 2004 08:50
Settings for Breathless? lordsnooty support.Games 1 25 July 2003 14:06

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 23:16.

Top

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