64kB 演示,它们是如何工作的?
我见过一些节目展示了令人惊叹的高度详细的 3D 场景和配乐,但令我震惊的是它们都小于 64kB!这些程序如何运作?
I've seen some programs showing amazing highly detailed 3d scenes with soundtracks, but what shocked me is that they are all smaller than 64kB! How do these programs work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
他们按程序生成内容。即他们不添加 3D 模型、位图、基于样本的音频文件...而是从代码或一些低细节表示生成。
使用自相似性(分形)并通过组合简单的构建块和公式来构建复杂的数据通常是紧凑表示的关键。
音频可以以某种类似 MIDI 的格式存储,其中存储不同的音符。
纹理是结合过滤器、分形等生成的......谷歌搜索“Perlin 噪声”作为一个简单的例子。 展示如何从柏林噪声创建截然不同的纹理
3D 模型可能有一些使用公式进行几何描述,并使用类似于程序纹理的技术添加细节。
大多数使用一些运行时解包器。即您的正常可执行文件大于限制并使用 exe 加壳器进行压缩。演示通常不使用 UPX,而是使用专门的加壳器,它们具有非常小的加载器/解壳器,甚至可能泄漏内存(如果您可以安全几个字节,谁会关心内存泄漏)。
They generate their content procedurally. i.e. they don't add 3d models, bitmaps, sample based audio-files,... but generate that from code or some low detail representation.
Using self similarity(fractales) and building complex data by combining simple building blocks and formulas is usually the key to a compact representation.
The audio could be stored in some midi like format where the different notes are stored.
The textures are generated combining filters, fractales,... google for "Perlin noise" for a simple example. Shows how to create very different textures from perlin noise
3D models probably have some geometric description using formulas and the detail is added with techniques similar to procedural textures.
And most use some runtime unpacker. i.e. your normal executable is larger than the limit and gets compressed with an exe packer. Demos usually don't use UPX, but specialized packers which have a very small loader/unpacker and might even leak memory(who cares about memory leaks if you can safe a few bytes).
过去,它们是用汇编语言编写的 COM。甚至还有 16kb 的演示。
我非常喜欢这些演示,这就是为什么汇编是我学习的第一种编程语言。我从未成功创建过真正的演示,但我能够创建一个病毒来清除我的硬盘。我没有源代码;)
Back in the day they were written in assembly language as COMs. There were even 16kb demos.
I liked those demos very much and that's why Assembly was the first programming language I learned. I never managed to create a real demo but I was able to create a virus that cleared my hard disk. I don't have source code ;)
它们是:
示例(代码示例!)可以在这里找到:
http://www .displayhack.org/2012/the-great-demoscene-sourcecode-giveaway/
别傻了 - 只要使用谷歌!
They are:
Examples (code examples!) could be found here:
http://www.displayhack.org/2012/the-great-demoscene-sourcecode-giveaway/
Don`t be stupid guys - just use google!!!