Faultless #09
24 мая 1998

Demo Design - Useful and interesting solution algorithms (implementation Fong).

<b>Demo Design</b> - Useful and interesting solution algorithms (implementation Fong).
continued design1>

2. Demos, Intros, DiskMags, recommended
for priority review.
========================================

PC:
===

YO! / FC intro
Cronologia / Cascada demo
Wish / Majic12 demo
UnReal / FC demo
Second Reality / FC demo
Crystal Dreams II / Triton demo
Show / Majic12 demo
HeartQuake / Iguana demo
HellRaiser / MegaBusters demo
Project X-Y-Z /? trackmo
Ambience / Tran demo
KUKOOO2 / TFL intro
Copper / S! P demo
Verses / EMF demo
CyboMan2 / Complex intro64k
StarPort II / FC intro
Luminati / Tran demo
EXCURSION / Vista Software intro
Paper intro64k

WorldCharts I / FC diskmag
Imphobia / Imphobia diskmag


Commodore 64:
=============

Red Storm / TRIAD trackmo
Place In Space / TABOO demo
Legoland I, II, III / FairLight64 demo
More Then Nops / Taboo demo
WonderLand 1 .. 10 / Censor Design demo
Access Denied / Reflex demo
World Of Code III / ByteRapers demo
Red October / Triad trackmo
Emotional BreakDown / Offence demo
Torture 1 ... 4 / Padua demo
Light / Crest demo
Coma Light / Oxyron demo
Courtesy of Soviet gfx collection

Propaganda (1-19) / G * P, F4CG diskmag
Pulse / Regina diskmag
Reformation / FairLight64 diskmag
Domination diskmag

Amiga
=====

State of the Art / SpaceBalls trackmo
Virtual Dreams / Fairlight trackmo
Technological Death / Mad Elks trackmo

Top Secret / Majic12 diskmag

xUSSR projects (PC)
===================

iNFUSED BYTES I, II / ROi diskmag
FireWork / CodeWise intro
Scene Side / SST diskmag
Never Land 1,2,3 / Crazy Coder intro
Glitch by QMG Art Div. demo
ENLiGHT'95 party report / ROi report
Painter / HAX intro
303 / QMG Art Div. trackmo
Nosferatu / Nephilims demo
Hellizer / QMG Art Div. demo

3.Sovety and requests for institutional
nature of the sponsors of demos / intros / etc ...
=======================================

1. If your demo has a few parts
you need to go to the next
parts could be pressing the (usually
but ESC), and not just waiting for its completion
solution. Do not forget that:


  a) A person can not watch your demo
the first time - why it must be seen
again all the parts?

  b) all have different tastes, finding severely
lyat Rights Watch that he was not the NRA
becomes (eg 10-minute spinning
cu;)

  c) Is there any part can fail at
car beholder.

2. If the sound system, you are using, playing, for example, 
only GUS, this is clearly not a reason to speak to owners

other cards 'No GUS - No Demo'. Let
look no sound - you sorry? ;)

3. If your demo at startup itself determines the sound card, 
you must vves Tu key, with which you can, bypassing the 
auto-sensing, to put himself ka mouth and (preferably, be sure) 
- IRQ, DMA, etc. The fact that all methods

definitions are imperfect and often wrong.

4. Do not make a long one and watch
the same effect on the screen (p.1b)

5. Do not reprogram the horizontal
scan for more than 360 then
Check. This - the limit value for which you can not step over - 
can work on your machine and do not work for others.

For vertical scanning of the hard-
of no limit (meaning neSVGA
modes).

6. Do not forget to put the archive on your
demo file_id.diz and a readme (or
noter the same text), which will
lists the requirements for machine operations
onnoy system, etc.

7. If you see that your demo is buggy /
does not work under OS / 2, Windows, DV - not
worry-it is absolutely not the reason for
anxiety.

8. Try not to copy the effects seen
defects. Think about it - who are interested
look at the next demo is the same as
and the previous one, but a different color? If
nothing new comes to mind - set aside the project until such 
time when there will be fresh ideas. 

9. Synchronize the action on screen
music. Try to do it as soon as possible
more often.

10. Note that the code in the demo is not important!
You can create a demo with the effects that
fairly easy to implement, but the red
you. Do not focus on the vectors and their
modifications. Try to diversify
demo from an artistic point of view - edge
sivye pictures, logos, fonts ... Purpose
demo - first to deliver the aesthetic
cal pleasure, and only secondarily as long as
show coolness in the field of programming

