| |
Rudi Account closed
Registered: May 2010 Posts: 125 |
DYPP
Hi,
DYPP - Different Y Pixel Position.
I don't seem to find an explanation on this effect on C64 on codebase or anywhere. Maybe its in another thread here on csdb, then please provide an link.
I know the basics of sines, ive made sinescroll on PC, but its easier there since you can look up the framebuffer directly, via sine-tables and so on.
Im wondering how this effect is easily made on C64. I believe there are more than one way, but i guess one way is slower than the other; for example moving each column-bit (inside a char) in realtime. The other way I think is having the chars animated, similar to a twister. Though, im thinking each angle is used for lookup table. I just dont seem to get it right in my mind to start coding on this effect. I've seen several early cracktros and demos that does this very fast, but haven't had the time to reverse-engineer the binaries. If you have any tips and info i'd appreciate it, or even better; write an explanation for codebase.
Thanks |
|
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
i think you want to look for DYCP or DYSP on codebase :) |
| |
TWW
Registered: Jul 2009 Posts: 545 |
The DYPPs I made in the past was done something like this:
Fetch charset data AND bit pattern and store with sine-index offset (1x1 charset).
lda Character
asl
asl
asl
tax
lda CharsetData,x
ldx sinus
and #%1111000
sta CharsetDisplayBuffer,x
and so on for the remainder. Off course the AND will determine how many routines you have to write.
There are some optimisations for bigger characters which was used where you only update the to and bottom of the character, not every pixel in between and resulted in looong codestreams ;-) |
| |
Rudi Account closed
Registered: May 2010 Posts: 125 |
groepaz: are you sure this is the same as DYPP? of course i could start with those, but i want to start with the difficult.
TWW: interesting ill try out this.
By the way, I started an irc-channel (ircnet) #c64coders. pls join, i want it to be purely coding related. and spread the word. no lamers pls! |
| |
Digger
Registered: Mar 2005 Posts: 437 |
A neat example of a char based DYPP can be found in Obornik (coded by Brush). |
| |
Rudi Account closed
Registered: May 2010 Posts: 125 |
Digger: nice. yes, the sine-scroll in that demo is a good example of what i want to learn how is done. |
| |
Rudi Account closed
Registered: May 2010 Posts: 125 |
Ok, I forgot to turn of invite on the channel. I wanted to keep the lamers out. If you are irc user, Pls (auto)join #c64coders (ircnet) if you want hang on a pure coders channel. Thx |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
Does anyone know which production holds the area record for freeform DYPP? (ie, not relying heavily on solid 8x8s in the source) |
| |
Axis/Oxyron Account closed
Registered: Apr 2007 Posts: 91 |
There exists an old, but pretty good DYPP based on VSP in Anal Intruder. And AFAIK the best completely dynamic DYPP is in Mekanix. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
Quote:are you sure this is the same as DYPP?
i have no idea what "DYPP" should be exactly, and how its different from DYSP, to be honest :=) |
| |
HCL
Registered: Feb 2003 Posts: 728 |
I'm afraid we're going off-topic here, but to me a DYSP means Different Y SideborderSprite Position, which is quite far from a DYPP. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
sideborder? that doesnt match what i remember at all, DYSP is just a sine scroller with sprites. some tutorial (its also on codebase iirc) even makes a DYSP from just 8 sprites without any multiplexing :)
(and this is, why starting a discussion with references to those totally well defined abrevations makes no sense at all ... =P) |
| |
Dano
Registered: Jul 2004 Posts: 234 |
DYPP is just a pixelwide DYCP.
Wasn't it Different Yyielding Pixel Position? |
| |
Shadow Account closed
Registered: Apr 2002 Posts: 355 |
I think the old definition of DYSP was Different Y Sprite Position, ie. when you had a routine that could have open sideborder and move sprites in Y.
DYCP = Different Y Character Position (ie. a since scroller where each character could move in y)
DYPP = Different Y Pixel Position (ie. a since scroller where every horizontal pixel of the character could move in y)
Ah, the good old days when every effect had to have a name! :) |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
real men make snurkel scrollers anyway. in the sideborder of course :) |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
Quote: real men make snurkel scrollers anyway. in the sideborder of course :)
Had to google that one. But https://www.youtube.com/watch?v=BmtIxiQDoZk only has DOPC (different orientation per character), rather than morphing each letter to fit the path. So lame ;-)
(Amiga super snurkel scroller/FLT for future reference, if the YT ever varnishes) |
| |
lft
Registered: Jul 2007 Posts: 369 |
Oh, the YT will vanish before the last 5.25" floppy becomes unreadable.
As for DYCP, I always thought that referred to the charbased effect where you render the letters into pairs of chars with speedcode. |
| |
Compyx
Registered: Jan 2005 Posts: 631 |
How would we call a DYCP (ie simple sinus-based char scroller) using sprites to make it move over a bitmap or FLI?
I did a few of those, and I wouldn't call them DYSP's. Just some trickery to make them appear as proper DYCP's.
I was thinking about doing a write-up on codebase about DYCP's, should be fun getting the terminology correct :) |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
Quote: How would we call a DYCP (ie simple sinus-based char scroller) using sprites to make it move over a bitmap or FLI?
I did a few of those, and I wouldn't call them DYSP's. Just some trickery to make them appear as proper DYCP's.
I was thinking about doing a write-up on codebase about DYCP's, should be fun getting the terminology correct :)
DYSPFLI :) normal bitmap just DYSP. |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
Quoting CompyxHow would we call a DYCP (ie simple sinus-based char scroller) using sprites to make it move over a bitmap or FLI?
I'd still call that a DYCP; the 'character' in the acronym is in my mind a unit of distance, that tells you the granularity of the effect. There are plenty of different ways to achieve it. |
| |
mankeli
Registered: Oct 2010 Posts: 146 |
I would do 8 copies of the charset (one for each pixel column) and then just LDA ORA ORA ORA ORA ORA ORA STA.
If you arrange chars nicely, maybe you can unroll the whole thing and do LDY LDA,y ORA,y ... dunno.
Maybe there's better way as well. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
better way: speedcode per char, to skip empty pixels. |
| |
Compyx
Registered: Jan 2005 Posts: 631 |
Even better: use VSP, that way the shape of the dypp doesn't actually change and you can optimize a lot of code (no need to clear stuff, perhaps 'join' a few pixels in a single ORA, etc). |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
Quote: There exists an old, but pretty good DYPP based on VSP in Anal Intruder. And AFAIK the best completely dynamic DYPP is in Mekanix.
mekanix is cheating as far as I'm concerned, lda sta code, no ORA. |
| |
HCL
Registered: Feb 2003 Posts: 728 |
Quote: mekanix is cheating as far as I'm concerned, lda sta code, no ORA.
Mekanix is using precalculated fonts for a range of angles. It is still calculating individual sinus-values for each pixel-column, and then mapping it to best possible font.. The accuracy is ok i would say :). Also this way it can do more funny sinuses than VSP-stuff. |
| |
Compyx
Registered: Jan 2005 Posts: 631 |
Gotta admit those DYPP's look really smooth, and using a movement you can't get with VSP-trickery.
Never had seen that demo before even, I'm lagging behind badly :) |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
Ah, so that's how they managed such a large area. It's effectively caching intermediates, so that still counts in my book; just restricted to reasonably smooth functions :) |
| |
Codey
Registered: Oct 2005 Posts: 79 |
I believe The Larch III The Larch 3 had a mega-DYPP in it. The same effect using a 1x1 charset and 8 splits per char without pre-plotting chars would take a massive amount of raster time. Plotting the bits in pairs resulting in 4 different Y positions per char still looks pretty impressive. |
| |
Dr.Science
Registered: Oct 2011 Posts: 41 |
We are in 2017 and you are talking about keeping lamers out? Sounds like 1989... :-) |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
Well, The Larch 3's from 1989, so I guess that fits at least..
But yeah, I think a somewhat more welcoming attitude to newbies is more important than ever. |
| |
Sam
Registered: Aug 2010 Posts: 21 |
I'm too stupid to figure out the trick in the multi-dypp-part of "Crest Avantgarde". Would anyone care to share any thoughts on that? I did a couple of dypp-routines in 1989-1992, but I always sucked in "vic tricks", amongst a lot of other things I sucked and keep sucking in.
The DYPP in Anal Intruder uses the same trick than mekanix, based on what I read about Mekanix here, no VSP (is vsp = vertical screen position here?) involved, but a lot suckier code optimizations.
Wouldn't a VSP trick to create a dypp just generate a static "road" of text? Unless the VSP is there just to save cycles when scrolling, but the pixel-per-pixel-sine has to be created in other ways, to have the text moving/animated. |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
Mekanix does a true dypp when only 1 is shown, and fake char anim when 2 AFAIK. |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
If the multi-DYPP part in Crest Avantgarde uses VSP, it only does so for the scrolling (and/or the moving colour gradient).
As for the actual DYPP effect, i guess there's a lot of copying of pre-rendered animated characters going on.
Note how the sine period is rather short, so there aren't so many frames to cycle through until wrap.
Also note how parts of many different characters are identical, possibly reducing the amount of animation data so that everything just barely fits into 64 kilobytes. |
| |
Sam
Registered: Aug 2010 Posts: 21 |
Thanks, Krill! I can sleep at night again :-) I had a memory of the wave being bigger, but looking at the effect again I realise that it was a much tighter loop than I imagined. The biggest trick, to me, here is the clever font. I should have noticed the lack of special characters right away *shame*.
BTW, my dypp in "Typical" had no special chars because each character shape was a speedcoded lda ora sta and I was too lazy to do all the chars. IIRC there was still memory left though. |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
I wonder if the char-transpose approach (swap pixel rows and columns in an 8x8 pixel grid) discussed in https://csdb.dk/forums/?roomid=11&topicid=121737#139125 may in practice really be useful for things like DYPP. =) |
| |
HCL
Registered: Feb 2003 Posts: 728 |
Quote: Mekanix does a true dypp when only 1 is shown, and fake char anim when 2 AFAIK.
Nope. it's exactly the same DYPP code when i show 1 and 2 scrolls. When showing 1 DYPP there is a double y-sinus, but when showing 2 DYPPs there are single y-sinuses.. simply because i don't have time to calculate TWO double y-sinuses :(. despite calculating 39 chars instead of 40 :P |
| |
Sam
Registered: Aug 2010 Posts: 21 |
HCL, your routine is a big improvement from my trick then, I just precalculated the sinus wave + the char fits. Using regular DYCP + selected char animations, are you moving the chars up and down with just basic DYCP or is there more going on there? |
| |
HCL
Registered: Feb 2003 Posts: 728 |
Damn it, i just checked the code (TurboAssembler code from 2005). In single-mode i calculate 160 double-sin values (all 40 chars :P). Then i sort out the lowest one for each char (lda + 3 compares per char), and save as y-offset. Next i do a similar compare to sort out char-internal y-difference, where only [-, 0, +] are taken care of -> 27 different combinations where each one has its corresponding pre-calculated font (pre-calculated during fade-in of course). Then shuffle the data.
The double dypp skips alot of the above. Seems like it just picks a sinus value for the whole char, and then picks another sinus value (should be aprox the derivative..) and use for the tilting angle.. In the end it is the same copy-code and everything else work the same, but yeah it's a cheat! So.. Sorry Oswald, you were right.. You are always right :). |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
Nah no, I find myself often on the wrong :) But having coded in turbo asm is cool, I did that in early 2000's hehe :) |
| |
PAL
Registered: Mar 2009 Posts: 292 |
https://youtu.be/-9F5z8K0PXY?t=1874
NOW THIS IS A DYPP - by yours truly and pantaloon :-) |
| |
Krill
Registered: Apr 2002 Posts: 2980 |
Quoting PALhttps://youtu.be/-9F5z8K0PXY?t=1874
NOW THIS IS A DYPP - by yours truly and pantaloon :-) Nice, but the actual character definition is pretty 8x8-ish. =)
One could argue that it's not an instance of the DYPP effect class discussed here. |
| |
PAL
Registered: Mar 2009 Posts: 292 |
of course one can argue in that... but it is per pixel in y movement WITH extra layer of vertical lines moving behind in opposite direction... beat that DYPP scroller please... let the argue begin :-) |
| |
Sam
Registered: Aug 2010 Posts: 21 |
PAL, my DYPP from 1989 (Poor/Bias Crusher [fixed]) has two different color texts on top of each other, with per pixel y movement and no animated chars, there is also techtech to make it fluffier :-)
But I give it to you that yours is much nicer looking. |
| |
PAL
Registered: Mar 2009 Posts: 292 |
your is from 1989 andtherefor the best! I am a pixel artist, if I could code I would beat you all but I simply can not code... but I can get them things to be inside limits in a way thet few can.... I take off my hat for all your splendid code... but still I think mine is the best DYPP on the c64 ever... it is super huge and free feeling.... but yeah... I know what you say. |
| |
Rudi Account closed
Registered: May 2010 Posts: 125 |
Quote: Nope. it's exactly the same DYPP code when i show 1 and 2 scrolls. When showing 1 DYPP there is a double y-sinus, but when showing 2 DYPPs there are single y-sinuses.. simply because i don't have time to calculate TWO double y-sinuses :(. despite calculating 39 chars instead of 40 :P
|
| |
Rudi Account closed
Registered: May 2010 Posts: 125 |
Quote: I wonder if the char-transpose approach (swap pixel rows and columns in an 8x8 pixel grid) discussed in https://csdb.dk/forums/?roomid=11&topicid=121737#139125 may in practice really be useful for things like DYPP. =)
Actually, I had that in mind when I started that thread :) |
| |
Rudi Account closed
Registered: May 2010 Posts: 125 |
Crap. how do I delete faulty comments? |
| |
Lubber
Registered: Jan 2002 Posts: 26 |
My DYPP in the last part of Screech had a fixed sinus. Although the font is hires, the sinus is always 2 bits wide, so it was possible to have less animation positions to save memory.
https://www.youtube.com/watch?v=rU07Amaad1A&t=10m |
| |
Rudi Account closed
Registered: May 2010 Posts: 125 |
@Lubber: Nice! |
| |
Raistlin
Registered: Mar 2007 Posts: 680 |
here are a few different ways to do DYPPs...
1) real-time... this hasn’t been done well yet AFAIK and I’m not sure that there’s much point in doing so as, yeah, it would be much slower than a precalc’ed one;
2) char-based with multiple charsets... this is the method I used in The Dive. Use a large font built out of pieces from a columnised font (eg. If you have a 7x7 char, 56x56 pixel font, try to make that font using 32 1x7 char strips). Have an offline program that essentially plots the full screen sinus into a buffer - and then for each screen line, work out all the chars that would be needed in a charset to draw that line (ie. iterate over the 32 strips and place each one). When your program finds that the new chars on a line give a charset with more than 256 chars, mark off the charset for the previous line and start the current line again with a new charset. Using this method you’ll probably find you need 5, 6 or 7 different charsets, depending on how good your font is. Using this method you can also generate some really nice fully unrolled plot code... since each char is built using 1 of 32 strips, you end up with just “LDA FontLookupData_PartXXYY, y”, “STA ScreenAddress + YLine * 40, x” or something to that effect.
3) plot-based, such as the all border DYPP in Rivalry... this uses a similar technique - but you instead look at packing each line of each font character into lookup tables... this can take a lot of memory of course. The effect in Rivalry was much harder than you might imagine as, iirc, there was ~30k of that data... and then the fully unrolled plot code interleaved into the border opening and sprite multiplex code... not to mention the bitmap memory, animation data, etc etc.
Maybe a Codebase article might be a good idea to do sometime to describe some of these things properly..? |
| |
HCL
Registered: Feb 2003 Posts: 728 |
I think that pretty much sums up the original question of this thread. Everyone knows how a DYPP looks, but there is in fact no straight forward way of doing it on the c64. Either you use one of the mentioned techniques, with their pros and cons, or you try to be really clever and find out something new that suits your needs. |
| |
Sam
Registered: Aug 2010 Posts: 21 |
The one-color DYPP in Typical was a sort of a real-time, it draws the advancing character line and then removes the tail in real-time. This only works with one-color filled chars that are simple enough, no script etc. |
| |
zscs
Registered: Sep 2010 Posts: 49 |
Last time I really coded something newly, that was in 1994 so I'm sorry in advance, if I would write something stupid. :D
In 1993, I was keen of trying to copy other's stuff by my own and created a kind of realtime DYPP in Attempt one. File "2...SCROLLDYPPER" PRG<
(I don't know what demo/intro was the inspiration here)
I'm just trying to check the code, as I can see, 16x16 chars matrix is a kind of saving rastertime here and I definitely chosen the multicolor because it also doubles the rastertime, but... I also did an interlace here. I dunno why and dunno how, however, can give a cool idea to someone for something more clever (maybe). ;-)
Use joystick to control speed and axis. Press key 1 or press 2 to start interlace ON/OFF.
(I know, I know, lame code, but I was 15 years old here and this is a one-person 'demo group') :) |
| |
Scan
Registered: Dec 2015 Posts: 111 |
Quoting zscs
In 1993, I was keen of trying to copy other's stuff by my own and created a kind of realtime DYPP in Attempt one. File "2...SCROLLDYPPER" PRG<
I think it looks really nice, but I can't stop wondering how DYPPER would be pronounced. ;) |