Skip to content

Commit

Permalink
Merge pull request #2 from TaleWorlds/master
Browse files Browse the repository at this point in the history
update to latest
  • Loading branch information
Oshibuki authored Oct 14, 2020
2 parents a7ae309 + ec3a699 commit 2215d02
Show file tree
Hide file tree
Showing 16 changed files with 467 additions and 63 deletions.
202 changes: 202 additions & 0 deletions docs/content/english/Authoring Mission Scenes/villages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
+++
title = "What Makes a Village Scene"
description = ""
weight = 1
+++

#### Navigation Mesh

* Navigation mesh consists of triangles and quads. It is used by the AI for pathfinding. The global illumination system also uses it to find the visible locations of the scene.
* Keep in mind that the navigation mesh faces should not be too far away from the physics below it. The distance should at 1.5m maximum.
* The faces can be labeled to give cues to the agent spawning and the navigation inside the scene.
* In order to make the agents follow roads, we label the faces on top of the roads with the ID 2.
* Note that all of the agent spawnpoints should be connected by navigation mesh faces with ID 2.
* For the animals, navigation mesh ID 3 can be used. Typically, these faces are keep within seperate islands in structures like ditches. The animals will roam inside those islands.
* All other faces should have the ID 0.
* Recall that the agents should use the navigation mesh ID's 1 in order to create a realistic pathing (on roads), scene designer should put an entity with the Navigation Mesh Deactivator (prefab name is Navigation_Mesh_Deactivator). It can be placed anywhere in the scene. Its purpose is to disable the ID 0 faces in civilian modes. The DisableFaceWithID variable of the script should be 1.
* For the animals, the variable "DisableFaceWithIDForAnimals" within the same script should be 3.
* Make sure the faces are fairly equal in size outside of the village area / where troops will maneuver.
* Make sure there is no disconnected navmeshes.
* The better the navmesh, the better will AI perform on it. Always think about that there might be big field battle inside the village. So try to avoid having many enclosed areas like a pig farm with only 1 entrance (for example: throw over some fences to create more entries)
* Avoid having big areas accessible to the player but not AI. Player will be able to shoot AI from places without nav mesh.
* Use “_barrier_ai_x” to prevent AI from falling off from cliffs or getting stuck in tight areas (like a market booth) off the navmesh.

![](/img/village_scenes/navmesh.png)

#### Spawn Points

As noted before, all spawn points needs to be placed on top of navmesh (ID 2) and inside the soft borders. Remember that some prefabs (like chairs and benches) come with spawn points attached to them. If the spawn points are incompatible with the village mission, they will most likely crash the game or cause errors. One example is "sp_blacksmith_with_smithing_machine". The most important thing about the entry points are their tags. They decide what type of NPC will spawn there. For your own sake, don't play around with those tags too much and keep them as they are from the prefabs.

![](/img/village_scenes/3. Entry Points.png)

##### Player Spawnpoint

* Prefab is called "sp_player".
* Make sure its placed in a location where it can be seen from or at least a clear path leading towards it. Do not place it too far away.
* There should be a navigation mesh under the spawnpoint.

##### Battle Spawnpoints

* The main battle spawnpoint is "Sp_battle_set". Make sure the attacker and defender spawn are not too close or at least don't have direct line of sight to each other.
* Make sure to move the reinforcement point as best out of sight as possible while still not being to far from the front lines.
* Make sure all spawnpoints have some empty space around for troops to properly spawn in.

##### Conversation Spawnpoints (civilian)

* Conversation points defines where the agent and the conversation partner spawns when the player enters the village via the "Talk to Notable" button from the World Map.
* Prefab is "sp_player_conversation".
* Make sure they have a nice vista but keep them relatively close to the village center.

##### Animation Points (civilian)

* Prefabs are named as “sp_npc_x”.
* These are used for normal villagers. You can use around 40 positions.
* They define the positions in the scenes where the villagers will spawn and walk to.
* Make sure they are nicely spaced throughout the village and close surroundings.
* Villagers will wonder along paths to get to them.
* If the way is too long you might find your village all wondering around and no one actually doing anything. So try to avoid long distances and place points close to main paths
* Placing more or less spawnpoints does not influence how many villagers will populate the scene.

##### Rural Noteable Spawnpoints

* Prefabs are named as “sp_notable_x”.
* The number should be around 6.
* These are the spawnpoints for the notables of the village (quest givers) and lords.
* Make sure they are in prominent location of the village or generally places where village elder / lords would hang around.
* You can check the Debug Window (documentation will cover that) to make sure you have placed the correct notable positions.
* Go to the “Scene Entity Check Tab”.
* Tick the “NPCs” Box and count

##### Patrol Spawnpoints

* Prefabs are "sp_guard_patrol_simple, sp_guard_patrol".
* Use the same spawns as for normal villagers. Try not to have them do chores like farming.
* For the patrol spawnpoints, you can use the prefabs "sp_guard_patrol_simple" and "sp_guard_patrol”.

