- www-cs-students.stanford.edu
这篇游戏开发资源大全由斯坦福大学的Amit整理。
这里有什么?
我喜欢由简单的部分进行延伸。这个页面包含了我在从事游戏开发过程中收集的内容,这里的内容并不是全部,而是代表了我需要了解的一些内容:几个主题(并不是全部与游戏开发有关),一般概念而不是特定平台的信息(图形、音频、编译),思路或者设计模式而不是源代码(我发现从思想到代码比从代码到思想要容易),像Gamedev Tuts+、Gamedev和Gamasutra覆盖的主题范围比我的更广。
最短路径
在地图上选择行动路径是一个有趣的问题,有很多不同的方式,从简单(比如直线行走直到遇到障碍)到复杂(启发式路径探索算法)。这里包含了一些常见的寻路算法,其中一些偏向于A*:
- Amit’s Introduction to A*, Breadth-First Search, Dijkstra’s Algorithm, and Greedy Best-First Search — with interactive diagrams and sample code(NEW!)
- Overview of Motion Planning covers both movement and pathfinding algorithms
- Amit’s Notes about Path-Finding
- Overview of the main issues that come up when choosing a pathfinder
- Choosing a graph representation for pathfinding
- Vehicle Pathfinding (long)
- Game pathfinding and AI resources
- Technical papers about navigation and paths
这些页面是寻路和物体移动的技术
- Finding the “best” path is hard
- Using Regions for Shortest Path
- Shortest Path vs. Maze Solving Algorithms
- Applet showing obstacle avoidance (also see more steering behaviors)
- Steering Behaviors
- Pathfinding for Tower Defense — with interactive diagrams and sample code(NEW!)
- Design flaws with steering behaviors
- Collision Avoidance Behavior of Pedestrians
- Terrain Analysis used in Age of Empires
- Motion using Potential Fields
- Pathfinding: the basics covers different types of graphs (grids, waypoints, navmeshes) used for graph search algorithms like A*
- Fringe Search [PDF] - possibly faster than A* for games (download the code here)
- Cooperative Pathfinding [PDF] - useful when you have many units moving in narrow spaces, and need the units to be aware of each other
- Introduction to Pathfinding Algorithms
- More Pathfinding algorithms (minimum spanning tree, Dijkstra’s algorithm, Johnson’s Algorithm, Bellman-Ford, Floyd-Warshall, …)
- Terrain recognition and obstacle avoidance
- Movement in space, with spaceship acceleration. Also see part 2 and part 3.
- Flanking algorithms using pathfinding
A*
A*是我当前最喜欢的算法,因为它在各种空间中的花销都不高,而且似乎比大多数的图形搜索算法都要快。然而,它只是寻路问题的部分解。地图设计和表示出现在A*之前,网格使用起来更方便,但有时得不到最优路径。编队、路径跟踪、移动、路径修正、动画出现在A*之后。很多游戏根本不需要A*:它处理离散的移动而不是连续的,它应用在图上,没有充分利用空间相关性(比如一个点与它的邻居位置接近)或者时间相关性(比如几秒前我们找到了一个路径,我们再试一次的结果可能是相似的)。如果游戏内改变很频繁,那就没必要预测的太远。A*是一个好的工具,但并不是唯一的选择。
- A* Demystified
- Intro to A*
- Using Navigation Meshes for pathfinding
- Multi-resolution A*
- Lists vs. Binary Heaps for A*
- Choosing a heuristic for A* (and other performance notes)
- An analysis of heuristics for A* [PDF]
- Speeding up A* by dropping admissibility
- Path Finding [150+ message newsgroup discussion] [290k]
- A* references
代码和例子
- A* for Beginners (with Basic code)
- A Java Applet demonstrating A* (mirror site) (be sure to use the Fudge method for best results)
- A* Explorer [Windows application] Lets you step through the A* algorithm.
- Flash pathfinding demo, includes source code.
- Python code for A* and other search algorithms — note that the
astar_search
function is only four lines long!
A*代码的链接是第二版本,修复的一些bug,做了一些优化,对不同的启发法和代价函数进行参数化处理。第一个版本的代码可以在Steve Woodcock的页面获得,这个版本可能更易读和理解。
人工智能
我玩游戏的很多时候希望电脑对手能更强一点。有些时候电脑玩家给予了不同的规则,有些时候给予了更多的资源。结果就是游戏让人感觉不平衡了:很显然电脑的智能不够,本来应该是脑力对决的游戏,却变成了脑力和体力对决的游戏。同时,我也不希望电脑的水平太高,如果那样的话,它会经常击败我,我会很沮丧的。
- Overview of Game AI
- An introduction to AI in Games
- Guide to AI architectures: ad-hoc, state machines, behavior trees, utility functions, planners, neural networks
- AI Wisdom [book]
- Geoff Howland’s Practical Guide to AI and part 2
- A different Overview of Game AI [PDF]
- Great Expectation-Formations — AI shouldn’t just react to the world, but it should form expectations about the world, and react to deviations from that.
- Terrain Reasoning for 3D Action Games [PDF]
- Planning in Games: an Overview - STRIPS, HTN, Behavior Trees, Utility systems
- Using Potential Fields in RTSes
- The AI of F.E.A.R [PDF] - Jeff Orkin’s planner AI
- Need-driven AI
- The Procedural AI in Killzone [PDF] Includes line of sight, firing range, pathfinding, and tactical evaluation at run-time
- Making AI more challenging, in particular, by making it less predictable
- Strategy and Tactics by DreamWeaver [62k]
- Behavior trees
- AI in Empire-Based Games
- Hierarchical AI
- Monster AI in Unangband
- Grenade handling AI [PDF]
- The Current State of Human-Level Artificial Intelligence in Computer Simulations and Wargames: A list of references for game AI
- Getting more Behavior out of Numbers - alternatives to using hard thresholds
- Secrets of Enemy AI in Uncharted 2
计算机人工智能常常被应用在电脑玩家上。然而,它也可以用在环境上(比如铁路大亨中所有的交易),协助玩家上(比如文明中自动化的城市管理),或者是中立的游戏角色上(比如角色扮演游戏的非玩家角色)
- AI Beyond Computer Games
- Under the Hood of The Sims [slides] (also see these design docuemnts)
- S.T.A.L.K.E.R. uses the terrain to assign goals to the NPCs nearby
人们在高谈阔论将神经网络、遗传算法或者机器学习应用在游戏开发上,在你这样做之前先读一下这个。我并不打算提供任何参考,我将指出一些最近谈论太少的技术。
- Subsumption Architecture for AI (Rodney Brooks)
- AI in Black & White
- Introduction to Reinforcement Learning (if you find this topic interesting, be sure to see the book by Sutton and Barto)
在为你游戏中的人工智能选择技术时,记得越简约越好。如果你知道答案,直接把答案写在程序里。如果你知道如何得到答案,那就把解答过程写到程序里。只有当你既不知道答案也不知道解决方案的时候,才有必要求助复杂的算法(神经网络、模拟退火、遗传算法、包容结构、增强学习、遗传程序设计)。这些技术在编程时间、游戏性能、调试难度、控制性等方面都要付出很高的代价。
游戏设计
关于游戏开发,如何选择正确的设计是比较困难的一部分。什么使得游戏有趣?游戏设计是一门艺术而不是一门科学,它包含的不仅仅是游戏的规则,还有你与游戏交互的方式。
- How to Prototype a Game in Under 7 Days — some good advice for getting something put together quickly to see if it’ll make a good game
- Tight Systems of Cause and Effect
- Too Many Clicks! Design the UI around the things the player wants to do, not around the objects in the game.
- The Chemistry of Game Design
- Game Balance
- Ramblings about RPG Design includes topics such as balance, food, economy, time, death, weapons, storyline, and magic.
- Confessions of a horrible game player - why you shouldn’t punish game players for playing your game
- Resources, currencies, and meters
- The Design of Online Economies: Part 1 (Currency), Part 2 (NPC Merchants), Part 3 (Items), and Part 4 (Skills)
- The Essence of Computer Games
- Evolutionary Design - why you should get something up and running before designing everything about your game
- Medieval town size: how many peasants are needed to feed towns and armies
- Persistent Myths about Game Design
- Urban modeling - models used in SimCity
- Sims, BattleBots, Cellular Automata, God and Go - an interview with Will Wright
- Designing simulation games - they’re games, not necessarily realistic models
- Game Economies and self-balancing designs
- The 36 plots for games
- One Billion Buttons: how to gradually teach complex concepts
- Positive and Negative Feedback
- Believability in games (read the comments too)
- Progressive vs. Experience games
- Realism in games: how much is too much?
- An example of why you don’t want too much realism in a game
- The use of physics in games
- Loops and Arcs - structures for game design
- The Future of Game Design (2005)
- Addictive Games
- Designing controls for a game, including how to combine controls to build more complex ones
- Design notes for my game, SimBlob
- Design notes for my game, Solar Realms Elite
- Understanding randomness in terms of mastery
- Design documents for Ultima 7 part 2
- SimCity Essay
- Why you should share your game designs
- The Focus of Gameplay
- UI for games: displaying information vs. immersion
- Bad Twinkie, a database of game design mistakes
- Random numbers for damage rolls and other RPG stats
- Building tight game systems of cause and effect(NEW!)
区块游戏
我喜欢基于区块的游戏,因为它可以从简单的部分衍生出很多复杂的东西。这里有很多关于区块游戏的话题。数据结构就是典型的二维数组的变种,呈现方式就是把区块的数据转换成以2D、2.5D、3D的视角呈现,也有关于侧视视角的,我这里并没有写。区块游戏也可以使用创世算法,比如暗黑破坏神、文明、矮人要塞。
数据结构
基本的区块结构不依赖于你以2D、2.5D还是3D的方式呈现,这些文章是关于如何存储你的数据。
- Tile-Based Games FAQ
- Amit’s Thoughts on Grids includes squares, hexagons, and triangles
- Data structures for tile based games
- A file format to handle linked lists of objects
- Placing multiple objects on each tile [newsgroup discussion]
- Streaming Data: how to choose tiles to load, if your entire map doesn’t fit into memory
- Tile-based games techniques
区块显示
2D区块的呈现方式有很多种。最直接的是自上而下或者侧视。但是最近更常见的是2.5D和3D视角。这里的大多数2.5D视角都不是真的,而是四边形的。
- Guide to projections in games
- Creating Isometric worlds
- Isometric, Dimetric, Axonometric projections
- Isometric Engines - are they for you?
- Overview of Isometric Engine Development
- Isometric math - converting back and forth
- Implementing isometric tile systems
- Isometric Coordinates using basis vectors
- Sorting objects in isometric view
- Why 2D is Better than 3D (not specifically about games)
- Offsetting background tiles, drawing tiles from corners instead of centers to improve terrain transitions
- Marching squares goes into details about implementing tile drawing from corners
- Creating tile seams for textures.
- Map representations for 2d platformers
算法
- Line Of Sight Algorithms
- Computing Line of Sight for Large Areas
- Tutorial for making a Roguelike, including map representation, dungeon generation, field of view, fog of war
- Line tracing on a grid — determining all tiles that are touched by a line
- Collision, visibility, and grid representation in tile based games, including using edge information
- 2d visibility on a grid, using polygons for computation, and part 2, which improves the algorithm
- Visibility algorithm for top-down 2d polygon map which can also be used with tiles
- Precise angle shadowcasting in a 2d grid
- Determining the range that a unit can move to
- Using tiles for flows [video and paper] The idea is to put motion/flow information into the tiles instead of in the objects; it reminds me of the reversal of roles in The Sims objects
- Influence maps
- Occupancy grids, using influence maps to let NPCs track possible locations of players
- Also read about pathfinding algorithms, which are often used on grids.
创世
尽管地图产生可以应用在非区块世界上,但它更常应用在区块上。在某个时刻观察地图上的某一点,产生的地图质量很难跟人工绘制相比,然而它有三个优势:(1)如果有许多世界需要绘制,它的花销更少。(2)更多的复用数据因为下一次产生的世界会不同(3)游戏演变过程中潜在的进化。
- Amit’s Island Map Generator and demo (Flash)
- Procedural Content Generation: generating terrain, cities, buildings
- Dungeon generation in Unangband
- Generating game worlds with a lock-and-key structure so that certain rooms require objects from other rooms
- Algorithm for building rivers
- Adding rivers to randomly generated terrain
- The original Rogue algorithm for generating dungeons
- 11 Maze Generating Algorithms with demos and code
- Using noise functions to generate caverns such as those in Terraria and Minecraft
- Irregular shaped rooms, simple algorithm
- Tunneler algorithm for digging dungeons in DungeonMaker
- Guide to random Terrain Generation techniques
- Wiki guide to procedural content generation
- Simulating Large Virtual Worlds
六角区块
很多战争游戏使用六角区块而不是四角区块。四角区块与四个邻居都有重合边,但在某一时刻也与四个邻居相邻。这常常使得移动变得困难,因为对角线移动很难用整数来表示。在四角区块中,你或者有四个方向,或者有八个方向。但在六角区块中,你有一个折中选择——六个方向。六角区块在某一时刻不会接触任何一个邻居,它有更小的周长面积比,它看起来更整齐。不幸的是,在我们四角像素的计算机世界里,六角使用起来不太容易,所以我收集了一下文章帮助你把通常的四角区块算法转换成六角区块算法。
- Amit’s guide to hexagonal grids - with interactive diagrams
- Amit’s Thoughts on Grids includes squares, hexagons, and triangles
- Overview of hex grid coordinates
- Hexagonal coordinates explained, including hex/pixel coordinate conversion
- Numbering Systems; Distances; Angles
- Isometric Cube Coordinates
- The HexPart numbering system with algorithms for range, bearing, offset, and line of sight
- Comparison of Hexagonal coordinate systems, including pixel to hex coordinates, and hex distances
- Hexagonal Coordinates and Distance function
- Hexagonal Grid Math, including mouse position to hex coordinate, and source code in Java and Actionscript
- Pixel Location to Hex Coordinates
- Converting mouse location to hex coordinates
- Line of Sight and Distance, plus a Java applet demonstrating field of view (includes Java source)
- Identifying directions in a hex grid [PDF]
- Grids used in Cellular Automata
面向对象编程
我发现面向对象编程对用户交互、操作系统、游戏中是十分有用的。同时,通常也认为面向对象是最佳的编程方式(尤其是在我创建这个页面20世纪90年代),在另外一些条件下,其余的编程方式可能是更好的选择。因为我的大多数读者都熟悉面向对象的编程,这里我收集的内容大多数是通常方式的替代选择。
- Data-oriented instead of object-oriented, and part 2
- Why data layout matters for performance
- Understanding Component-Entity Systems
- Entity systems instead of Objects, especially for MMOs. I found parts 2, 3, and 5 most useful; also see how to apply entities to Bomberman
- What is an entity framework? - step by step, how to move from traditional OOP to entities
- Components for game entities
- Entity systems in terms of nouns and verbs
- How to represent hierarchical data in a data-oriented way
- Multiple Inheritance and RPGs
冒险游戏
冒险游戏通常有很好的谜团和故事结构。当我创建这个页面的时候,我对MUDS和交互小说很感兴趣。TADS是使用的工具。从那时起,有了很多的工具,比如Curveship, Hugo, Inklewriter, Twine, Quest, 和ADRIFT。我从没有参与过交互小说项目,所以我并没有很丰富的资源。你可以从互动小说的Wiki获得更多。
- Interactive Fiction design patterns
- The structure of puzzles in Ocarina of Time (Zelda)
- Modeling Opinions in the NPC Social Graph
- NPC Conversation Techniques
- Narrative Flow Graphs [PDF] based on Petri Nets, for representing story elements
- Big List of Plots
- Laws of MUDs
- Non-linearity in games
- Object Oriented Adventure Games
- Text vs. Graphical MUD thread [newsgroup posts]
- Text vs. Graphical MUDs (Raph Koster’s view)
- Modeling Opinion Flow in Humans: use the Boids algorithm to model human opinions in social groups
- Prose in Games
- I Have No Words & I Must Design
脚本语言
脚本语言能让你用较少的代码写出一些对性能要求不高的程序。你可以在游戏中设计你的特定语言,这样你的工作量就会比使用通用语言少一些。你也可以写编译器来优化很多事情(比如文件大小而不是速度),支持更多的特色(比如运行时动态匹配),甚至是用户自定义配置(对于发烧用户)。
- The Secret Life of Game Scripting
- Intro to writing an interpreter: in only 90 lines of code, he implements variables, execution, higher-order functions, recursion, branching, lists, trees, and procedure calls. (Not specific to games but a good introduction)
- Rule-Based Programming and a comparison to Object-Oriented programming for game scripting
- Properties Pattern, useful to know before you design your own language
- Bytecode Interpreter pattern and implementation
- Game scripting with Stackless Python
- Building a scripting engine parts 1, 2, 3, 4, 5, 6, 7, 8, 9
- NPC Scripting
- Discussion about what language to use, how to implement [newsgroup discussion]
- Scripting languages in MUDs [newsgroup discussion]
- Implementation strategies for scripting languages [newsgroup discussion]
- Writing modifiable games
- Scripting languages used in Interactive Fiction
- Using Stackless Python and microthreads for games
经济学
经济学是一门关于人类在管理资源(金钱、时间、幸福、原材料、货物等)中如何做出选择的学科。在很多策略游戏中,经济学都是设计的很重要的一个方面。平衡你的游戏中的资源可以成为游戏中有趣的一部分。经济学也是多人游戏中很重要的一部分:你想要通过挣钱奖励玩家,但你不能让他们太富有,这样新来的玩家就得不到乐趣了。我想探索的一件事是位置如何影响经济。在高中经济学中,商业活动通过定价完成,交易少的人将会获胜。但如果考虑上运输成本,那任何商业都可以共存,玩家必须考虑哪里要放置新的设备来平衡各种变量(劳动的易得型、原材料的运输成本、产品的运输成本、税率、地区法律等)
- Is it a game or a world?
- Economies in a virtual world
- AI Economics Agents
- Medieval Demographics Made Easy
- Economies of Virtual Worlds (more about macroeconomics than microeconomics)
- Medieval Price List
- Transport system in Widelands
- Economic model of Pirates of The Burning Sea: labor, prices, markets, upkeep, taxes, and world events
阅读原文 »