Engine:CVAR module: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
(Created page with "{{dev/uicvar}} Base name for 'world' module, without platform postfix or extensions. <kua>set module 'game'</kua> == Arguments == * name - 'module' * value - module name to load == Associations == * Is by default placed in the 'global' context. == Details == Name of the world module. The path is either a full OS file system path to the library location, or a path relative to the launch location, which is the location of the executable for the engine. In some confi...")
 
(Undo revision 21624 by Bear (talk))
Tag: Undo
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{dev/uicvar}}
{{dev/uicvar}}
Base name for 'world' module, without platform postfix or extensions.
Base name for the default 'world' module, without platform postfix or extensions.
<kua>set module 'game'</kua>
<kua>set module 'game'</kua>


Line 11: Line 11:


== Details ==
== Details ==
Name of the world module.  
Name of the world native library to load.  


The path is either a full OS file system path to the library location, or a path relative to the launch location, which is the location of the executable for the engine.
'World' in this context means a graphically or otherwise conceptually interactive environment, and is apart from any regular 2D UI environment, or may have no direct user interfaces.


In some configurations the path is relative to the current directory and not necessarily the actual engine start location. The 'data_path' will be used verbatim to resolve the final library load path.
A world library typically loads when the 'world' loads and provides support for managing discrete world components how they interact and can act as a sink and/or source for messaging with other systems.
set lib_path './data/'
with install in: d:\install\engine
effective path: d:\install\engine\data\


Asset loading in the engine is a multi-tier system. This path provides the location of the base lowest tier set of files and archives. If a higher tier location or archive has a file with the same relative path, it will be chosen first. Each tier is either an OS file system location, or an archive.
; Lifetime


And archive is any system, like maybe a zip file with assets inside, that is not an OS file system. A single archive could be made of multiple real files, that together form one virtual file system as one tier.
World is loaded separately through configuration, and lives on its own managed by the engine 'World' module. A library may create and manage sets of entities and control how they interact and provide other services.


The relative file paths and names inside an archive or location, are the paths and names used to request an asset.
During world load, the world may manage which native libraries if any get loaded. A library may also cause a different world to load. Also, no library may load at all.
data (tier 1)
    pak0.zip (tier 0)
      file.txt
      model
          file1.obj
    model
      file2.obj
    file.txt


Default precedence:
; Library load name and path:


By default, Engine tries to load a single archive file named 'pak0.zip' in the specified 'base_path'. This archive file will then be asset tier 0, the lowest. The 'base_path' itself will be asset tier 1.
The actual load path set with [[CVAR lib_path]], and final library file name will be calculated from the 'module' name and the platform suffixes. See [[CVAR lib_path]] for the list of suffixes and explanation.


For example, on startup Engine will look for a file named 'config.cfg', first in the file system at 'base_path', and then inside the 'pak0.zip' file loaded from 'base_path'. If neither are found, will load with static defaults.
The library state typically unloads when the world unloads or changes, and loads again when the world loads again. The actual OS module that is the library may or may not, from the OS standpoint, ever be unloaded from the engine process, once loaded.


== Examples ==
== Examples ==
=== Default values ===
=== Default values ===
For the path executable path 'd:\install\engine.exe', and a 'data_path' of './data/':
For the path executable path 'd:\install\engine.exe', and a 'lib_path' of './lib/' on windows running the 64-bit engine:
  \install
  set module 'game'
    engine.exe
becomes: ./lib/gamex64.dll
    lib
with install in: d:\install\engine
      gamex86.dll
effective OS load: d:\install\engine\lib\gamex86.dll
      gamex64.dll
    data
      pak0.zip
          config.cfg
      config.cfg
: On start the config file directly in '\install\data' will be loaded. The one in pak0 will not.


== Notes ==
== Notes ==

Latest revision as of 05:12, 17 October 2023

Console commands

Base name for the default 'world' module, without platform postfix or extensions.

set module 'game'

Arguments[edit]

  • name - 'module'
  • value - module name to load

Associations[edit]

  • Is by default placed in the 'global' context.

Details[edit]

Name of the world native library to load.

'World' in this context means a graphically or otherwise conceptually interactive environment, and is apart from any regular 2D UI environment, or may have no direct user interfaces.

A world library typically loads when the 'world' loads and provides support for managing discrete world components how they interact and can act as a sink and/or source for messaging with other systems.

Lifetime

World is loaded separately through configuration, and lives on its own managed by the engine 'World' module. A library may create and manage sets of entities and control how they interact and provide other services.

During world load, the world may manage which native libraries if any get loaded. A library may also cause a different world to load. Also, no library may load at all.

Library load name and path

The actual load path set with CVAR lib_path, and final library file name will be calculated from the 'module' name and the platform suffixes. See CVAR lib_path for the list of suffixes and explanation.

The library state typically unloads when the world unloads or changes, and loads again when the world loads again. The actual OS module that is the library may or may not, from the OS standpoint, ever be unloaded from the engine process, once loaded.

Examples[edit]

Default values[edit]

For the path executable path 'd:\install\engine.exe', and a 'lib_path' of './lib/' on windows running the 64-bit engine:

set module 'game'
becomes: ./lib/gamex64.dll
with install in: d:\install\engine
effective OS load: d:\install\engine\lib\gamex86.dll

Notes[edit]

See also[edit]