11. Upon completion of demo is useful to derive
on the screen ANSi showing ways how to
Your contact and other information ...


4.Commodore 64 - Scene, software, traditions,

                   terms ...
========================================

Prologue:
=======

Commodore 64 - the machine on which emerged
Do all such well-known concept now
as a demo / intro / diskmag and all the others.

Features:
===============

CPU:
---
  6510 - 1MHz, 8 bit, RISC like instruction set (56 
instructions), 13 addressing modes, pipeline, 4-5 times faster 
than Z80 at same clock. 

Memory:
------
  64K RAM, 20K ROM, standard expansion -
256K '512K units.

Video:
-----
  Sprites, Raster IRQs, Text / Graphics mo
des at same time, 320x200x16 colors.With
open borders - 512x256 horiz., vert.scrol
ling.

Sound:
-----
  3 Tone Oscillators

  4 Waveforms per Oscillator: Triangle,

       Sawtooth, Variable, Pulse, Noise

  3 Amplitude Modulators

  Random Number / Modulation Generator

  3 Envelope Generators (Attack Rate, De
    cay Rate, Sustain Level, Release Rate)

  Oscillator Synchronization

  Ring Modulation

  Programmable Filters

  Master Volume Control

  External Audio Input

Ports:
-----
  RS232, IEEE488 serial bus, Centronics,
Two A / D inputs, Video outputs: Composite
video PAL, Monochrome video, RF Expansion Port.

Peripherals:
-----------
  2 Joysticks, Mouse, Light Pen, 1531 ta
pe datarecorder; 1541,71,81 diskdrives
(Own ROM / RAM, CPU - 6502AD)


C64 Scene
=========

Intro
----

  Several beautiful horizontally skrollyaschihsya / emerging 
lines of text + beautifully drawn between LOGO - logo or on a 
black background or a background of flying stars, for example.



  LOGO is separated from the horizontal lines of text
zontally raster poloskami.Pozadi /
ahead of the logo is also possible stripes - for example, 
moving in a sine or transfer they establish.


The music was somewhere in 70% of the intro, but could
la and miss. In contrast to the demos,
There was nothing objectionable in the use of music, torn from, 
say, toys, but in no case from another

intro (!)

Intro by itself usually does not exist - they prileplivali to 
svezhereliznutym / kraknutym game and other software. Output of 
them was carried out on space, and then extract (usually with 
involving a piece of video ram'a) and was run already own a 
toy. 

Size intro varied depending on the
tricked and the availability of music somewhere
from 5-to the 20-block (1.2-5kb). Music
any degree tricked never
took more than 8-15kb.

Demos
=====

Completely independent thing, written
or for any party, or just
so (the ratio was about 70% / 30%,
I think - more and more oriented
ented to the party).

Size - sometimes no more than the 1st standard disk (ie, about 
360kb) 

Demo consisted of several parts - h
it loadable. During podgruzki (~ 1025cek) playing music and 
going kakoeto simple but nice effect. The emphasis is on 
design, graphics and music. Quality of the code is usually not 
to worry because people left the demo on C64 did not write - 
simply needed high qualifications. (No sortsov and

others does not apply, any network
was not).

The effects though were repeated, but rather
rarely, and not one to one. As an illustration - I remember the 
topic when a Offence of coder'ov told the dude from

Crest'a an idea (very cool - a wild distorted over the 
scrolling:). So - Crest urgently unreleased demo,

which was used this ideya.Byl
absolutely terrible scandal. Offence you
started up the demo with its own, so to speak, copyright 
version of this effect, which I personally do not cease to 
drag:) 

At the party there were no prizes, it is very
beneficial effect on the overall atmosphere in the
Unlike today's party, where people
chews for $ $ $.

Noters
======

Small (1-6kb) applets, startup that in the black (usually) 
appears on the screen something like: 

?????? NOTER v?.? by ?????

PRESS SPACE TO SEE ACTUAL NOTE
PRESS ANY ELSE TO EDIT NOTE

If you press any button except the sample
la, it goes into something like a simple text editor, which can 
be fill the text (in the background music plays).

