Author Topic: True 3D starfield in overscan: "2021 a CPC odyssey" by cpcitor  (Read 1754 times)

0 Members and 1 Guest are viewing this topic.

Offline cpcitor

  • The user previously known as FindYWay
  • 464 Plus
  • *****
  • Posts: 356
  • Country: fr
  • My heart still runs on traditional CPC.
    • My code for the CPC.
  • Liked: 197
  • Likes Given: 452
Hi guys!


For all Amstrad CPC models, all CRTCs, it features:

* a 3D starfield, nearly 100 stars
* in overscan (384x256 instead of the normal 320x200)
* plus a scrolltext
* all animated at solid 50Hz
* with music by The Other Days

Yes, you read that well: an overscan true 3D starfield on the CPC!

Feel free to visit 2021 a CPC Odyssey by cpcitor + The Other Days :: pou√ęt.net and vote your opinion there.

You'll find:
  • disk image to run in your favorite emulator,
  • and also videos, one specially adjusted for 60Hz screen (most screen nowadays)
  • and a video in genuine 50Hz if you can set your display to 50Hz or 100Hz.

I'm planning to release source code under an open source license (needs some cleanup for now). Feel free to ask for it.
« Last Edit: 13:05, 24 May 21 by cpcitor »
Had a CPC since 1985, currently software dev professional, including embedded systems.

I made in 2013 the first CPC cross-dev environment that auto-installs C compiler and tools: cpc-dev-tool-chain: a portable toolchain for C/ASM development targetting CPC, later forked into CPCTelera.

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 16.915
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 4031
  • Likes Given: 7261
Just watched the video (no CPCs here at work - shock, horror), really really nice and the scroller zips along very nicely :)

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.382
  • Country: fr
  • Liked: 1310
  • Likes Given: 191
Very nice! Cool tune too.

However, sorry to say something that may sound negative, but contrary to what you said in the scroller, the starfield had already been done before... and in a better way (in my opinion). Did you check the RTS demo by Jack?

Congrats anyway and looking forward to play your game as a stand-alone!
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline cpcitor

  • The user previously known as FindYWay
  • 464 Plus
  • *****
  • Posts: 356
  • Country: fr
  • My heart still runs on traditional CPC.
    • My code for the CPC.
  • Liked: 197
  • Likes Given: 452
Thanks Targhan! I could not find a previous prod doing it, and this link is really relevant!

RTS demo is really nice indeed!

Ow, what is written in pouet.net is true: it crashes after a moment (maybe 10 minutes).

I will step through the code to understand how he did it.

Since the part do not last long, I'm suspecting there's some precalculation in the 10-20 seconds before.

"2021 a CPC Odyssey" actually computes the 3D in real time.
That's because of a difference in goal: intro and demo are byproducts for me, I'm aiming at a 3D fully immersive interactive game. So, 3D must be computed real time from player action.

Also, "2021 a CPC Odyssey" works even on a 464 with tape :-) although the future game will most certainly need a 6128.


Thanks again Targhan for the link, it's very interesting and relevant!

Had a CPC since 1985, currently software dev professional, including embedded systems.

I made in 2013 the first CPC cross-dev environment that auto-installs C compiler and tools: cpc-dev-tool-chain: a portable toolchain for C/ASM development targetting CPC, later forked into CPCTelera.

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.382
  • Country: fr
  • Liked: 1310
  • Likes Given: 191
From what I recall by looking at the code, it is a simple projection using a 8-bit division, but I might be wrong. So, no precalculation from what I remember (contrary to Batman!).

Also, nice starfield by Face Hugger in the Mops megademo (less accurate but translation in X/Y too).
« Last Edit: 14:50, 24 May 21 by Targhan »
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline Optimus

  • 464 Plus
  • *****
  • Posts: 366
  • Country: gr
  • Liked: 193
  • Likes Given: 147
Since the part do not last long, I'm suspecting there's some precalculation in the 10-20 seconds before.


Hehe,. I guess the only reason it's short is because it tries to be a multipart. There is also 3d dots part later, with so few dots I am pretty guesing it's realtime.

Offline Optimus

  • 464 Plus
  • *****
  • Posts: 366
  • Country: gr
  • Liked: 193
  • Likes Given: 147
Also, nice starfield by Face Hugger in the Mops megademo (less accurate but translation in X/Y too).


Oh yeah, I remember that one.
Was there another better starfield with also translation on X/Y but in a secret part of a particular demo? I remember someone showing me at ReSeT, can't remember the demo, maybe an old 90s french demo, but I wondered hey that's cool, why hiding it in a secret part?

Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.206
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1370
  • Likes Given: 2694
Nice!

How did you adjust to 60 hz? Did you just play the frames faster?

Offline cpcitor

  • The user previously known as FindYWay
  • 464 Plus
  • *****
  • Posts: 356
  • Country: fr
  • My heart still runs on traditional CPC.
    • My code for the CPC.
  • Liked: 197
  • Likes Given: 452
