按年被提到
20092014 · 17 次2026
开源书›图形与游戏·No.12

Game Programming Patterns

游戏编程模式
Robert Nystrom

用游戏代码讲设计模式与架构,网上可免费读全书

免费阅读 ↗
被推荐 · 129 人首次 2009-10-11 · 最近 2026-07-25官方免费在线(版权保留,作者或出版社免费放出)
129不同的人
98活跃月份
51有推荐的月份
144讨论串

Robert Nystrom 写的设计模式书,把常见模式放到游戏开发的背景下讲,涵盖命令、观察者、状态、游戏循环、组件等内容,示例用 C++。文字清楚简洁,还带有作者自己的口吻。和经典的《设计模式》相比,它更现代,也更偏重在游戏里会遇到的实际问题,其中许多章节对非游戏开发者同样有用。

HN 为什么推荐它

HN 上的人推荐它,是因为写得清楚、有趣,而且内容超出游戏范围,适合想学软件设计与模式的人;常被当作《设计模式》的现代补充,也被引用来解释组合优于继承。

难度 3 / 5约 15 小时
适合谁

做游戏或想提升代码设计的程序员

读之前最好知道
1面向对象编程
2C++ 基础语法

怎么读

由 Claude 根据这本书和 HN 上的说法整理,可能有错
  1. 1先读开头对设计模式的介绍,再挑自己感兴趣的模式章节读
  2. 2游戏循环、组件、状态这几章最值得先读
  3. 3每章先想一下自己项目里是否遇到过这个问题,再看书里的解法
  4. 4可以和自己的小游戏项目配合着读

HN 书评

推荐在前,同类按时间 · 每本最多保留 20 条,统计用全部提及 · 作者本人贴的不算
推荐abhijat · 2013-05

“The following resources proved useful:”

列为了解游戏如何构建的有用资源
The C++ Programming Language (4th Edition)原评论 ↗
推荐scott_s · 2013-07

“I'm going to jump on the bandwagon and say that these are very well written - clear and concise, but they still retain authorial voice, and the examples work as intended.”

称写得清晰简洁,有作者风格,示例可用
Game Programming Patterns原评论 ↗
推荐anon1385 · 2013-10

“I think his Game Programming Patterns book is great: Game Programming Patterns”

称这是一本好书
For modern development, Javascript is just something you need to learn原评论 ↗
推荐taeric · 2014-06

“at a glance this[1] article seems pretty good. And is basically this idea.”

推荐一篇讲数据布局与 prefetching 的文章
C++: Vector of Objects vs. Vector of Pointers原评论 ↗
推荐jcrites · 2014-07

“Folks who enjoyed this article might also like the book Game Programming Patterns: Game Programming Patterns”

向喜欢这篇文章的人推荐同一作者的书
Dropping Loot原评论 ↗
推荐teamhappy · 2014-07

“Here's a lengthy article that explains it way better (IMHO): Game Programming Patterns”

推荐它,称对 composition over inheritance 讲得更清楚
Why composition is often better than inheritance原评论 ↗
看全部 20 条 →
推荐laurenbee · 2014-07

“Bob Nystrom's Game Programming Patterns is an engaging, informative book about design patterns that are commonly used in games but are relevant to non-game software too.”

称引人入胜,其中的设计模式也适用于游戏之外
Ask HN: How best to learn software design principles?原评论 ↗
推荐dangets · 2014-08

“Thanks for your book by the way! I loved it.”

对作者表示感谢,说自己很喜欢这本书
The Case for Buying Technical Books原评论 ↗
推荐hemdawgz · 2015-02

“I know this site was written specifically for game programming patterns:”

回应 game loop 的问题,指出这个站点专讲游戏编程模式
Annotated code: Circles bouncing off lines原评论 ↗
推荐tosh · 2015-05

“check out his book on Game Programming Patterns. Great read of software design and patterns (not only for game developers).”

推荐,称是软件设计和模式的好读物,不限游戏开发
Bootstrapping a Type System原评论 ↗
推荐mordocai · 2015-09

“Game Programming Patterns looks like an excellent book for me to read in order to try to not make some really stupid mistakes in basic architecture when starting out.”

想读它来避免起步时犯基础架构错误
What we break when we fix ad blocking原评论 ↗
推荐agentultra · 2015-12

“If design patterns are comfortable and understandable for you then check out Game Programming Patterns[0]. It's a decent book.”

推荐给熟悉设计模式的人,称是不错的书
Announcing Handmade Quake原评论 ↗
推荐wsc981 · 2016-05

“the Game Programming Patterns[0] website is a great read. I bought the book, but all content is available on the site.”

称网站很好读,内容全部在线,自己还是买了书
I Have Created 50 Games in 2014原评论 ↗
推荐squeaky-clean · 2016-06

“If you want a little more reading this is a nice example of an application of reification [0].”

拿它作为 reification 的应用例子
Alan Kay on the misunderstanding of OOP (1998)原评论 ↗
推荐stepvhen · 2016-07

“Bob Nystrom wrote a very good chapter on composition in his Game Programming Patterns book [1] and is worth reading if you want to program in the OO paradigm.”

推荐其中讲 composition 的一章,适合 OO 程序员
Goodbye, Object Oriented Programming原评论 ↗
推荐adrianoconnor · 2016-12

“It's full of interesting lessons and patterns and deals with coupling and state management. It won't have the answers to copy and paste, but it gives you a lot of food for thought and it's really well written.”

称讲了 coupling 和 state 管理,启发多、写得好
Choosing Functional Programming for Our Game原评论 ↗
推荐msangi · 2017-01

“I really enjoyed Game Programming Patterns and I've been looking forward for this book since I saw the link on munificent's homepage”

称很喜欢同作者的另一本,期待已久的这本
Show HN: Crafting Interpreters – A handbook for making programming languages原评论 ↗
推荐adamnemecek · 2017-01

“HN's own @munificent wrote a book discussing the most important design patterns in game design. Good book applicable beyond games.”

推荐 HN 用户 munificent 的书,称不限于游戏
A trip down the League of Legends graphics pipeline原评论 ↗
推荐Nition · 2017-02

“Having read Design Patterns in the past, I found Game Programming Patterns to be a really good modern follow-up, though it's targeted at game developers in particular.”

称是 Design Patterns 之后的现代续作,面向游戏开发
The most mentioned books on Stack Overflow原评论 ↗
推荐ingve · 2017-03

“Bob wrote (the very excellent!) Game Programming Patterns [0].”

称作者写的这本书非常出色
How I Made $70k Self-Publishing a Book about Ruby on Rails原评论 ↗