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)
Guess The Random Number - A sample Random Number Guessing Game Python Program

Guess_The_Random_Number This repo contains a simple "Random Number Guessing Game

Pramod Kumar 3 Feb 09, 2022
This is a text-based snake and ladder game .

This is a text-based snake and ladder game .

AKSHAI KRISHNA A 1 Nov 01, 2021
Flappy-Bird AI - Flappy Bird game with AI

FLAPPY BIRD AI Flappy Bird game solved with neat-python, a Python module based o

1 Jan 07, 2022
SnailJumper - A game that is developed as an assignment for Computer Intelligence course

Snail jumper Neuroevolution game assignment. Fall 2021 - Computer Intelligence.

Soroush Mehraban 22 Aug 22, 2022
Brawl Stars v31.96 server emulator written in Python.

Brawl Stars v31 Brawl Stars v31.96 server emulator written in Python. Requirements: Python 3.7 or higher pymongo dnspython colorama MongoDB configurat

9 Nov 26, 2021
This is a repository created to run a workshop on Game Theory using the programming language Python and more specifically an open-source software called the Axelrod Python library

Game-Theory-and-Python This is a repository created to run a workshop on Game Theory using the programming language Python and more specifically an op

Nikoleta Glynatsi 136 Dec 01, 2022
A python program for playing rock-paper-scissors with computer .

Rock_Paper_Scissors_Cut A time passing famous hand game known as rock paper scissors cut game. Starting from children to adults everyone plays this ga

Arghya Banerjee 1 Dec 16, 2021
Vac-Man in Python

Vac-Man in Python This is my personal version of Vax-man game using python, which is the first assignment of EA Software Engineering Virtual Experienc

ZiXiang Luo 3 Jan 05, 2022
Wordlebot - A simple Wordle puzzle solver in python

WordleBot A simple search-based puzzle solver for Wordle, built in Python. Inspi

Rob Kimball 2 Jan 27, 2022
An single python server emulator of MMORPG game WindSlayer also known as WS1.

PySlayer An single python server emulator of MMORPG game WindSlayer also known as WS1. Requirements Python = 3.7 Old windslayer client (Korea Yahoo!

mirusu400 29 Dec 19, 2022
ReplitTD - Replit Tower Defense Game

IMPORTANT: I mean no offense at all in this game, this is only based off of cycl

kokomi simp :3 3 Jun 25, 2022
MiTM proxy server for Darza's Dominion

Midnight A MiTM proxy server for Darza's Dominion, PC version. See this video for a demonstration of godmode: https://youtu.be/uoqvSxmnCJk How to use

2 Oct 24, 2022
DouZero_For_HLDDZ_FullAuto: 将DouZero用于欢乐斗地主自动化

DouZero_For_HLDDZ_FullAuto: 将DouZero用于欢乐斗地主自动化 本项目基于DouZero 和 DouZero_For_Happy_DouDiZhu 环境配置请移步项目DouZero 模型默认为ADP,更换模型请修改main.py中的模型路径 运行main.py即可 在原

322 Dec 25, 2022
Tictactoe py tkinter canvas - Tic Tac Toe written in Python 3 with tkinter mainly using canvas

Python 3 Tic Tac Toe with tkinter This is a tkinter version of my Tic Tac Toe ga

Bojan Adzic 1 Jan 09, 2022
Minimalistic generic chess variant GUI using pyffish and PySimpleGUI, based on the PySimpleGUI Chess Demo

FairyFishGUI Minimalistic generic chess variant GUI using pyffish and PySimpleGUI, based on the PySimpleGUI Chess Demo. Supports all chess variants su

Fabian Fichter 6 Dec 20, 2022
A Street Fighter game in Pygame

What is Street Fighter? Street Fighter, commonly abbreviated as SF or スト, is a Japanese competitive fighting video game franchise developed and publis

Sameer Sahu 3 Aug 20, 2022
BritishTrainsDepartureBoard - A pygame program that immitates the dot matrix departure screens found at National Rail stations

BritishTrainsDepartureBoard - A pygame program that immitates the dot matrix departure screens found at National Rail stations

Finn O'Neill 3 Aug 10, 2022
A Tetris Game for programming education

Tetris Game プログラミング学習を目的とした、ブロックを操作してスコアを競うゲームです。 FAQはこちら。 tutorialはこちら。 実行環境準備 Mac環境 Finder→Application→Utility→Terminalから、ターミナルを起動して以下コマンドを実行する。 # i

11 Dec 01, 2022
Quiz Game: answering questions naturally with a friendly UI to enjoy the game

About Quiz Game : The Game is about answering questions naturally with a friendl

4 Jan 19, 2022
Chess game for 2 players with UI

2-D Chess for 2 players Overview This is a simple 2D Chess game for 2 players using pygame library. Requirements To be able to run this game, you must

7 Apr 06, 2022