Nice!

How did you adjust to 60 hz? Did you just play the frames faster?

Yes. A demo scrolltext must be smooth, or must not be. That is the question.  ;)

After researching solutions, I combined the normal soundtrack with the same frames played at 60fps instead of 50fps, which makes a shorter video. That's why I put a text overlay to make clear this is adjusted.

This is an interesting topic.

The solution, I think is to write modern productions with 60Hz in mind, even 50Hz/60Hz compatibility. This is as easy as adjusting screen dimensions, easier than enabling overscan. Of course the prod should be ready to have 1/6 less time for the Z80, that is 16640 NOPs per frame instead of 19968 NOPs per frame.

Since the CPC supports 60Hz prod when hooked to a 60Hz capable screen, the only missing piece is emulators that support 60Hz prod.

To help this, I just posted this extremely long post full of details about how this could work https://www.cpcwiki.eu/forum/emulators/wish-60hz60fps-support-in-emulators-thought-on-emulating-a-crt/msg2023161/#msg202316
Had a CPC since 1985, currently software dev professional, including embedded systems.

I made in 2013 the first CPC cross-dev environment that auto-installs C compiler and tools: cpc-dev-tool-chain: a portable toolchain for C/ASM development targetting CPC, later forked into CPCTelera.

Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.206
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1370
  • Likes Given: 2694
Yes. A demo scrolltext must be smooth, or must not be. That is the question.  ;)

There is no question: It must be smooth!
But I know the majority sadly doesn't care at all. In fact, most people doesn't even seem to notice the jerky movement. We're outsiders.

After researching solutions, I combined the normal soundtrack with the same frames played at 60fps instead of 50fps, which makes a shorter video. That's why I put a text overlay to make clear this is adjusted.

I did something similar for 8-bit Memoirs. Since the CPC is 50.04 Hz, I turned it down to an even 50 hz, and stretched the audio to match. It's so little that no one can hear it, but the result is awesome. All videos are as smooth as a baby's butt, just the way God intended.
I would never have been satisfied with 8-bit Memoirs if it had been made as a web-project, and thus running on a 60 hz screen. By going with Blu-ray, all videos give a much more authentic impression of the CPC. (Except of course if playing the ISO on a PC with a media player - but any real blu-ray player makes sure the display switches to 50 hz, and to this day it still pleases me  :) ).

The solution, I think is to write modern productions with 60Hz in mind, even 50Hz/60Hz compatibility. This is as easy as adjusting screen dimensions, easier than enabling overscan. Of course the prod should be ready to have 1/6 less time for the Z80, that is 16640 NOPs per frame instead of 19968 NOPs per frame.

Interesting concept. I can't imagine anyone will embrace though. Deviating from the standards of a plain CPC464 is often frowned upon, I've noticed. But of course, a higher framerate could sound interesting to some.

Offline MaV

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.120
  • Country: at
  • Ius summum saepe summa est malitia.
  • Liked: 418
  • Likes Given: 851
So, no precalculation from what I remember.
Do you really think that the top 8-bit, 16-bit demos outside of the CPC scene aren't precalculated?
Black Mesa Transit Announcement System:
"Work safe, work smart. Your future depends on it."

Offline MaV

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.120
  • Country: at
  • Ius summum saepe summa est malitia.
  • Liked: 418
  • Likes Given: 851
Smooth! I like the starfield.  :)
Black Mesa Transit Announcement System:
"Work safe, work smart. Your future depends on it."

Offline pelrun

  • Supporter
  • 6128 Plus
  • *
  • Posts: 762
  • Country: au
    • index.php?action=treasury
  • Liked: 443
  • Likes Given: 272
Do you really think that the top 8-bit, 16-bit demos outside of the CPC scene aren't precalculated?
Only when you're one of the Meteoriks' judges and you're looking for a plausible lie to give an award to your mates instead of the entry that actually deserves it... *cough*

Offline cpcitor

  • The user previously known as FindYWay
  • 464 Plus
  • *****
  • Posts: 356
  • Country: fr
  • My heart still runs on traditional CPC.
    • My code for the CPC.
  • Liked: 197
  • Likes Given: 452
Only when you're one of the Meteoriks' judges and you're looking for a plausible lie to give an award to your mates instead of the entry that actually deserves it... *cough*

 :o
Had a CPC since 1985, currently software dev professional, including embedded systems.

I made in 2013 the first CPC cross-dev environment that auto-installs C compiler and tools: cpc-dev-tool-chain: a portable toolchain for C/ASM development targetting CPC, later forked into CPCTelera.

Offline MaV

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.120
  • Country: at
  • Ius summum saepe summa est malitia.
  • Liked: 418
  • Likes Given: 851
