- 最后登录
- 2014-10-23
- 注册时间
- 2011-7-19
- 阅读权限
- 90
- 积分
- 81303
- 纳金币
- -1
- 精华
- 11
|
In this tutorial we will be looking at an important concept of games development; instantiation. The process of instantiation or instancing as it is also known, is where you load or create objects at runtime through scripts.
Introduction
Normally, when you want an object to appear in a scene or level you place it from the library into the scene and position it in 3d space. This is useful for static objects or objects that always appear in a specific spot. However in your average game, there are many things that do not appear in a specific spot, all the time.
If we think about what objects appear in a game that are instanced (i.e. created dynamically through code or "spawned") here are just a few examples:
■Monsters / Creatures / Enemies
■NPC characters are often instanced
■Player characters are also often instanced
■Quest items in RPG's
■Rewards - such as rings in Sonic games or chests in RPG's
■Components of puzzle games
So in summary, instantiation is simply the process of dynamically spawning an object as opposed to it being manually placed in a scene. As you can probably imagine, this topic can get very long and incredibly complicated when you consider different types of game and how the implementations of instantiation could be formed.
Therefore we will start with some very basic technical examples and then move onto more practical implementations. |
|