English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 26 March 2024, 20:05   #201
vulture
Registered User
 
Join Date: Oct 2007
Location: Athens , Greece
Posts: 1,858
You could still include those cut back options for lower speced systems, regardless of what gains further optimisations may yield, if it's not too much hassle of course.

Quote:
Originally Posted by reassembler View Post
I think we've got enough speed reports now. It runs on a variety of setups, which is the news I needed. I've fixed the lock-up bug also in the codebase.



It's a fair question and we won't truly know until all features are implemented.

The most significant performance drains are already in:
- Sprite Scaling (still some performance improvements to be found I suspect)
- C2P (marginal improvements based on target hardware and algorithm)
- Road Rendering (pretty optimized now, but you never know)

The remaining game logic is relatively light. Rendering the Ferrari won't be significant. Rendering the traffic slightly more so, as it needs to sprite scale.

However, even if I don't speed things up further by ingenuity, there are obvious areas to gain a 'cheap' increase in speed.

- Reduce scenery (could easily speed dense levels up by 50% overall)
- Remove the smaller tile layer which needs to be mixed transparently (or simply blit it over the background tile layer and have them both scroll at the same speed)
- Toggle Shadows
- Reduce the display height. Simply not rendering the top 32 pixels in a C2P fashion where the HUD lives could yield a decent increase.
- Insert your idea here.

I quite enjoy optimizing code though. So my preference is always to optimize as much as possible rather than immediately reach for the scissors. It's not like I'm employed by US Gold and have to get this out for a deadline!

I'm unsure what drain a MOD player and effects mixing will have at this stage, having not coded for the Amiga previously. All part of the adventure.
vulture is offline  
Old 26 March 2024, 20:34   #202
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,204
Quote:
Originally Posted by reassembler View Post
Yes these sprite ideas have potential. The Arcade hardware (and this port) use ~5 pre-computed sizes to work from in fact. It's not simply one source image scaled up and down.

For the sprites - I actually think one decent optimization would be to not worry about x-clipping the sprites and making the chunky buffer wider with padding either side. It may sound counter-intuitive, but often the dumb approaches can work as well as the intellectual ones when looking for speed increases. Sometimes it's just faster to write data no matter what.

I haven't really delved into the C2P algorithms deep enough to understand whether this is trivial, or would incur a performance decrease - if they expect the chunky data to be contiguous for example and an equal size (well bitplane wise) to the target bitplanes.

If anyone out there has coded C2P algorithms in detail and is happy to talk me through it in detail via e-mail and answer dumb questions, drop me a PM.
I won't claim to be a C2P expert, but feel free to ask questions here or in DM (or via e-mail, get it from there).
But basically you're always doing it on 32 aligned pixels at once (so you end up with 8 long words of planar data). This is still good and relevant: https://amycoders.org/sources/c2ptut.html
For 8-bit screens You need 5 (log2(32)) passes to do it, and the blitter assisted onces are called c3b1 because they do 3 of the passes on the CPU and do one combined pass that handles 2 with the blitter (it's slightly more complicated, but that's the idea)

This has been optimized to death, so only substantive improvement is overlapping chipmem stores with other non-C2P computations (and I think this is only useful on 060+, but have not checked). It is not trivial though, as you're very limited in both the amount of instructions and what you can do (no cache misses for example). (I experimented with it a while back, and while it works it's not really generally useful: https://eab.abime.net/showthread.php?t=111352)


Don't think C2P optimizations are where you want look ATM, but since I don't know the engine, maybe there are opportunities I don't know about.
paraj is offline  
Old 27 March 2024, 00:05   #203
reassembler
Registered User
 
reassembler's Avatar
 
Join Date: Oct 2023
Location: London, UK
Posts: 124
paraj - That's a useful summary. When I next get back to looking at C2P related stuff, I'll give you a shout!
reassembler is offline  
Old 27 March 2024, 08:19   #204
alexh
Thalion Webshrine
 
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 14,461
Quote:
Originally Posted by reassembler View Post
I'm unsure what drain a MOD player and effects mixing will have at this stage, having not coded for the Amiga previously. All part of the adventure.
I would recommend you look at LSP (light speed player) a relatively new module player for Amiga heavily optimised for speed, size or both. Significant runtime performance improvement over classic mod replay routines. Developed by Leonard of Oxygene it was created to help add music to record breaking demo attempts when CPU power was needed for the main effects
alexh is offline  
Old 27 March 2024, 09:03   #205
tomcat666
Retro Freak
 
tomcat666's Avatar
 
Join Date: Nov 2001
Location: Slovenia
Age: 51
Posts: 1,665
Quote:
Originally Posted by alexh View Post
I would recommend you look at LSP (light speed player) a relatively new module player for Amiga heavily optimised for speed, size or both. Significant runtime performance improvement over classic mod replay routines. Developed by Leonard of Oxygene it was created to help add music to record breaking demo attempts when CPU power was needed for the main effects
Don't think that natively supports playing of SFX at the same time though. It is more meant for demo productions.
I think https://aminet.net/package/mus/play/ptplayer would be more suitable for what is needed here, or ?
tomcat666 is offline  
Old 27 March 2024, 09:20   #206
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,368
ptplayer is very good for sfx+music. However, it does not support varying engine noise, only looped/not looped.

