跳到正文
炼金金· 来源· @Timojoy713 · X·· 3 天前同新闻AI 评分78

同一新闻,精选展示《Karpathy 用 Claude Code 和 Opus 5.5 基于真实数据构建游戏地图》

正文

Karpathy 四天前又发了个周末项目:用美国真实公开数据,铺一张文明风格的战略地图。现在 322 万浏览、1.66 万收藏。

作者 Andrej Karpathy,原文:https://x.com/karpathy/status/2125779541952246039

下面是全文,我按他的原意重新整理成中文

——

我让 Claude 用美国的真实数据,填一张文明风格的游戏地图。Opus 5.5 自己下载并解析了大量公开数据,7 个小时、4.5 万行代码之后,它能跑了。

  • 31 个真实数据源,包括人口普查局、经济分析局、劳工统计局、能源信息署、海洋大气管理局、地质调查局、国防部、国家公园管理局、联邦航空局、联邦应急管理署、疾控中心……
  • 海拔、土地覆被、GDP、就业、电厂、矿山、港口、机场、军事基地、公园、大学、货运、灾害,全部对齐到一张 25 公里的六边形网格上。
  • 数据被翻译成了文明的语言。比如黄金产量就是 GDP。一座城市的区域,按它真实的产业特长来定:圣何塞是 Campus,底特律是 Motor city。居民也按真实就业结构来:圣何塞每 4 个劳动者里,就有 1 个是工程师、程序员或科学家,全国平均是每 14 个里才有 1 个。奇观按公开规则挑选,比如国家公园看游客量,大学看研发支出。
  • 19 种透镜(收入、学历、信仰、灾害……),524 个都会区的城市视图,9 位顾问,外加一个 Explorer。Explorer 能把 3100 多个县的任意一列数据,做成表格和散点图,并跟地图连在一起。
  • Claude 自己决定跳过了几个州和领地,抱歉。
  • 用的是 Claude Code 桌面版,模型是 Opus 5.5,中等推理强度,并打开了 ultracode。

网站在这里:https://karpathy.ai/usaciv/ 问号里也有源码链接。他自己说不太清楚接下来要做成什么,但翻着玩很有意思,也许以后能扩成一个游戏。不过他这周的 Claude 额度只剩一半了,后面得别人接着做。Claude 还顺便做了条预告片。

——

能核实的部分

  1. 原帖发于 11 月 26 日上午 10 点 31 分(北京时间),今晚 8 点多看是 322 万浏览、1.66 万收藏、2.92 万赞
  2. https://karpathy.ai/usaciv/ 现在能打开。站点 sources.json 正好是 31 个数据源,普查局、BEA、BLS、EIA、NOAA、USGS、国防部、公园局、FAA、FEMA、CDC 都在里面
  3. cities.json 是 524 个都会区;lenses.json 是 19 种透镜,里面包括收入、学历、信仰、灾害;world.json 里有 3109 个县,网格字段 radius 为 25.0,和原帖说的 25 公里网格一致
  4. 顾问列表是 9 位,外加 Explorer,和原文一致。圣何塞的区域是 Campus,城市徽章写 Tech city;底特律的徽章就是 Motor city。公民数据里,圣何塞工程师/程序员/科学家占比 26%(约 1/4),全国是 7.4%(约 1/14)
  5. 站点说明写明阿拉斯加、夏威夷和领地还没画上去。问号页提供 http://usaciv-source.zip,注明 MIT
  6. 7 小时、4.5 万行代码、额度只剩一半,这些是他自己说的,我没法单独核对

给中文读者

网站现在能打开,问号里有 MIT 源码包。

圣何塞的 Campus、底特律的 Motor city,还有 1/4 对 1/14 的就业对比,都能在站点数据里对上。

引用Andrej Karpathy@karpathy
I asked Claude to populate a Civilization-style game map with real data from the US. Opus 5.5 downloaded and parse a ton of public data and 7 hours and 45K lines of code later... it works :) - 31 real data sources including Census, BEA, BLS, EIA, NOAA, USGS, DoD, NPS, FAA, FEMA, CDC... - Real elevation, land cover, GDP, jobs, power plants, mines, ports, airports, bases, parks, universities, freight flows, disasters; all reconciled onto one 25 km hex grid. - The data is converted into Civilization language, e.g. Gold yield is GDP. A city's districts are its real industry specializations: San Jose gets a Campus, Detroit is "Motor city". Its citizens are its real workforce: 1 in 4 San Jose workers are engineers, coders or scientists, against 1 in 14 nationally. Wonders are chosen by published rules, such as national parks by visitor numbers and universities by R&D spending, etc etc. - 19 lenses (income, degrees, faith, disasters…), a City View for 524 metros, and nine advisors plus an Explorer. The Explorer turns any column for any of 3,100+ counties into a table and scatter plot, linked to the map. - Claude decided to skip a few states and territories sry - Built using Claude Code desktop app, Opus 5.5 on medium and turning on ultracode. It's deployed here: https://karpathy.ai/usaciv/ and the "?" has the source link too. I don't exactly know where I was going with this but it's really fun to browse and play with. Possibly it can be expanded or built into a game. I only have half of my weekly Claude quote left though so someone else will have to take over :D. Claude also made a trailer:
在 X 查看被引用的帖子

来源:炼金金 · x.com