JS1k, 1k Javascript demo contest
category: code [glöplog]
way to go p01!
now we want multiplayer! :p
now we want multiplayer! :p
p4p4: Thanks for the notice.
The submit form on js1k borked the script of WOLF1K when I submitted it last night. Kuvos and I got in touch around noon today. I gave him a link to the JS file so that he could copy it as is and avoid the encoding issues of the submit form. Problem solved.
JSYK, at noon today, kuvos said he would keep approving entries but to limit plagiarism he would not be updating the site until the deadline. Meaning: no new entries visible on js1k until midnight CET.
Meanwhile you can check WOLF1K on my site.
The submit form on js1k borked the script of WOLF1K when I submitted it last night. Kuvos and I got in touch around noon today. I gave him a link to the JS file so that he could copy it as is and avoid the encoding issues of the submit form. Problem solved.
JSYK, at noon today, kuvos said he would keep approving entries but to limit plagiarism he would not be updating the site until the deadline. Meaning: no new entries visible on js1k until midnight CET.
Meanwhile you can check WOLF1K on my site.
did it, enjoyed sliding along the walls like 10 years before..
so --: what a shame, you won't get updated before midnight
so --: what a shame, you won't get updated before midnight
I'm not going to publish it on js1k, but I did a 128b random walk texture generator. It was tought to be used as texture for a 3d scene, but I finally didn't had time to do it...
Code:
x=y=w=300;setInterval("for(n=w;n--;y+=m(x+=m(y*x)))document.body.children.c.getContext('2d').fillRect(x%w,y%w,1,.1)",m=Math.cos)
texel: beware, it's the 'monster under your bed' !
p4p4: No biggie, you credited IQ's Shadertoy, so it's all good, he made a lot of modifications to my original ;)
A lossy image decompressor and an image in less than 1kb:
http://www.romancortes.com/ficheros/gioconda_js1k.php
The compression ratio is 32x, it outperforms JPEG in PSNR at that file size -- but the visual quality is very similar in any case.
Note that why it outperforms JPEG is not because my algorithm is good at general image compression, but just because JPEG doesn't perform good at very low bitrates.
*Looks better in Chrome and Safari
http://www.romancortes.com/ficheros/gioconda_js1k.php
The compression ratio is 32x, it outperforms JPEG in PSNR at that file size -- but the visual quality is very similar in any case.
Note that why it outperforms JPEG is not because my algorithm is good at general image compression, but just because JPEG doesn't perform good at very low bitrates.
*Looks better in Chrome and Safari
She looks a bit "square faced" ;)
She looks a bit awesome to me.
texel: Using UTF-8 even further, I think you could save ~50 bytes by doing:
Which is 227 bytes + ( the 361 characters long UTF-8 string ~ 722 bytes ) ~ 949 bytes max.
ps: I'd be curious to see the encoder for this thing. The quality is pretty good.
texel: Using UTF-8 even further, I think you could save ~50 bytes by doing:
Quote:
<body><canvas id=c><script>for(W=152,A=W*W;A--;c.getContext('2d').fillRect(A%W,A/W>>0,1,1-D))p="".charCodeAt((A/W>>3)*19+(A>>3)%19),r=p%16,m=p%17/16,a=(p-A%8)%67-33,b=(p-A/W%8)%53-26,D=Math.sin(r*r-(a*a+b*b)/199)*m*m+p%18/20</script>
Which is 227 bytes + ( the 361 characters long UTF-8 string ~ 722 bytes ) ~ 949 bytes max.
ps: I'd be curious to see the encoder for this thing. The quality is pretty good.
Does using the pig give better compression? (really, what is it supposed to be?!)
psonice: What do you mean 'supposed to be'? It's meant to be a pig. They compress best.
piglet compression > wavelet compression
I used the to save us all a 361 characters long UTF-8 string. You know 'coz I'm no Jazz musician and there's not much point posting that string here anyways.
gruik!
gruik!
Ahh, hehe. Thought it was some kind of 'replace chars xxx with pig' feature built into pouet for some reason. Like the sites that replace :) with shitty early 90s animgifs. That was a stupid thought :)
I'm using about 7,775 bits per character (8 bits byte) in the example (219 values possible), and have 722 charactes.
The maximum number of bits with 722 bytes is 8*722=5776
With my method 722*7,775~=5613
Then (5776-5613)/8~=20 bytes. But afaik, I can't use fully the unicode characters bits... Or I'm wrong? And, in any case... do you think it is worth the effort? If you think so, maybe I can send you my encoders (I have a lot of different versions, the one I used for the mona lisa example is one of the simpler) and we could try to do any kind of collaboration with these...
I thought, for example, in tiny video compression or something... Well, if you are interested, write to my e-mail!
The maximum number of bits with 722 bytes is 8*722=5776
With my method 722*7,775~=5613
Then (5776-5613)/8~=20 bytes. But afaik, I can't use fully the unicode characters bits... Or I'm wrong? And, in any case... do you think it is worth the effort? If you think so, maybe I can send you my encoders (I have a lot of different versions, the one I used for the mona lisa example is one of the simpler) and we could try to do any kind of collaboration with these...
I thought, for example, in tiny video compression or something... Well, if you are interested, write to my e-mail!
http://democopei.de/1021.html
Choose pixel size before shooting it off. Will hog your Firefox. :)
Couldn't submit it to JS1K, because it needs ISO-8895-1 charset to get compressed below 1K.
Choose pixel size before shooting it off. Will hog your Firefox. :)
Couldn't submit it to JS1K, because it needs ISO-8895-1 charset to get compressed below 1K.
@pixel:
Very good. Do you think it would be possible to make it faster (even if it were needed to make it a bit bigger)?
Could you post the source uncompressed?
I suppose you did, but, for the "ground", have you used a BIG sphere, isn't it? Using an "infinitely" big sphere should be cheaper in filesize than adding a plane equation.
Finally, I think the saturated sphere seen only in reflection doesn't look very good for me... I would have rather added it in the middle of the screen, to be seen both in the first ray and in the reflection rays.
Very good. Do you think it would be possible to make it faster (even if it were needed to make it a bit bigger)?
Could you post the source uncompressed?
I suppose you did, but, for the "ground", have you used a BIG sphere, isn't it? Using an "infinitely" big sphere should be cheaper in filesize than adding a plane equation.
Finally, I think the saturated sphere seen only in reflection doesn't look very good for me... I would have rather added it in the middle of the screen, to be seen both in the first ray and in the reflection rays.
@texel:
Thanks a lot! :)
You're perfectly right: it's all spheres. You can fetch the uncompressed version here:
http://democopei.de/1021-uncompressed.html
I guess no objects and more bare-metal code would speed it up. Görg, who helped to me to shrink the uncompressed version down and to make the thing aesthetically pleasing, suggested to use some more advanced techniques to trace less rays. (I hope we'll team up again.)
The saturated sphere looks worse if you can see it immediately - it was supposed to look like a sun. This was really all I could do before the mental breakdown when it couldn't be submitted. ;)
Thanks a lot! :)
You're perfectly right: it's all spheres. You can fetch the uncompressed version here:
http://democopei.de/1021-uncompressed.html
I guess no objects and more bare-metal code would speed it up. Görg, who helped to me to shrink the uncompressed version down and to make the thing aesthetically pleasing, suggested to use some more advanced techniques to trace less rays. (I hope we'll team up again.)
The saturated sphere looks worse if you can see it immediately - it was supposed to look like a sun. This was really all I could do before the mental breakdown when it couldn't be submitted. ;)
damn to late
http://funkylab.info/html5/1k-1/
http://funkylab.info/html5/1k-1/
Results available:
http://js1k.com/home
Congrats to p01, feiss and... is there any other demoscener at the list?
The results are very similar to my personal preferences. I'd have made the first Tiny Chess, wich is, not only amazing but the most popular at Twitter (and Twitter a very good estimator of general popularity) entry by a big margin. I'm sure it would have been the "public choice".
About Legend Of The Bouncing Beholder, it is really good, it would have been in my 2nd or 3rd position, so not a very big difference from the current results.
Tetris with sound is amazing too, but, it doesn't sound in all browsers. By other hand, Morse code generator sounds in all browsers. So, for me, and thinking in the rule of the compo "Must work on current fx, sa, ch and o.", tetris should be lower and morse code upper.
About Binary Clock, I think it was an absolutely stupid rule in the compo "6.Bonus points if your submission fits in one tweet ;)". Does it is a 1kb compo or a 140bytes compo? It looks really difficult to rate entries of the same size limit, but how to compare entries of so different sizes? For compiled code, it would have been very similar to a mixed 32/64bytes and 256/512bytes compo...
Finally, I've to say that if we demosceners had been the jury, the results would have been very different I think, probably biased to cool visuals. Since the open nature of the compo, I like the variety in the winners list.
http://js1k.com/home
Congrats to p01, feiss and... is there any other demoscener at the list?
The results are very similar to my personal preferences. I'd have made the first Tiny Chess, wich is, not only amazing but the most popular at Twitter (and Twitter a very good estimator of general popularity) entry by a big margin. I'm sure it would have been the "public choice".
About Legend Of The Bouncing Beholder, it is really good, it would have been in my 2nd or 3rd position, so not a very big difference from the current results.
Tetris with sound is amazing too, but, it doesn't sound in all browsers. By other hand, Morse code generator sounds in all browsers. So, for me, and thinking in the rule of the compo "Must work on current fx, sa, ch and o.", tetris should be lower and morse code upper.
About Binary Clock, I think it was an absolutely stupid rule in the compo "6.Bonus points if your submission fits in one tweet ;)". Does it is a 1kb compo or a 140bytes compo? It looks really difficult to rate entries of the same size limit, but how to compare entries of so different sizes? For compiled code, it would have been very similar to a mixed 32/64bytes and 256/512bytes compo...
Finally, I've to say that if we demosceners had been the jury, the results would have been very different I think, probably biased to cool visuals. Since the open nature of the compo, I like the variety in the winners list.
Next time i will make a game, using "demoscene technology" LOL
Did anybody spot our entry?
http://js1k.com/demo/528
The chess entry is rather impressive, but still my favorite how-the-hell-can-it-fit 1kb chess must be this one! :)
Sdw: remember that the ZX 1kb is compiled code and it is much more compact than Javascript -- even if the JS code is compacted. The ratio can be around 1:2 or 1:3. (See JSpongy 284bytes versus Spongy 128bytes).
TinyChess have less than 700 bytes of Javascript for game play code (the rest is for chess board rendering), wich could be around 3-4 hundred bytes as compiled code. 1K ZX Chess lacks of queening but TinyChess have it. So, I think TinyChess is at least as impressive as 1k zx chess...
TinyChess have less than 700 bytes of Javascript for game play code (the rest is for chess board rendering), wich could be around 3-4 hundred bytes as compiled code. 1K ZX Chess lacks of queening but TinyChess have it. So, I think TinyChess is at least as impressive as 1k zx chess...
texel: on the other hand, the JS version had the graphics basically for free :)