骑砍战团MOD开发(29)-module_scenes.py游戏场景

骑砍1战团mod开发-场景制作方法_哔哩哔哩_bilibiliicon-default.png?t=N7T8https://www.bilibili.com/video/BV1Cw411N7G4/

一.骑砍游戏场景

     骑砍战团中进入城堡,乡村,战斗地图都被定义为场景,由module_scenes.py进行管理。

     scene(游戏场景) = 天空盒(Skyboxes.py) + 地形(terrain code) + 场景物(scene_obj) 

#  Each scene record contains the following fields:
#  1) Scene id {string}: used for referencing scenes in other files. The prefix scn_ is automatically added before each scene-id.
#  2) Scene flags {int}. See header_scenes.py for a list of available flags
#  3) Mesh name {string}: This is used for indoor scenes only. Use the keyword "none" for outdoor scenes.
#  4) Body name {string}: This is used for indoor scenes only. Use the keyword "none" for outdoor scenes.
#  5) Min-pos {(float,float)}: minimum (x,y) coordinate. Player can't move beyond this limit.
#  6) Max-pos {(float,float)}: maximum (x,y) coordinate. Player can't move beyond this limit.
#  7) Water-level {float}. 
#  8) Terrain code {string}: You can obtain the terrain code by copying it from the terrain generator screen
#  9) List of other scenes accessible from this scene {list of strings}.
#     (deprecated. This will probably be removed in future versions of the module system)
#     (In the new system passages are used to travel between scenes and
#     the passage's variation-no is used to select the game menu item that the passage leads to.)
# 10) List of chest-troops used in this scene {list of strings}. You can access chests by placing them in edit mode.
#     The chest's variation-no is used with this list for selecting which troop's inventory it will access.

     通过scene_flags标识为室内场景/室外场景,出生点随机生成等

#flags
##室内室外场景,进入城堡为室内场景,野外战斗为室外场景
sf_indoors           = 0x00000001   #The scene shouldn't have a skybox and lighting by sun.##是否加载天空盒
sf_force_skybox      = 0x00000002   #Force adding a skybox even if indoors flag is set.
sf_generate          = 0x00000100   #Generate terrain by terran-generator
sf_randomize         = 0x00000200   #Randomize terrain generator key##是否随机出生点
sf_auto_entry_points = 0x00000400   #Automatically create entry points
sf_no_horses         = 0x00000800   #Horses are not avaible
sf_muddy_water       = 0x00001000   #Changes the shader of the river mesh

二.场景天空盒

           CommonRes\skyboxes.brf 存放天空盒模型,骑砍天空盒是一个球体,材质支持RGB,HDR等天空盒纹理。

           Skyboxes.py 存放天空盒配置,高光和反射程度,实现夜晚,白天等不同时间的天空盒效果.也提供API实现天空盒的设置.

# Scene parameters handlingscene_set_day_time                           = 1266  # (scene_set_day_time, <value>),# Defines the time for the scene to force the engine to select a different skybox than the one dictated by current game time. Must be called within ti_before_mission_start trigger in module_mission_templates.py. Value should be in range 0..23.
set_rain                                     = 1797  # (set_rain, <rain-type>, <strength>),# Sets a new weather for the mission. Rain_type values: 0 = clear, 1 = rain, 2 = snow. Strength is typically used in range 0..100 but is actually unlimited. Affects number of particles and fog density.
set_fog_distance                             = 1798  # (set_fog_distance, <distance_in_meters>, [fog_color]),# Sets the density (and optionally color) of the fog for the mission.set_skybox                                   = 2389  # (set_skybox, <non_hdr_skybox_index>, <hdr_skybox_index>),# Version 1.153+. Forces the scene to be rendered with specified skybox. Index of -1 will disable.
set_startup_sun_light                        = 2390  # (set_startup_sun_light, <r>, <g>, <b>),# Version 1.153+. Defines the sunlight color for the scene.
set_startup_ambient_light                    = 2391  # (set_startup_ambient_light, <r>, <g>, <b>),# Version 1.153+. Defines the ambient light level and colour for the scene. Expects Fixed Point values between 0 and 1.
set_startup_ground_ambient_light             = 2392  # (set_startup_ground_ambient_light, <r>, <g>, <b>),# Version 1.153+. Defines the ambient light color for the ground.
get_startup_sun_light                        = 2394  # (get_startup_sun_light, <position_no>),# Version 1.165+. Returns startup sunlight color in (x, y, z) coordinates of position register.
get_startup_ambient_light                    = 2395  # (get_startup_ambient_light, <position_no>),# Version 1.165+. Returns startup ambient light color in (x, y, z) coordinates of position register.
get_startup_ground_ambient_light             = 2396  # (get_startup_ground_ambient_light, <position_no>),# Version 1.165+. Returns startup ambient ground lighting color in (x, y, z) coordinates of position register.

