Jump to content

Possibly unwanted behaviour of launch scripts, generated executables and AppEditorLogic


photo

Recommended Posts

Hi,

I got some questions about the launch scripts in the project root directories and the binaries that get generated from .cpp. I noticed some unexpected behaviour in version 2.7, but still after update to 2.7.3.

I attached a project folder of a sample project called unigine_project. It is a x64, C++ VisualStudio, Float project.

After generation I modified only the following: I let the AppEditorLogic, AppSystemLogic and AppWorldLogic init() function Log a message that indicated where it is from. The same in the Worldscript (unigine_project.usc) init() function.

 

First of all, in the /bin directory there are

unigine_project_x64.exe, unigine_project_x64d.exe, main_x64.exe and main_x64d.exe

(the last two are main_double_x64.exe and main_double_x64.exe when project is generated with double precision). The unigine_project_*.exe are generated when building the .cpp project. What are the main_*.exe files? They do something different as also elaborated below.
 

When looking at the launch scripts in the project folder, the debug and release script execute a unigine_project_*.exe file, the editor script however calls a main_*.exe. As I'd expect when launching debug and release script, the system and world cpp inits are logged as is the world script init. Since the editor script doesn't execute my modified .cpp files only the world script init is logged.

When I modify launch_editor.bat to execute the unigine_project_*.exe binary the System and World cpp init messages are logged as expected, but the editor init message never appears.

 

When further investigating the Unigine SDK Browser Buttons, they don't seem to execute the launch scripts in the project folder, but some other commands. I noticed this with the modified editor script when I rename it the same as the original editor script (from launch_editor_modified.bat to launch_editor.bat). When clicking "Edit Content" again the main_*.exe file is executed and not the unigine_project_*.exe file as specified in the modified editor launcher. To me it would have made sense if the buttons would execute those scripts (or at least execute my modified files).

 

I originally just wanted to log a message from AppWorldLogic to test something when loading a world in the editor, but then opened all the above questions. It might be unwanted behaviour or I didn't get how it all should work, even after checking Execution sequence docs and similar information sources.

 

It would be nice to hear an overview about how that all should work and if it does so correctly or if those are possible bugs.

 

Thanks in advance

unigine_project.rar

Link to comment

sstuder

The thing is that you can't execute logic that written in C++ (or C#) application (unigine_project_x64*.exe) inside Editor. Editor will always launch main_x64 + Editor library (Editor2_x64*.dll). When you load world inside Editor it will load UnigineScript-based logic only  (from associated *.usc file).

In the upcoming 2.8 release we will remove main_* application and will left only Editor executable (called Editor*.exe).

When you run your application directly from Visual Studio (or by double-clicking on unigine_project_x64*.exe) both logics (from UnigineSciprt and C++ application) will be executed. To apply changes from C++ code you need to rebuild application in Visual Studio first.

Hope that clarifies some things :)

We are working on scripting pipeline improvements that will be introduced later this year (I think it's scheduled for 2.9 update), so the scripting process will become more easier.

Thanks!

 

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Thanks for the clarification.

I think you then might want to remove the AppEditorLogic if it never gets executed anyway and maybe also mention in the docs how exactly this works and what gets executed under what circumstances. It does seem a bit confusing to me without that knowledge. (hope I haven't looked over parts in the docs that mention this)

Link to comment

sstuder

Here comes interesting part :) You can get AppEditorLogic from C++ app execute if you will build an Engine plugin. In that case (when you load plugin) and load Editor you will be able to execute some logic.

But we will surely consider to clarify this kind of behavior in our documentation.

Thank you for the feedback!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment
×
×
  • Create New...