{"id":15031882,"url":"https://github.com/hopson97/minecraft-one-week-challenge","last_synced_at":"2025-05-14T01:02:17.322Z","repository":{"id":37768279,"uuid":"98561896","full_name":"Hopson97/MineCraft-One-Week-Challenge","owner":"Hopson97","description":"I challenged myself to see if I could create a voxel game (Minecraft-like) in just one week using C++ and OpenGL, and here is the result","archived":false,"fork":false,"pushed_at":"2025-01-14T20:19:36.000Z","size":12321,"stargazers_count":2677,"open_issues_count":14,"forks_count":378,"subscribers_count":113,"default_branch":"master","last_synced_at":"2025-04-12T22:16:28.119Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.youtube.com/watch?v=Xq3isov6mZ8","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Hopson97.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-27T17:07:06.000Z","updated_at":"2025-04-08T11:23:22.000Z","dependencies_parsed_at":"2023-02-14T14:30:50.842Z","dependency_job_id":"b33b372a-e436-41be-80ca-a76f7092b074","html_url":"https://github.com/Hopson97/MineCraft-One-Week-Challenge","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hopson97%2FMineCraft-One-Week-Challenge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hopson97%2FMineCraft-One-Week-Challenge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hopson97%2FMineCraft-One-Week-Challenge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hopson97%2FMineCraft-One-Week-Challenge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hopson97","download_url":"https://codeload.github.com/Hopson97/MineCraft-One-Week-Challenge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637787,"owners_count":21137538,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T20:16:49.854Z","updated_at":"2025-04-12T22:16:32.486Z","avatar_url":"https://github.com/Hopson97.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MineCraft-One-Week-Challenge\r\n\r\nI challenged myself to see if I could create Minecraft in just one week... So lets go!\r\n\r\nVideo: https://www.youtube.com/watch?v=Xq3isov6mZ8\r\n\r\nNote: I continued to edit after the 7 days, however the version seen in the video is found here https://github.com/Hopson97/MineCraft-One-Week-Challenge/tree/eb01640580cc5ad403f6a8b9fb58af37e2f03f0c\r\n\r\nAnd the \"optimized\" version can be found here: https://github.com/Hopson97/MineCraft-One-Week-Challenge/tree/792df07e9780b444be5290fd05a3c8598aacafc8 (~1 week later version)\r\n\r\nThere also is a version of this game with very good graphics, and things like a day/night cycle. However, it was causing rendering issues for many people. This version can be found here:\r\nhttps://github.com/Hopson97/MineCraft-One-Week-Challenge/tree/aa50ad8077ef0e617a9cfc336bdb7db81c313017\r\n\r\n## Other People's Projects\r\n\r\nThis was made in a week, as a challenge for a video. There do exist other, more mature and developed Minecraft clones written in C++.\r\n\r\nMineTest here: https://github.com/minetest/minetest\r\n\r\n## Building and Running\r\n\r\n### Windows (Visual Studio)\r\n\r\nThe easiest way to build is to use [vcpkg](https://vcpkg.io/en/index.html) and install dependencies through this:\r\n\r\n```bash\r\nvcpkg install sfml\r\nvcpkg install glm\r\nvcpkg integrate install\r\n```\r\n\r\nThen open the Visual Studio project file to build and run.\r\n\r\n### Linux\r\n\r\n#### Pre-requisites\r\n\r\nInstall Vcpkg and other required packages using your distribution's package manager:\r\n\r\n```sh\r\ngit clone https://github.com/microsoft/vcpkg.git\r\ncd vcpkg\r\n./bootstrap-vcpkg.sh\r\n\r\n# These are required to build some packages\r\nsudo apt install cmake make autoconf libtool pkg-config\r\n\r\n# The following are required for SFML\r\nsudo apt install libx11-dev xorg-dev freeglut3-dev libudev-dev\r\n```\r\n\r\nEnsure paths are set correctly:\r\n\r\n```sh\r\nexport VCPKG_ROOT=/path/to/vcpkg\r\nexport PATH=$VCPKG_ROOT:$PATH\r\n```\r\n\r\nRECOMMENDED: Add the above lines to your `.bashrc` or `.zshrc` file:\r\n\r\n```sh\r\necho 'export VCPKG_ROOT=/path/to/vcpkg' \u003e\u003e ~/.bashrc\r\necho 'export PATH=$VCPKG_ROOT:$PATH' \u003e\u003e ~/.bashrc\r\n```\r\n\r\n#### Build and Run\r\n\r\nTo build, at the root of the project:\r\n\r\n```sh\r\nvcpkg install # First time only\r\nsh scripts/build.sh\r\n```\r\n\r\nTo run, at the root of the project:\r\n\r\n```sh\r\nsh scripts/run.sh\r\n```\r\n\r\nTo build and run in release mode, simply add the `release` suffix:\r\n\r\n```sh\r\nsh scripts/build.sh release\r\nsh scripts/run.sh release\r\n```\r\n\r\n## The Challenge\r\n\r\n### Day One\r\n\r\nEnd of day one commit: https://github.com/Hopson97/MineCraft-One-Week-Challenge/tree/44ace72573833796da05a97972be5765b05ce94f\r\n\r\nThe first day was spent setting up boilerplate code such as the game state/ game screen system, and the basic rendering engines, starting off with a mere quad.\r\n\r\nThe day was finished off by creating a first person camera.\r\n\r\n![Quad](http://i.imgur.com/fJDgA2a.png)\r\n\r\nEnd of day stats:\r\n\r\n| Title                  | Data    |\r\n| ---------------------- | ------- |\r\n| Time programming Today | 3:21:51 |\r\n| Lines of Code Today    | 829     |\r\n| Total Time programming | 3:21:51 |\r\n| Total Lines of Code    | 829     |\r\n\r\n### Day Two\r\n\r\nEnd of day two commit: https://github.com/Hopson97/MineCraft-One-Week-Challenge/tree/98055215f735335de80193221a30c0bb8586fba5\r\n\r\nThe second day was spent setting up the basic ChunkSection and various block classes.\r\n\r\nI also worked out the coordinates for a cube, and thus created a cube renderer.\r\n\r\nI finished up the day attempting to create a mesh builder for the chunk; however, this did not go well at all, and two had ended before I got it to work correctly.\r\n\r\n![Messed up chunk](http://i.imgur.com/UsKHJrR.png)\r\n\r\nEnd of day stats:\r\n\r\n| Title                  | Data    |\r\n| ---------------------- | ------- |\r\n| Time programming Today | 4:16:07 |\r\n| Lines of Code Today    | 732     |\r\n| Total Time programming | 7:37:58 |\r\n| Total Lines of Code    | 1561    |\r\n\r\n### Day Three\r\n\r\nEnd of day three commit: https://github.com/Hopson97/MineCraft-One-Week-Challenge/commit/78bd637581542576372d75cf7638f76381e933b4\r\n\r\nTo start the day off, I fixed the chunk drawing. Turns out I was telling OpenGL the indices were `GL_UNSIGNED_BYTE`, but they were actually `GL_UNSIGNED_INT`. This took 3 hours to work out...\r\n\r\n![gl bytesss](http://i.imgur.com/PD44aRg.png)\r\n\r\nAnyways, after this I got the game working with more chunks. I now have an area of 16x16 chunks, made out of chunk sections of 16x16x16 blocks.\r\n\r\nTo finish the day off, I got some naive block editing to work.\r\n\r\n![Block editing](http://i.imgur.com/ilTJr8i.png)\r\n\r\nEnd of day stats:\r\n\r\n| Title                  | Data     |\r\n| ---------------------- | -------- |\r\n| Time programming Today | 3:15:38  |\r\n| Lines of Code Today    | 410      |\r\n| Total Time programming | 10:53:36 |\r\n| Total Lines of Code    | 1974     |\r\n\r\n### Day 4\r\n\r\nThe first thing I did on day 4 was create a sky box using OpenGL cube maps.\r\n\r\nAfter this, I started work on the world generation, eg adding height map and trees.\r\n\r\n![Skybox and world gen](http://i.imgur.com/mzUwqPo.png)\r\n\r\nEnd of day stats:\r\n\r\n| Title                  | Data     |\r\n| ---------------------- | -------- |\r\n| Time programming Today | 3:14:15  |\r\n| Lines of Code Today    | 523      |\r\n| Total Time programming | 14:07:51 |\r\n| Total Lines of Code    | 2489     |\r\n\r\n### Day 5\r\n\r\nI started off the day by cleaning up some of the chunk code, and then proceeded to make the world infinite, but\r\nI felt it was not needed, so I simply went back to a fixed-sized world.\r\n\r\nI then added an item system. My implementation probably was not great for this, but it was my first time\r\nat creating that sort of the thing.\r\n\r\nBasically, when a player breaks a block, it gets added to their inventory. When they place a block, a block\r\nis placed.\r\n\r\n| Title                  | Data     |\r\n| ---------------------- | -------- |\r\n| Time programming Today | 2:54:14  |\r\n| Lines of Code Today    | 560      |\r\n| Total Time programming | 17:02:05 |\r\n| Total Lines of Code    | 3049     |\r\n\r\n### Day 6\r\n\r\nMostly optimizations, such as view-frustum culling and making the mesh building faster.\r\n\r\n### Day 7\r\n\r\nFocus on improving how it looks, eg adding directional lighting\r\n\r\nAlso implemented concurrency :)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhopson97%2Fminecraft-one-week-challenge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhopson97%2Fminecraft-one-week-challenge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhopson97%2Fminecraft-one-week-challenge/lists"}