PyUnity is a Python implementation of the Unity Engine, written in C++

Overview

PyUnity

Documentation Status License PyPI version Python version Language grade: Python Total alerts Build status Discord Gitter GitHub Repo stars

Version 0.7.0 (in development)

PyUnity is a Python implementation of the Unity Engine, written in C++. This is just a fun project and many features have been taken out to make it as easy as possible to create a scene and run it.

Installing

To install PyUnity for Linux distributions based on Ubuntu or Debian, use:

> pip3 install pyunity

To install PyUnity for other operating systems, use pip:

> pip install pyunity

Alternatively, you can clone the repository to build the package from source. Then use setup.py to build. Note that it will install Cython to compile.

> python setup.py install

Its only dependencies are PyOpenGL, PySDL2, GLFW, Pillow and PyGLM.

Importing

To start using pyunity, you must import it. A standard way to import is like so:

>>> from pyunity import *

Debug information is turned on by default. If you want to turn it off, set the PYUNITY_DEBUG_MODE environment variable to "0". This is the output with debugging:

Loaded config
Trying GLFW as a window provider
GLFW doesn't work, trying PySDL2
Using window provider PySDL2
Loaded PyUnity version 0.7.0

If debugging is off, there is no output:

>> from pyunity import * >>> # No output ">
>>> import os
>>> os.environ["PYUNITY_DEBUG_MODE"] = "0"
>>> from pyunity import *
>>> # No output

Scenes

All PyUnity projects start with a scene. To add a scene, do this:

>>> scene = SceneManager.AddScene("Scene 1")

Then, let's move the camera backwards 10 units.

>>> scene.mainCamera.transform.position = Vector3(0, 0, -10)

Finally, add a cube at the origin:

>> renderer = cube.AddComponent(MeshRenderer) >>> renderer.mesh = Mesh.cube(2) >>> renderer.mat = Material(Color(255, 0, 0)) >>> scene.Add(cube) ">
>>> cube = GameObject("Cube")
>>> renderer = cube.AddComponent(MeshRenderer)
>>> renderer.mesh = Mesh.cube(2)
>>> renderer.mat = Material(Color(255, 0, 0))
>>> scene.Add(cube)

To see what you have added to the scene, call scene.List():

>>> scene.List()
/Main Camera
/Light
/Cube

Finally, to run the scene, call scene.Run(). The window that is created is one of FreeGLUT, GLFW or PySDL2. The window is selected on module initialization (see Windows subheading).

Behaviours

To create your own PyUnity script, create a class that inherits from Behaviour. Usually in Unity, you would put the class in its own file, but Python can't do something like that, so put all of your scripts in one file. Then, to add a script, just use AddComponent(). Do not put anything in the __init__ function, instead put it in Start(). The Update() function receives one parameter, dt, which is the same as Time.deltaTime.

Windows

The window is provided by one of three providers: GLFW, PySDL2 and FreeGLUT. When you first import PyUnity, it checks to see if any of the three providers work. The testing order is as above, so FreeGLUT is tested last.

To create your own provider, create a class that has the following methods:

  • __init__: initiate your window and check to see if it works.
  • start: start the main loop in your window. The first parameter is update_func, which is called when you want to do the OpenGL calls.

Check the source code of any of the window providers for an example. If you have a window provider, then please create a new pull request.

Examples

To run an example, import it like so:

>>> from pyunity.examples.example1 import main
Loaded config
Trying FreeGLUT as a window provider
FreeGLUT doesn't work, trying GLFW
GLFW doesn't work, trying PySDL2
Using window provider PySDL2
Loaded PyUnity version 0.7.0
>>> main()

Or from the command line:

> python -m pyunity 1

The 1 just means to load example 1, and there are 9 examples. To load all examples one by one, do not specify a number. If you want to contribute an example, then please create a new pull request.

