Skip to content

Latest commit

 

History

History
130 lines (101 loc) · 4 KB

File metadata and controls

130 lines (101 loc) · 4 KB

Minecraft-inspired Python Project

This project is a Minecraft-inspired game implemented in Python using Pyglet for graphics rendering. It aims to replicate some of the core mechanics and features of Minecraft while serving as a learning exercise in 3D graphics programming, game development, and Python.

Project Progress Videos

Video Title

Features

  • 3D voxel-based world generation
  • Customizable block types with different textures and properties
  • First-person camera and movement
  • Chunk-based world loading and rendering
  • Basic terrain generation
  • Block placement and destruction
  • Texture management system
  • Shader-based rendering
  • Save and load functionality for world persistence

Task List

Here's a task list for further development of the project:

  • Enhance world generation
    • Implement more diverse terrain features (hills, caves, etc.)
    • Add different biomes
  • Improve block interaction mechanics
  • Add block variants (e.g., different wood types)
  • Implement more complex terrain generation
    • Add biomes
    • Implement noise-based terrain generation
  • Add an inventory system
    • Create UI for inventory
    • Implement item pickup and storage
  • Implement crafting mechanics
    • Design crafting recipes
    • Create crafting UI
  • Optimize rendering for better performance
    • Implement occlusion culling
    • Add level of detail (LOD) for distant chunks
  • Implement multiplayer functionality
    • Set up client-server architecture
    • Implement network synchronization
  • Add sound effects and music
  • Implement a day/night cycle
  • CUDA Parllelization
  • ENJOY - ✨

Learning Resources

If you're new to game development or some of the concepts used in this project please go through the reading-material.txt files where crude logic and resources are pasted

Requirements

  • Python 3.x
  • Pyglet
  • OpenGL
  • nbtlib (for save file handling)
  • base36 (for save file path encoding)

Project Structure

  • main.py: Entry point of the application, sets up the game window and runs the main loop
  • world.py: Manages the game world, chunks, and block types
  • chunk.py: Handles individual chunks of the world
  • subchunk.py: Manages subchunks for more efficient rendering
  • block_type.py: Defines different types of blocks and their properties
  • camera.py: Implements the first-person camera and movement
  • texture_manager.py: Manages loading and handling of textures
  • shader.py: Handles shader compilation and usage
  • matrix.py: Provides matrix operations for 3D transformations
  • hit.py: Implements ray casting for block selection and interaction
  • save.py: Handles saving and loading of the world data

How to Run

  1. Clone this repository.
  2. Ensure you have all the required dependencies installed.
  3. Create virtual environment
python -m venv myenv
myenv\Scripts\activate
pip install pyglet
pip install nbtlib
pip install base36
  1. Run python main.py to start the game.

Controls

  • WASD: Move around
  • Space: Move up
  • Left Shift: Move down
  • Mouse: Look around
  • Left Click: Break block
  • Right Click: Place block
  • Middle Click: Pick block
  • G: Cycle through block types
  • O: Save the world
  • Escape: Release mouse capture

Customization

You can add new block types by editing the data/blocks.mcpy file. The format is as follows:

block_id: name "Block Name", texture.all "texture_name", model models.cube

Textures should be placed in the textures/ directory.

Acknowledgements

This project was inspired by Minecraft, created by Mojang Studios. It is not affiliated with or endorsed by Mojang or Microsoft.

Special thanks to the Pyglet and OpenGL communities for their excellent documentation and resources.