I would drop engine noise altogether as it wastes 1 channel. Offer music+sfx or engine+sfx option like it was done for Supercars 2 AGA (which uses ptplayer unless engine noise is enabled)
jotd is offline  
Old 27 March 2024, 10:18   #207
khph_re
Registered User
 
Join Date: Feb 2008
Location: Northampton/UK
Posts: 529
Roondar's sound mixer might be useful:

"mixing four samples onto a single channel at 11KHz takes only 3.7% CPU time on a 7MHz 68000 without Fast RAM"


https://eab.abime.net/showthread.php...ht=sound+mixer
khph_re is offline  
Old 27 March 2024, 10:25   #208
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,039
Quote:
Originally Posted by tomcat666 View Post
Don't think that natively supports playing of SFX at the same time though. It is more meant for demo productions.
I think https://aminet.net/package/mus/play/ptplayer would be more suitable for what is needed here, or ?
LSP needs only 2 Amiga channels for playing converted MOD, if I remember right.
Then 2 channels are free for SFX.
If Roondar's mixing routine will be used, then up to 8 mixed SFX can be played.
For me LSP with or without mixing routine for SFX is optimal setup for new Amiga game (port) for fast handling music with SFX.
Don_Adan is offline  
Old 27 March 2024, 10:33   #209
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,436
Quote:
Originally Posted by khph_re View Post
Roondar's sound mixer might be useful:

"mixing four samples onto a single channel at 11KHz takes only 3.7% CPU time on a 7MHz 68000 without Fast RAM"

https://eab.abime.net/showthread.php...ht=sound+mixer
Thanks for the mention

To add to this, I did test the mixer on much faster CPU's as well. 22KHz playback, single channel, four samples takes around 0,8% CPU on a 030/50MHz.

Do note however that my mixer only supports pitch changing through a plugin routine and that does cost quite some CPU time* (~5% per sample that has its pitch changed on the same 030/50MHz, assuming 22KHz playback).

*) I misread my own performance data table, which had plugin results per 4 samples having the plugin active instead of one . It's actually ~1,35% CPU time per sample that has its pitch changed on the same 030/050MHz, assuming 22KHz playback

Quote:
Originally Posted by Don_Adan View Post
LSP needs only 2 Amiga channels for playing converted MOD, if I remember right.
Then 2 channels are free for SFX.
If Roondar's mixing routine will be used, then up to 8 mixed SFX can be played.
For me LSP with or without mixing routine for SFX is optimal setup for new Amiga game (port) for fast handling music with SFX.
I can confirm that LSP uses as many channels to play back music as the original MOD did. It is really, really fast though, so well worth the use!

Last edited by roondar; 27 March 2024 at 10:51.
roondar is offline  
Old 27 March 2024, 10:34   #210
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,039
Quote:
Originally Posted by reassembler View Post
paraj - That's a useful summary. When I next get back to looking at C2P related stuff, I'll give you a shout!
I think that You can use external c2p routine like for Gloom game.
File to load (stored in main game dir) can be called "default.c2p".
Others c2p routines can be stored inside "c2p/" subdir.
Amiga user can copy/rename c2p which want to tests.
F.e. Akiko plus fast ram, is fast enough for handling c2p, then CD32 with fast ram can be enough. Your game needs fast memory.
And of course Paraj or other coder can wrote own version of c2p routine for tests.
Don_Adan is offline  
Old 28 March 2024, 07:22   #211
DanyPPC
Registered User
 
Join Date: Dec 2016
Location: Italy
Posts: 769
On Aminet there is also a new c2p library:
https://aminet.net/package/dev/misc/c2plib
DanyPPC is offline  
Old 28 March 2024, 21:24   #212
vroom6sri
Registered User
 
Join Date: Sep 2005
Location: Peterborough
Age: 47
Posts: 855
Quote:
Originally Posted by DanyPPC View Post
On Aminet there is also a new c2p library:
https://aminet.net/package/dev/misc/c2plib
I've tried reading through the documentation but it is way beyond me. Is this aimed at developers rather than users? If it is for users please can anyone dumb it down enough for me to understand how to try out this new C2P library in games like aDoom and Gloom?
vroom6sri is offline  
Old 29 March 2024, 06:41   #213
DanyPPC
Registered User
 
Join Date: Dec 2016
Location: Italy
Posts: 769
I think games must be updated to support the new library.
DanyPPC is offline  
Old 29 March 2024, 12:18   #214
VladR
Registered User
 
