PyCraft

一个包含500行 python的《我的世界》的分支,打算有朝一日被用作一个真正的引擎,而不是一个学习示例。「A fork of "Minecraft in 500 lines of python" intended to someday be used as a real engine, instead of as a learning example.」

  • Owner: traverseda/pycraft
  • Platform: Linux, Mac, Windows
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    2
      Compare:

Github stars Tracking Chart

PyCraft

Folleman 的“Minecraft”存储库的社区驱动分支。

动机

Python 不太适合游戏开发。然而,它非常适合数据科学。我们处理大型体素集(large voxels sets)的许多任务与您在数据科学中遇到的问题非常相似。

最大的优势在于限制了实时状态。通过不依赖于现在发生的任何事情,我们可以做更复杂的计算。在低端,这意味着我们可以实现更复杂的遮挡算法,从而绘制更复杂的场景。

这种分离也可以用来进行更复杂的操作,就像细胞自动机,粗略地模拟植物生长或水等事物。

如果可能的话,我们宁愿“横向扩展”。我们不太关心效率,我们更关心我们的解决方案是否适用于非常大或非常复杂的操作。这与“典型”游戏开发方法完全相反,后者更喜欢“按比例放大”的解决方案,对于他们希望处理的数据类型而言,解决方案的速度非常快。

它目前是 pre-alpha 质量。

屏幕截图

虚拟环境(推荐)

# create a virtual environment
virtualenv -p python3 ~/.venv/pycraft # (or wherever)
# you may need to add execute permissions
chmod -R a+x ~/.venv
# activate
. ~/.venv/pycraft/bin/activate # on mac
. ~/.venv/pycraft/Scripts/activate # on windows
# deactivate (when you're done)
deactivate

安装

pip install -e .
选项1:
pip install -e .[dev]
# or: python3 setup.py develop
pycraft
选项2:
python -m pycraft
# or: python3 -m pycraft

特性

  • 支持 python 3.5
  • 简单的 Perlin Noise 地形生成器
  • 面向对象的块系统

怎么玩

移动
  • W:向前
  • S:回来
  • A:向左扫射
  • D:向右扫射
  • 鼠标:环顾四周
  • 空格:跳跃
  • Tab:切换飞行模式
建造
  • 选择要创建的块的类型:
    • 1:砖头
    • 2:草
    • 3:沙
  • 鼠标左键:删除块
  • 鼠标右键单击:创建块
退出
  • ESC:释放鼠标,然后关闭窗口

贡献

我们支持并鼓励做出贡献。

归属

Alex Voelk 的游戏纹理“Piehole”已获得 CC BY 3.0 的许可。

(The first version translated by vz on 2020.07.15)

Main metrics

Overview
Name With Ownertraverseda/pycraft
Primary LanguagePython
Program languagePython (Language Count: 3)
PlatformLinux, Mac, Windows
License:MIT License
所有者活动
Created At2016-04-07 12:29:46
Pushed At2021-03-25 21:57:54
Last Commit At2019-06-17 15:02:15
Release Count0
用户参与
Stargazers Count1.1k
Watchers Count50
Fork Count96
Commits Count242
Has Issues Enabled
Issues Count41
Issue Open Count22
Pull Requests Count44
Pull Requests Open Count2
Pull Requests Close Count6
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private

image

image

PyCraft

A community driven fork of foglemans "Minecraft" repo
<https://github.com/fogleman/Minecraft>
.

\#pycraft on
freenode

Motivation

Python is somewhat poorly suited for game development. However it is
well suited to data-science. A lot of our tasks, working with large
voxels sets, strongly resemble the kind of problems you encounter in
data science.

The big advantage comes from limiting "real-time" state. By not
relying on anything having to happen now, we can do more complicated
computation. At the low-end, that means we can implement much more
complicated occluding algorithms, and thus draw more complicated scenes.

This kind of split could also be used to run more complicated types of
operations, like a cellular automata crudely simulating things like
plant growth or water.

When possible, we would prefer to "scale-out". We don't care about
outright efficiency too much, rather we care that our solutions can work
for very large or very complicated operations. The exact opposite of
"typical" game development methodology, which would prefer solutions
that "scale-up", solutions that a very fast for the type of data they
expect to deal with.

It is currently pre-alpha quality.

Screenshot

# create a virtual environment
virtualenv -p python3 ~/.venv/pycraft # (or wherever)
# you may need to add execute permissions
chmod -R a+x ~/.venv
# activate
. ~/.venv/pycraft/bin/activate # on mac
. ~/.venv/pycraft/Scripts/activate # on windows
# deactivate (when you're done)
deactivate

Installing

pip install -e .

option 1:

pip install -e .[dev]
# or: python3 setup.py develop
pycraft

option 2:

python -m pycraft
# or: python3 -m pycraft

Features

  • Support for python 3.5
  • Simple Perlin Noise terrain generator
  • Object-oriented blocks system

How to Play

Moving

  • W: forward
  • S: back
  • A: strafe left
  • D: strafe right
  • Mouse: look around
  • Space: jump
  • Tab: toggle flying mode

Building

  • Selecting the type of block to create:
    • 1: brick
    • 2: grass
    • 3: sand
  • Mouse left-click: remove block
  • Mouse right-click: create block

Quitting

  • ESC: release mouse, then close window

Contributing

We support and encourage contributions.

Attributions

The game textures "Piehole" by Alex
Voelk
is licensed under CC BY
3.0
.