And for the text can change color, highlight words flicker, 
etc., animated chars etc ... In some noterah was such an 
approach - that you walked into this "editor", and all 
subsequent button presses (Cursor movement, backspace, del, 
characters) are stored, so that later when you start to play. 
It turns out very cool - sliding line, correcting

that returns the error, etc. In short, once edited - all this 
is written (or rather creates the same file that when you start 
to do something the same (to allow read / write), but

only been with your text). And if Yit
maesh space, then you just shows everything that wrote the 
previous people (nice, the music, etc.) 

  Noter'y used widely.
For example:

1) When a team release software, and it required some 
explanation, they were decorated just so. Descriptions buttons 
igruhah, comments crack'y, fix'y etc.


2) Some of the information, which the team
wishes to convey to the scene. For example, what
They returned that unreleased new DeMouy,
that the party will be held, etc.

3) Warnings bust'ax - transfer Bordin, who zabastili who do not
be trusted, etc.

4) If a swapper (sm.swapper 's:) from
sends the disc in the mail to another, it is usually
recorded there noter combo warez'a
on this disk and friendly wishes.

5) Just a man had a good / bad
mood, and he decided to write about it:)

Scene
=====

In addition to the well-known coder'ov, graphician'ov, 
musician'ov, cracker'ov were still swapper'y as an 
indispensable attribute of any self-respecting team. They were 
engaged in correspondence with other groups / mailing

drive with a fresh warez'om, and others in that
com spirit.

Were also more fixer'y - they were engaged in
the fact that the bugs in fiksali just been released
algebraically closed any firm software / game.

It should be noted no small Moment PC there is a fairly clear 
border between cracker'ami and demo maker'ami. Fixer and 
svapperov like do not exist exists:) So - in the c64 scene 
majority teams engaged in all at once. This is already

then everything became somehow acquire special
realizations, leading to what is today the man, breaking soft
and does not occur Scodie sleek intro for the occasion: (


Trends and characteristics
=======================

99.99% of software written by ACME, although there are C, 
BASIC, PASCAL, LOGO, FORTH, LISP etc. Standard kernel'ovskie 
podprog FRAMEWORK I / O is usually not used - write your own.


If the toy / demo multifile, the hour
a directory of the drive beautifully drawn dog
vdografikoy (for C64 files in the directory are displayed in 
the order in which Roy recorded).


Copy protection exist, but usually
but copiers for them to appear on the following
the next day:) I caught only one
drive that I could not copy.

99.99% of toys are broken. I do not remember a single
Noah game in which there would be no intro or
at least mark that fixed / cracked / trained by??? :)

Music editors are based on the type of
tracker'ov, but the approach is slightly different - more
more flexible (no notion of order, just in
patterns for each of the channels are
links to some block'i ​​containing small amounts of notes). 
Editing tools ruyutsya in the tracker'e by changes tsiferok 
(ADSR, filters, modulation, waveform, etc.). Generally such 
tracke r'y focus on human err .. let's say - who knows how to 
work iron in the car. For example, for ease of writing music 
vertical bar shows what kind of part-time

from complete passage of the beam raster spends
Xia for playing music. :)

There is a sea dock (which I personally had the opportunity to 
read even after as he became less enter: (;)


Programs are written either by assembler'a, usually has a 
simple built-in editor, and / or using things called under 
consideration, monitor. It represents a assembler / 
disassembler without character IU current + a bunch of useful 
features such as transfer / fill / load / save / ascii-hex dump 
/ search. Monitors, there are quite a lot, but

they all look similar externally and occupy 17 blocks (4.3kb) - 
this size is due to the ease of placement in memory. There are 
cartridges with built-in monitor / debugger 'ami, etc. (Type 
Final Cartridge III, Action Replay, etc.)


5. Useful algorithms and interesting solution
   of.
========================================

5.1.Realizatsii Fong.
[Andrew Zabolotny]

Over the last month I have been studying
vozmozhnost a normal paint
Phonga. Below I will describe the results of its
Research =) in order to prevent
repeat repeat my mistakes as well as
just for the attention of the curious. I assumed
We assume that the reader has some skills
Key programming 3D graphics as well as
basic knowledge of school algebra.


  Initially, as I wrote earlier, I invented a proprietary 
method that yet?) I yet no one but me videl.Seychas

I'm more inclined to think that it:
a) The most correct (or rather, fully consistent with the 
original algorithm mu);