Only when you're one of the Meteoriks' judges and you're looking for a plausible lie to give an award to your mates instead of the entry that actually deserves it... *cough*
:D I'm sensing a story here that I apparently missed out on.
Black Mesa Transit Announcement System:
"Work safe, work smart. Your future depends on it."

Offline MaV

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.120
  • Country: at
  • Ius summum saepe summa est malitia.
  • Liked: 418
  • Likes Given: 851
@the 50/60Hz discussion: Doable on the CPC, but having 3328 NOPs less frame time hurts quite a bit.


Other platforms which only need minor modifications to switch to 60Hz also do not embrace it:
TiTAN - Overdrive 2 (RGB 50fps) - SEGA Mega Drive - Revision 2017 (1st Place) - YouTube
D-Zero by Desire (2021) | Nintendo SNES Demoscene - YouTube


The SNES and Megadrive sold with 50 Hz enabled in PAL countries (and we suffered for it because games usually were programmed with 60Hz and the US and Japanese market in mind, and then simply slowed them down to 50Hz with black bars on top and bottom). Current demos on old platforms all use 50 Hz because it's largely (pre-dominantly) a European thing, even though modern hardware has switched to 60 Hz.

Black Mesa Transit Announcement System:
"Work safe, work smart. Your future depends on it."

Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.206
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1370
  • Likes Given: 2694
It would be better to beg emulator-devs to add a fullscreen mode that toggles screen refresh rate to 50 hz.

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.382
  • Country: fr
  • Liked: 1310
  • Likes Given: 191
Do you really think that the top 8-bit, 16-bit demos outside of the CPC scene aren't precalculated?
Mmmh, no, and I never said that wasn't the case. I just said that I think the RTS is real-time, from what I remember.
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

Offline XeNoMoRPH

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.051
  • Country: es
  • " ... in space no one , can hear you scream ... "
    • https://auamstrad.es/
  • Liked: 2401
  • Likes Given: 1683
your amstrad news source in spanish language : https://auamstrad.es

Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.206
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1370
  • Likes Given: 2694
Er...... why does the embedded version look less smooth / more blurry than if you watch the exact same video on YouTube?

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 1.104
  • Country: fr
    • urban exploration
  • Liked: 1526
  • Likes Given: 880
Do you really think that the top 8-bit, 16-bit demos outside of the CPC scene aren't precalculated?
you don't need to precompute until many many many more dots  ;D
@cpcitor you claims there is no cheat or trick but starfield is going the same way all the time, why?  :P
use RASM, the best assembler ever made :p

I will survive

Offline cpcitor

  • The user previously known as FindYWay
  • 464 Plus
  • *****
  • Posts: 356
  • Country: fr
  • My heart still runs on traditional CPC.
    • My code for the CPC.
  • Liked: 197
  • Likes Given: 452
you don't need to precompute until many many many more dots  ;D
@cpcitor you claims there is no cheat or trick but starfield is going the same way all the time, why?  :P

I don't understand your question. Can you be more precise about each element of your question?
Had a CPC since 1985, currently software dev professional, including embedded systems.

I made in 2013 the first CPC cross-dev environment that auto-installs C compiler and tools: cpc-dev-tool-chain: a portable toolchain for C/ASM development targetting CPC, later forked into CPCTelera.

Offline roudoudou

  • 6128 Plus
  • ******
  • Posts: 1.104
  • Country: fr
    • urban exploration
  • Liked: 1526
  • Likes Given: 880
I don't understand your question. Can you be more precise about each element of your question?

A true 3D starfield must be free directionnal (also named freedir), not only from back to front
use RASM, the best assembler ever made :p

I will survive

Offline cpcitor

  • The user previously known as FindYWay
  • 464 Plus
  • *****
  • Posts: 356
  • Country: fr
  • My heart still runs on traditional CPC.
    • My code for the CPC.
  • Liked: 197
  • Likes Given: 452
A true 3D starfield must be free directionnal (also named freedir), not only from back to front

Never heard about such a rule. Anyway, this was submitted to Shadow Party, where rules say "non-interactive" and that allows all the optimization you want. Precalculation is totally okay in this spirit. So, trick not cheat.

In my case, since the 2D coordinates are calculated real time for each frame, I could have adapted this to other directions by adding an offset, at the cost of some cycles, I just didn't do it. Some demos like Phenomena demo do all directions and rotations and all, this is just an intro.

Not sure I get your point?
Had a CPC since 1985, currently software dev professional, including embedded systems.

I made in 2013 the first CPC cross-dev environment that auto-installs C compiler and tools: cpc-dev-tool-chain: a portable toolchain for C/ASM development targetting CPC, later forked into CPCTelera.

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.382
  • Country: fr
  • Liked: 1310
  • Likes Given: 191
A true 3D starfield must be free directionnal (also named freedir), not only from back to front
So now we are rules in demomaking? Things will get boring very soon :). Don't worry @cpcitor, you did a very fine starfield :).
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime