| |
Shadow Account closed
Registered: Apr 2002 Posts: 355 |
Release id #116340 : Time Machine
Multiplexers are cool, and multiplexed DYSPs are of course even cooler!
I started thinking about the record here (32 sprites, 100 pixels y-movement) and when I calculate it, it seems mathematically impossible.
Taking 32 evenly distributed points along a 50-radius sine wave, I end up with at least 9 coordinates that are within 21 y pixels of each other, which would mean lines with 9 sprites on them.
Now, this demo uses added sines, and maybe it's here I'm messing up, because when experimenting with this, no matter what I try with two added sines, I always end up with worst-cases that are even worse than the original single sine.
Am I missing some simple math, or is this just a case of good old demo magic cheating somehow? :) |
|
... 2 posts hidden. Click here to view all posts.... |
| |
chatGPZ
Registered: Dec 2001 Posts: 11391 |
What i have done here and there... if there is some "impossible" combination of coordinates/sprite sprite positions - just skip it, move some sprite a line up or down. noone will notice it =) |
| |
Raistlin
Registered: Mar 2007 Posts: 689 |
Quote: What i have done here and there... if there is some "impossible" combination of coordinates/sprite sprite positions - just skip it, move some sprite a line up or down. noone will notice it =)
I think that’s the point here though… “no-one will notice it” is fine for regular demos… ones that are going for world records, though, can’t really do that.. it would be “cheating” ;-) |
| |
chatGPZ
Registered: Dec 2001 Posts: 11391 |
Wow cheating in demos? WTF |
| |
JackAsser
Registered: Jun 2002 Posts: 2014 |
Quote: Wow cheating in demos? WTF
Hahaha indeed WTF. :) |
| |
Raistlin
Registered: Mar 2007 Posts: 689 |
Quote: Hahaha indeed WTF. :)
You know what I mean though… I’m sure in HCL’s scrolltext somewhere he mentioned that the records were achieved without cheating on the sinuses. Like, it would be something like:-
Y = A * Sin(B) + C * Sin(D)
Without any further modification.
While (!bSpriteFits) Y++
would be “cheating”. I know most people wouldn’t see it - but if that was happening, it would be hard to say “I beat you, Crossbow!” (Or whoever). |
| |
chatGPZ
Registered: Dec 2001 Posts: 11391 |
Reminds me of the scrolltext where crossbow explained the vertical rasters =) |
| |
ChristopherJam
Registered: Aug 2004 Posts: 1409 |
The first couple of harmonics of a triangle wave will get you there.
cos(th)*45+cos(th*3)*5 ranges from -100 to 100, and the closest gap in a sorted sprite list of 32 evenly distributed phases never drops below 21.5
You get a slightly more comfortable function from cos(th)*44.13+cos(th)*5.87. Minimum gap for that is around 22.9. Bump the overall range to 100.9 and you'd increase the gap to a touch over 23. |
| |
Shadow Account closed
Registered: Apr 2002 Posts: 355 |
Thanks CristopherJam, cool to see that there was a mathematical solution to this!
In my very non-mathematical try-different-values-and-see-what-happens I never stumbled upon this since I never tested with two waves with so large difference in amplitude.
The resulting wave btw. is very triangular-looking, but it still is the result of two correct waves added, so not at all cheating.
A satisfying end to this little mystery! |
| |
HCL
Registered: Feb 2003 Posts: 728 |
Oh yeah.. i'm the subject of another deep discussion *again* ;)..
Haha, i actually found the bunch of c-programs that i used for generating those sinuses, ending up with almost one program specialized for the properties of each part in the demo.. I will save you from that mess, but yes they loop through some million sinuses, first finding the best angular offsets for the purpose, and then trying a bunch of fraction offsets to the results to see if the quantization (float -> integer) accidentally generates a better result..
Simply rocket science at its best :D. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11391 |
As always, if you can't make it work using brute force, use a bigger hammer :=) |
Previous - 1 | 2 - Next |