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)
A near-exact clone of google chrome's no internet game, or the "google dinosaur game", with some additions and extras.

dinoGame A near-exact clone of google chrome's no internet game, or the "google dinosaur game", with some additions and extras. Installation Download

1 Oct 26, 2021
An interactive pygame implementation of quadtree spatial quantization

QuadTree-py An interactive pygame implementation of quadtree spatial quantization Contents Installation Usage API Reference TODO Installation Clone th

Ethan 1 Dec 05, 2021
A game made similar as space inveders with pygame

space-inveders-pygame a game made similar as space inveders with pygame . . . if you are using it make sure to change audio and imgs file i do no own

Volt_L18 2 Dec 26, 2021
A DDQN that learned to play tic tac toe by playing against itself

TicTacToeAI A DDQN that learned to play tic tac toe by playing against itself Cu

Anik Patel 3 Apr 09, 2022
A project to san the internet of all open Minecraft servers.

MC-Server-Finder A project that scans the internet to find open Minecraft servers. Install the dependencies by running pip install -r requirements.txt

drakeerv 8 Mar 12, 2022
My first Minecraft CPU. Created in collaboration with Peer Carnes as a final project in CS 281: Architecture and Assembly at the University of Puget Sound

Minecraft CPU This is my first ever Minecraft CPU, created in collaboration with Peer Carnes. We created a custom assembly language, including an asse

Andy Chamberlain 4 Oct 10, 2022
Minecraft Script to Tellraw Datapack Generator

Minecraft Script to Tellraw Datapack Geneator (STDG) can generate a chain of tellraw command in datapack from script.

1 Jan 28, 2022
Code and outputs from analysis determining that the wordle game can always be won in six moves.

wordle_worst_case_analysis Code and outputs from analysis determining that the wordle game can always be won in six moves. This is for the general cas

2 Aug 19, 2022
Implementation of the famous puzle Tower of Hanoi

Tower_of_Hanoi Implementation of the famous puzle "Tower of Hanoi". The setup consists of three pegs (sticks) and a certain amount of discs (in this i

Raffaele Fiorillo 3 Mar 08, 2022
Flappy Bird clone utilizing facial recognition to move the

Flappy Face Flappy Bird clone utilizing facial recognition to move the "bird" How it works Flappy Face uses Facial Recognition to detect your face's p

Brady McDermott 1 Jan 11, 2022
Wordle-player - An optimal player for Wordle. Based on a rough understanding of information theory

Wordle-player - An optimal player for Wordle. Based on a rough understanding of information theory

Neill Johnston 3 Feb 26, 2022
Python fitting assistant, cross-platform fitting tool for EVE Online

pyfa What is it? Pyfa, short for python fitting assistant, allows you to create, experiment with, and save ship fittings without being in game. Open s

1.4k Dec 22, 2022
Algorithm to solve Wordle correctly 100% of the time within 6 attempts.

WordleSolver © Zulkarnine, 2022. Algorithm to solve Wordle 100% of the time within 6 attempts. You can go ahead and run main.py to run it for all 2315

Zulkarnine Mahmud 69 Dec 11, 2022
Searches the word list in Wordle based on search pattern.

Wordle Searcher Searches the word list in Wordle based on search pattern. Warning: like all forms of cheating, it trivializes the game, and robs you o

Tyler Martin 1 Jan 29, 2022
This repository contains the Unix Game challenges and metadata

This repository contains the Unix Game challenges and metadata

Nokia 7 Apr 06, 2022
An old time game Tic-Tac-toe

A Tic Tac Toe Bot This is the code repository for my article on Medium - Playing Games with Python - Tic Tac Toe, where I have tried to take the famou

Jigyanshu 0 Feb 25, 2022
3D online shooter written on Panda3D 1.10.10 and Python 3.10.1

на русском itch.io page Droid Game 3D This is a fresh game that was developed using the Panda3D game engine and Python language in the PyCharm IDE (I

Marcus Kemaul 5 Jun 04, 2022
Unknown Horizons official code repository

Unknown-Horizons based on Fifengine is no longer in development. We are porting it to Godot Engine. Please dont report any new bugs. Only bugfixes wil

Unknown Horizons 1.3k Dec 30, 2022
A Tetris Game for programming education

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

11 Dec 01, 2022
TetrisAI - Tetris AI Bot using computer vision to play game automatically

Tetris AI Tetris AI Bot using computer vision to play game automatically bot.py

11 Aug 29, 2022