Skip to content

Commit

Permalink
Various docs updates (#9)
Browse files Browse the repository at this point in the history
* CTRL+R
* Removed PhysX
* surface update
* Rope update
* console
* old visual script
* follow path component
* skeleton asset
* details
* ResetTransform and MoveTo component
* sensors
* menu changes
* c++ workflow
  • Loading branch information
jankrassnigg authored Oct 22, 2023
1 parent edd6ae2 commit fe80c1c
Show file tree
Hide file tree
Showing 41 changed files with 150 additions and 108 deletions.
2 changes: 1 addition & 1 deletion pages/docs/Shipping/project-export.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The project export feature consolidates all these files into a single directory,

## Export Project Dialog

To get started with generating a self-contained package of your game, use the *project export dialog* that you find in the editor under *Editor > Export Project...*.
To get started with generating a self-contained package of your game, use the *project export dialog* that you find in the editor under *Project > Export Project...*.

![Project Export Dialog](media/project-export-dlg.png)

Expand Down
2 changes: 2 additions & 0 deletions pages/docs/ai/sensor-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Sensor components poll the world in regular intervals and thus incur a performan

Still, it is best to reduce the update rate as much as possible. For example in a game with large levels, you should check how close the player is to an NPC and dynamically adjust the update rate. At a large distance, the sensor can be set to update only every second, or you could even deactivate the sensor entirely. Similarly, you can use the 'alterness' state of an NPC to increase or decrease the sensor update rate.

It is also possible to set the update rate to **Never** which disables automatic updates. In this case you can explicitely instruct to sensor to do an update only on demand, via the C++ function `RunSensorCheck()`. This is for more advanced usage, for instance when writing custom AI code.

Finally, you should decide whether doing a visibility check is always necessary. The sensor would do this check for every possible target at every update. However, for a lot of game logic, once something has attracted attention, further visibility checks are not necessary. In such a case, it can be more efficient to do visibility raycasts only while a creature is not yet alert.

## Component Properties
Expand Down
7 changes: 7 additions & 0 deletions pages/docs/animation/paths/follow-path-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ This component is mainly meant for mechanical movement, such as objects moving o
* `Speed`: How fast to move along the path.
* `LookAhead`: The component will rotate the object according to the path direction. For this it samples the path some distance ahead. The farther the look-ahead the earlier the object will rotate into upcoming curves. At a very low look-ahead, it will rotate very rigidly.
* `Smoothing`: With zero smoothing the position of the object will be exactly that of the path. With some smoothing, the position doesn't change as abruptly. For mechanical objects attached to a rail, this should be zero, for more organic movement, increase the value towards one.
* `FollowMode`: How the transform of the owner object gets modified:
* `OnlyPosition`: Only the position gets moved along the path. The orientation of the object stays unaffected.
* `AlignUpZ`: While moving along the path, the object rotates only around the up axis (Z) to look into the direction of the path. This is useful for moving platforms that should always stay perfectly flat.
* `FullRotation`: The object is both moved and oriented accoring to the path.
* `TiltAmount`, `MaxTilt`: If `FollowMode` is `AlignUpZ`, *MaxTilt* defines whether the object may tilt a little when turning. *TiltAmount* specifies how much tilting will occur.

<video src="media/follow-path-mode.mp4" width="800" height="600" autoplay controls></video>

## See Also

Expand Down
Binary file not shown.
28 changes: 25 additions & 3 deletions pages/docs/animation/property-animation/move-to-component.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
# MoveTo Component

<!-- PAGE IS TODO -->
A light-weight component that moves the owner object towards a single position.

The state of this component is currently unclear and it needs to be revisited.
The functionality of this component can only be controlled through (script) code.
The component is given a single point in global space. When it is set to *running* it will move
the owning object towards this point. Optionally it may use acceleration or deceleration and a maximum speed
to reach that point.

## See Also
Since the target position is given through code and can be modified at any time, this component can be used
for moving objects to a point that is decided dynamically. For example an elevator can be moved to a
specific height, depending on which floor was selected. Or an object could follow a character,
by updating the target position regularly.

The component sends the event `ezMsgAnimationReachedEnd` and resets its running state when it reaches the target position.

## Component Properties

* `Running`: Whether the component is currently moving the owner. Has to be set to `true` to start moving towards the target position. Setting this to `false` before the target was reached will interrupt the movement immediately.
* `TranslationSpeed`: The maximum speed at which to move towards the target.
* `TranslationAcceleration`: The acceleration to use to reach the translation speed.
* `TranslationDeceleration`: The deceleration to use to slow down when the target destination is being reached.

## Component Script Functions

* `SetTargetPosition(pos)`: Call this to change the target position. Nothing will happen, though, unless `Running` is also set to `true`.

## See Also

* [Follow Path Component](../paths/follow-path-component.md)
* [Slider Component](slider-component.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Reset Transform Component

This component sets the local transform of its owner to known values when the simulation starts.

It is meant for use cases where an object may be activated and deactivated over and over.
For example due to a state machine switching between different object states by (de-)activating a sub-tree of objects.

Every time an object becomes active, it may want to start moving again from a fixed location.
This component helps with that, by reseting the local transform of its owner to such a fixed location once.

After that, it does nothing else, until it gets deactivated and reactivated again.

## Component Properties

* `ResetPositionX`, `ResetPositionY`, `ResetPositionZ`: Whether to reset the x, y and z component of the local position.
* `LocalPosition`: The local position value to reset the owner's transform to.
* `ResetRotation`: Whether to reset the local rotation.
* `LocalRotation`: The local rotation value to reset the owner's transform to.
* `ResetScaling`: Whether to reset the local scaling.
* `LocalScaling`, `LocalUniformScaling`: The uniform and non-uniform local scaling value to reset the owner's transform to.

## See Also

* [Property Animations](property-animation-overview.md)
* [Follow Path Component](../paths/follow-path-component.md)

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Animated meshes are placed in a scene with a dedicated [animated mesh component]

* `NormalPrecision`, `TexCoordPrecision`: See the [mesh asset properties](../../graphics/meshes/mesh-asset.md#asset-properties).

* `BoneWeightPrecision`: How precisely to store the bone weights. For highly detailed regions, such as character faces, it may be necessary to increase the precision, to prevent artifacts.

* `NormalizeWeights`: Usually all bone weights should add up to 1 on each vertex. To enforce this, bone weights are usually normalized. However, some meshes violate this rule and normalizing the weights introduces artifacts. Only disable this, option, if it very obviously fixes artifacts.

* `ImportMaterials`: See the [mesh asset properties](../../graphics/meshes/mesh-asset.md#asset-properties).

* `Materials`: See the [mesh asset properties](../../graphics/meshes/mesh-asset.md#asset-properties).
Expand Down
6 changes: 6 additions & 0 deletions pages/docs/animation/skeletal-animation/skeleton-asset.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ In the future the skeleton asset will also be used to define physics shapes for

* `BoneDirection`: This setting only affects the visualization of the skeleton. It has no effect on the actual mesh skinning. It is used to tell the visualizer which cardinal direction the bones should point into. You only need to change this setting, if the skeleton visualization looks all wrong (all lines point into weird directions). You need to *transform* the asset to apply the change. Just try all options until it looks right.

* `PreviewMesh`: An [animated mesh](animated-mesh-asset.md) to render transparently over the skeleton to serve as a preview. This is especially useful when setting up collider shapes, to know how large they should be to fit nicely.

* `CollisionLayer`, `Surface`: The default [collision layer](../../physics/jolt/collision-shapes/jolt-collision-layers.md) and [surface](../../materials/surfaces.md) to use for all bone shapes. This can be overridden on each bone.

* `MaxImpulse`: When projectiles and other things apply impulses to ragdoll limbs, the forces can quickly add up and fling a ragdoll far away. This value is used to clamp the maximum impulse to apply to prevent that.

## See Also

* [Skeletal Animations](skeletal-animation-overview.md)
Expand Down
4 changes: 4 additions & 0 deletions pages/docs/appendix/third-party-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ Used as the basis for skeletal animations. Both during asset import (to build an

## PhysX 4.1.1

> **Important:**
>
> NVIDIA PhysX in EZ is no longer maintained. The code is currently still there, but most likely doesn't compile without errors anymore.
Link: [https://github.com/NVIDIAGameWorks/PhysX](https://github.com/NVIDIAGameWorks/PhysX)

Compile switch: **EZ_BUILD_PHYSX**
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/assets/asset-browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ You can toggle this feature by right clicking any folder and selecting **Show it

## Create Asset Documents

You can create new asset [documents](../editor/editor-documents.md) by right clicking a folder on the bottom left, or an asset on the right and selecting *New > Asset Type*. The advantage over creating a document via *Editor > Create Document...* is that the create file dialog opens directly in the location of the selected asset or folder, which makes it easier to create a new asset next to an existing asset.
You can create new asset [documents](../editor/editor-documents.md) by right clicking a folder on the bottom left, or an asset on the right and selecting *New > Asset Type*. The advantage over creating a document via *File > Create...* is that the create file dialog opens directly in the location of the selected asset or folder, which makes it easier to create a new asset next to an existing asset.

## Display Assets in Recently Used Order

Expand Down
2 changes: 1 addition & 1 deletion pages/docs/assets/asset-profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Asset profiles are used to make project configurations for each platform. For ex

## Modify asset profiles

Under *Editor > Project Settings > Asset Profiles* you can open the **asset profiles** dialog. At the top you can select for which platform you want to make modifications.
Under *Project > Project Settings > Asset Profiles* you can open the **asset profiles** dialog. At the top you can select for which platform you want to make modifications.

<!-- PAGE IS TODO -->

Expand Down
2 changes: 1 addition & 1 deletion pages/docs/assets/assets-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Examples for the latter are [scenes](../scenes/scene-editing.md), [prefabs](../p

## Creating Assets

The straight forward way to create an asset document is through the menu *Editor > Create Document...*. This gives you a blank asset and you can (and must) fill out all properties manually.
The straight forward way to create an asset document is through the menu *File > Create...*. This gives you a blank asset and you can (and must) fill out all properties manually.

For common types of assets there is a more convenient way to quickly fill out the common properties. See the [asset import](import-assets.md) documentation for details.

Expand Down
4 changes: 2 additions & 2 deletions pages/docs/assets/import-assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ To create these documents you have two options: Manual or automatic import.

## Create Documents Manually

You can manually create documents via *Editor > Create Document...*. In the file creation dialog, choose the file extension for the desired asset type and specify where to store the document. The newly created document will be in a blank state. You will need to fill out all the properties, including where the source files are located.
You can manually create documents via *File > Create...*. In the file creation dialog, choose the file extension for the desired asset type and specify where to store the document. The newly created document will be in a blank state. You will need to fill out all the properties, including where the source files are located.

This method always works for all asset types and for some types it is the only way. Since this method always involves multiple, mostly simple steps, it can become tedious. Therefore, some asset types provide a way to automate much of this process.

## Create Documents Automatically

For asset types that are mostly defined by a single source file (e.g. [textures](../graphics/textures-overview.md) and [meshes](../graphics/meshes/mesh-asset.md)), the editor often provides an importing method that automates most of the trivial setup.

Select **Editor > Import Assets...** or press **CTRL+I** to open a file browse dialog. Navigate to the file(s) that you want to import and select them. If you want to know which asset types are currently supported for automatic import, you can open the dropdown with the allowed file extensions here.
Select **Project > Import Assets...** or press **CTRL+I** to open a file browse dialog. Navigate to the file(s) that you want to import and select them. If you want to know which asset types are currently supported for automatic import, you can open the dropdown with the allowed file extensions here.

After you selected the source files, you will be presented with a table of options how to import them:

Expand Down
4 changes: 2 additions & 2 deletions pages/docs/build/cmake-config.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# CMake Setup

To generate a solution, run the CMake GUI. Specify *Where is the source code* and *Where to build the binaries*, then run **Configure**. As a generator, pick *Visual Studio 2019 x64* (or one of the other [supported platforms](supported-platforms.md)).
To generate a solution, run the CMake GUI. Specify *Where is the source code* and *Where to build the binaries*, then run **Configure**. As a generator, pick *Visual Studio 2022 x64* (or one of the other [supported platforms](supported-platforms.md)).

![CMake configuration](media/cmake-config.png)

The screenshot above shows a common setup. Noteworthy are the following points:

* **EZ_ENABLE_QT_SUPPORT** Disable this setting, if you want to compile EZ without Qt. This will remove all editor code and several tools from the final solution. The default is *on*. When possible the EZ CMake scripts will automatically download Qt libraries and set everything up for you. On configurations for which we do not support fully automatic setup, you need to install Qt manually and then set set **EZ_QT_DIR** to its installation folder.

* **EZ_BUILD_FMOD** Enable this, if you want to [FMOD sound](../sound/fmod-overview.md) support in your build. One Windows and Linux the default is *on*.
* **EZ_BUILD_FMOD** Enable this, if you want to [FMOD sound](../sound/fmod-overview.md) support in your build. On Windows and Linux the default is *on*.

* **EZ_BUILD_PHYSX** Enable this, if you want to add [NVIDIA PhysX](../physics/physx/physx-overview.md) support to your build. Once enabled, the next run of "Configure" will automatically download PhysX binaries (Windows only) and set the **EZ_PHYSX_SDK** variable accordingly. The default is *off*. Note that PhysX support has been superseded by the [Jolt Physics integration](../physics/jolt/jolt-overview.md).

Expand Down
13 changes: 6 additions & 7 deletions pages/docs/custom-code/cpp/cpp-project-generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ However, if you want that, you can include the generated plugin as an [external

## How to Generate a New Solution

1. Select *Editor > Open C++ Project...*. The following dialog will appear:
1. Select *Project > C++ Project > Setup C++ Plugin...*. The following dialog will appear:

![Project Generation Dialog](media/generate-project.png)

Currently the locations for where the C++ source is stored and where the project will be built are both hard-coded to be within the project directory.

1. Choose the desired name for the plugin or leave the default.

1. Choose the desired MSVC solution version.

1. Press the **Generate Solution** button and wait for it to finish.
Expand All @@ -35,18 +37,15 @@ However, if you want that, you can include the generated plugin as an [external
>
> The code has to be built for the very same build type that the editor is running in (*Debug*, *Dev* or *Shipping*), otherwise the editor won't be able to load the DLL. If the build fails because certain EZ DLLs are missing, you are most likely building the wrong build type. The same may be true if you do code changes, but running the game from the editor doesn't reflect those changes.
> **Note:**
>
> After compiling your new plugin for the very first time, you have to close the [editor project](../../projects/projects-overview.md) and reopen it, for it to load the information properly. Due to automatic [hot reloading](cpp-code-reload.md) this shouldn't be necessary later anymore, but it can still be necessary, for example when you add a new component type to your C++ code.
## Opening an Existing Solution

If you have generated the solution before, the *Open Solution* button will be active right away when you open this dialog. In this case you don't need to generate the solution again.
If you have generated the solution before, the *Open Solution* button will be active right away when you open this dialog. In this case you don't need to generate the solution again. You can also skip this dialog and use *Project > C++ Project > Open Solution* instead.

## Regenerating a Solution

If you have added or removed source files on disk, you need to regenerate the solution for those changes to show up in the Visual Studio solution. You have two options to do so:
If you have added or removed source files on disk, you need to regenerate the solution for those changes to show up in the Visual Studio solution. You have three options to do so:

1. Use *Project > C++ Project > Regenerate C++ Solution*.
1. Run CMake yourself. For example you can use the CMake GUI app, point it to the plugin's build directory, and then *Configure* and *Generate* the solution at any point you like.
1. Rerun *Generate Solution* from the dialog above. This will **clear the CMake cache** and fully regenerate the solution. Be aware that this resets all CMake options to their default values and often takes longer than strictly necessary.

Expand Down
Binary file modified pages/docs/custom-code/cpp/media/generate-project.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pages/docs/custom-code/typescript/ts-asset.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TypeScript Asset

Each *TypeScript asset* manages the script for a single [custom TypeScript component](custom-ts-components.md). You create a new TypeScript asset using *Editor > Create Document...*.
Each *TypeScript asset* manages the script for a single [custom TypeScript component](custom-ts-components.md). You create a new TypeScript asset using *File > Create...*.

![TypeScript asset](media/ts-asset.png)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# Custom Code with Visual Scripts

There is a visual scripting system, which can be used to write a form of custom components. However, at this point it makes no sense to write documentation for the system.
<!-- PAGE IS TODO -->

The [TypeScript integration](../typescript/typescript-overview.md) is far superior in functionality and tooling. The core team behind ezEngine has no intention of investing further time into the visual scripting system, as time spent on improving the TypeScript integration has the much bigger benefit.

That said, the system exists, and the code is not too bad. If anyone has interest to develop it further, contact the team to get a detailed introduction into how the code works, what needs improvement and to discuss how far this could go. There are a couple of improvements that would be easy to do. However, the main problem with visual scripting is the tooling. If you look at what crazy amount of work other engines put into their visual script tools, you'll see that this is the main area of work. If you intend to take this on, you should have a decent understanding of Qt.

Another option is to scrap the whole thing and replace it with a completely different implementation. We are open to all suggestions.
A new visual scripting system was added, but is undocumented so far.

## See Also

Expand Down
Loading

0 comments on commit fe80c1c

Please sign in to comment.