Urho3D
|
The main executable Urho3D.exe in the Bin directory contains all the engine runtime functionality. However, it does not contain any inbuilt logic or application, and therefore must be supplied with the name of the application script file it should run:
Urho3D.exe <scriptfilename> [options]
The scripting language used is AngelScript (http://www.angelcode.com/angelscript); the script files have .as extension and need to be placed under either the Bin/Data or Bin/CoreData subdirectories so that Urho3D.exe can find them. An application script is required to have the function void Start(), which will be executed before starting the engine main loop. It is this function's responsibility to initialize the application and to hook up to any necessary events, such as the update that happens every frame.
On Android and iOS there are no command line options, so running the NinjaSnowWar example is hardcoded. This can be changed from the file Urho3D/Urho3D.cpp.
Currently eight example application scripts exist:
A third-person action game. To start, run NinjaSnowWar.bat in the Bin directory, or use the command Urho3D.exe Scripts/NinjaSnowWar.as
Key and mouse controls:
WSAD Move Left mouse Attack Space Jump F1 Toggle AngelScript console F2 Toggle physics debug geometry F3 Toggle profiling display F4 Toggle octree debug geometry
If a joystick is connected, it can also be used for controlling the player character.
NinjaSnowWar also supports client/server multiplayer. To start the server, run the command NinjaSnowWar.bat server (-headless switch can optionally given so that the server will not open a graphics window.) To connect to a server, specify the server address on the command line, for example NinjaSnowWar.bat 127.0.0.1
Rendering, physics and serialization test. To start, run TestScene.bat in the Bin directory, or use the command Urho3D.exe Scripts/TestScene.as
Key and mouse controls:
WSAD Move Left mouse Create a new physics object; characters will ragdoll when hit Right mouse Hold and move mouse to rotate view Shift+LMB Paint a decal into the mouse cursor hit location Space Toggle debug geometry F1 Toggle AngelScript console F5 Save scene F7 Load scene 1 to 8 Toggle rendering options T Toggle profiling display O Toggle orthographic camera F Toggle FXAA edge filter B Toggle bloom post-process
TestScene also includes a network replication test, where clients can connect, move around as invisible cameras, and create new physics objects. For this, a server needs to be started with the command TestScene.bat server (-headless switch can optionally given so that the server will not open a graphics window) and clients can connect by specifying the server address on the command line, for example TestScene.bat 127.0.0.1
Scene editor application written in script. To start, run Editor.bat, or use the command Urho3D.exe Scripts/Editor.as
For details on how to use the editor, see Editor instructions.
Terrain rendering example. To start, run Terrain.bat, or use the command Urho3D.exe Scripts/Terrain.as. Controls are the same as in TestScene, and additionally:
L Toggle buoyant liquid volume
A stress test of 1000 moving physics objects, which also showcases the performance difference instancing can make. Run with Physics.bat, or use the command Urho3D.exe Scripts/Physics.as. Controls as in TestScene.
A variation of TestScene ported from Urho3D 1.0. It lacks networking features, but is provided for examining backward compatibility and performance. Run with TestSceneOld.bat or by using the command Urho3D.exe Scripts/TestSceneOld.as. Controls are like in TestScene, and additionally:
P Toggle scene animation L Toggle camera light detached/attached
Light rendering performance test. To start, run LightTest.bat in the Bin directory, or use the command Urho3D.exe Scripts\LightTest.as
Key and mouse controls:
WSAD Move ZX Select model to use Arrows Add or remove lights and objects Pageup/down Add or remove 10 lights Right mouse Hold and move mouse to rotate view F1 Toggle AngelScript console 1 to 8 Toggle rendering options T Toggle profiling display O Toggle orthographic camera V Toggle vertex lighting F Toggle FXAA edge filter R Re-randomize light and object positions
Simple client-server chat test application. To start, run Chat.bat or ChatServer.bat in the Bin directory, or use the command Urho3D.exe Scripts/Chat.as
On the client, first type the server address to the text edit box and click "Connect." After connecting successfully you can start typing messages; either press return or click "Send" to send them. Press ESC to exit.
To connect automatically, the server address can also be given on the command line, for example Chat.bat 127.0.0.1
Urho3D.exe understands the following command line options:
-x<res> Horizontal resolution -y<res> Vertical resolution -m<level> Enable hardware multisampling -v Enable vertical sync -t Enable triple buffering -w Start in windowed mode -b<length> Sound buffer length in milliseconds -r<freq> Sound mixing frequency in Hz -headless Headless mode. No application window will be created -logdebug Display debug level log messages also in release mode -prepass Use light pre-pass rendering -deferred Use deferred rendering -lqshadows Use low-quality (1-sample) shadow filtering -noshadows Disable shadow rendering -nolimit Disable frame limiter -nothreads Disable worker threads -nosound Disable sound output -noip Disable sound mixing interpolation -sm2 Force SM2.0 rendering