News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_DanyPPC

[CPC vs ZX] Game speed

Started by DanyPPC, 08:52, 19 February 25

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DanyPPC

Sorry if this object has already been treated, but I have a simple question:

Why CPC versions of ZX Spectrum games are a little slower ?

For example, Yesterday evening I played Flying Shark and it's slower than the ZX Spectrum version.

Thanks for your your time.
CPC 6128+ with C4CPC and Gotek HxC USB Drive Emulator

pelrun

#1
Because you have to write a lot more data to update a CPC pixel.

The spectrum can only have two colours in each character cell, because the graphics buffer is still monochrome. The CPC is full bitmapped colour, so each pixel can be anything. No "colour clash", but also updating a pixel requires writing 2 or 4x the number of bits.

Speccy ports don't take advantage of the better colour resolution, and they're hobbled by the need to spend more time updating pixels. And the programmers were rarely given the time or money to optimise the port, it was a case of "do the bare minimum to make it work and get the game out the door".

overange

Quote from: DanyPPC on 08:52, 19 February 25Sorry if this object has already been treated, but I have a simple question:
Why CPC versions of ZX Spectrum games are a little slower ?
For example, Yesterday evening I played Flying Shark and it's slower than the ZX Spectrum version.
Thanks for your your time.


Many Amstrad CPC games were essentially direct ports from the ZX Spectrum, rather than being optimized for the CPC's hardware. Since the Spectrum used a more straightforward memory architecture and screen layout, games designed for it didn't always run efficiently on the CPC. Instead of rewriting the code, developers often took shortcuts to save development time.

During the 8-bit era, the ZX Spectrum was often the primary development platform because of its popularity. The CPC was seen as a secondary platform, and developers didn't always take the time to optimize performance when porting games over.

If developers had taken more time to optimize CPC ports, they could have performed better, but tight deadlines and budget constraints usually led to simple, unoptimized conversions.

Current Usable Collection = 800XL / XE Remake / 1100 Drive / Sinclair ZX Spectrum 48k ( Rubber Key ) / Sinclair ZX Spectrum Harliquin 128k ( Rubber Key ) / Amstrad CPC6128 Plus / Amstrad GX4000 / Sega Master System / Sega Mega Drive / Nintendo DMG-01 Gameboy / Amiga CD32 / AMSTRAD MEGAPC 386SX and possibly the UKs largest Collection of Competition Pro Joysticks, so far 40 different variations and always looking for more

eto

Quote from: DanyPPC on 08:52, 19 February 25Why CPC versions of ZX Spectrum games are a little slower ?
There's a whole Wiki article dedicated to the problems of Speccy ports. I can highly recommend reading it: 

https://www.cpcwiki.eu/index.php/Speccy_Port

arnoldemu

Perhaps the following doc I made when I converted Mayhem might give an idea:

https://www.cpc-power.com/index.php?page=detail&onglet=notices&num=18884

It is heavy in detail but the main one is often there are more bytes to draw to the screen. It also highlights that I couldn't use the same approach in some places and had to re-write parts for the CPC (one of these is the HUD where the attribute bytes were changed to colour the HUD, here I had to draw more bytes for the CPCs representation.

The approach I took here is comparable to an independent conversion from zx to cpc. This approach is different to many game companies where the same coder was working on both the Spectrum and CPC versions with the game play code shared and the drawing functions were changed to suit each. With this approach they would have their own code library of functions to use and often use common methods for e.g. random numbers.

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

Adding to this. A common approach on the spectrum is to have a copy of the screen which is not visible and to draw all the graphics to this, then you copy either part of it (the changed bits) or the entire lot to the display.

On the spectrum with it's 6KB screen you can copy this fairly quickly and keep a decent frame rate, but on the cpc where this method has been used in some games it's ~12KB and now it takes a lot longer to copy and the game runs slower.

Thankfully a lot of game companies used hardware double buffer which is better on cpc . Here you need a coder that can do both methods potentially if they are to write a decent spectrum and amstrad version.

It is therefore all about spending the time and effort to use the right method on each platform to get the best performance.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

DanyPPC

Quote from: arnoldemu on 09:43, 19 February 25Perhaps the following doc I made when I converted Mayhem might give an idea:

https://www.cpc-power.com/index.php?page=detail&onglet=notices&num=18884


Thanks for the link, very useful. 
But I read that Amstrad has hardware scrolling, but for what I know only the PLUS series have hardware scrolling (in order to hardware sprites, 32 colors out of 4096, etc...).
So, is there  a mistake here ?
CPC 6128+ with C4CPC and Gotek HxC USB Drive Emulator

eto

Quote from: DanyPPC on 10:05, 19 February 25But I read that Amstrad has hardware scrolling, but for what I know only the PLUS series have hardware scrolling (in order to hardware sprites, 32 colors out of 4096, etc...).
So, is there  a mistake here ?
Plus has 1 pixel smooth scrolling. 
CPC has 1 character (Mode 1) scrolling - but can be made smooth with advanced programming techniques.

https://www.cpcwiki.eu/index.php/Programming:Hardware_scrolling

DanyPPC

Ah, ok, thanks for the clarification.

MSX has also hardware 1 character scrolling.
CPC 6128+ with C4CPC and Gotek HxC USB Drive Emulator

ZorrO

Dear colleagues, you are all wrong. Amstrad is a computer for retirees. Its zodiac sign is a snail, and its philosophy of life is - if you do something fast, you do it wrong.  :P
CPC+PSX 4ever

GUNHED

Eventually it all depends on the programming code. The CPC can do 50 fps scrolling with 32 KB Video-RAM. No problem.  :) :) :)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2024.10.27)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Powered by SMFPacks Menu Editor Mod