Comments
  • ModuleNotFoundError: No module named 'vector3'

    ModuleNotFoundError: No module named 'vector3'

    I am a new user to pyunity.. i installed it with pip install pyunity

    I was trying out the examples.. python -m pyunity 1 it resulted in error: Error log:

    PS C:\Users\Lenovo> python -m pyunity 1
    Loaded config
    Trying GLFW as a window provider
    Using window provider GLFW
    Traceback (most recent call last):
      File "C:\Program Files\Python38-32\lib\runpy.py", line 185, in _run_module_as_main
        mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
      File "C:\Program Files\Python38-32\lib\runpy.py", line 144, in _get_module_details
        return _get_module_details(pkg_main_name, error)
      File "C:\Program Files\Python38-32\lib\runpy.py", line 111, in _get_module_details
        __import__(pkg_name)
      File "C:\Program Files\Python38-32\lib\site_packages\pyunity\__init__.py",  line 131, in <module>
        from .audio import *
      File "audio.py", line 13, in init pyunity.audio
      File "core.py", line 1, in init pyunity.core
    ModuleNotFoundError: No module named 'vector3'
    

    I have tried whatever i can do.. but i can't fix it nor find any module with name "vector3" on the internet..

    Specs (if you need):

    Python Version: Python 3.8.9
    OS: Windows 7 SP 1
    Processor: Intel core i3 (x86)
    
    opened by whmsft 16
  • Convert stubs to inline type hints

    Convert stubs to inline type hints

    The current approach makes it hard to maintain the project's types since the docstrings and stub files has to be in sync so I think the project should convert to inline type hints as defined in PEP 448 and note that a py.typed file will need to be added to /pyunity for PEP 561.

    Since pyunity only supports Python3.6+ there will be no compatibility issues what's however.

    I would like to know your opinion on this :)

    opened by FaresAhmedb 11
  • Importing issue

    Importing issue

    Cannot import pyunity due to error below:

    Loaded config
    Trying GLFW as a window provider
    Using window provider GLFW
    Traceback (most recent call last):
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\runpy.py", line 188, in _run_module_as_main
        mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\runpy.py", line 147, in _get_module_details
        return _get_module_details(pkg_main_name, error)
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\runpy.py", line 111, in _get_module_details
        __import__(pkg_name)
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\site-packages\pyunity\__init__.py", line 156, in <module>
        from .audio import *
      File "audio.py", line 13, in init pyunity.audio
      File "core.py", line 1, in init pyunity.core
    ModuleNotFoundError: No module named 'vector3'
    
    Type: Bug Meta: Invalid 
    opened by rayzchen 10
  • Feature/saving

    Feature/saving

    TODO:

    • [x] Move Color and MeshRenderer to meshes.py
    • [x] Subclass SavesProjectID for savable assets
    • [x] Customize saving of assets in class not in Loader
    • [x] Save class as struct-like representation
    • [x] Clean up Loader.Save* functions and remove weird parameters
    • [x] Create prefab mechanics
    • [ ] Fix Behaviour saving (only write when needed)
    • [x] Callback saving
    Type: Enhancement Topic: Module Meta: Awaiting Response OS: Any 
    opened by rayzchen 5
  • [BUG] Cannot import from egg

    [BUG] Cannot import from egg

    Describe the bug

    Trying to import PyUnity from an egg file errors out.

    To Reproduce

    Run cython=0 python setup.py bdist_egg Go to dist folder Run code

    Expected behavior

    Successful import

    Code

    import sys
    sys.path.insert(0, "pyunity-0.9.0-py3.9.egg")
    import pyunity
    

    System info

    ##############################
             VERSION INFO
    ##############################
    PyUnity version: v0.9.0
    Python version: v3.9.4-final
    Operating system: Windows 10
    Architecture: 32bit
    Requirements:
    - pyopengl version: 3.1.5
    - pillow version: 9.0.1
    - pysdl2 version: 0.9.11
    - pysdl2-dll version: 2.0.20
    - pyglm version: 2.5.7
    - importlib-resources version: None
    - glfw version: 2.5.0
    

    Traceback

    Traceback (most recent call last):
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\importlib\_common.py", line 35, in _tempfile
        os.write(fd, reader())
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\zipfile.py", line 2322, in read_bytes
        with self.open('rb') as strm:
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\zipfile.py", line 2306, in open
        stream = self.root.open(self.at, zip_mode, pwd=pwd)
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\zipfile.py", line 1502, in open
        zinfo = self.getinfo(name)
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\zipfile.py", line 1429, in getinfo
        raise KeyError(
    KeyError: "There is no item named 'pyunity/shaders/skybox/textures/' in the archive"
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
      File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
      File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
      File "<frozen zipimport>", line 259, in load_module
      File "pyunity-0.9.0-py3.9.egg\pyunity\__init__.py", line 209, in <module>
        from .render import __all__ as _render_all
      File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
      File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 664, in _load_unlocked
      File "<frozen importlib._bootstrap>", line 627, in _load_backward_compatible
      File "<frozen zipimport>", line 259, in load_module
      File "pyunity-0.9.0-py3.9.egg\pyunity\render.py", line 324, in <module>
        skyboxes["Water"] = Skybox(stack.enter_context(as_file(ref / "skybox/textures")))
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\contextlib.py", line 429, in enter_context
        result = _cm_type.__enter__(cm)
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\contextlib.py", line 117, in __enter__
        return next(self.gen)
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\importlib\_common.py", line 52, in as_file
        with _tempfile(path.read_bytes, suffix=path.name) as local:
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\contextlib.py", line 117, in __enter__
        return next(self.gen)
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\importlib\_common.py", line 40, in _tempfile
        os.remove(raw_path)
    PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\raych\\AppData\\Local\\Temp\\tmpbrwljrmttextures'
    

    Additional context Add any other context about the problem here.

    Type: Bug Topic: Module OS: Any 
    opened by rayzchen 3
  • Memory leaks

    Memory leaks

    Sometimes MemoryError is encountered when copying the scene at runtime, especially with shaders and skyboxes duplicated (which they aren't meant to be).

    Type: Bug Meta: Invalid 
    opened by rayzchen 3
  • Cannot import when built with Cython

    Cannot import when built with Cython

    In the current state, importing PyUnity will cause this error:

    Loaded config
    Traceback (most recent call last):
      File "C:\Users\Ray\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 184, in _run_module_as_main
        mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
      File "C:\Users\Ray\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 143, in _get_module_details
        return _get_module_details(pkg_main_name, error)
      File "C:\Users\Ray\AppData\Local\Programs\Python\Python38-32\lib\runpy.py", line 110, in _get_module_details
        __import__(pkg_name)
      File "C:\Users\Ray\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyunity\__init__.py", line 125, in <module>
        from .audio import *
      File "audio.py", line 12, in init pyunity.audio
      File "config.py", line 17, in init pyunity.config
      File "C:\Users\Ray\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyunity\window\__init__.py", line 34, in <module>
        from .glutWindow import Window as glutWindow
    ImportError: DLL load failed while importing glutWindow: The specified module could not be found.
    
    Type: Bug Meta: Invalid 
    opened by rayzchen 3
  • [OBSERVATION] Cool idea, but the name will likely get C&D'd....

    [OBSERVATION] Cool idea, but the name will likely get C&D'd....

    Cool idea for a project :) I suspect that as far as the name there are two situations:

    1. no-one is using your project, and it sits below the radar, and Unity themselves don't notice, or do anything
    2. your project starts to become popular. I suspect your name will then get cease and desisted, by Unity, at that point

    I suppose you could just change the name at that point, but, might be as easy to just change the name now? (e.g. Mono, which Unity uses, didn't call themselves "Linux .Net Framework", they called themselves "mono", and everyone knew that it was a cross platform version of the windows .net framework).

    this would also avoid having to state twice, in the first two paragraphs of your front page, that pyunity is not a wrapper around unity :)

    (And it's natural to assume pyunity is a wrapper. My pytorch project, https://github.com/hughperkins/pytorch (which predates the Facebook pytorch by a year or two), was a wrapper around Facebook's lua torch)

    opened by hughperkins 2
  • [FEATURE] Move main loop to SceneManager, or have a custom main loop runner

    [FEATURE] Move main loop to SceneManager, or have a custom main loop runner

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] The main loop code in the window providers is almost exactly the same thing: run some init, create a clock, infinite loop, quit etc. but it's hard to create something like VSync that can be toggled on and off. This really shouldn't be handled by the window providers.

    Describe the solution you'd like A clear and concise description of what you want to happen. The main loop code should be either in SceneManager.__loadScene or (more preferably) another ABCMeta that can be subclassed and implemented, given an update function and set to chug along nicely.

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    Additional context Add any other context or screenshots about the feature request here.

    Type: Enhancement Topic: Module OS: Any 
    opened by rayzchen 2
  • RenderTarget.canvas nested rendering

    RenderTarget.canvas nested rendering

    If RenderTarget.canvas is true, it may try to render itself in PreRender. Whether this is wanted or not, there needs to be a limit to the depth of recursion.

    Type: Bug 
    opened by rayzchen 2
  • Example 8

    Example 8

    Loading example 8 always gives an error:

    Traceback (most recent call last):
      File "C:\Users\Ray\AppData\Local\Programs\Python\Python39-32\lib\runpy.py", line 197, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "C:\Users\Ray\AppData\Local\Programs\Python\Python39-32\lib\runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "D:\Ray\python\pyunity\__main__.py", line 2, in <module>
        examples.show()
      File "D:\Ray\python\pyunity\examples\__init__.py", line 32, in show
        example.main()
      File "D:\Ray\python\pyunity\examples\example8\__init__.py", line 9, in main     
        source = scene.mainCamera.AddComponent(AudioSource)
      File "D:\Ray\python\pyunity\core.py", line 327, in AddComponent
        return self.gameObject.AddComponent(component)
      File "D:\Ray\python\pyunity\core.py", line 186, in AddComponent
        component = componentClass(self.transform)
      File "D:\Ray\python\pyunity\audio.py", line 58, in __init__
        mixer.Mix_AllocateChannels(channels)
    OSError: exception: access violation reading 0x00000074
    

    This doesnt happen when I run python -m pyunity 8, only when I run all examples. This happens on the develop branch.

    Type: Bug 
    opened by rayzchen 2
  • [FEATURE] `Config` class that is set per project

    [FEATURE] `Config` class that is set per project

    Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

    Instead of having global variables under pyunity/config.py, using a class that can be modified is more portable. This way we can separate flags and actual configs, whereas right now config.audio can be modified.

    Describe the solution you'd like A clear and concise description of what you want to happen.

    Config class created that can be loaded and saved from the .pyunity file in projects

    Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

    Additional context Add any other context or screenshots about the feature request here.

    Type: Enhancement Topic: Module 
    opened by rayzchen 0
  • [BUG] ctypes.ArgumentError: argument 2: <class 'KeyboardInterrupt'>

    [BUG] ctypes.ArgumentError: argument 2:

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    System info

    Loaded config
    Detected settings.json entry
    Using window provider GLFW
    Loaded PyUnity version 0.9.0
    ##############################
             VERSION INFO
    ##############################
    PyUnity version: v0.9.0
    Python version: v3.9.4-final
    Operating system: Windows 10
    Machine: AMD64
    Python architecture: 32bit
    Dependencies:
    - pyopengl version: 3.1.5
    - pillow version: 9.0.1
    - pysdl2 version: 0.9.11
    - pysdl2-dll version: 2.0.20
    - pyglm version: 2.5.7
    - importlib-resources version: None
    - glfw version: 2.5.3
    

    Describe the bug

    Program quits with a large error yet KeyboardInterrupt is not raised and so cannot be caught normally by SceneManager.__loadScene.

    To reproduce

    Run examples Press Ctrl+C while an example is running Repeat until KeyboardInterrupt is raised while an OpenGL function is being called

    Code

    No response

    Traceback

    Loaded config
    Detected settings.json entry
    Using window provider GLFW
    Loaded PyUnity version 0.9.0
    
    Example 1
    /Cube
    /Floor
    /Light
    /Main Camera
    Launching window manager
    Compiling objects
    Starting scene
    Physics is on
    Scene 'Scene' has started
    
    Example 2
    Launching window manager
    Compiling objects
    Starting scene
    Physics is on
    Scene 'Scene' has started
    Traceback (most recent call last):
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\runpy.py", line 197, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "C:\Ray-Data\python\pyunity\pyunity\__main__.py", line 60, in <module>
        examples.show()
      File "C:\Ray-Data\python\pyunity\pyunity\examples\__init__.py", line 36, in show
        loadExample(i)
      File "C:\Ray-Data\python\pyunity\pyunity\examples\__init__.py", line 20, in loadExample
        module.main()
      File "C:\Ray-Data\python\pyunity\pyunity\examples\example2\__init__.py", line 55, in main
        SceneManager.LoadScene(scene)
      File "C:\Ray-Data\python\pyunity\pyunity\scenes\sceneManager.py", line 243, in LoadScene
        __loadScene(copy.deepcopy(scene))
      File "C:\Ray-Data\python\pyunity\pyunity\scenes\sceneManager.py", line 308, in __loadScene
        windowObject.start(scene.update)
      File "C:\Ray-Data\python\pyunity\pyunity\window\providers\glfw\window.py", line 145, in start
        self.updateFunc()
      File "C:\Ray-Data\python\pyunity\pyunity\scenes\scene.py", line 502, in update
        self.Render()
      File "C:\Ray-Data\python\pyunity\pyunity\scenes\scene.py", line 518, in Render
        self.mainCamera.Render(renderers, lights)
      File "C:\Ray-Data\python\pyunity\pyunity\render.py", line 732, in Render
        self.RenderScene(renderers, lights)
      File "C:\Ray-Data\python\pyunity\pyunity\render.py", line 727, in RenderScene
        self.SetupShader(lights)
      File "C:\Ray-Data\python\pyunity\pyunity\render.py", line 637, in SetupShader
        self.shader.setVec3(b"viewPos", list(
      File "C:\Ray-Data\python\pyunity\pyunity\render.py", line 292, in setVec3
        location = gl.glGetUniformLocation(self.program, var)
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\site-packages\OpenGL\latebind.py", line 63, in __call__
        return self.wrapperFunction( self.baseFunction, *args, **named )
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\site-packages\OpenGL\GL\VERSION\GL_2_0.py", line 430, in glGetUniformLocation
        return baseOperation( program, name )
    ctypes.ArgumentError: argument 2: <class 'KeyboardInterrupt'>:
    

    Additional context

    To do with raising KeyboardInterrupt while running an OpenGL function

    Type: Bug Topic: Module 
    opened by rayzchen 2
  • [BUG] Fix collision detection algorithm

    [BUG] Fix collision detection algorithm

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    System info

    Loaded config
    Detected settings.json entry
    Using window provider GLFW
    Loaded PyUnity version 0.9.0
    ##############################
             VERSION INFO
    ##############################
    PyUnity version: v0.9.0
    Python version: v3.10.4-final
    Operating system: Windows 10
    Machine: AMD64
    Python architecture: 64bit
    Dependencies:
    - pyopengl version: 3.1.6
    - pillow version: 9.1.1
    - pysdl2 version: 0.9.11
    - pysdl2-dll version: 2.0.20
    - pyglm version: 2.5.7
    - importlib-resources version: None
    - glfw version: 2.5.3
    

    Describe the bug

    Physics is broken, when two cubes collide head-on they collide into each other Collision point is offset by 1 unit in the Z axis in example 2 Example 3, red cube has infinite inertia yet it still rotates

    To reproduce

    Run examples 2 and 3, observe For example 2 pressing Space and R starts and resets the cubes respectively

    Code

    No response

    Traceback

    No response

    Additional context

    Using GJK and EPA algorithm, pretty expensive and still doesnt work

    Type: Bug Topic: Module 
    opened by rayzchen 2
  • [BUG] 3D render is flipped left-to-right

    [BUG] 3D render is flipped left-to-right

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    System info

    Loaded config
    Detected settings.json entry
    Using window provider PySDL2
    Loaded PyUnity version 0.9.0
    ##############################
             VERSION INFO
    ##############################
    PyUnity version: v0.9.0
    Python version: v3.10.4-final
    Operating system: Windows 10
    Machine: AMD64
    Python architecture: 64bit
    Dependencies:
    - pyopengl version: 3.1.6
    - pillow version: 9.1.1
    - pysdl2 version: 0.9.11
    - pysdl2-dll version: 2.0.20
    - pyglm version: 2.5.7
    - importlib-resources version: None
    - glfw version: None
    

    Describe the bug

    The skybox is flipped, rotating seems flipped along the Y-axis.

    To reproduce

    Run example 1 and watch the cube rotate anticlockwise.

    Code

    No response

    Traceback

    No response

    Additional context

    No response

    Type: Bug Meta: Invalid Topic: OpenGL 
    opened by rayzchen 3
  • [BUG] OSError with egl

    [BUG] OSError with egl

    Is there an existing issue for this?

    • [X] I have searched the existing issues

    System info

    Loaded config
    Detected settings.json entry
    Using window provider GLFW
    Loaded PyUnity version 0.9.0
    ##############################
             VERSION INFO
    ##############################
    PyUnity version: v0.9.0
    Python version: v3.9.4-final
    Operating system: Windows 10
    Machine: AMD64
    Python architecture: 32bit
    Dependencies:
    Warning: PyUnity not ran as an installed package
    - pyopengl version: 3.1.5
    - pillow version: 9.0.1
    - pysdl2 version: 0.9.11
    - pysdl2-dll version: 2.0.20
    - pyglm version: 2.5.7
    - importlib-resources version: None
    

    Describe the bug

    EGL window provider throws OSError when running multiple examples in sequence

    To reproduce

    Use PYUNITY_WINDOW_PROVIDER=egl and run python -m pyunity.

    Code

    No response

    Traceback

    Loaded config
    Trying EGL as a window provider
    Using window provider EGL
    Loaded PyUnity version 0.9.0
    Warning: Currently broken examples: 3
    
    Example 1
    /Cube
    /Floor
    /Light
    /Main Camera
    Launching window manager
    [<EGLDisplay object at 0x020F8BF8>, <pyunity.window.providers.egl.egl.EGLint_Array_13 object at 0x04F661D8>, <pyunity.window.providers.egl.egl.EGLConfig_Array_1 object at 0x04F66190>, 1, <EGLint object at 0x04F66148>]
    Compiling objects
    Starting scene
    Physics is on
    Scene 'Scene' has started
    Exiting
    
    Example 2
    Launching window manager
    [<EGLDisplay object at 0x020F8BF8>, <pyunity.window.providers.egl.egl.EGLint_Array_13 object at 0x0D2FFB20>, <pyunity.window.providers.egl.egl.EGLConfig_Array_1 object at 0x0D2FFD18>, 1, <EGLint object at 0x0D2FFF58>]
    Compiling objects
    Warning: Detected settings.json entry
    Warning: windowCache entry has been set, indicating window checking happened on this import
    Warning: settings.json entry may be faulty, removing
    Traceback (most recent call last):
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\runpy.py", line 197, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "C:\Users\raych\AppData\Local\Programs\Python\Python39-32\lib\runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "C:\Ray-Data\python\pyunity\pyunity\__main__.py", line 60, in <module>
        examples.show()
      File "C:\Ray-Data\python\pyunity\pyunity\examples\__init__.py", line 36, in show
        load_example(i)
      File "C:\Ray-Data\python\pyunity\pyunity\examples\__init__.py", line 20, in load_example
        module.main()
      File "C:\Ray-Data\python\pyunity\pyunity\examples\example2\__init__.py", line 55, in main
        SceneManager.LoadScene(scene)
      File "C:\Ray-Data\python\pyunity\pyunity\scenes\sceneManager.py", line 244, in LoadScene
        __loadScene(copy.deepcopy(scene))
      File "C:\Ray-Data\python\pyunity\pyunity\scenes\sceneManager.py", line 282, in __loadScene
        render.compileSkyboxes()
      File "C:\Ray-Data\python\pyunity\pyunity\render.py", line 338, in compileSkyboxes
        skybox.compile()
      File "C:\Ray-Data\python\pyunity\pyunity\files.py", line 313, in compile
        gl.glTexImage2D(gl.GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, gl.GL_RGBA,
      File "src/latebind.pyx", line 39, in OpenGL_accelerate.latebind.LateBind.__call__
      File "src/wrapper.pyx", line 311, in OpenGL_accelerate.wrapper.Wrapper.__call__
    OSError: exception: access violation reading 0x00000004
    

    Additional context

    Could be caused by using a terminated display but in pyunity/window/providers/window.py eglInitialize is called every time the window provider is instantiated. Similar issues also happen when using 32-bit python on 64-bit machine.

    Type: Bug Topic: OpenGL OS: Windows 
    opened by rayzchen 1
Releases(0.8.3)
Open-source project written in the ursina engine, simulating the popular game Minecraft.

Voxelcraft is an open-source project written in the ursina engine, simulating the popular game Minecraft.

Calinescu Mihai 21 Oct 6, 2022
Minecraft clone using Python Ursina game engine!

Minecraft clone using Python Ursina game engine!

Taehee Lee 35 Jan 3, 2023
Mandaw 2 Mar 1, 2022
An easy to use game engine/framework for python.

A game engine powered by python and panda3d.

Petter Amland 1.6k Jan 5, 2023
Pyxel is a retro game engine for Python.

Pyxel is open source and free to use. Let's start making a retro game with Pyxel!

Takashi Kitao 11.2k Jan 9, 2023
A python game engine.

PursuedPyBear, also known as ppb, exists to be an educational resource. Most obviously used to teach computer science, it can be a useful tool for any topic that a simulation can be helpful.

PPB 235 Jan 8, 2023
A Game Engine Made in Python with the Pygame Module

MandawEngine A Game Engine Made in Python with the Pygame Module Discord: https://discord.gg/MPPqj9PNt3 Installation To Get The Latest Version of Mand

Mandaw 14 Jun 24, 2022
Blender Game Engine Game Type Templates Logic Bricks (and Python script) based Game Templates for Blender

Blender-Game-Engine-Templates Blender Game Engine Game Type Templates Logic Bric

null 3 Oct 25, 2022
A Neural Network based chess engine and GUI made with Python and Tensorflow/Keras.

Haxaw-Chess Haxaw: Haxaw is the Neural Network based chess engine made with Python and Tensorflow/Keras. Also uses the python-chess library. (WIP: Imp

Sarthak Bharadwaj 8 Dec 10, 2022
An ongoing process to make a physics engine using python.

Simple_Physics_Engine An ongoing process to make a physics engine using python. I am using this goal as a way to learn python in and out. I am trying

Jon Sherrick 1 Jan 18, 2022
Hagia is a 2D game engine and toolset for Python.

HAGIA What is Hagia? Hagia is a 2D game engine and toolset for Python. Hagia has

star 3 Jun 1, 2022
Python game engine for 2D multiplayer online games.

LAN-Caster The goal of LAN-Caster is to provide an easy-to-use code base (game engine) for developing 2D multiplayer online games. LAN-Caster original

Douglas Bakewell 1 Feb 11, 2022
Lint game data metafiles against GTA5.xsd for Rockstar's game engine (RAGE)

rage-lint Lint RAGE (only GTA5 at the moment) meta/XML files for validity based off of the GTA5.xsd generated from game code. This script accepts a se

GoatGeek 11 Sep 18, 2022
Brax is a differentiable physics engine that simulates environments made up of rigid bodies, joints, and actuators

Brax is a differentiable physics engine that simulates environments made up of rigid bodies, joints, and actuators. It's also a suite of learning algorithms to train agents to operate in these environments (PPO, SAC, evolutionary strategy, and direct trajectory optimization are implemented).

Google 1.5k Dec 31, 2022
Automates cubemap generation for Source Engine games.

AutoCube Automates cubemap generation for Source Engine games during compile-time. Download: see the release page Installation Using with CompilePal A

null 5 Feb 18, 2022
A base chess engine that makes moves on an instance of board.

A base chess engine that makes moves on an instance of board.

null 0 Feb 11, 2022
TwoDMaker (2DMaker) - Simple engine for 2D games making!

TwoDMaker (2DMaker) - Simple engine for 2D games making! Create simple games (or ui) in one hour! About. This is a simple engine for game or gui app c

Ivan Perzhinsky. 1 Jan 3, 2022
AXI Combat is a networked multiplayer game built on the AXI Visualizer 3D engine.

AXI_Combat AXI Combat is a networked multiplayer game built on the AXI Visualizer 3D engine. https://axi.x10.mx/Combat AXI Combat is released under th

. 0 Aug 2, 2022
A chess engine with basic AI capabilities (search for best move using MinMax algorithm)

A chess engine with basic AI capabilities (search for best move using MinMax algorithm)

Ken Wu 1 Feb 2, 2022