-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Enhancement engine py version api #578
Enhancement engine py version api #578
Conversation
- CMake controls the version information, export it via a configurable header(s). - Display the version information from the version header when using `--help` - Show the version information from the version header in the setup tooling
Introduce an Assets API version similar to the Google Android API Version. It's a simple single value that increments when the API is changed and can increment indepent of the engine version. This allows the Assets API to change slightly even between minor releases, or not change at all across major releases, and to communicate that via a simple mechanism.
Initial pass as integrating the API version data into the Python API. A basic test show's it's not working as intended as the object on `VS` returns `None`.
NOTE: My tests for the Python side is simple:
|
I think you have to actually have the Engine (C++ code) running, and execute Python code from within it, for the
I also changed engine/src/python/unit_wrapper.cpp, line 188, to read:
instead of
And it worked! I was able to retrieve a 4-tuple containing the engine version |
@stephengtuggy thanks... I did add something to the Assets, but it was getting a |
UPDATE: Figured it out. The I made your change, and I can get the same response within the engine itself like you got:
However, the goal is to get it to operate from the Game Assets. So I applied the following diff to the Asset Productions: Assets-Production$ git diff
diff --git a/modules/GUI.py b/modules/GUI.py
index 9a26d0b5..d40c3a8c 100644
--- a/modules/GUI.py
+++ b/modules/GUI.py
@@ -354,6 +354,11 @@ class GUIRoot:
self.needRedraw = {}
self.modalElement = None
self.keyTarget = None
+
+ trace(_GUITraceLevel, "::: What's in VS object %s :::" %(dir(VS)))
+ trace(_GUITraceLevel, "::: Engine Version %s :::" %(VS.EngineVersionData.GetVersion()))
+ trace(_GUITraceLevel, "::: Asset API Version %s :::" %(VS.EngineVersionData.GetAssetAPIVersion()))
+
Base.GlobalKeyPython('#\nfrom GUI import GUIRootSingleton\nGUIRootSingleton.keyEvent()\n')
def setScreenDimensions(self,screenX,screenY): And I end up with the following stack trace a little further down in the game console output: Traceback (most recent call last):
File "main_menunightprivateer.py", line 30, in <module>
File "/home/bmeyer/Devel/opensource/vegastrike/assets/Assets-Production/modules/GUI.py", line 448, in GUIInit
GUIRootSingleton = GUIRoot(screenX,screenY,marginX,marginY,**kwargs)
File "/home/bmeyer/Devel/opensource/vegastrike/assets/Assets-Production/modules/GUI.py", line 359, in __init__
trace(_GUITraceLevel, "::: Engine Version %s :::" %(VS.EngineVersionData.GetVersion()))
Boost.Python.ArgumentError: Python argument types in
None.GetVersion()
did not match C++ signature:
GetVersion(VegaStrike::EngineVersionData {lvalue}) |
- Thanks @stephengtuggy for the final bits - Rename `Version` to `EngineVersion` - Generate an output of the version data from within the engine
The Windows CI is failing on this line: #include <unistd.h> in engineVersion.h. This header file is not available on Windows. Is there another header file you can use instead, @BenjamenMeyer ? |
@stephengtuggy yeah, really meant |
Thank you for submitting a pull request and becoming a contributor to the Vega Strike Core Engine.
Please answer the following:
Code Changes:
Issues:
Purpose:
NOTE: The Python side presently does not work. This needs to be figured out before I can release the PR.
NOTE: This will need to get ported to 0.8.x before #349 is closed.