2023-UNIST-Rust-Minecraft is the material(lecture notes, examples and assignments) repository for learning Rust programming language and making simple Minecraft clone game that I'll teach the club 'HeXA' at UNIST in the winter of 2023.
- Week 0 (1/11) [Lecture]
- Introduction
- Week 1 (1/18) [Lecture] [Assignment] [Solution]
- A Tour of Rust, Part 1
- Assignment #1
- Week 2 (1/25) [Lecture] [Assignment] [Solution]
- Explain Solution of Assignment #1
- A Tour of Rust, Part 2
- Assignment #2
- Week 3 (2/1)
- A Tour of Rust, Part 2
- Assignment #2
- Week 4 (2/8)
- Explain Solution of Assignment #2
- Week 5 (3/1) [Lecture] [Assignment] [Solution]
- A Tour of Rust, Part 3
- Assignment #3
- Week 6 (3/10) [Lecture]
- A Tour of Rust, Part 4
- Week 7 (3/15) [Assignment] [Solution]
- A Tour of Rust, Part 4
- Assignment #4
- Week 8 (3/22)
- A Tour of Rust, Part 5
- Assignment #5
- Week 9 (5/10) [Code]
- Making Minecraft, Part 1
- Project Setup
- Make a Simple Window using
gl
andglfw
- The Main Loop
- Double Buffering
- Event Pooling
- Making Minecraft, Part 1
- Week 10 (7/18)
- Making Minecraft, Part 2
- Color Batch Rendering
- Drawing a Quad
- Make a Shader
- Vertex Shader
- Fragment Shader
- Event Processing
- Color Batch Rendering
- Making Minecraft, Part 2
- Week 11 (8/1)
- Making Minecraft, Part 3
- Texture Batch Rendering
- Create a Texture
- Texture Mapping
- Debugging
- Show FPS
- Texture Batch Rendering
- Making Minecraft, Part 3
- Week X (1/24) [Code]
- Making Minecraft, Part X
- Chunk Manager for Improving Performance
- Reduce the draw call for regenerating the chunk
- Chunk Manager for Improving Performance
- Making Minecraft, Part X
- Week X (1/31) [Code]
- Making Minecraft, Part X
- Improve Performance
- Block Face Culling
- Improve Performance
- Making Minecraft, Part X
- Week X (2/16) [Code]
- Making Minecraft, Part X
- Simplex Noise
- Improve Performance
- Use raw pointers for the VBO instead of
Vec
- Use raw pointers for the VBO instead of
- Making Minecraft, Part X
- Week X (2/23) [Code]
- Making Minecraft, Part X
- Support for different textures per block side
- Code Refactoring
- Move some type aliases to another files
- Making Minecraft, Part X
- Week X (2/28) [Code]
- Making Minecraft, Part X
- Transparent Blocks
- Trees
- Code Refactoring
- Delete unused files
- Improve Performance
- Reinitialize the VBO each time a chunk has been invalidated
- Making Minecraft, Part X
- Week X (3/6) [Code]
- Making Minecraft, Part X
- AABB Collision Detection
- Fix bugs with the player movement
- Jump key spam issue
- Making Minecraft, Part X
- Week X (3/13) [Code]
- Making Minecraft, Part X
- Fixed Timestep Physics
- Making Minecraft, Part X
- Week X (3/21) [Code]
- Making Minecraft, Part X
- Fix bugs with the player movement
- Make player physics framerate independent
- Code Refactoring
- Replace magic numbers with constants
- Extract all useful constants to a separate file
- Fix bugs with the player movement
- Making Minecraft, Part X
- Week X (4/7) [Code]
- Making Minecraft, Part X
- Code Refactoring
- Split main into multiple files
- Move some functions for readability
- Rename some symbols
- Code Refactoring
- Making Minecraft, Part X
- Week X (4/28) [Code]
- Making Minecraft, Part X
- Code Refactoring
- Replace triple for loops with
BlockIterators
- Replace triple for loops with
- Add a crosshair in the center of the screen
- Implement a base system for GUI
- Code Refactoring
- Making Minecraft, Part X
- Week X (5/4) [Code]
- Making Minecraft, Part X
- Add Block Outline
- The block that the player is looking at
- Draw The Hotbar Texture at the bottom of the screen
- Add Basic Lighting System
- Add Block Outline
- Making Minecraft, Part X
- Week X (5/12) [Code]
- Making Minecraft, Part X
- Implement Hotbar and Inventory System
- Refactor GUI rendering code
- Making Minecraft, Part X
- Week X (5/19) [Code]
- Making Minecraft, Part X
- Implement Ambient Occlusion
- Fix lag spike when updating chunks
- Making Minecraft, Part X
- Week X (6/1) [Code]
- Making Minecraft, Part X
- Implement Interpolation System using trait
Interpolatable
- Apply interpolation to the physics system and FOV
- Implement
Timer
for global time management and pause/resume - Implement flying trigger interval
- Implement Interpolation System using trait
- Making Minecraft, Part X
- Week X (6/30) [Code]
- Making Minecraft, Part X
- Implement Particle System
- Spawn white particles when breaking blocks
- Making Minecraft, Part X
- Week X (7/10) [Code]
- Making Minecraft, Part X
- Replace texture atlas with array texture
- Making Minecraft, Part X
- Week X (7/13) [Code]
- Making Minecraft, Part X
- Improve Particle System
- Use a texture atlas using array texture
- Add a lifetime to particles
- Improve performance
- Batch all particles together into 1 draw call by interleaving the data
- Don't use instancing because the texture coordinates must change for each particle
- If the block is not at the edge of the chunk, then skip the chunk manager
- Batch all particles together into 1 draw call by interleaving the data
- Change code to spawn block breaking particles more minecraft-like
- Improve Particle System
- Making Minecraft, Part X
- Week X (7/20) [Code]
- Making Minecraft, Part X
- Add new gameplay features
- Sprinting on Left Control or Double Tap Forward
- Sneaking on Left Shift
- Add new gameplay features
- Making Minecraft, Part X
- Week X (7/31) [Code]
- Making Minecraft, Part X
- Add FPS counter using
log
andpretty_env_logger
- Improve Input System
- Auto click to place or break blocks
- Auto jump frequency throttle
- Code Refactoring
- Move code for handling input event to
PlayerProperties
andPlayerPhysicsState
- Move code for handling input event to
- Add FPS counter using
- Making Minecraft, Part X
- Week X (8/7) [Code]
- Making Minecraft, Part X
- Implement proof of concept for block in hand
- Making Minecraft, Part X
- Week X (8/9) [Code]
- Making Minecraft, Part X
- Code Refactoring
- Split input and player update into multiple systems (ECS) using
specs
- Split input and player update into multiple systems (ECS) using
- Code Refactoring
- Making Minecraft, Part X
- Week X (8/12) [Code]
- Making Minecraft, Part X
- Code Refactoring
- Make player inventory and hand as ECS components
- Insert particle systems, timer and texture pack as ECS resources
- Remove unnecessary components and systems
- Rename some types and fields to be more descriptive
- Code Refactoring
- Making Minecraft, Part X
- Week X (8/21) [Code]
- Making Minecraft, Part X
- Code Refactoring
- Put breaking and placing blocks in a separate ECS system
- Animate main hand when switching items in the hotbar
- Add mouse event for middle click to pick up blocks
- Code Refactoring
- Making Minecraft, Part X
- Week X (9/25) [Code]
- Making Minecraft, Part X
- Code Refactoring
- Move all rendering into ECS systems
- Put chunks into chunk columns
- Code Refactoring
- Making Minecraft, Part X
- Week X (10/4) [Code]
- Making Minecraft, Part X
- Code Refactoring
- Replace dynamic allocated structures with fixed-size arrays
- Use
BitVec
for block face visibility - Add some timers for performance profiling
- Code Refactoring
- Making Minecraft, Part X
- Week X (11/6) [Code]
- Making Minecraft, Part X
- Code Refactoring
- Replace
HashMap
withVec
for storing ambient occulsion patterns - Store active faces and ambient occlusion data in memory in order to avoid recalculations
- Recalculate them only for the changed surfaces, not the entire chunk
- Replace
- Code Refactoring
- Making Minecraft, Part X
- Week X (11/20) [Code]
- Making Minecraft, Part X
- Load one randomized chunk per frame
- Implement proof of concept for infinite chunk generation
- Making Minecraft, Part X
- Week X (11/27) [Code]
- Making Minecraft, Part X
- Add new textures for the blocks
- Bedrock
- Stone
- Improve Performance
- Make flood fill much faster by replacing
HashSet
withBitVec
- Replace
HashMap
withVec
in structChunkLoading
- Make flood fill much faster by replacing
- Prepare for multithreading by using interior mutability patterns for chunk columns
- Parallelize terrain generation by using
rayon
andparking_lot
- Parallelize terrain generation by using
- Add new textures for the blocks
- Making Minecraft, Part X
- Beginner
- Intermediate
- Advanced
Contributions are always welcome, either reporting issues/bugs or forking the repository and then issuing pull requests when you have completed some additional coding that you feel will be beneficial to the main project. If you are interested in contributing in a more dedicated capacity, then please contact me.
You can contact me via e-mail (utilForever at gmail.com). I am always happy to answer questions or help with any issues you might have, and please be sure to share any additional work or your creations with me, I love seeing what other people are making.
The class is licensed under the MIT License:
Copyright © 2023 Chris Ohk.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.