• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

obiwac/python-minecraft-clone: Source code for each episode of my Minecraft clon ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

obiwac/python-minecraft-clone

开源软件地址(OpenSource Url):

https://github.com/obiwac/python-minecraft-clone

开源编程语言(OpenSource Language):

Python 97.2%

开源软件介绍(OpenSource Introduction):

python-minecraft-clone

Source code for each episode of my Minecraft clone in Python YouTube tutorial series.

Introduction

Click on the thumbnail below to watch the introduction video:

Introduction

Prerequisites

Here is the setup video for Windows 10:

Setup: Windows 10

and for Debian-based Linux distros:

Setup: Linux

The pyglet module is a necessary dependency for all episodes, the nbtlib & base36 modules are necessary dependencies for all episodes starting with 11, and the pyglm module is necessary for the community directory. You can install them with PIP by issuing:

$ pip install --user pyglet nbtlib base36 pyglm

Running

Run the following command in the directory of any episode to run the result from that episode:

$ python3 main.py

This tutorial requires Python version 3.8 minimum (#56, with only a few changes though, it can run on versions much lower).

Community

The community directory is for experiments & contributions made by other people on the latest tutorial's code (see PR #29). It more generally extends the project with functionality I've yet to cover in a tutorial or that I don't intend on covering at all. Characteristic contributions are contributions which add something to the code. Contributions which fix something are still merged on the source of all episodes.

The community has several features and options that can be toggled in options.py:

  • Render Distance: At what distance (in chunks) should chunks stop being rendered

  • FOV: Camera field of view

  • Indirect Rendering: Alternative way of rendering that has less overhead but is only supported on devices supporting OpenGL 4.2

  • Advanced OpenGL: Rudimentary occlusion culling using hardware occlusion queries, however it is not performant and will cause pipeline stalls and decrease performance on most hardware - mostly for testing if it improves framerate

  • Chunk Updates: Chunk updates per chunk every tick - 1 gives the best performance and best framerate, however, as Python is an slow language, 1 may increase chunk building time by an ludicrous amount

  • Vsync: Vertical sync, may yield smoother framerate but bigger frame times and input lag

  • Max CPU Ahead frames: Number of frames that the CPU can go ahead of a frame before syncing with the GPU by waiting for it to complete the execution of the command buffer, using glClientWaitSync()

  • Smooth FPS: Legacy CPU/GPU sync by forcing the flushing and completion of command buffer using glFinish(), not recommended - similar to setting Max CPU Ahead Frames to 0. Mostly for testing whether it makes any difference with glClientWaitSync()

  • Smooth lighting: Smoothes the light of each vertex to achieve a linear interpolation of light on each fragment, hence creating a smoother light effect - it also adds ambient occlusion, to simulate light blocked by opaque objects (chunk update/build time will be severely affected by this feature)

  • Fancy translucency: Better translucency blending, avoid weird looking artefacts - disable on low-end hardware

  • Mipmap (minification filtering): Texture filtering used on higher distances. Default is GL_NEAREST (no filtering) (more info in options.py)

  • Colored lighting: Uses an alternative shader program to achieve a more colored lighting; it aims to look similar to Beta 1.8+ (no performance loss should be incurred)

  • Antialiasing: Experimental feature

List of projects based on this




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap