编程与软件工程fabiensanglard.net编辑精选
《另一个世界》的多边形艺术
The Polygons of Another World
2020 — 2022,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
这是 Fabien Sanglard 对经典游戏《Another World》(1991)的深度技术解析,讲解作者 Éric Chahi 如何用多边形渲染在当时的 Amiga 等硬件上实现电影化的全动态画面。文章剖析了游戏的字节码虚拟机、多边形填充算法以及当年硬件的种种限制与巧思。
为什么经久不衰:它把一款 1991 年游戏的渲染技术讲得透彻又迷人,多年来持续启发人们把游戏移植到各种新平台,是复古游戏编程领域的经典长文。
HN 评论精选
指出当年 Amiga 硬件设计并不适合多边形渲染,凸显该游戏实现的难度
《Another World》当年问世时令人震撼。虽然 Amiga 被视为高配机器,但它的图形硬件是围绕滚动、精灵和矩形块传输设计的,适合当时主流的平台跳跃和射击游戏,却完全不适合 AW 想做的全动态视频。Amiga 的 blitter 状态最好时每秒也只能写约 4MB——在一台 1920×1080 的现代显示器上,光清屏就要将近 2 秒。
AndrewStephens查看英文原文
Another World was _astounding_ when it came out. Although the Amiga was considered a high spec machine at the time, its graphics hardware was oriented around scrolling, sprites, and rectangular blits. This is good for the typical platformers and shoot-em-ups that dominated gaming at the time but useless for the type of full motion video the AW was attempting. The Amiga's blitter could write almost 4Mbs per second (if you set things up juuuust right and you had the wind behind you). On a modern monitor (a modest 1920 * 1080) the Amiga's blitter would take almost 2 seconds just to clear the screen.
补充了 SNES 移植版这一惊人的技术壮举
Interplay 的程序员 Rebecca Heineman 大约在 1992 年把《Out of This World》移植到了超级任天堂。这是了不起的成就:SNES 只有 3.58MHz 的处理器(你没看错),而且无法按传统像素位图方式绘制。她写的代码把三角形实时渲染进 SNES 的 8×8 块状平面格式,每个像素的位分散在四个平面里——而且跑到了 20 FPS,30 年后我仍觉得不可思议。
netcoyote查看英文原文
A programmer at Interplay, Rebecca Heineman, ported Out of This World to Super Nintendo around ... 1992 or so? It was an amazing accomplishment because the SNES only had a 3.58 MHz (yes, you read that right) processor, and wasn't afforded the luxury of drawing into a traditional pixel-oriented bitmap (e.g. one byte per pixel). The code that Rebecca wrote rendered triangles into SNES "chunky planar" format on the fly. The chunks are 8x8 pixel tiles, where the bits of each pixel are spread out across four planes (https://sneslab.net/wiki/Graphics_Format). And all this at 20 FPS, a feat which still boggles me, 30 years on.
证明这篇文章至今仍在激发新的移植项目
这个系列文章连同 another_js 启发了我正在慢慢开发的《Another World》Game Boy Color 移植版。由于游戏基于字节码(加上 another_js 那个出色的单文件 VM 实现),让游戏以灰度跑起来工作量不大;但要把 16 色调色板适配到 GBC 的 4 色调色板并保持好看,就得手工绕开平台限制。我强烈推荐把它移植到其他系统或用新语言实现它的 VM,作为业余项目非常有趣。
mattcurrie查看英文原文
This series of articles, together with another_js[1], inspired my port of Another World for the Game Boy Color that I'm slowly working on[2][3]. Getting the basic game running in shades of gray was relatively little work due to the game being bytecode based (and the great single file example VM implementation from another_js!), but getting the game's 16 colour palette to work with the CGB's 4 colour palettes and still look good is unfortunately a very manual process to work around the limitations of the platform. Anyway, it is a lot of fun to work on. I'd highly recommend as a hobby project porting it to some other (less constrained) system, or implementing the game's VM in whichever new language you're interested in trying. [1] https://github.com/cyxx/another_js [2] https://www.youtube.com/watch?v=dv00LlmFq0o [3] https://twitter.com/mcurrie/status/1451460454530764800
对文中关于 Amiga 1000 和 Commodore 销量的说法提出技术纠正
惯例给作者纠错:Amiga 1000 其实有 ROM 里的引导加载器(Kickstart loader),是两片共 64KB 的 EPROM;它缺的是 ROM 里的固件和操作系统。冷知识:当年比尔·盖茨曾保持为 Altair 8800 手写最短引导加载器的纪录——只有 13 字节,每次开机都得用拨动开关手动输入,直到 2017 年才被人以少一个字节打破。另外 Commodore 最畅销的产品是 C64,不是 Amiga。
rasz查看英文原文
Traditionally some corrections for the author: >The Amiga 1000 could not boot by themselves, they had no ROM. The bootloader was on a floppy and you better not lose or damage it! Amiga 1000 has bootloader (Kickstart loader) in ROM, chips U5N and U5P - two 256Kbit EPROMs/mask ROMs, 64KB in total. What it didnt have was firmware(Kickstart, like PC bios) or system(Workbench, like PC DOS/Windows) in ROM. You can see chips containing A1000 bootloader on the motherboard picture, its the two with stickers, right below two 8250 CIA chips https://www.bigbookofamigahardware.com/bboah/media/download_photos/a1000mbrev6.jpg You cant boot(load) without a bootloader. Trivia: Back in the day Bill Gates held a record of writing the shortest bootloader for Altair 8800, computer with nothing but LEDs for output and switches for input. You had to input said bootloader every single time you wanted to load something (like BASIC) from tape. 'Computer Notes Volume 1, Issue 6, 1975' Page Twenty-One, Author Bill Gates: “I’ve written a bootloader that only takes 13 bytes of keyed-in data, but anything smaller than 20 bytes isn’t easy to use.”. He was finally beat by one byte in 2017 http://just8bits.blogspot.com/2017/03/doing-it-in-less-than-bill-gates.html >It was Commodore best selling product with an estimated 6 millions units shipped from 1987 to 1991 other than you know, C64 ;-) and thats not counting other products like Datasette Commodore 1530, shipped with every VIC-20 and C64. >amiga_arch.svg Chip RAM is not directly connected to CPU, its gated behind AGNUS https://www.pmsoft.nl/amiga/A500-block-diagram.jpg DBR signal is what switches CPU data bus access.
强调游戏画面的艺术成就,并推荐视频直观感受
文章技术细节非常扎实,但静态截图无法展现画面的美感,推荐看长实况视频。很难相信这是 1991 年做出来的,画面看起来相当现代、极其漂亮。
echelon查看英文原文
The article is wonderfully technical and full of meaty details, but the stills just don't do the art justice. Here's a long play that gets right into the action: https://www.youtube.com/watch?v=utrxk5_PeEY I can't believe this was done in 1991. It looks perfectly modern and is incredibly gorgeous to look at.
历次讨论
同类还值得读
开源应用架构
The Architecture of Open Source Applications
《开源软件架构》(AOSA)是一本在线免费书,邀请知名开源项目的作者亲自剖析其内部设计,涵盖 SQLAlchemy、LLVM、Audacity、Apache、Bash 等系统。
编程与软件工程上首页 9 次 · 2011–2024aosabook.org编辑精选编程语言简史:简短、不完整且多半错误
A Brief, Incomplete, and Mostly Wrong History of Programming Languages
一篇以戏谑、故意不准确的方式回顾编程语言史的博客文章,用夸张轶事和讽刺定义串起 Lisp、C、C++、Java、JavaScript、PHP 等语言。
编程与软件工程上首页 8 次 · 2009–2021james-iry.blogspot.comSQLite 是如何测试的
How SQLite is tested
SQLite 官方文档页,系统介绍 SQLite 的测试体系:多种测试方法(TCL 测试、模糊测试、回归测试、静态分析等)和海量测试用例,展示了这个小型开源项目如何靠极致测试获得…
编程与软件工程上首页 8 次 · 2009–2025sqlite.org编辑精选高级编程语言(2009)
Advanced programming languages (2009)
Matt Might 的经典文章,按用途推荐“高级编程语言”:如果追求就业就选主流语言,如果追求表达力、学术研究或创业,则推荐 Haskell、OCaml、Scala 等函数式语…
编程与软件工程上首页 8 次 · 2009–2022matt.might.net我的 Forth 与栈机器经历
Yosefk - My history with Forth & stack machines
作者以亲身经历回顾了使用 Forth 语言和栈式机器的历程:既赞叹其简洁优雅、代码量小、可自举的优点,也坦率指出栈操作在实际编程中的痛苦,以及 Forth 社区文化中的问题。
编程与软件工程上首页 8 次 · 2010–2024yosefk.com编辑精选