• Facepunch Programming Competition #10: I've got 4K problems
    73 replies, posted
[IMG]http://i.imgur.com/HqPaLnF.png[/IMG] [b]Theme[/b] The theme of this quarter-year-period's competition is 4k demoscene! Your goal is to fit a demo in four kilobytes (4096 bytes) or less. Think it's not possible? Check the resources. [b]Duration (In GMT)[/b] Competition Starts: 1st October 2013 Competition Ends: 31st October 2013 (at the end of the day) Voting Starts: 2nd November 2013 Voting Ends: 9th November 2013 (at the end of the day) You need to turn in your demo by the end of 1st November 2013 at the latest. You can add bug fixes after your demo is complete, but only if the bug fix fixes a demo-breaking bug. [b]Prizes[/b] Does anyone still do this for prizes? Anyways, when the voting ends, the person who wins will get first choice of prize. The second one who wins will get second choice, and so on, until we're out of winners (that won't be too hard). Please don't earmark your prizes for certain winners, as this just complicates things. [b]Competitors[/b] - supersnail11 - robmaister12 - jamie1130 - Chris220 - BMCHa - synthiac - quincy18 - Kybalt - Richy19 - HellSoldier [b]Rules[/b] - Use any language or framework you want - however, the total executable, including libraries that need to be installed, must be less than 4096 bytes (this really limits you to OpenGL or DirectX and a language that compiles to machine code - sorry) - Program MUST run on Windows, Mac, or Linux. No DOS, Amiga, etc. (but it can run on all three if you want) - Team up if you want, but only one prize for the whole team. - You can't start your demo before the start date. [b]Previous Competitions[/b] #9: The Contest Unseen - [url]http://facepunch.com/showthread.php?t=1282304[/url] #8: Calla Dootify the Classics - [url]http://facepunch.com/showthread.php?t=1259964[/url] #7: Super Hyper Game Demake - [url]http://www.facepunch.com/showthread.php?t=1228162[/url] #6: Halloween Edition - [url]http://facepunch.com/showthread.php?t=1216934[/url] #5: Arcade - [url]http://www.facepunch.com/showthread.php?t=1159773[/url] #4: Procedural Generation - [url]http://www.facepunch.com/showthread.php?t=1105841[/url] #3: Non-Combat Gaming Experience - [url]http://www.facepunch.com/showthread.php?t=1064093[/url] #2: It's a Coder's Holiday - [url]http://www.facepunch.com/showthread.php?t=1041206[/url] #1: Pong - [url]http://www.facepunch.com/showthread.php?t=961746[/url] [b]Hall of Fame[/b] eirexe - Won "Stealth" competition NinjaWilko - Won "Calla Dooty" competition Everyone lost the "demake" competition Dlaor - Won "Arcade" Competition i300 - Won "Procedural Generation" Competition Dlaor - Won "Non-Combat Gaming Experience" Competition Jallen - Won "It's a Coder's Holiday" Competition Turb_ - Won "Pong" Competition [b]Resources[/b] Iñigo Quílez's articles: [url]http://www.iquilezles.org/www/index.htm[/url] in4k (backup): [url]http://web.archive.org/web/20070527220313/http://in4k.untergrund.net/index.php?title=Main_Page[/url] 4klang: [url]http://4klang.untergrund.net/[/url] Crinkler: [url]http://www.crinkler.net/[/url] Tiny PE: [url]http://www.phreedom.org/research/tinype/[/url] Demo Archive: [url]http://www.pouet.net/prodlist.php?type%5B0%5D=4k&page=1&order=thumbup[/url] Reducing Executable Size Tips: [url]http://www.catch22.net/tuts/reducing-executable-size[/url] If you have any other resources, post them! [b]Other Info[/b] Website with a bit of info & clock: [url]http://fpcomp.cash4america.us/[/url] Now go! Make some demos and/or get mad at me for not choosing the one network protocol idea!
Times like this make me wish I knew C's OpenGL. Also there's a typo in the Rules: 4096 k
I'm in
I'm a bit busy with school, but this looks awesome. Also, typo under duration section: [QUOTE]You need to turn in your demo by the end of 1st August 2013 [/QUOTE] Looks like we all missed the date.
I'll play.
I'm entering.
Count me in.
[QUOTE=Dragonflare;42361860]I'm a bit busy with school, but this looks awesome. Also, typo under duration section: Looks like we all missed the date.[/QUOTE] This is why I should stop editing the old post every new thread :v:
Having never done anything like this before, I figured it'd be a good idea to poke around with Visual Studio 2013, C++, DirectX 11 and Crinkler. I have a 680 byte executable that initialises and creates a 800x600 window that is cleared each frame via DirectX. I'm not sure if this is a good start or not, I guess I'll have to add some stuff to get a feel for whether I need to cut that base down some more or not.
I don't even.. A blank VS C++ project is like 7 kilobytes.
[QUOTE=reevezy67;42365795]I don't even.. A blank VS C++ project is like 7 kilobytes.[/QUOTE] C, ASM
[QUOTE=reevezy67;42365795]I don't even.. A blank VS C++ project is like 7 kilobytes.[/QUOTE] [url]http://www.catch22.net/tuts/reducing-executable-size[/url]
Is TCC the recommended compiler for this kind of thing?
I'm just using Visual Studio 2013 and C++, reducing the size down is quite easy. Use crinkler in place of VS's default linker, turn off all the standard libraries and that crap. Once you've done all that, you should be below 500 bytes on your executable size, that's where I started from. [editline]1st October 2013[/editline] These articles are old, but I found them quite helpful. [url=http://hugi.scene.org/online/hugi27/hugi%2027%20-%20coding%20corner%20darkblade%20creating%20a%204k%20windows%20intro%20-%20part%201.htm]Part 1[/url] [url=http://hugi.scene.org/online/hugi27/hugi%2027%20-%20coding%20corner%20darkblade%20creating%20a%204k%20windows%20intro%20-%20part%202.htm]Part 2[/url]
-Snipped look at newer post further in the thread-
You forgot to add #9 to the previous competitions.
I'll join.
Who needs crinkler!?! [code] #!/bin/bash clang -Os -fomit-frame-pointer -nostdlib -lGL -lX11 demo.c -o demo echo "dd bs=1 skip=60<4k|xz -d>/tmp/C;chmod +x /tmp/C;/tmp/C;exit" > 4k xz -zce -9 demo >> 4k chmod +x 4k [/code]
What's the size compared to crinkler?
[QUOTE=Agent766;42370023]What's the size compared to crinkler?[/QUOTE] Crappy, minimal X11 + OpenGL init is ~1500 bytes. Though I haven't really worked hard at it yet either.
[QUOTE=quincy18;42368608]I'll join this time, started working on it this afternoon : [IMG]https://dl.dropboxusercontent.com/u/28926055/FP4k.png[/IMG] Win32 Window + basic opengl = 691 bytes with no parameters in crinkler.[/QUOTE] Win32 Window + basic directx 11 = 680 bytes Gentlemen, I appear to have solved the age old GL vs DX war. Clearly.
[QUOTE=qqqqqqqq;42370135]Crappy, minimal X11 + OpenGL init is ~1500 bytes. Though I haven't really worked hard at it yet either.[/QUOTE] I dont know if it has any thing to do with the API, but most demo's I have seen are done in DX Can DX demos be made smaller than oGL?
I'm pretty sure it's just because he's not using Crinkler.
Not Crinkler V2 [code] #!/bin/bash clang -Os -fomit-frame-pointer -nostdlib -lGL -lX11 demo.c -o demo -Wl, -s echo "a=/tmp/I;tail -n+2 \$0|unxz>\$a;chmod +x \$a;\$a;exit" > 4k xz -zce -9 demo >> 4k chmod +x 4k [/code] I'm down to 1344 bytes now.
[QUOTE=Chris220;42370342]Win32 Window + basic directx 11 = 680 bytes Gentlemen, I appear to have solved the age old GL vs DX war. Clearly.[/QUOTE] Grr well it currently is still in fast mode and not optimized for size :P So turning up some of the parameters and then compiling it again will make it even smaller haha
Can I make a simple game in javascript? Or the game must be a executable?
Id like to say il be entering but Il most likely pull out at some point due to not having any fucking spare time, so for now I guess ill be a tentative entry
[QUOTE=Mete;42371023]Can I make a simple game in javascript? Or the game must be a executable?[/QUOTE] That's not really in the spirit of the thing. The challenge is to make a full demo that doesn't rely on the tons of abstractions that higher level languages provide, and do it in 4k.
The hell is meant by a demo? Are we supposed to make like a commercial game and then make a free demo, and make it under 4K? I don't really understand what exactly we're supposed to be making for this...
[QUOTE=synthiac;42373510][url]http://en.wikipedia.org/wiki/Demo_(computer_programming)[/url][/QUOTE] So, it's like a video but all the events (motion, sound, etc) are computed in realtime, rather than being prerendered? And it's under 4k? Well, count me out. Hah.
Sorry, you need to Log In to post a reply to this thread.