News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_cpcitor

True 3D starfield in overscan: "2021 a CPC odyssey" by cpcitor

Started by cpcitor, 11:01, 24 May 21

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cpcitor

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.
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.

Gryzor

Just watched the video (no CPCs here at work - shock, horror), really really nice and the scroller zips along very nicely :)

Targhan

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

cpcitor

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.

Targhan

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).
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

Optimus

Quote from: cpcitor on 12:39, 24 May 21
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.

Optimus

Quote from: Targhan on 12:48, 24 May 21
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?

mr_lou

Nice!

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

cpcitor

Quote from: mr_lou on 17:57, 24 May 21
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.

mr_lou

Quote from: cpcitor on 23:20, 24 May 21Yes. 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.

Quote from: cpcitor on 23:20, 24 May 21After 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  :) ).

Quote from: cpcitor on 23:20, 24 May 21The 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.

MaV

Quote from: Targhan on 12:48, 24 May 21So, 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."

MaV

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

pelrun

Quote from: MaV on 10:52, 25 May 21
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*

cpcitor

Quote from: pelrun on 11:20, 25 May 21
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.

MaV

Quote from: pelrun on 11:20, 25 May 21Only 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."

MaV

@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."

mr_lou

It would be better to beg emulator-devs to add a fullscreen mode that toggles screen refresh rate to 50 hz.

Targhan

Quote from: MaV on 10:52, 25 May 21Do 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

XeNoMoRPH

your amstrad news source in spanish language : https://auamstrad.es

mr_lou

Er...... why does the embedded version look less smooth / more blurry than if you watch the exact same video on YouTube?

roudoudou

Quote from: MaV on 10:52, 25 May 21
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
My pronouns are RASM and ACE

cpcitor

Quote from: roudoudou on 17:28, 25 May 21
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.

roudoudou

Quote from: cpcitor on 18:24, 25 May 21
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
My pronouns are RASM and ACE

cpcitor

Quote from: roudoudou on 18:36, 25 May 21
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.

Targhan

Quote from: roudoudou on 18:36, 25 May 21A 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

Powered by SMFPacks Menu Editor Mod