doom3关卡编辑器代码的一些分析

来源:互联网 发布:尚观linux 编辑:程序博客网 时间:2024/05/09 13:38


地图编辑器包括了提供了地图组件,在两个类中


构建世界的几何brush和物体,跟国内的网游游戏的地图编辑器有所不同,国内的大多是室外的编辑,

一般有地形编辑器,室外的四叉树八叉树之类的场景,

不使用室内的bsp场景的分割

而doom3与之不同,大半乃是室内的brush来构建造的,来进行室内的游戏环境的建造。

殷勤上彻底去掉了光照贴图,光照非常的强悍,迄今为止很多游戏依然比不上doom3的画面,我认为依然有研究的价值,

凹凸贴图上的,反射图等太强悍的贴图技术了


World Geometry and Entities.  World Geometry represents the brushes 

世界的几何依靠,brush,


(the Q3A term for the blocks of geometry used to build the physical game world)

 and patches (anything built with calculated curves).

和patch,(使用裁剪计算,来建造的)

  Entities are a broad category that not only includes simplistic editor representations of game play objects like weapons and ammo,

entity(物体)在关卡编辑器中,不仅仅包括了游戏物体对象,例如武器和弹药

 but also includes diverse things like player start spots, 

但是也仅仅包括了一个东西,例如玩家的起点

灯和

and lights. Typically, they are displayed as brightly colored cubes

 (for those entities not constructed of brushes). 

还有一些物体,不是结构性的brush

 The following are the general category of entity types. The actual entities and the rules and tips for their use are listed in the Appendices.

 

Brush entities.

brush entity

  The “brush” is the basic building block of Quake engine games 

brush是一个基本的建造块关于quake引擎游戏(包括了quake,quake2,quake3和使用这个引擎的游戏)


(including Quake, Quake 2, Quake III Arena, and a host of games using the engine licenses).  

In its most basic form, it’s a block, a solid rectangular volume defined by the 

在很多基本的内容中,它是一个块,一个实体的矩形,体,被这个纹理,顶点

coordinates of its corner vertices. 

 A single brush or a linked grouping of brushes can be turned into a brush entity.  Brush entities include the movers (see below), triggers, and func_statics.

一个简单的brush,或者一个连接一组brush能够的被加入到了brush entity里面

Movers. Most moving objects or “Movers” are built from brushes. These include doors, lifts or “plats”, rotating objects, buttons, pendulums and trains (objects following pre-defined paths), and bobbers (platforms that are constantly in motion, up and down or side to side).

Triggers. Triggers are brush entities that cause an event to occur when a player’s bounding box moves inside the volume of the trigger. Triggers can be targeted on many other entities, including most movers and targets.  Some triggers also have more specialized functions.  There are triggers that cause injury, activate other entities, and push or teleport the players.

Targets. Targets are the entities that are activated to cause events to happen in Q3A, or to redirect activations, insert time delays, mark locations for team play, or act as destination points for teleportation or pushing.

                Lights.  These are point lights, disembodied (read as no visible source) sources of illumination. They ca n be targeted at info_nulls to create spotlights. They can be turned into colored lights. Usually, they are used to create unfocused fill light in a large area or placed near glowing surface textures to create an effect.

Info. This category includes non-team player spawn spots, targets for lights, and camera locators for intermission shots.

Items. With the exception of ammo and weapons, these are things in the map that the players grab to use during play.  Included are armor, power ups like the quad, and one-use items like the personal teleporter.

Ammo. Locations for ammo boxes. Each weapon type in Q3A has its own unique ammo entity.

Weapons.  Each of the weapons that can be picked up has an entity that can be placed.

Miscellaneous. This is another catchall category. It includes things like the misc_model which links into the models directory when placed, func_timers which are automated repeating triggers, shooters which fire one of three different weapon fire types, camera and portal surfaces, and path corners. 

一个在doom3中的单位为这个 unit


在进行于预先生成了这个光照的处理

对于编译成了这个bsp阶段的处理,乃是加载的这个上了bsp.dll,或者这个q3map.exe 

等等将这个map文件编译成为了这个bsp文件者也


Worldspawn Entity


Worldspawn

每一个地图都需要一个worldspawn位置


Only used for the world. You access the worldspawn entity by selecting any non-entity brush in your map.

worldspawn

的键值

Keys


message: text to print at user logon. Used for name of level.

music: path/name of looping .wav file used for level's music (eg. music/sonic5.wav).  This is for a piece of music with only one part. To make a song play with both an intro and a looping portion, the following is the correct form for the music value: 

music/intro.wav music/loop.wav

ambient: Adds a constant value to overall lighting. Use not recommended. Ambient light will have a tendency to flatten out variations in light and shade.


_color: This is the normalized formula for RGB values  for ambient light. A value is considered normalized when it fits in a range between 0 and 1.  If you are using a tool like the Windows color picker, divide the value for each component of the RGB values by 255.  The result will be a normalized value.

gravity: gravity of level (default is normal gravity: 800).



选项

用于设置关卡编辑器的属性了者也

例如


在quake3的view下面,点击,可以弹出来了这个对话框来


地图的这个保存文件路径保存位置

设定的照相机的移动速度



是否打开opengl灯光

是否加载的这个z对话框


打开的quake3游戏的这个路径位置

等等


在打开游戏时,出现一个控制台来显示出来这个opengl的扩展来


在控制台中还可以显示出来了者也,拖移,选择等等动作,相当于日志了者也


选中一个物体以后,显示出选择的这个entity的名字了者也



Currently a map should be within the bounds (-65536, -65536, -65536) -

(65536, 65536, 65536) for the bspc tool to compile. These are the same

limits the q3map tool has

设定地图的最大的包围盒为这个( (-65536, -65536, -65536)).(65536, 65536, 65536)


map菜单中
文件新建,文件打开等等的处理

保存,另存为,

退出等等


预设perf的加载了者也,

预设是指这个游戏各个关卡中可以重新利用的物体了者也,可以保存下来,在另一个关卡中重用了者也

保存预设,和加载预设的处理了者也


主要的函数有这个加载预制,

保存预制



editLights这个来编辑灯光,可以设定灯光的颜色,,初始的位置,当使用这个的时候,游戏中的灯就会变成了绿色的

precompile预编译部分,主要包括了,关卡编辑器,编译工具的代码

还有这个渲染,声音,图像,网络,ai等等各大部分的代码

简直跟quake3完全是两码事









原创粉丝点击