游戏开发概念梳理

1 data structure**

  • array: don’t fragement the memory, lie contiguously
  • linked lists: fragement the memory, very fast to add or remove elements
  • queue: priority queue, always sorted; useful in pathfinding

2 scripting

2.1 game engine and game special code
2.2 scripting language***
  • more simple to use
  • interpret at runtime
  • players can mod the game after realease
  • the time we make a code change, the time we can see the result in game
    drawback:
  • usually not compiled, lead lower performance than compiled language
  • tools support often more simple

the most important reason for using scripting language is that it reduce the time from writing the code until the changes occur in the game. in some case, it is also possible to modify the game when the game is played.
scripting language interpreted at runtime instead of being complied, leading to lower performance. the tool support is not as good as for complied languages.

3 architecture*

  • ad-hoc
  • modular
  • DAG
  • layer

4 game controller

handle thing that happen without player interation, for example AI agents

4.1 initialization and shutdown steps

load source into memory and unload them
RAII: when we create a game object, it is itself responsible for loading all the necessary resource (texture, scripting…)

4.2 fast shutdown

dedicate a large block of memory to the game world, and shutdown just wipe the whole memory.

4.3 main game loop

perform a series of tasks to keep the game world updated and alive. Gather player input; run AI; update game entities; render…
each iteration of this game loop is called a frame

explain why it is typically not a good idea to read player input at the ending of each frame**

since there is typically a wait at the end of each frame, reading player input at the end of the game loop might create a feeling of lag in the game

5 simulation

  • keep entities that needs updating in priority queue

6 collision

  • collision detection
    check if colliding with other entities
    speed by simplified collision volumns, organizing entities in grids or BSP tree to reduce the number of entity pairs we need to calculate collisions for.
overlap testing***

to detect if objects collide, we simulate the game world movements one discrete step at a time. in each simulate step, we check if two ojects are in collision. depending on how complex the objects are, the check can be a very simple or quite complex task. the limitation is if we have fast moving object like a bullet from a gun. at the simulate step t0, the bullet can be on one side of a window, and at step t1, the bullet at the other side of the window. the collision is therefore not detect.

intersection testing*****

intersection testing predicts furture collision before they happen. can slowly moved forward to the time of impact. if two extruded geometris overlap, we have a furture collision between the two objects.
there are two limitation that:
furture predictions rely on knowing the exact state of the game world.
intersection testing assums a constant velocity and no acceleration.

minkowski sum : to speed up overlap and intersection testing. is created by sweeping the origin of object X over all points belonging to object Y.

  • colision response
    calculate how it affects each entities

7 rendering

rendering a three dimensional scene onto a flat two-dimensional screen.

frame buffer and back buffer

the frame buffer is where what is shown on the actual screen is stored.

when compressing an image of high resolution to a lower resolution, visible aliasing can occur, therefore rendering engines often use antialiasing techniques to minimize these

depth buffer

for each pixel written to the back buffer, a depth value of that pixel is written to the depth buffer.
used to determine which objects are visible or not in a scene, to avoid rendering invisible objects.

stencil buffer 24/8

windows, rendering objects with reflections like a mirror

8 space***

the game world is located in the world space, and uses the global coordinate system
game objects are often defined in their own object space, and uses local coordinate system

camare space, what the camara see. the camara has a space in front, called frustum

before being rendering, objects need to be transformed from object space to world space, and then from world space to camara space. Everything outside the camara view, the frustum, is not rendered.

9 material*****

a meterial is used to render triangles in an object. it consists of textures, normals, tangent spaces, texture coordinates, reflectivity, and more if needed. the material is used by a shader when rendering the game object.

Texture filtering

bilinear: the color of a pixel is an average of the color the four closest pixels
trilinear: an extension of bilinear where we interpolate between two entries in a mipmap chain
anisotropic: used when a texture is scaled differently in horizontal and vertical direction

10 bone based animation*****

An animated character is made up of bones arranged in a tree hierarchy. The tree has a single root bone, which has one or more child bones. Each child bone can have one or more child bones, making up the tree structure. The transfrom of each bone is relative to its parent bone. Two bones are connected in a joint, and when animating the character bones rotate in their joints.

kinematics*****
  1. forward kinematics: the motion is forward down the hierarchy of bones. Calculates where each bone ends up when animating a character.
  2. inverse kinematics: calculates how each bones must move for the last bone, used when a character shall pick up or hit an object.

11 motion extraction**

when playing an animation, the character is often not stationary, for example a running animation. Motion extraction means that we can extract this motion from the animation, and move the entity the same distance in the game world.
Methods:

  • linear motion extraction : the root bone position at the last frame subtract the position at the first frame. linear interpolate when playing animation.
  • composite motion extraction : instead of interpolating between the last and the first frame, we interpolate between each keyframe in the animation.
  • variable delta extraction: in this case we sample the animation position in each frame using bezier curve.

12 reduce the memory required to store an animation****

we only store keyframes of an animation, we can use interpolation to calculate how the animation will look like between the keyframes
linear interpolate
bezier curve

13 gimbal lock problem****

two different rotation angles can produce the same result, referred to as poles. Due to this linear interpolation between two orientations can produce very bad result when rotating an entity

14 FSM

state, transition, condition for transition
在这里插入图片描述

15 findingPath

common data structure for pathfinding*****
  1. grid(game world divide into squares): a grid of square is placed over the game world, character can move from the center of one square to the center of adjancent square.
  2. waypoint graphs: a number of waypoints connected with links represent the game world, character can only move on a link.
  3. navigation mesh: game world divide into convex polygons. character can move freely wiyhin a polygon. two polygons connected with edge.

16 component systems***

adding or removing components does not require re-compilation of the code, can add or remove when game is running.

data driven composition*****

in data-driven composition, the game entities are not described in the code but in separate data file. the main advantage is that this enables to change game entities and their behaviour withou having to recompile the game.

17 development processes

waterfall model*

analysis; design; implementation; testing; maintentance
used to develop large game

18 math

dot product*

if both vertor is normalized, the dot product is the cosine of the angle between the two vectors.

matrix**
  1. diagonal matrix: a square matrix
  2. symmetric matrix: matrix that is equal to its own transpose. (every diagonal matrix)
  3. identity matrix (diagonal matrix + 1)
  4. inverse

19 debugging***

  1. reproduce the problem consistently
  2. collect clues and information
  3. pinpoint the error
  4. repair/fix the error
  5. test the solution
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值