美文网首页
KivEnv Introduction

KivEnv Introduction

作者: 码上说 | 来源:发表于2020-04-16 16:16 被阅读0次

    KivEnv


    KivEnt is a framework for building performant, dynamic real-time scenes in Kivy. While not as powerful as something like the Unreal engine or Unity3d, KivEnt is capable of creating games that handle several thousands to tens of thousands of entities, depending on what type of processing we are doing on them. You can easily have a hundreds thousand static sprites rendered in the background if they do not have any dynamic processing. At the same time, almost the entire API is accessible through Python, with a more performant cythonic API for those looking to get closer to the metal. Even without creating any cython gamesystems, you ought to be able to create games that feature up to several thousand game objects at once.

    The only dependency for the kivent_core module is Kivy  itself. Additional modules may have other requirements, such as kivent_cymunk module being based on Chipmunk2d and its cymunk wrapper.

    An entity-component architecture is used to control game object state and the logic of processing the game objects. This means that your game objects will be made up of collections of independent components that stricly hold data; each component corresponds to a GameSystem that will perform all data processing on the components, in the update loop each frame, and as a result of user interaction or other programmaticaly generated events. All memory for the built-in components is allocated statically: if you would like learn more about memory management, read here.

    KivEnt is built with a modular architecture and designed to have both a python api and a c-level cython api that allows more performant access to your game data. This makes it suitable for quickly prototyping a mechanic completely in python, and relatively trivial to then deeply cythonize that GameSystem if you find it to be performance sensitive. This process has already been done for the built-in components meaning they are ready for you to build new, performant game systems on top of them.

    The simulation below is created using this pure python code. It is still capable of handling updates on 5000 entities at nearly 60 fps, while creating and deleting entities in python at a rate of about 1250 per second.

    5,000 STARS BEING RENDERED, WITH NON-CYTHONIZED GAMESYSTEMS

    相关文章

      网友评论

          本文标题:KivEnv Introduction

          本文链接:https://www.haomeiwen.com/subject/lwfdvhtx.html