##### Bandit Camps
* Each village scene has 3 Bandit Camps out of side of the village, used for scene quests.
* Place the three “common_area_x” prefabs.
* All spawn points in the radius will spawn bandits instead of villagers.
* You can increase the radius by scaling the common area prefab.
* Use Civilian animation points as spawn points for bandits.
* Some suggestions: “sp_npc_wait_wall, lookout, sp_npc_argue_set, sp_npc_wait”.
* Make sure there is some indication to where they could be so the player has a chance of finding them (especially at night).
* Don't place them to close to each other.

![](/img/village_scenes/4. Bandit Camps.png)

##### Animal Spawnpoints

* Use “DisableWandering” in the AnimalSpawnSettings script, to stop animals from walking around your scene.
* Overall its best to put it on all bigger animals like cows and pigs if you don't have them to wonder around

##### Tactical Region

* Used to tell the AI where there are relevant grander regions (forests, hills etc.).
* AI will position themselves inside the radius or avoid.
* Dont over overuse it, stick to ~5 (make sure there is some variety).
* Prefab: “TacticalRegion”.

##### Tactical Positions

* Used to tell AI where there are relevant smaller positions (like choke points between buildings, cliffs for archer and so on).
* Ai will position themselves according to the rotation of the Prefab and in regards to the width given by the script.
* You can use them quite often.
* The higher the slope the “better” is the position.
* Prefab: “TacticalPosition”.

![](/img/village_scenes/5. Tactical Positions.png)

##### Flee Positions

* Positions to which fleeing troops and also horses will run away too.
* Make sure they are inside the Soft Border and there is nav mesh below them.

![](/img/village_scenes/7. Flee Positions.png)

#### Debug Window
* There is a built in dbeug tool which can be enabled by adding a certain prefab to the scene.
* Prefab name is “SpawnPointDebugView”.
* This prefabs opens a little debug window in the editor, that helps you make sure you meet the requirements for the mission (like spawn points, navmesh).
* In the “Scene Entity Check Tab” you can count your Entry Points and make sure you placed enough of them (or too many).
* In the “Navigation Mesh Check Tab” you can make sure all your Entry Points are connected to the navmesh properly.
* Place the prefab anywhere in the scene and activate the window with the check box in its script.

#### Soft Border

* They define the red borders of the scene.
* Prefab: “border_soft”.
* When placed they form a polygon, where the edges are connecting themselves the closests two border entities but never more than 2.
* To check the current borders, go into the "Visibility Window" → "Visibility Masks" and enable "Borders".
* After crossing them the player has a few seconds to return inside the map borders, make sure this can't be abused somehow.

![](/img/village_scenes/6. Borders.png)

#### Sounds

#### Master Ambient Sound

* Choose a mandatory master ambient sound.
* You can place the prefab for the mandatory ambient (“x_ambient_sound”) anywhere.
* Make sure it has the “Is Master Sound” enabled.
* Make sure it doesn't have the “Is Triggered” enabled.

##### Additional Ambient sounds

* Used for bigger areas (like forests).
* Needs to have the “Is Triggered” bool.
* To see their reaches, from the "Visibility Window" enable "Sound Entities" under the ""Visibility Masks" group.
* To change their reach, you can scale them like you would do with other editor entities (using the “b” key or the gizmo).

![](/img/village_scenes/8. Sounds.png)

##### Reverb

* Adds reverb effect to any sound spawned inside its boundary.
* They are generaly used for tight or underground areas.
* You can place these in tight alleys between taller buildings, cliffs or in caves or dense forests.
* There is different prefabs for each use case: “reverb_x”.
* Needs to have the “Is Triggered” enabled.

##### Detail

* Used for small details.
* Keep “Is Triggered” disabled.
* Place them where ever you want them to play.

##### Moving sounds on paths (for rivers and such)

Sometimes it's useful to move sounds along a coast line or a river. Using the below technique is more performant and more precise than placing multiple sound entities along your river for example.

* Place a path on the river. For more information, see <strong>[Path Editing]({{< ref "path_editing.md" >}})</strong>.
* Add the sound to the scene.
* Place any additional Ambient sound as explained above.
* Add the “path_converger” script to your ambient sound's entity.
* Enter the name of your path to the "path_converger".
* The sound will now follow the path according to the camera position.

##### Sounds in the Engine

You can check the "MODDING_TOOLS_DIRECTORY/Sounds/GUIDs.txt" file for the list of the sounds in the game. These names can be used inside the script of the sound entities.

#### Lights

* Have at least one “envmap_prop” in your scene.
* For darker areas like caves use “local_envmap_prop”.
* It will affect the lighting in an area depending on the values of its “ReflectionCapturer” script.
* Make sure the village and Bandit camps are nicely lit.
* Take extra care for the conversation points.
* Use torches and other entities.
* Make sure torches inside buildings and other dark areas have “alwaysBurn” enabled in the LightCycle script.
* Try to avoid placing “artificial lights” without an actual source.
* You can bake the ambient lighting in your scene with the GI system. This will make the ambient lighting much more realistic. For more information, see <strong>[GI System]({{< ref "prt.md" >}})</strong>.