Join Date: Dec 2019
Location: North Dakota
Posts: 741
Quote:
Originally Posted by vroom6sri View Post
I've tried reading through the documentation but it is way beyond me. Is this aimed at developers rather than users? If it is for users please can anyone dumb it down enough for me to understand how to try out this new C2P library in games like aDoom and Gloom?
It is absolutely aimed at developers. You can't do **** without having the source code of the game and being able to recompile it after replacing the current C2P routine with the new one.
VladR is offline  
Old 30 March 2024, 14:05   #215
robxbl69
Registered User
 
Join Date: Oct 2021
Location: Norfolk
Posts: 4
Crashed (locked up the Amiga) when I tried to start from my normal workbench, but that could be anything from RTG to Network Stack causing issues. A quick reboot into minimal shell start-up (as I use for demo's and most games and worked fine).

A4000 with CyberStorm Mk2 060 + 68882 @ 50MHz, 2MB chip (obviously) and 366.5MB of available fast ram. Amiga OS 3.2.2.1.

Logic 20
Road BG 4/5
Road FG 2B/2C
Tiles 3E/3F
Sprites 2EF...2F5 (lots of flickering)
C2P E6/7
VBlanks 3

Runs really fast

Great work...
robxbl69 is offline  
Old 30 March 2024, 15:23   #216
vroom6sri
Registered User
 
Join Date: Sep 2005
Location: Peterborough
Age: 47
Posts: 855
Quote:
Originally Posted by VladR View Post
It is absolutely aimed at developers. You can't do **** without having the source code of the game and being able to recompile it after replacing the current C2P routine with the new one.
Thanks for clarifying.
vroom6sri is offline  
Old 30 March 2024, 15:45   #217
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,368
if the game runs good on classic amigas even if it needs 68040 or 68060 that's already an achievement. We've been stuck with super-slow MAME for too long and even PacMan is unplayable on a 68060 on MAME, not sure RTG help at least not all cards are fast, Pixel64 was not.
jotd is offline  
Old 31 March 2024, 18:56   #218
mrupp
Registered User
 
mrupp's Avatar
 
Join Date: Jun 2019
Location: St.Gallen, Switzerland
Posts: 105
Quote:
Originally Posted by jotd View Post
if the game runs good on classic amigas even if it needs 68040 or 68060 that's already an achievement. We've been stuck with super-slow MAME for too long and even PacMan is unplayable on a 68060 on MAME, not sure RTG help at least not all cards are fast, Pixel64 was not.
I apologize if this is slightly offtopic, but at least this is still OutRun related:
Do we have a MAME 68k version that supports OutRun? I found out it needs MAME 0.36b2, but on Aminet the latest version is 0.35.12 (mame060.lha) and I tried that one and it doesn't run OutRun (of course). Apparently, there's supposed to be a v0.60, but I couldn't find any working links for downloading. Does somebody know a working link or could upload v0.60 to the Zone?
mrupp is offline  
Old 31 March 2024, 23:04   #219
tomcat666
Retro Freak
 
tomcat666's Avatar
 
Join Date: Nov 2001
Location: Slovenia
Age: 51
Posts: 1,665
Quote:
Originally Posted by mrupp View Post
I apologize if this is slightly offtopic, but at least this is still OutRun related:
Do we have a MAME 68k version that supports OutRun? I found out it needs MAME 0.36b2, but on Aminet the latest version is 0.35.12 (mame060.lha) and I tried that one and it doesn't run OutRun (of course). Apparently, there's supposed to be a v0.60, but I couldn't find any working links for downloading. Does somebody know a working link or could upload v0.60 to the Zone?
There is a mame 0.60 , but actually it is 0.37 version. It does run OutRun, unfortunetly it still has minor gfx glitches (sprites shifted a bit, shadows not transparent, etc.) and this mame only opens 16bit screens (even though it has a DEPTH parameter which even when set to 8 opens 16 bit screens) so it seems its RTG only. In the zone.
With pistorm32 2.2ghz you get "smooth" gameplay with frameskip 2.
tomcat666 is offline  
Old 01 April 2024, 20:18   #220
Cris1997XX
Registered User
 
Join Date: Oct 2022
Location: Roma
Posts: 346
I'm not exactly a programmer, so I'm not sure if my words make any sense. But still...would it be possible to use sprites for the HUD in order to avoid straining the CPU even further? Maybe some blitter objects for things like cars, or simply just the road stripes. Otherwise sacrificing a few pixels of resolution might also work
Cris1997XX 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
Outrun AGA agermose project.Amiga Game Factory 401 10 June 2024 17:08
Better Outrun port for Amiga tekopaa Retrogaming General Discussion 399 14 April 2022 17:56
Outrun adfs macce2 request.Old Rare Games 3 18 April 2021 21:22
would you like to have an Outrun like for Aga? sandruzzo Retrogaming General Discussion 50 30 January 2013 12:03
Aweb: New APL 3.5Beta AOS4 PPC code + Milestone: KHTML porting started Paul News 0 05 November 2004 11:21

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 00:42.

Top

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