三.场景地形

    骑砍引擎中地形不采用静态模型进行实现,为了管理不同的情况下的地形,通过地形代码terrain code进行控制,地形代码包含地形长宽,地形植被茂密程度,高低起伏比例等特征,在大地图左下角的地形tab页进行编辑生成.

四.场景物

    骑砍引擎将定义的场景名添加scn前缀实现场景物的管理.场景物不仅包含静态的模型如门,城墙等,还包含地形增量,出生点,通道,AI网格等信息.

    场景物(scene_obj) = 静态模型房子/门(scene_prop) + 出生点(entry_point) + AI网格(控制AI自动游荡) + 通道(Passage).

    例如城堡town1的对应的scene_obj为scn_town1.sco,存放在SceneObj\scn_town1.sco中

    sco文件暂无编辑工具进行编辑,需调整骑砍战团为编辑作弊模式,进入场景后Ctrl + E进行编辑.

骑砍引擎场景编辑操作指导如下,例如:C/E/WASD 上下左右前后移动摄像机 

Left Mouse Button: While pressed, mouse movements rotate
the camera.
H: Hides/unhides the highlights and user interface objects
(Good for taking a screenshot).
CTRL + Any movement key: Speeds up the camera
movements, slows down the object movements.Edit Objects Mode
----------------------
Right Mouse Button: Selects objects.
CTRL + Right Mouse Button: Selects multiple objects.
Double Click on Scene Objects list: Selects the clicked
object and moves the camera towards it.
A,S,D,W: Moves the camera.
C,E: Increases/decreases the height of the camera.
G: While pressed, mouse movements move the selected
object(s) parallel to the ground.
T: While pressed, mouse movements increase/decrease the
height of the selected object(s).
X,Y,Z: While pressed, mouse movements rotate the selected
object(s) with respect to the object's X, Y and Z axis.
U: While pressed, mouse movements rotate the selected
object(s) with respect to the "Up" axis of the world.
R: Resets the selected object's rotation.
B: Scale selected object.
B + X: Scale selected object along X axis.
B + Y: Scale selected object along Y axis.
B + Z: Scale selected object along Z axis.
Alt + B: Resets the selected object's scale.
Delete: Deletes selected object(s).
Space: Enables add object mode.Add Object Mode
-------------------
Right Mouse Button: Adds current object to scene.
Space: Disables add object mode.
T, U, X, Y, Z, R and B can also be used in this mode.Ground Elevate and Ground Paint Mode
-----------------------------------------------
Right Mouse Button: Elevates the ground up or down in
"Ground Elevate" mode and paints the ground in "Ground
Paint" mode.
Midle Mouse Button: Clears the elevation in "Ground Elevate"
mode and clears the paints in "Ground Paint" mode.Edit AI Mesh Mode
---------------------
Right Mouse Button: Selects AI mesh objects.
CTRL + Right Mouse Button: Selects multiple AI mesh objects.
1: Activates Vertex Editing Mode
2: Activates Edge Editing Mode
3: Activates Face Editing Mode
G, T, X, Y, Z, B and Delete can also be used in this mode.Additional Help
------------------
- You can save your changes only when you leave the edit
mode.- You can not undo your works, you can only discard changes
while leaving the edit mode. So you should save your work
occasionally by leaving the edit mode and re-entering it.- Scene files are located under [Current Module]\SceneObj
foler. When you save your changes, the related scene file
under this folder will be updated.- Create AI Mesh button works only on outdoor scenes

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/314286.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Halcon闭运算closing

Halcon闭运算 文章目录 Halcon闭运算 闭运算的计算步骤&#xff0c;为先膨胀&#xff0c;后腐蚀。这两步操作能将看起来很接近的元素&#xff0c;如区域内部的空洞或外部孤立的点连接成一体&#xff0c;区域的外观和面积也不会有明显的改变。通俗地说&#xff0c;就是类似于“填…

Linux:/proc/sys/vm/目录各文件详解

目录 前言一、/proc/sys/vm/目录各文件二、相关功能的API函数 前言 /proc/sys/vm/ 目录是 Linux 系统中的一个特殊目录&#xff0c;它包含了与虚拟内存子系统相关的系统内核参数。这些参数可以用来配置系统的虚拟内存管理策略&#xff0c;包括内存分配、页面置换、内存压缩、NU…

