Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Worlds] zCVobWaypoint class article and changes in index #133

Merged
merged 3 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
**Version Identifiers:**<br />
— Gothic I: `35585`<br/>
— Gothic II: `35585`<br/>
**ZenKit Class:** `VBed`<br/>
**Sources:**<br/>
— [spacerhilfedatei.sph](https://wiki.worldofgothic.de/doku.php?id=spacer:hilfedatei)<br/>
— [zk.gothickit.dev](https://zk.gothickit.dev/engine/objects/oCMobBed/)
Expand Down
1 change: 0 additions & 1 deletion docs/zengin/worlds/Classes/zCVob/zCCSCamera.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
**Version Identifiers:**<br />
— Gothic I: `30720`<br/>
— Gothic II: `33793`<br/>
**ZenKit Class:** `VCutsceneCamera`<br/>
**Sources:**<br/>
— [gothic-library.ru](http://www.gothic-library.ru/publ/zccscamera/1-1-0-494)<br/>
— [zk.gothickit.dev](https://zk.gothickit.dev/engine/objects/zCCSCamera/)
Expand Down
1 change: 0 additions & 1 deletion docs/zengin/worlds/Classes/zCVob/zCCamTrj_KeyFrame.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
**Version Identifiers:**<br />
— Gothic I: `12289`<br/>
— Gothic II: `52224`<br/>
**ZenKit Class:** `VCameraTrajectoryFrame`<br/>
**Sources:**<br/>
— [gothic-library.ru](http://www.gothic-library.ru/publ/zccamtrj_keyframe/1-1-0-495)<br/>
— [zk.gothickit.dev](https://zk.gothickit.dev/engine/objects/zCCamTrj_KeyFrame/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
**Version Identifiers:**<br />
— Gothic I: `36865`<br/>
— Gothic II: `36865`<br/>
**ZenKit Class:** `VTouchDamage`<br/>
**Sources:**<br/>
— [zk.gothickit.dev](https://zk.gothickit.dev/engine/objects/oCTouchDamage/)

Expand Down
1 change: 0 additions & 1 deletion docs/zengin/worlds/Classes/zCVob/zCVobLight.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
**Version Identifiers:**<br />
— Gothic I: `46080`<br/>
— Gothic II: `39168`<br/>
**ZenKit Class:** `VLight`<br/>
**Sources:**<br/>
— [spacerhilfedatei.sph](https://wiki.worldofgothic.de/doku.php?id=spacer:hilfedatei)<br/>
— [gothic-library.ru](http://www.gothic-library.ru/publ/class_zcvoblight/1-1-0-497)<br/>
Expand Down
35 changes: 35 additions & 0 deletions docs/zengin/worlds/Classes/zCVob/zCVobWaypoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# zCVobWaypoint

!!! abstract inline end "Quick Infos"
**Class Name:** `zCVobWaypoint`<br/>
**Version Identifiers:**<br />
— Gothic I: Unknown<br/>
— Gothic II: Unknown<br/>
**Sources:**<br/>
— [spacerhilfedatei.sph](https://wiki.worldofgothic.de/doku.php?id=spacer:hilfedatei)<br/>
— [gothic-library.ru](https://gothic-library-mirror.piotrmacha.pl/publ/1-1-0-501)

Waypoints are used to mark a position and orientation in virtual space like [`zCVobSpot`](zCVobSpot.md), but are combined into a path network through which NPCs will perform pathfinding. Waypoints can be used in scripts to spawn other objects at their location.

!!! Warning
`zCVobWaypoint` objects aren't saved in `.ZEN` files. Their `zCWaypoint` representations are used instead.

## Class members

=== "Gothic 1"

- [zCVob](index.md)
{: .sp-class}
- zCVobWaypoint
{: .sp-class}
- &lt;empty&gt;
{: .sp-none}

=== "Gothic 2"

- [zCVob](index.md)
{: .sp-class}
- zCVobWaypoint
{: .sp-class}
- &lt;empty&gt;
{: .sp-none}
26 changes: 16 additions & 10 deletions docs/zengin/worlds/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,34 @@
!!! example "Acknowledgment"
This article is heavily inspired by various tutorials from the polish [TheModders forums](https://themodders.org/index.php#c13).

Worlds, saved as `.ZEN` files in ZenGin, are archives that contain the world mesh (model), BSP tree and the information of all objects in the world. These objects are called VOBs ("virtual objects"). ZEN files can be saved in two ways; compiled and uncompiled. The compiled version is a full-fledged level with a terrain model. Uncompiled ZENs only save the VOB tree and are meant for specific use-cases.
Worlds, saved as `.ZEN` files in ZenGin, are archives that contain the world mesh (model), BSP tree, materials and the information of all objects in the world. These objects are called VOBs ("virtual objects"). ZEN files can be saved in two ways; compiled and uncompiled. The compiled version is a full-fledged level with a terrain model. Uncompiled ZENs only save the VOB tree and are meant for specific use-cases.

Spacer is used to create these `.ZEN` files. There are also [other world editors](../tools/index.md). The way of doing things can vary between these editors, so the specifics will be discussed in separate articles for those tools; at the same time, a lot of knowledge carries over between them. Also have in mind that Spacer is the least comfortable of the editors.

## World contents

The content of worlds in Gothic can be roughly separated in the following way:

- Base level mesh: terrain and buildings, sometimes also trees
- VOBs: all interactive objects, items, foliage, small rocks, huts, furniture, ramps etc.
- Base level mesh - terrain and buildings, sometimes also trees.
- VOBs ([`zCVob`](Classes/zCVob/index.md) and subclasses) - all interactive objects, items, foliage, small rocks, huts, furniture, ramps etc.

Asides from those elements, there are also many invisible VOBs, such as:

- Waypoints - used for NPC navigation
- Freepoints (zCVobSpot) - used mainly for NPC routines and roaming behavior for monsters
- Startpoints - used only to spawn the player when starting a new game. Teleporting between levels is handled with scripts and uses freepoints to determine where the player will appear.
- Waypoints ([`zCVobWaypoint`](Classes/zCVob/zCVobWaypoint.md)) - used for NPC navigation.
- Freepoints ([`zCVobSpot`](Classes/zCVob/zCVobSpot.md)) - used mainly for NPC routines and roaming behavior for monsters.
- Startpoints ([`zCVobStartpoint`](Classes/zCVob/zCVobStartpoint.md)) - used only to spawn the player when starting a new game. Teleporting between levels is handled with scripts and uses freepoints to determine where the player will appear.
- Sound emitters
- Music zones
- oCZoneMusic - music which plays inside the bounding box of this zone
- oCZoneMusicDefault - default music which plays whenever the player is not inside some oCZoneMusic
- Fog zones (zCZoneZFog) - areas which add fog, e.g. like in swamp areas where the sky is not visible. The setting to fade out the sky is optional though.
- Music zones
- [`oCZoneMusic`](Classes/zCVob/zCZone/oCZoneMusic/index.md) - music which plays inside the bounding box of this zone.
- [`oCZoneMusicDefault`](Classes/zCVob/zCZone/oCZoneMusic/oCZoneMusicDefault.md) - default music which plays whenever the player is not inside some `oCZoneMusic`.
- Fog zones ([`zCZoneZFog`](Classes/zCVob/zCZone/zCZoneZFog/index.md)) - areas which add fog, e.g. like in swamp areas where the sky is not visible. The setting to fade out the sky is optional though.
- PFX - particle effects (fire, smoke, fireflies, falling leaves etc.)

!!! note
This list isn't exhaustive.

World also contains information about all materials used by level mesh and VOBs. They are stored in the form of [`zCMaterial`](Classes/zCMaterial.md) instances.

## Creating a ZEN file

Before VOBs can be added to a world model, the world needs to be compiled.
Expand All @@ -53,6 +55,10 @@ It is generally advised to use static lights whenever possible.

Portals are special parts of outdoor world meshes which separate interiors from exteriors. This allows the level to have dark areas: otherwise interiors are lit the same way as any outside area. Additionally, portals help with performance (interiors aren't rendered unless the player is nearby). Creation of portals has many caveats and will be discussed in a separate article. Portals are also related to NPC behavior (e.g. setting ownership of a room).

## Water

Water is a special surface in the world. It has to be properly modelled, and its material has to be set up correctly. You can read more about it in the [dedicated article](../meshes/water.md).

## Optimisation

The game uses occlusion culling, which means that if an object is covered by another object, it is not rendered and saves performance. This means that the performance in a level can be boosted by a lot by creating city walls and mountains and valleys which separate areas.
Expand Down