![](/img/village_scenes/9. Lights.png)

#### Atmosphere

* Make sure your scene works and looks fine with all of the “TOD_x” atmospheres and in all seasons! (since it will be tested with those).
* Choose a “Color Grade” that fits your scene (we suggest using the ones for the faction your scene is for like: “color_grade_empire_soft”).

![](/img/village_scenes/10. Atmosphere.png)

2 changes: 1 addition & 1 deletion docs/content/english/_header.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
+++
+++
![](/img/twlogo_s.png)
<a href="/"><img src="/img/twlogo_s.png"></img></a>
42 changes: 21 additions & 21 deletions docs/content/schinese/Asset Management/Asset Types/bodies.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
+++
title = "Bodies"
title = "物体"
description = ""
weight = 1
+++

Bodies define the physics boundaries of objects. They can be assigned to entities in scenes or prefabs. Users can edit the Body Flags to change their behaviour.
物体定义了物体的物理边界,它们可以被分配给场景或者预制物件的实体。用户可以编辑“物体标识”(Body Flag) 来改变其行为。

##### Body Flags
##### 物体标识(Body Flags)

* Two Sided: Forces the physics engine to use both sides of the polygons for this body.
* AI Limiter: Used to tag bodies which will only used against AI agents, excluding the player.
* Destructible Door: Used by the automatic navigation mesh generator to not put nav mesh under destructable doors.
* Disabled: Disables the physics for this prefab or entity instance.
* Barrier: Enables smooth exit for agents exiting the interior of the body.
* Exclude Path Snap: Path points does not snap to these bodies.
* Don't Collide With Camera: Camera for the player does not collide with these bodies.
* Dynamic: Physics engine simulates the movement of this entity.
* Moveable: This flag indicates that this body and its owner entity can move.
* Ladder: Should be given to the ladder meshes so that they function properly.
* Has Steps: Should be given to the bodies of the staircases so that the agent can climb them correctly. (The body of the stairs should be seperated from the other parts of the entity).
* 双面(Two Sided):让物理引擎可以使用多边形的两面。
* Ai限制器(AI Limiter):用来标记只针对AI使用的物体,不包括玩家。
* 可破坏的门(Destructible Door): 通过自动导航网格生成器来使用,而非将导航网格直接置于可破坏的门之下。
* 禁用(Disabled):禁用预制物体,或者实体实例的物理特性。
* 边界(Barrier):使对象可以顺利移出物体内部
* 排除路径对齐(Exclude Path Snap):适用于路径点无法对齐物体的情况
* 避免镜头碰撞(Dont Collide With Camera):玩家的镜头不会和对应物品产生碰撞。
* 动态化(Dynamic):可以让物理引擎会模拟实体的运动
* 可移动化(Moveable):该标识标志该物品及其所有的实体可以移动
* 梯形化(Ladder):赋予梯形网格,从而使其正常运行。
* 台阶化(Has Steps):决定是否将实体物品楼梯化,使得对象能够正确地攀爬楼梯。(楼梯的物体应与实体的其他部分分开)。

Agent physics require smooth and low poly physics objects for performance. Missile ones require more precision so that the stuck missiles are simulated better. The below flags can be used to have two different bodies per object which is the best of both worlds. If none of the flags are given, both missiles and agents react to the bodies.
自主体的物理引擎要求平滑和低多边形的物理对象来保证性能。投射物则要求更高的精度,以达到能更好的模拟投射物卡顿效果。以下的标识可以用于让每个物体拥有两个不同的机体,以适应两种不同的情况。若两者均未被标记,投射物和自主体都会对该物体做出反应。

* Agent Only: Only the agents react into these bodies.
* Missile Only: Only the missiles react into these bodies.
* 仅限自主体(Agent Only): 只有自主体会对该物体做出反应。
* 仅限投射物(Missile Only): 只有投射物会对该物体做出反应。


##### Occluders
##### 遮蔽器(Occluders

Occluders are bodies which are placed at mesh surfaces to tell the rendering system to not render the contents on the other side of that surface. They do not contribute to the physics simulation. Big towns and villages benefit largely from carefully placed occluders. User can place occluders directly to the scene or attach them to entities & prefabs.
遮蔽器被用于网格模型表面,从而让渲染系统不会去渲染物体的另一面。通常来说,它们对物理模拟过程通常作用不大。但对于大城镇和村庄来说,精心布置的遮蔽器将会非常有用。用户可以直接在场景中放置遮蔽器,也可以将其附加到到实体物品和预制件上。

{{% notice info %}}
The imported occluder bodies names should start with "occ_" phrase.
{{% /notice %}}
导入的遮蔽器名称一般应该以" occ_"开头。
{{% /notice %}}
Loading

0 comments on commit 2215d02

Please sign in to comment.