4kb's and line codes
category: general [glöplog]
I'm curious. How long are your 4kb's, in lines of code?
It's all about how good your code packs, but it's not that many lines. Keep it simple, keep it real.
it depends on your coding style. you can easily format it to be just one single line...
...fine, how many ; of code.
Syntax error in Line 1.
xernobyl: I tried to tell you that the relevance of code lines and size of executable doesn't matter. Partly because you'll end up spending some space on data.
But still, you can have quite a few k.
But still, you can have quite a few k.
someone just realized that the less there is space the less there is code, and why 4k coding is so trendy nowadays :p
The reason I'm asking is that I was having a discusion about code complexity and the amount of code you need to have something on the screen. I pretty much know how code compression works. Not compression, but I suck at math :)
Well, i guess the question then is, what do you want to see on the screen :) then for a specific scene, we can discuss the technic that is the most straightforward to acheive the visual result..
raytracing related technics are quite interresting, as you can render scenes of a relativelly non-boring complexity in very few bytes of code/shadercode.
raytracing related technics are quite interresting, as you can render scenes of a relativelly non-boring complexity in very few bytes of code/shadercode.
I know the reason there are a lot of 4kbs nowadays is because they're easier to make with the resources available and until very recently any kind of shit was easily accepted just because it's tiny.
I certainly wouldn't say easier, but your definition of "easy" here is very important. Sure, any doorknob can get an exe down to 4k but expectations for quality are MUCH much higher than they used to be. So it's much less a matter of that you got it that small and more of how intelligently you used your space.
All in all I'm saying it's not necessarily easier, just different.
All in all I'm saying it's not necessarily easier, just different.
And to answer your question, around 1200 or so lines in my current project and counting ;)
it's alot more fun (just ask spookysys :) and challenging.
it's alot more fun (just ask spookysys :) and challenging.
Agreed :) Much more time is spent getting it to fit and more spent on actual content...at least imo
My last demo (Stripped by Rebels) has 404 + 323 (gfx + synth with music) lines of code. Some code parts are totally commented out, but they are not that large. Code contains a lot of comments. Sample piece of code:
Code:
// Returns currently playing note volume (channel number is negative, starting from -1)
float GetNote ( char channel ) {
for ( int rowNum = g_timeNorm, i = 0; rowNum >= 0 && i < 16; rowNum--, i++ ) {
g_patternNo = ( rowNum >> 4 );
g_patternRowNo = ( rowNum & 0xF );
if ( GetFixedOrStreamValue ( channel ) )
return 1.0f / ( 1.0f + (g_time - rowNum*ROW_LEN_SEC)*10.0f );
}
return 0;
} // GetNote
clue: comments don't COUNT :D
I think the reasons for the increased popularity of 4k's are obvious:
1) No need for a big team (usually), the coder can play around much more and there is less red tape.
2) The good-ol' challenge-element. It's always more fun to do something challenging than something easy (if you're a coder)
1) No need for a big team (usually), the coder can play around much more and there is less red tape.
2) The good-ol' challenge-element. It's always more fun to do something challenging than something easy (if you're a coder)
i dont think lines of code is a good measure or guideline anyway.
it would be more interesting to compare uncompressed compiled code/data size plus their compression rates.
it would be more interesting to compare uncompressed compiled code/data size plus their compression rates.
no one implied that LOC is a measure of anything. answer the question or gtfo.
... relax grusbanan, relax
10kb of shader code, ran through a custom tool to make it 4kb big, and through crinkler crunched it down to 1,3kb. Are lines of code still worth mentioning? :) Look out for a shader battle in BP :)
since we're on it:
what's usually smaller when compressed? GLSL or ARB asm shaders?
what's usually smaller when compressed? GLSL or ARB asm shaders?
My experience tells me that ASCII compresses better (~33%) than bytecode (~55%)