b) The fastest (I have already described it
earlier);
c) The most complex of the implemented on
Currently :-)
Soon I will accept his reimplement
tion to a qualitatively new level.

Then I began intensively studying the available
Available for demo / intro for the understanding of their 
algorithm works. Firstly, it should be noted that many in the 
guts just are strikingly similar, which leads to the sad 
reflections :-( In the second Second, in all studied demos uses

Xia three different, in fact, the algorithm. Now
I will describe them.

1-th of which much has been written here.
Interpolation, using the representation
normal in the polar coordinates. Normal
supposed by the unit vector in the direction described by two 
polar angles - Phi 'Theta. For interpolation

two vectors are interpolated Phi 'Theta, then from the table, 
the size of 256x256 (64K) / Phi 'Theta = 0 .. 255 / opt

 value of the emission intensity of the surface at a given 
point at a given normal  to the surface. Pluses

this method - the exceptional ease.

    The method has 2 (dva! rather than one) of major drawbacks: 
firstly the body can not arbitrarily rotate - very difficult to 
rotate the normal expressed in polar coordinates (and even if 
rotated, then the result is often ambiguous because the vector 
(0, 90) coincides with (180, 90)) and secondly -

This method is incorrect, since interpolating
vectors in polar coordinates we obtain
it results differ from that which is obtained by interpolation 
in Cartesian coordinates. This is most easily proved as 
follows: Prointerpoliruyte mentally the above two vectors:

(0,90) -> (0, 0) and
(180, 90) -> (0,0)
In Cartesian coordinates, we get the same result in polar - 
shish with small com. The second vector is reduced to a complex

helix.

2-nd bit similar to the first. Representation of the vector 
spherical coordinates. What makes the spherical coordinates of 
polar: the polar Theta - a angle between the vector and the 
plane OXY, and spherical - the angle between the OX axis and 
the projection tion vector on the plane OXZ. Disadvantages of 
this method is the same as that of the method N1.



  The first two methods can be distinguished because the object:
a) either revolves solely around
axis Z (the only axis around which
swarm can be rotated easily normal). T
typical example can be considered mateus.exe
b) or spinning in all directions
but in very small boundaries. At the same time
attempts to somehow compensate for all this, but the highlight 
is still jumping all over Therefore, the body (bunny.exe)


Third method, at first I thought it perfect, then realized that 
did not. Normal interpolated in Cartesian coordinates

but not all three (X, Y, Z), but (Y, Z).
The direction of the light must be the same (or almost) with 
the axis OX otherwise get too heaped Guro.Kak calculate the 
intensity of the two coordinates? Very simply: it is assumed 
that the linear interpolation unit is a unit vector (actually 
it is not) and is computed for each pair (Y, Z) Table

person, assuming that X is a sphere with
unit radius:

X ^ 2 + Y ^ 2 + Z ^ 2 = 1 => X = Sqrt (1-Y ^ 2-Z ^ 2). (1)