Vue中使用JavaScript中的requestAnimationFrame动画循环实现循环滚动效果-demo

效果 requestAnimationFrame是一个由浏览器提供的 JavaScript 方法&#xff0c;用于在下一次浏览器重绘之前执行指定的回调函数。它接受一个回调函数作为参数&#xff0c;并返回一个整数值&#xff0c;可以用于取消动画循环。 使用 requestAnimationFrame 可以创建平滑的动画效…

【UnityShader入门精要学习笔记】(1)了解渲染流水线

本系列为作者学习UnityShader入门精要而作的笔记&#xff0c;内容将包括&#xff1a; 书本中句子照抄 个人批注项目源码一堆新手会犯的错误潜在的太监断更&#xff0c;有始无终 总之适用于同样开始学习Shader的同学们进行有取舍的参考。 文章目录 渲染流水线什么是流水线什么…

不吹不黑,辩证看待开发者是否需要入坑鸿蒙

前言 自打华为2019年发布鸿蒙操作系统以来&#xff0c;网上各种声音百家争鸣。尤其是2023年发布会公布的鸿蒙4.0宣称不再支持Android&#xff0c;更激烈的讨论随之而来。 本文没有宏大的叙事&#xff0c;只有基于现实的考量。 通过本文&#xff0c;你将了解到&#xff1a; Har…

【力扣题解】P106-从中序与后序遍历序列构造二叉树-Java题解

&#x1f468;‍&#x1f4bb;博客主页&#xff1a;花无缺 欢迎 点赞&#x1f44d; 收藏⭐ 留言&#x1f4dd; 加关注✅! 本文由 花无缺 原创 收录于专栏 【力扣题解】 文章目录 【力扣题解】P106-从中序与后序遍历序列构造二叉树-Java题解&#x1f30f;题目描述&#x1f4a1;题…

「网络编程」其他重要的协议或技术_ DNS协议 | ICMP协议 | NAT技术

「前言」文章内容是DNS协议、ICMP协议、NAT技术的讲解。 「归属专栏」网络编程 「主页链接」个人主页 「笔者」枫叶先生(fy) 目录 一、DNS协议1.1 背景1.2 域名简介1.3 域名解析的过程 二、ICMP协议2.1 ICMP简介2.2 ping命令2.3 traceroute命令 三、NAT技术3.1 NAT技术背景3.2 …

一起学Elasticsearch系列-写入原理

本文已收录至Github&#xff0c;推荐阅读 &#x1f449; Java随想录 微信公众号&#xff1a;Java随想录 文章目录 写入过程写操作写流程写一致性策略 写入原理RefreshMergeFlushTranslog图解写入流程 ES作为一款开源的分布式搜索和分析引擎&#xff0c;以其卓越的性能和灵活的扩…

跳跃表原理及实现

一、跳表数据结构 跳表是有序表的一种&#xff0c;其底层是通过链表实现的。链表的特点是插入删除效率高&#xff0c;但是查找节点效率很低&#xff0c;最坏的时间复杂度是O(N)&#xff0c;那么跳表就是解决这一痛点而生的。 为了提高查询效率&#xff0c;我们可以给链表加上索…

Java EE Servlet之Cookie 和 Session

文章目录 1. Cookie 和 Session1.1 Cookie1.2 理解会话机制 (Session)1.2.1 核心方法 2. 用户登录2.1 准备工作2.2 登录页面2.3 写一个 Servlet 处理上述登录请求2.4 实现登录后的主页 3. 总结 1. Cookie 和 Session 1.1 Cookie cookie 是 http 请求 header 中的一个属性 浏…

JVM工作原理与实战(三):字节码文件的组成

专栏导航 JVM工作原理与实战 RabbitMQ入门指南 从零开始了解大数据 目录 专栏导航 前言 一、基础信息 1.Magic魔数 2.主副版本号 3.其他信息 二、常量池 1.案例解析 三、方法 1.方法介绍 2.案例解析 四、字段 五、属性 总结 前言 JVM作为Java程序的运行环境&…

什么是JavaScript

文章目录 一、❄️什么是JavaScript&#xff1f;二、❄️JavaScript的特点三、❄️JavaScript的组成&#x1f9eb;1、核心&#xff08;ECMAScript&#xff09;&#x1f9ff;2、文档对象模型&#xff08;DOM&#xff09;&#x1f94f;3、浏览器对象模型&#xff08;BOM&#xff…