English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old Today, 10:53   #1
carlosgod
Registered User
 
Join Date: Oct 2021
Location: boston
Posts: 33
How are the Demo scene people able to create very fast 3D polygon routines for OCS?

I know that making a Demo is completely different from making a game.

Having said that, I noticed that the 3D polygon routines in the Hologon demo by The Electronic Knights (2020) running on A500 is really fast and quite sophisticated (ie, not just solid color fill, but also using dynamic texture and some sort of lighting techniques). Honestly, it's something you'd expect from an N64 or SNES with SuperFX chip, not a 16-bit machine from the 1980s.

(skip to 24 seconds, 1 min 6 seconds and 3 min 59 seconds to see what I'm talking about)

[ Show youtube player ]

Yet I keep hearing from everyone that the Amiga sucks at rendering Polygons, that using blitter to fill polygon is slow etc. etc. This statement is not wrong of course - as we all know just about all the games that use polygons are very slow on OCS, to the extent that they're almost unplayable. Games like Zeewolf for instance. 11:08 is rather painful to watch...

[ Show youtube player ]

So what exactly are these demo scenes people doing that enables them to achieve this kind of result. Or more precisely, why can't commercial game developers replicate the technique? Is the technique used in the Hologon demo not at all practical in real life gaming situation? Or is it because these 3D routines are closely guarded secrets, and since the demo scene people don't mix with game devs, the secret goes with them to their graves? If any one from the Demo scene can shed light on this mystery would be much appreciated!

Last edited by carlosgod; Today at 15:57.
carlosgod is online now  
Old Today, 10:56   #2
chip
Registered User
 
Join Date: Oct 2012
Location: Italy
Age: 49
Posts: 2,960
Amiga demo scene rulez !
chip is offline  
Old Today, 11:02   #3
carlosgod
Registered User
 
Join Date: Oct 2021
Location: boston
Posts: 33
Quote:
Originally Posted by chip View Post
Amiga demo scene rulez !
Yes they do!

I wish some of them make games...
carlosgod is online now  
Old Today, 11:26   #4
britelite
Registered User
 
Join Date: Feb 2010
Location: Espoo / Finland
Posts: 823
Quote:
Originally Posted by carlosgod View Post
I know that making a Demo is completely different from making a game.
That's pretty much the answer to your question. You can take way more shortcuts and make assumptions about things when making effects for a demo than when making something interactive like a game.


Quote:
So what exactly are these demo scenes people doing that enables them to achieve this kind of result. Or more precisely, why can't commercial game developers replicate the technique?
Commercial game developers can definitely replicate the techniques, but you would probably want something a bit more complex in a game than only a rotating cube on screen, and that's where things quickly get way too slow.
britelite is offline  
Old Today, 11:33   #5
grond
Registered User
 
Join Date: Jun 2015
Location: Germany
Posts: 1,941
Amazing demo indeed! The thing with demos is that a lot of the stuff gets precalculated while you are looking at stills or less demanding effects. A lot of effects also have a certain amount of "replay" in them (frames or graphics that were rendered and/or displayed before get reused). Then a lot is based on tables that only have a certain size and thus only work for objects within a certain very limited range such as tables used for 3D projection. In a game you need to be able to allow any kind of movement at any time and therefore need an engine that can display anything and not just scenes which are constructed to match the limitations of the hyperoptimised engine. (When you have eliminated all crappy coding, each further optimisation relies on an assumption which may break in a general setting). This said, a lot of demo sceners went into games coding. Probably less these days because there is so little need to actually optimise anything any more.
grond is offline  
Old Today, 11:35   #6
carlosgod
Registered User
 
Join Date: Oct 2021
Location: boston
Posts: 33
Quote:
Originally Posted by britelite View Post
Commercial game developers can definitely replicate the techniques, but you would probably want something a bit more complex in a game than only a rotating cube on screen, and that's where things quickly get way too slow.
Okay, so in the Hologon example, would I be correct in saying that they're making the polygon object rotate in a pre-determined manner. As a result, the CPU doesn't actually have to perform a lot of calculations, so all they have to do is optimize the hell out of that with blitter/copper routine?

But in a 3D game (say, a space sim), because the engine is constantly waiting for movement input from the user, it means the CPU has to become heavily involved in figuring out how the polygon object will rotate based on the user's input/interaction, and this causes massive slowdown in the polygon movement to the level that we're seeing in games like Frontier or Hunter for OCS?
carlosgod is online now  
Old Today, 11:39   #7
AestheticDebris
Registered User
 
Join Date: May 2023
Location: Norwich
Posts: 498
Quote:
Originally Posted by carlosgod View Post
.
So what exactly are these demo scenes people doing that enables them to achieve this kind of result.
Cheating.

Demo coding is all about cutting the absolute maximum number of corners to make it look like you're doing something that you really aren't. Precalculations can play heavily into it, as can taking shortcuts that would break in the general case but work for very specific scenarios (f.e. not redrawing all of a polygon if you know it hasn't moved much and will never be obscured etc).

In an actual game, you typically have a lot less control over things - not none, but less, Elite for example carefully constructs all the spaceship models to remove a bunch of difficult to render edge cases.
AestheticDebris is offline  
Old Today, 11:48   #8
carlosgod
Registered User
 
Join Date: Oct 2021
Location: boston
Posts: 33
Quote:
Originally Posted by AestheticDebris View Post
Cheating.

Demo coding is all about cutting the absolute maximum number of corners to make it look like you're doing something that you really aren't. Precalculations can play heavily into it, as can taking shortcuts that would break in the general case but work for very specific scenarios (f.e. not redrawing all of a polygon if you know it hasn't moved much and will never be obscured etc).

In an actual game, you typically have a lot less control over things - not none, but less, Elite for example carefully constructs all the spaceship models to remove a bunch of difficult to render edge cases.
Okay, this starts to make sense. So eliminating the need to redraw parts of the polygon that you know won't crop up again in the next frame can probably save you a clot of CPU cycles.

But while we've seen some innovation for FPS type games like Dread/Grind (which I understand has to more to do with Blittler C2P techniques), do you know if there has there been any innovation in fast polygon rendering for the Amiga? Or are we pretty much at the same spot as when David Braben made Frontier?
carlosgod is online now  
Old Today, 11:56   #9
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,078
cheating = specialization (in a very controlled environment, without user interaction) :P
a/b is offline  
Old Today, 12:12   #10
carlosgod
Registered User
 
Join Date: Oct 2021
Location: boston
Posts: 33
Quote:
Originally Posted by grond View Post
Amazing demo indeed! The thing with demos is that a lot of the stuff gets precalculated while you are looking at stills or less demanding effects. A lot of effects also have a certain amount of "replay" in them (frames or graphics that were rendered and/or displayed before get reused). Then a lot is based on tables that only have a certain size and thus only work for objects within a certain very limited range such as tables used for 3D projection. In a game you need to be able to allow any kind of movement at any time and therefore need an engine that can display anything and not just scenes which are constructed to match the limitations of the hyperoptimised engine. (When you have eliminated all crappy coding, each further optimisation relies on an assumption which may break in a general setting). This said, a lot of demo sceners went into games coding. Probably less these days because there is so little need to actually optimise anything any more.
I see, so they reused frames that were rendered previously as well. I guess that makes a lot of sense in the rotating cube demo.

Sorry, I am not a developer - what do you mean by 'tables' that are used for 3D projection? Is that like a pre-written array of vertices and coordinates for each points in the polygon that you tell the program to render for specific frames, instead of calculating them on the fly?
carlosgod is online now  
Old Today, 12:13   #11
alexh
Thalion Webshrine
 
alexh's Avatar
 
Join Date: Jan 2004
Location: Oxford
Posts: 14,567
Ambermoon 3D sections. Work well on A500. Written by Demo scene coders who were moving to the PC. (certainly not on par with the techniques in Dread/Grind)
alexh is offline  
Old Today, 12:16   #12
carlosgod
Registered User
 
Join Date: Oct 2021
Location: boston
Posts: 33
Quote:
Originally Posted by alexh View Post
Ambermoon 3D sections. Work well on A500. Written by Demo scene coders who were moving to the PC. (certainly not on par with the techniques in Dread/Grind)
Ah, so that was an example of a demoscene developer moving to game... and the result shows! Thanks for the info.
carlosgod is online now  
Old Today, 12:44   #13
AestheticDebris
Registered User
 
Join Date: May 2023
Location: Norwich
Posts: 498
Quote:
Originally Posted by carlosgod View Post
Is that like a pre-written array of vertices and coordinates for each points in the polygon that you tell the program to render for specific frames, instead of calculating them on the fly?
In a simple case, yes. More complex effects might store tables of partial calculations etc that cut down the amount of maths required to produce the required result but the principle is still the same. It's pretty much always quicker to look something up rather than calculate it, unless the maths is trivial (since finding a lookup entry might well involve some maths itself).
AestheticDebris is offline  
Old Today, 12:53   #14
grond
Registered User
 
Join Date: Jun 2015
Location: Germany
Posts: 1,941
Quote:
Originally Posted by carlosgod View Post
I see, so they reused frames that were rendered previously as well. I guess that makes a lot of sense in the rotating cube demo.
One example would be a 2D effect that gets calculated in real time like a roto-effect. After some time the effect gets more exciting and it does roto-zoom. You could now just use the rotated frames you calculated before to do the zooming (this example probably doesn't make much sense but anyway). Now you have a lot of rotating/zooming frames recorded in memory and then you just redisplay them for another few spins. During this time you calculate an object you are going to display flying in front of the rotating-zooming background. And so on...


Quote:
Sorry, I am not a developer - what do you mean by 'tables' that are used for 3D projection? Is that like a pre-written array of vertices and coordinates for each points in the polygon that you tell the program to render for specific frames, instead of calculating them on the fly?
That would be one possibility but I was referring to sine-tables or tables for division. Instead of calculating what sin(x) is, you simply have a table with sine values for a number of different values of x and then use you actual x to access the table to find sin(x). Of course, tables can grow very large and you'll run out of storage space. Hence, you limit the number of possible x values to input which then means you can only use the table under specific circumstances which may be too limiting for a game engine.
grond is offline  
Old Today, 13:04   #15
carlosgod
Registered User
 
Join Date: Oct 2021
Location: boston
Posts: 33
Quote:
Originally Posted by grond View Post
One example would be a 2D effect that gets calculated in real time like a roto-effect. After some time the effect gets more exciting and it does roto-zoom. You could now just use the rotated frames you calculated before to do the zooming (this example probably doesn't make much sense but anyway). Now you have a lot of rotating/zooming frames recorded in memory and then you just redisplay them for another few spins. During this time you calculate an object you are going to display flying in front of the rotating-zooming background. And so on...




That would be one possibility but I was referring to sine-tables or tables for division. Instead of calculating what sin(x) is, you simply have a table with sine values for a number of different values of x and then use you actual x to access the table to find sin(x). Of course, tables can grow very large and you'll run out of storage space. Hence, you limit the number of possible x values to input which then means you can only use the table under specific circumstances which may be too limiting for a game engine.
Ah that's a pretty clever trick. Thank you!
carlosgod is online now  
Old Today, 13:35   #16
TCD
HOL/FTP busy bee
 
TCD's Avatar
 
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 32,305
Quote:
Originally Posted by carlosgod View Post
Or more precisely, why can't commercial game developers replicate the technique?
While I wouldn't call it 'commercial game development', the Dread/Grind dev comes from a demo background: https://amiga.abime.net/artists/view...czek-kk-altair
TCD is online now  
Old Today, 13:50   #17
carlosgod
Registered User
 
Join Date: Oct 2021
Location: boston
Posts: 33
Quote:
Originally Posted by TCD View Post
While I wouldn't call it 'commercial game development', the Dread/Grind dev comes from a demo background: https://amiga.abime.net/artists/view...czek-kk-altair
Looks like there's a common thread here for Amiga games that achieve technical breakthroughs (Ambermoon being the other one). Thanks for the info!
carlosgod is online now  
Old Today, 14:09   #18
khph_re
Registered User
 
Join Date: Feb 2008
Location: Northampton/UK
Posts: 536
It does look fantastic :-)

The scene at 1.06, I don't think it's texture mapped. I think the facets are looking through to other bitplane's that are scrolling a picture. Similar to how Da Jormas fake their Phong shading.

Could be wrong though, I'm not a coder.
khph_re is offline  
Old Today, 15:06   #19
carlosgod
Registered User
 
Join Date: Oct 2021
Location: boston
Posts: 33
Quote:
Originally Posted by khph_re View Post
It does look fantastic :-)

The scene at 1.06, I don't think it's texture mapped. I think the facets are looking through to other bitplane's that are scrolling a picture. Similar to how Da Jormas fake their Phong shading.

Could be wrong though, I'm not a coder.
You're right - now that I had time to examine it more closely, it is indeed another layer of images scrolling around independent of one another. That is a really clever trick!

Last edited by carlosgod; Today at 15:16.
carlosgod is online now  
Old Today, 15:32   #20
arcanist
Registered User
 
Join Date: Dec 2017
Location: Austin, TX
Age: 41
Posts: 416
An old scene trick I've reused very recently divides a bounding box (cube) into evenly spaced points, allowing polygon vertices only at these points. This is sufficient to represent many nice shapes with subdivision.

Instead of rotating/scaling every vertex of the object, which is expensive, rotate/scale three unit vectors only, one for each axis. Build a vector lookup table for each axis by successively adding this vector to itself. Finally, to rotate/scale any point of the object, look up its position in the three tables and sum the vectors together.

I've also made extensive use of log/exp lookup tables to turn multiply/divide into add/subtract. And of course sin/cos tables.
arcanist is online now  
 


Currently Active Users Viewing This Thread: 3 (2 members and 1 guests)
arcanist, carlosgod
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
3D Polygon fun Powerboat USA/Heat Wave? Angus Retrogaming General Discussion 11 18 March 2024 13:08
Who wrote the 3D routines for Unreal and how is it done? ImmortalA1000 Coders. General 11 08 July 2021 09:46
[Factory]3d polygon techniques Samurai_Crow project.Amiga Game Factory 0 12 December 2017 09:06
People are looking to create video game company Amiten Amiga scene 7 23 November 2011 12:50
scene people Time Bandit Nostalgia & memories 8 09 December 2002 11:43

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

Top

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