Next on the X, Y, Z is the angle between N and
L (light vector). On it is the intensity
(Usually in the illumination model Phong `a). All
it pushes the table size
Again 256x256. Disadvantages of the method:
a) Objects may only be considered special
redi.Pochemu? Because the expression (1) is ambiguous, in fact, 
X = + / - Sqrt (...) In practice, this translates into the fact 
that Ob CPC rear has the same flare as the front. Sux.

b) The surface should be divided into
as possible into smaller pieces, then do not
a manifest error due before
position that the interpolation of the two coordinate
coordinates of the module is a unit. However,
as is well known Gouraud shading, with the same conditions
lovii gives very similar results to Phong
The results :-)
Positive aspect of the method can be considered
rotatable object in all the EmOC
governance.


  Recently, it started to actively use
use it. Almost all demos caught me recently it is used. For 
example: 

animate.com (4K)
crshtst.com (4K)
loop01.com (4K)
BillG force (64K)
[...]


  There is another method which seems to be free from all 
defects methods described above. However, it has

one big flaw that outweighs all the above wealth: It is not
Phong, and the most natural Gouraud shading. A typical example 
is file PHONG.TXT running through not so long ago

by DEMO.DESIGN.UUE. If student,
him to write, to think a little more then
he would have understood it :-)
But most of all I liked how this
method is used in fboom.exe (what you
can do with a torus) and everywhere call names like 'phong'. 
Any sufficiently under natorevshy this man a texture paint to 
easily recognize where the typical nuyu shading Gouraud, and 
even increased specification does not prevent proklevyvaniya

straight lines of the intensity (in
Phong, they almost always curvilinear). I
to this demo or floor-space would not have given for
the introduction of misleading the public :-)


  Speaking of the bird: Do not necessarily everywhere
use Fong, good looks and
Guro using Fongovoy, not Lam
Bertha, lighting models. Example to all, I
I hope, known drift.exe built
exclusively on Gouraud, Phong, and there is not
smells. However, after all, deceived me! :-)
I thought it was very curve Fong, but it turned out that a very 
nice Guro :-) 


  The idea is not based on the idea of ​​interpolated vectors 
of two coordinates instead of three. Moreover, the vector I 
interpolated one :-) 


  Imagine a unit ball. For the direction of light is taken a 
unit vector, let (1,0,0). Now imagine a plane that separates

ball into two halves. To begin with consider
Consider (for example), the plane XOY. Represent
beam itself, which at one end attached
to (0,0,0), while others describe a circle along
the cut on the angle of 0 degrees with respect to
respect to the vector of the light up to 360 degrees.
Now draw a graph of change highlighted
surface at the points through which we pass, it's only 90 
degrees of possible angles between this plane and the vector of 
the light Ta. What is going on - this is the same

only a side view (only do not ask
why the side :-)

On the other hand we have a range of 360
degrees to rotate our vector normalization
Mali in the plane (actually 180, but
to avoid the hassle, we take 360). Therefore, we take 360 
​​degrees over 256 units then 90 degrees is 64 units, so you 
need pre-computed table to 16k. 

Now try to imagine a triangle, which we need to paint on
Fong. We have three normals at its vertices.
Through any two of the normal can be
plane (it is an axiom of the plane through
three points, do not forget that the normal vector based at 
(0,0,0), but not in the corners triangles). * ALL * 
intermediate vectors are obtained by interpolation of the 
vectors ditch on the normal Phong are in this

plane, their coordinates can be taken
angle between the normal and the projection of
light on this plane.

This plane is inclined at some angle to the vector of light. 
This angle can be calculated (if you do not know how it can 
further zhete not read). Grab one of 64 tables. Then we find 
the two angles between the normals and projection of light on 
this plane. This, too, how something is done (not

I remember now, but something in the spirit of vector 
multiplication - and remembered! multiply Century vector of 
light on the normal vector and we vector perpendicular to both 
of them that located in the lower plane, the angle between

him and the required projection is 90). Then
interpolate this angle (there is also kakieto details on how to 
interpolate: "right to left" or "left to right) and take 
readings from the table. 






Other articles:

ASM4KOFF - Run the compiled melodies. Loader at ACME. Using on-screen file ArtStudio (display). Maximum speed on the conclusion of sprites. As quickly as possible output points. Fastest up the stack.

CCLFSTM - All disk copier 128/512K.

CCLFSTM - The album "Backstreet Boys"

CCLFSTM - News from the Spark group

CCLFSTM - Description of system software: Power Code Decrusher v6.2

Demo Design - On the history demomeykinga.

Demo Design - Useful and interesting solution algorithms (implementation Fong).

Flash - The extension of the color palette ZX-Spectrum.

GFK Fraktiuit - Secrets of the graphic standards GX1.

LZW and GIF - Description of image formats. LZW and. GIF.

MUSICNEWS1 - Music kaleidoscope of pop ...

MUSICNEWS2 - METALL NEWS.

NEWS of Picon - The draft of the future ROMs. BASIC subroutine 48.

OPERATEXT - From the history of the demo Oper'y.

PRICE - Price list for products firm Scorpio.

RUSH - On the coterie in Chernigov, in April 1998.

SPECCY AF - Immortal Speccy.

Did you know - Passwords, eternal time and the bombs in the game Last Courier. Passwords for the game: X-Reversy; and muzykalkam: Branch of Mind demo, Diesirae demo. Hidden part in Faultless 2, 3, 4, 5, 8 (passwords) ...

Introduction - On the pros and cons of numbers.

Medem - The history of Zaporizhzhya modem.


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
Programmers - On the music format modules Sound Tracker Pro and source player.
Detective - "a recipe for a murder."
Mosaic - expanding ports ZX Spectrum.

В этот день...   21 November