Giter VIP home page Giter VIP logo

minecraft-one-week-challenge's Introduction

MineCraft-One-Week-Challenge

I challenged myself to see if I could create Minecraft in just one week... So lets go!

Video: https://www.youtube.com/watch?v=Xq3isov6mZ8

Note: 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

And the "optimized" version can be found here: https://github.com/Hopson97/MineCraft-One-Week-Challenge/tree/792df07e9780b444be5290fd05a3c8598aacafc8 (~1 week later version)

There 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: https://github.com/Hopson97/MineCraft-One-Week-Challenge/tree/aa50ad8077ef0e617a9cfc336bdb7db81c313017

Other People's Projects

This was made in a week, as a challenge for a video. There do exist other, more mature and developed Minecraft clones written in C++.

MineTest here: https://github.com/minetest/minetest

Building

You will need GLM and SFML 2.4.1+ libraries w/headers, and this also requires a compiler that supports C++14 (or newer) with threads.

macOS

Install macports from https://www.macports.org

sudo port install sfml glm

Ubuntu

sudo apt-get install libsfml-dev libglm-dev

Compile Source and Running

Linux

Debug

sh scripts/build.sh
sh scripts/run.sh

Release

sh scripts/build.sh release
sh scripts/run.sh release

The Challenge

Day One

End of day one commit: https://github.com/Hopson97/MineCraft-One-Week-Challenge/tree/44ace72573833796da05a97972be5765b05ce94f

The 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.

The day was finished off by creating a first person camera.

Quad

End of day stats:

Title Data
Time programming Today 3:21:51
Lines of Code Today 829
Total Time programming 3:21:51
Total Lines of Code 829

Day Two

End of day two commit: https://github.com/Hopson97/MineCraft-One-Week-Challenge/tree/98055215f735335de80193221a30c0bb8586fba5

The second day was spent setting up the basic ChunkSection and various block classes.

I also worked out the coordinates for a cube, and thus created a cube renderer.

I 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.

Messed up chunk

End of day stats:

Title Data
Time programming Today 4:16:07
Lines of Code Today 732
Total Time programming 7:37:58
Total Lines of Code 1561

Day Three

End of day three commit: https://github.com/Hopson97/MineCraft-One-Week-Challenge/commit/78bd637581542576372d75cf7638f76381e933b4

To 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...

gl bytesss

Anyways, 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.

To finish the day off, I got some naive block editing to work.

Block editing

End of day stats:

Title Data
Time programming Today 3:15:38
Lines of Code Today 410
Total Time programming 10:53:36
Total Lines of Code 1974

Day 4

The first thing I did on day 4 was create a sky box using OpenGL cube maps.

After this, I started work on the world generation, eg adding height map and trees.

Skybox and world gen

End of day stats:

Title Data
Time programming Today 3:14:15
Lines of Code Today 523
Total Time programming 14:07:51
Total Lines of Code 2489

Day 5

I started off the day by cleaning up some of the chunk code, and then proceeded to make the world infinite, but I felt it was not needed, so I simply went back to a fixed-sized world.

I then added an item system. My implementation probably was not great for this, but it was my first time at creating that sort of the thing.

Basically, when a player breaks a block, it gets added to their inventory. When they place a block, a block is placed.

Title Data
Time programming Today 2:54:14
Lines of Code Today 560
Total Time programming 17:02:05
Total Lines of Code 3049

Day 6

Mostly optimizations, such as view-frustum culling and making the mesh building faster.

Day 7

Focus on improving how it looks, eg adding directional lighting

Also implemented concurrency :)

minecraft-one-week-challenge's People

Contributors

bawbby avatar booster884 avatar chicoamorim avatar cyboerg42 avatar dreamhollow avatar e1z0 avatar ekashpersky avatar esser50k avatar grpou avatar hopson97 avatar iand avatar isibboi avatar jmermar avatar jonas-july avatar kastrbl4nik avatar kiroma avatar m1ksu avatar mortie avatar orangemi avatar pneigel avatar qwertychouskie avatar shaoruu avatar theknarf avatar tropicalbastos avatar uglyswedishfish avatar undertrack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minecraft-one-week-challenge's Issues

Loaded world disappears after a few seconds on windows

First of all thank you for your work.

Second, I cloned this repository and tried to get it to work on windows with visual studio 2015. I didn't use cmake because it kept throwing errors I didn't fully understand. I downloaded glew, glm and sfml and compiled those and included them into my project. After compiling the project and tweaking the variables a little and adding dll's I got it running in debug mode. Well, at least showing a window. The window shows a blue background, after a few seconds the generated world appears and 3 seconds later it's back to the world background (blue sky) and the fps are awefull. I imagine, I made a mistake while linking.

Now the actual question: Is that a problem for you as well? If not, do you have a .sln file, that could help me?

Errors and Crash on macOS

Errors and Crash on macOS:

  • OS Version: macOS Sierra 10.12
  • Clang Version: Apple LLVM version 8.0.0 (clang-800.0.42.1)

ld: library not found for -lGL

openGL isn't a library on macOS, it's a framework

Use -framework openGL instead of -lGL solve this and MinecraftWeek is created.
But it crash on launch โ‡ฉ.

MinecraftWeek crash on launch:

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000001810
Exception Note: EXC_CORPSE_NOTIFY

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]

Thread 4 Crashed:
libGL.dylib 0x00007fff80367133 glDeleteVertexArrays + 18

It probably comes from model.cpp (line 96):

void Model::deleteData()
{
glDeleteVertexArrays(1, &m_vao); <===
...
}

Note: On launch there is some warns =

Warning. Compatibility profile not supported on this platform.
Error. Unable to create the context. Retrying without shared context.
Warning. New context created without shared context.
Warning: The created OpenGL context does not fully meet the settings that were requested
Requested: version = 3.3 ; depth bits = 24 ; stencil bits = 8 ; AA level = 0 ; core = false ; debug = false ; sRGB = false
Created: version = 4.1 ; depth bits = 24 ; stencil bits = 8 ; AA level = 0 ; core = true ; debug = false ; sRGB = false

Note 2: Same problem on Ubuntu = Crash on Ubuntu 17.04

Thread 2 "MinecraftWeek" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fabc47f9700 (LWP 28480)]
0x00007fabc9bf8d69 in ?? () from /usr/lib/libGLdispatch.so.0
(gdb) bt
0 0x00007fabc9bf8d69 in ?? () from /usr/lib/libGLdispatch.so.0
1 0x00000001000312ca in Model::deleteData() () <---- this one

Crashes on Solus

I just did a git clone of the game and compiled it. When I ran the game it opened a black screen then it just crashed. It said it was a Segmentation fault.

================Full History============================
plex@plex ~/git $ git clone https://github.com/Hopson97/MineCraft-One-Week-Challenge.git
Cloning into 'MineCraft-One-Week-Challenge'...
remote: Counting objects: 1493, done.
remote: Compressing objects: 100% (42/42), done.
remote: Total 1493 (delta 22), reused 33 (delta 13), pack-reused 1438
Receiving objects: 100% (1493/1493), 4.79 MiB | 60.00 KiB/s, done.
Resolving deltas: 100% (983/983), done.
plex@plex ~/git $ cd MineCraft-One-Week-Challenge/
plex@plex ~/git/MineCraft-One-Week-Challenge $ ls
config.txt Controls.txt LICENSE Makefile README.md Res Shaders Source
plex@plex ~/git/MineCraft-One-Week-Challenge $ make
g++ -std=c++1y -o Source/Camera.o -c Source/Camera.cpp
g++ -std=c++1y -o Source/Item/ItemStack.o -c Source/Item/ItemStack.cpp
g++ -std=c++1y -o Source/Item/Material.o -c Source/Item/Material.cpp
g++ -std=c++1y -o Source/Controller.o -c Source/Controller.cpp
g++ -std=c++1y -o Source/Renderer/SkyboxRenderer.o -c Source/Renderer/SkyboxRenderer.cpp
g++ -std=c++1y -o Source/Renderer/ChunkRenderer.o -c Source/Renderer/ChunkRenderer.cpp
g++ -std=c++1y -o Source/Renderer/CubeRenderer.o -c Source/Renderer/CubeRenderer.cpp
g++ -std=c++1y -o Source/Renderer/QuadRenderer.o -c Source/Renderer/QuadRenderer.cpp
g++ -std=c++1y -o Source/Renderer/WaterRenderer.o -c Source/Renderer/WaterRenderer.cpp
g++ -std=c++1y -o Source/Renderer/RenderMaster.o -c Source/Renderer/RenderMaster.cpp
g++ -std=c++1y -o Source/Renderer/SFMLRenderer.o -c Source/Renderer/SFMLRenderer.cpp
g++ -std=c++1y -o Source/Model.o -c Source/Model.cpp
g++ -std=c++1y -o Source/ToggleKey.o -c Source/ToggleKey.cpp
g++ -std=c++1y -o Source/Main.o -c Source/Main.cpp
g++ -std=c++1y -o Source/Shaders/ChunkShader.o -c Source/Shaders/ChunkShader.cpp
g++ -std=c++1y -o Source/Shaders/SkyboxShader.o -c Source/Shaders/SkyboxShader.cpp
g++ -std=c++1y -o Source/Shaders/BasicShader.o -c Source/Shaders/BasicShader.cpp
g++ -std=c++1y -o Source/Shaders/ShaderLoader.o -c Source/Shaders/ShaderLoader.cpp
g++ -std=c++1y -o Source/Shaders/WaterShader.o -c Source/Shaders/WaterShader.cpp
g++ -std=c++1y -o Source/Shaders/Shader.o -c Source/Shaders/Shader.cpp
g++ -std=c++1y -o Source/Util/FPSCounter.o -c Source/Util/FPSCounter.cpp
g++ -std=c++1y -o Source/Util/FileUtil.o -c Source/Util/FileUtil.cpp
g++ -std=c++1y -o Source/Util/Random.o -c Source/Util/Random.cpp
g++ -std=c++1y -o Source/World/Event/PlayerDigEvent.o -c Source/World/Event/PlayerDigEvent.cpp
g++ -std=c++1y -o Source/World/Block/BlockTypes/BlockType.o -c Source/World/Block/BlockTypes/BlockType.cpp
g++ -std=c++1y -o Source/World/Block/BlockData.o -c Source/World/Block/BlockData.cpp
g++ -std=c++1y -o Source/World/Block/ChunkBlock.o -c Source/World/Block/ChunkBlock.cpp
g++ -std=c++1y -o Source/World/Block/BlockDatabase.o -c Source/World/Block/BlockDatabase.cpp
g++ -std=c++1y -o Source/World/World.o -c Source/World/World.cpp
g++ -std=c++1y -o Source/World/Generation/Biome/OceanBiome.o -c Source/World/Generation/Biome/OceanBiome.cpp
g++ -std=c++1y -o Source/World/Generation/Biome/DesertBiome.o -c Source/World/Generation/Biome/DesertBiome.cpp
g++ -std=c++1y -o Source/World/Generation/Biome/TemperateForestBiome.o -c Source/World/Generation/Biome/TemperateForestBiome.cpp
g++ -std=c++1y -o Source/World/Generation/Biome/LightForest.o -c Source/World/Generation/Biome/LightForest.cpp
g++ -std=c++1y -o Source/World/Generation/Biome/GrasslandBiome.o -c Source/World/Generation/Biome/GrasslandBiome.cpp
g++ -std=c++1y -o Source/World/Generation/Biome/Biome.o -c Source/World/Generation/Biome/Biome.cpp
g++ -std=c++1y -o Source/World/Generation/Terrain/SuperFlatGenerator.o -c Source/World/Generation/Terrain/SuperFlatGenerator.cpp
g++ -std=c++1y -o Source/World/Generation/Terrain/ClassicOverWorldGenerator.o -c Source/World/Generation/Terrain/ClassicOverWorldGenerator.cpp
g++ -std=c++1y -o Source/World/Generation/Structures/TreeGenerator.o -c Source/World/Generation/Structures/TreeGenerator.cpp
g++ -std=c++1y -o Source/World/Generation/Structures/StructureBuilder.o -c Source/World/Generation/Structures/StructureBuilder.cpp
g++ -std=c++1y -o Source/World/Chunk/ChunkMesh.o -c Source/World/Chunk/ChunkMesh.cpp
g++ -std=c++1y -o Source/World/Chunk/ChunkSection.o -c Source/World/Chunk/ChunkSection.cpp
g++ -std=c++1y -o Source/World/Chunk/Chunk.o -c Source/World/Chunk/Chunk.cpp
g++ -std=c++1y -o Source/World/Chunk/ChunkMeshBuilder.o -c Source/World/Chunk/ChunkMeshBuilder.cpp
g++ -std=c++1y -o Source/World/Chunk/ChunkManager.o -c Source/World/Chunk/ChunkManager.cpp
g++ -std=c++1y -o Source/GL/GLFunctions.o -c Source/GL/GLFunctions.cpp
g++ -std=c++1y -o Source/States/PlayingState.o -c Source/States/PlayingState.cpp
g++ -std=c++1y -o Source/Physics/AABB.o -c Source/Physics/AABB.cpp
g++ -std=c++1y -o Source/Context.o -c Source/Context.cpp
g++ -std=c++1y -o Source/Texture/BasicTexture.o -c Source/Texture/BasicTexture.cpp
g++ -std=c++1y -o Source/Texture/TextureAtlas.o -c Source/Texture/TextureAtlas.cpp
g++ -std=c++1y -o Source/Texture/CubeTexture.o -c Source/Texture/CubeTexture.cpp
g++ -std=c++1y -o Source/Maths/Vector2XZ.o -c Source/Maths/Vector2XZ.cpp
g++ -std=c++1y -o Source/Maths/GeneralMaths.o -c Source/Maths/GeneralMaths.cpp
g++ -std=c++1y -o Source/Maths/NoiseGenerator.o -c Source/Maths/NoiseGenerator.cpp
g++ -std=c++1y -o Source/Maths/Ray.o -c Source/Maths/Ray.cpp
g++ -std=c++1y -o Source/Maths/Frustum.o -c Source/Maths/Frustum.cpp
g++ -std=c++1y -o Source/Maths/Matrix.o -c Source/Maths/Matrix.cpp
g++ -std=c++1y -o Source/Application.o -c Source/Application.cpp
g++ -std=c++1y -o Source/Player/Player.o -c Source/Player/Player.cpp
g++ -o MinecraftWeek Source/Camera.o Source/Item/ItemStack.o Source/Item/Material.o Source/Controller.o Source/Renderer/SkyboxRenderer.o Source/Renderer/ChunkRenderer.o Source/Renderer/CubeRenderer.o Source/Renderer/QuadRenderer.o Source/Renderer/WaterRenderer.o Source/Renderer/RenderMaster.o Source/Renderer/SFMLRenderer.o Source/Model.o Source/ToggleKey.o Source/Main.o Source/Shaders/ChunkShader.o Source/Shaders/SkyboxShader.o Source/Shaders/BasicShader.o Source/Shaders/ShaderLoader.o Source/Shaders/WaterShader.o Source/Shaders/Shader.o Source/Util/FPSCounter.o Source/Util/FileUtil.o Source/Util/Random.o Source/World/Event/PlayerDigEvent.o Source/World/Block/BlockTypes/BlockType.o Source/World/Block/BlockData.o Source/World/Block/ChunkBlock.o Source/World/Block/BlockDatabase.o Source/World/World.o Source/World/Generation/Biome/OceanBiome.o Source/World/Generation/Biome/DesertBiome.o Source/World/Generation/Biome/TemperateForestBiome.o Source/World/Generation/Biome/LightForest.o Source/World/Generation/Biome/GrasslandBiome.o Source/World/Generation/Biome/Biome.o Source/World/Generation/Terrain/SuperFlatGenerator.o Source/World/Generation/Terrain/ClassicOverWorldGenerator.o Source/World/Generation/Structures/TreeGenerator.o Source/World/Generation/Structures/StructureBuilder.o Source/World/Chunk/ChunkMesh.o Source/World/Chunk/ChunkSection.o Source/World/Chunk/Chunk.o Source/World/Chunk/ChunkMeshBuilder.o Source/World/Chunk/ChunkManager.o Source/GL/GLFunctions.o Source/States/PlayingState.o Source/Physics/AABB.o Source/Context.o Source/Texture/BasicTexture.o Source/Texture/TextureAtlas.o Source/Texture/CubeTexture.o Source/Maths/Vector2XZ.o Source/Maths/GeneralMaths.o Source/Maths/NoiseGenerator.o Source/Maths/Ray.o Source/Maths/Frustum.o Source/Maths/Matrix.o Source/Application.o Source/Player/Player.o -lGL -lpthread -lsfml-system -lsfml-window -lsfml-graphics -lGLEW
plex@plex ~/git/MineCraft-One-Week-Challenge $ ls
config.txt Controls.txt LICENSE Makefile MinecraftWeek README.md Res Shaders Source
plex@plex ~/git/MineCraft-One-Week-Challenge $ ./MinecraftWeek
Config: Render Distance: 16
Config: Full screen mode: true
Config: Window Size: 1280 x 720
Config: Field of Vision: 100
Seed: 172953
making noise
Searching for spawn...
Spawn found! Attempts: 1 Time Taken: 0.003319 seconds
Segmentation fault

F3 Doesn't work

It is suppose to toggle the GUI, but for some reason it has stopped working.

World doesn't render (Visual Studio 2017)

I have tried using both cmake and manually creating projects trying to get this to work, but each time the world just appears black. I don't think it is an issue with the world as I can move and interact with it based on the info in the corner, but nothing else is drawn.

Level loading?

I would be interested in how to load fixed levels from level files, like defined below:

000002222000000
000001111000000
000033333333333

The row number should be the y axis, the character number the x axis, and the number the y axis :)

I realy got no idea how to load something like this into the current project :/ I already tried different things

Rewrite Settings System

I feel like the current Settings System is a little bulky and inflexible. I suggest rewriting it using Settings Parser. This is a very simple and flexible configuration manager. (I would implement this myself but I haven't been able to get the project to compile properly yet anyway.)

Here's an example from one of my projects on how this could be used

{
	SettingsParser settings;

	if (settings.loadFromFile(".\\" + GBL::DIR::BASE + "kunlauncher.conf"))
	{
		settings.get("window_width", app->settings.width);
		settings.get("window_height", app->settings.height);
		settings.get("updatelauncheronstart", app->settings.updateLauncherOnStart);
		settings.get("checkforitemsonstart", app->settings.checkForNewItemsOnStart);
		settings.get("experimentalThemes", app->settings.experimentalThemes);
		settings.get("printdownloadprogress", app->settings.printdownloadprogress);
		settings.get("defaultTheme", app->settings.selectedTheme);
	}
	else
	{
		std::cout << "failed to load settings, using defaults" << std::endl;
	}
}

With this, it would be very simple to add and remove things from the list without breaking things.
And, things can very easily be changed whilst the game is running.

  • :D :communibb:

Cheers :)

You basically just fixed the two issues I wanted to report (inconsistent cases & missing Makefile/CMakeLists.txt/whatever), so just cheers I guess. :) I've built the game yesterday after fixing the issues and planned to report today.

Also good job and go on. The game's lagging quite a bit on my machine, but you have clearly written, isn't not close to optimal atm.

[Ongoing] SkyNet... or something like that.

Sky Update

Main Planned Features:

Completed Features:

  • Clouds (basic)
  • Procedural SkyBox
  • Ambient Lighting
  • Sky Fix (SkyLight class) EDIT: Turns out I'm just dumb -_-
  • Sun/Moon Basic
  • Tick management system (can be used later for redstone)

Extra Tweaks:

  • Cross hair and debug constantly on
  • Improved Water Tweaks (which apparently @Hopson97 did about 3 hours after me ๐Ÿ˜œ )
  • Fixed #40 by modifying contrast and gamma values (texture-based skybox now removed)
  • Fixed #39 by removing mip-maps. The resulting pixelation from far away will be fixed in post-processing.
  • Fixed #42 by changing all shaders.
  • Removed active use of skybox.
  • Removed texture-based SkyBox in general.
  • Removed Patch-1 to fix #51
  • (was not stated earlier) Implemented Numerical Inventory Access (#9)
  • Added smoother flora animations.

Issues to be Closed:

Next Update Themes:

Lighting

The World

The Player

Shader filenames are non-standard.

Or so do I think, glslangValidator does not support .glsl files.
Changing names from xVertex.glsl/xFragment.glsl to x.vert/x.frag could help bugchecking.

Which sfml version was used for building?

I'm building with sfml 2.4.2 on Ubuntu 16.04 LTS, but I get some undefined references when linking.
It would be really nice if you could add which version of sfml was used, and if it was a 32 or 64-bit version.

These are the undefined references I get, if that is of any help:

Source/Util/FPSCounter.o: In Funktion 'FPSCounter::FPSCounter()':
FPSCounter.cpp:(.text+0xf8): Nicht definierter Verweis auf 'sf::Font::loadFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
Source/Util/FPSCounter.o: In Funktion 'FPSCounter::draw(RenderMaster&)':
FPSCounter.cpp:(.text+0x324): Nicht definierter Verweis auf 'sf::String::String(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::locale const&)'
Source/Player/Player.o: In Funktion 'Player::Player()':
Player.cpp:(.text+0x21b): Nicht definierter Verweis auf 'sf::Font::loadFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
Source/Player/Player.o: In Funktion 'Player::draw(RenderMaster&)':
Player.cpp:(.text+0x14df): Nicht definierter Verweis auf 'sf::String::String(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::locale const&)'
Player.cpp:(.text+0x1698): Nicht definierter Verweis auf 'sf::String::String(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::locale const&)'
Source/Texture/BasicTexture.o: In Funktion 'BasicTexture::loadFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
BasicTexture.cpp:(.text+0x1ac): Nicht definierter Verweis auf 'sf::Image::loadFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
Source/Texture/TextureAtlas.o: In Funktion 'TextureAtlas::TextureAtlas(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
TextureAtlas.cpp:(.text+0x8b): Nicht definierter Verweis auf 'sf::Image::loadFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
Source/Texture/CubeTexture.o: In Funktion 'CubeTexture::loadFromFiles(std::array<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, 6ul> const&)':
CubeTexture.cpp:(.text+0x13e): Nicht definierter Verweis auf 'sf::Image::loadFromFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'```

Keys do not work on macOS

None of the keys work on mac, but the mouse works fine. WASD/Space/Shift/F3/L/Up/Down all do nothing. Escape works fine. Left click/Right click/Mouse move all work.

Mac 10.12.6 Sierra built with make

Performance

Something seems to be lowering the FPS to a lot less than what it once was ๐Ÿค”

Block/ Item system is awful

If I want to add a new block I must:

  1. Add it to the block enum
  2. Add it to the item enum
  3. Add it to the item-block enum conversion functions
  4. Add it to the block database
  5. Add it to the Blocks/ folder

This is pretty awful, but may be forgivable seeing as I only had a week.

But of course, there probably is a better way, but idk

Block Collision

Can you make it so you can walk on and collide with blocks.

cmake generated cmake_install.cmake file. What's next?

I am not familiar with cmake, can you help me here please?

I used cmake and successfully generated in my specified build directory, a cmake_install.cmake file and a bunch of other visual studio project files. What's next? How do I build the .exe file? There is a CMAKE_INSTALL_PREFIX path but no folder/files is created at that location. I also can't find any flags that instruct cmake to create the exe file.

Thanks.

Water Shader Bug

New water shaders won't compile. Mainly because Water.frag does not exist ๐Ÿ™

MacOS X - Compile issue

For successful compile, I was need to change -L/opt/local/bin to -L/opt/local/lib in the Makefile.

[Ongoing] Graphical & Game Enhancements

Graphical Effects


Features left before next pull request:

  • YAY

Features So Far:

  • FXAA in post-processing
  • Move color correction code from ChunkShader to PostProcessShader
  • Option to enable or disable all post processing in config
  • Rendering to texture & Post-Process Render
  • Waving water
  • Enable switching code in order to disable an effect if a user changes the value in the config to less than 0 (avoids graphical glitches) or higher than 2 (also strange effects).
  • Ability to change options in the config
  • Tri-linear Filter
  • Brightness enhancement
  • Gamma correction

Upcoming Features:

  • Sun/Moon
  • Clouds
  • Stars
  • Day/Night Cycle
  • Shadows (basic / advanced)
  • Weather & Storms

Chunk Generation

At areas like 0,0 chunk generation randomly stops... The result is a world that can only be in the positive linear coordinate system instead of the negative. Also, chunk generation & loading should be put in a separate thread from the main thread / render thread since it often causes a very unstable framerate & bugs like seen in issue #30. World generation height might also be a concern in the future as the current terrain system causes some hardships with the creation of a sky, as the moon is visible from some hills even when its approximately 9-10 a.m.

Multiplayer?

Thanks to @NT-Bourgeois-Iridescence-Technologies the looks are improving constantly and other people contributing improvements, I thought it would be time to think about multiplayer (and I was eager to try it out).

On the weekend I tried to just send the player position via a threaded UDP connection to a C# receiver. In the following gist is the code of both. It took longer than expected, but I didn't know that the whole application crashes if a std::thread goes out of scope.
https://gist.github.com/OperationDarkside/bd5f157f4d11df11881dfc66a34bd4aa

Following are the communication channels I see a need for at the moment:

  • World-Event (digging, placing, weather-change): TCP
  • Player-Event (Add Item): TCP
  • World-Load (Blocks + Textures + Chunkblocks): TCP
  • Player-Load (Position, Inventory): TCP
  • Player-Position-Update (Position-Vector + View-Vector): UDP

I chose mostly TCP because those are not yet time-critical, but it's debatable. Some could even be bundled to save memory for threads+connections.

Problems:

  • Who should do what? Does the client just do the rendering and the server has all the logic?
  • Current code needs to be split. Server has only the data and needs less frameworks, but needs to handle multiple connections and concurrency.

terminate called after throwing an instance of 'std::bad_alloc'

For some reason it's not linking the latest version SFML I've compiled and installed using CMake. I'm using SFML 2.3.2, which is the version on the Xenial repo. As a workaround, I changed setFillColor() and setOutlineColor() to setColor() on both Player.cpp and FPSCount.cpp.

Could that cause the following error?

Warning: The created OpenGL context does not fully meet the settings that were requested
Requested: version = 3.3 ; depth bits = 24 ; stencil bits = 8 ; AA level = 0 ; core = false ; debug = false
Created: version = 4.5 ; depth bits = 24 ; stencil bits = 8 ; AA level = 0 ; core = true ; debug = false
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

Clouds?

I would realy like to know how to make clouds like in minecraft. They are kind of like white blocks, but I think they move(?)

Mention Minetest ?

Hey this is an impressive challenge and a nice proof of feasibility (so I'm definitely not saying to abandon it).

But for the people that may stumble upon it and see it's potential as an alternative to the proprietary Minecraft game, why not at least mention the larger and more mature Minetest project ?
(I was thinking in the README or something)

[Ongoing] It's lit!

Lighting Update:

Planned Features:

Completed Features:

  • Winter!
  • Motion Blur
  • Color Boost
  • Tonemap
  • Implement truly customizable postprocess.
  • Antialiasing filter
  • Bloom
  • Create render filters
  • Vignette
  • Add a sun color to the lighting...
  • Color Correction / Saturation
  • Circular sun
  • Real frame buffers (as objects)
  • Denoise function
  • Add LOD bias
  • Anisotropic Filtering
  • Directional Lighting
  • Fog
  • Dedicated Post-Processor
  • Enhanced Water Waves

Tweaks:

  • Mipmaps that don't affect trees (at least that you can tell).
  • Global Config Access
  • New Shader Options
  • Fixed Cloud Movements
  • Fixed #66

Performance impacts:

  • 8x FXAA (~6%)
  • Bloom (~12%)
  • Motion Blur (~7%)

Next Update:

The World

Skybox is very obvious

Probably a simple issue of contrast; the skybox is very visible which decreases immersion in the game.

Unable to compile

On Ubuntu 14.04, using the following:
gcc 6.3.0
libglm-dev 0.9.5.1-1

I am getting the following error:
Source/Camera.cpp: In constructor โ€˜Camera::Camera(const Config&)โ€™: Source/Camera.cpp:10:27: error: converting to โ€˜const glm::detail::tvec3<float, (glm::precision)0u>โ€™ from initializer list would use explicit constructor โ€˜glm::detail::tvec3<T, P>::tvec3(const A&, const B&, const C&) [with U = int; V = int; W = double; T = float; glm::precision P = (glm::precision)0u]โ€™
position = {0, 0, -3.5};
^

Could you give more details on which versions to use for every library/binary involved?
Thanks

"Attempt to use a deleted function thread" error at the Xcode

I want to play this game at the Xcode 9.0.1 (macOS high sierra)

So, I have tried to build this project and finished to prepare all codes, textures, blocks and fonts.

But, 1 error ocurred.

"Attempt to use a deleted function thread"

The place of thread is

template <class _TSp, class _Fp, class ..._Args, size_t ..._Indices> inline _LIBCPP_INLINE_VISIBILITY void __thread_execute(tuple<_TSp, _Fp, _Args...>& __t, __tuple_indices<_Indices...>) { __invoke(_VSTD::move(_VSTD::get<1>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...); }

The location of this error is below.

__invoke(_VSTD::move(_VSTD::get<1>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...);

Did anyone encounter a same error like it ?

I have no idea how to solve this...
If it is good, please give me some advices.

Naming error in CobbleStone file

I have found a small and easy to fix issue in the CobbleStone file located in /Res/Blocks.
It seems that despite it being cobblestone, its name is "OakBark".
This should be a very easy issue to fix, simply requiring for you to rename it, yet I am not sure if the renaming of the object in its currently working build would result in some possible propagation of the renaming to create some unforeseen errors. This should be taken into consideration.

CobbleStone file for reference with the arrow and comment added in:

Name
OakBark <--- NOTICE HOW ITS CALLED OAKBARK

Id
13

TexAll
3 1

Opaque
1

MeshType
0

Can't Run

I can't run the game
Here are some files that windows says will explain why

Info.zip

Block Texture Issue [Info]

Just a warning,
Me and Cray were both working on a pass from the previous x16 texture pack to a x64 texture pack, however, Cray had a windows issue and lost the code fixs without uploading merging them.
So take in consideration that the current Branch do have that issue :

The game will load the texture atlas as it is and will give block textures according to it on a 16x base where the atlas itself have it based on x64. (x16 = 16x16 px and x64 = 64x64 px)

So if textures looks f**k'd up, it's normal.

I'll try to fix it myself if I enventualy manage to make CMake work, or eventually if he want/can NT will do/compile it for me

Crash on Ubuntu 17.04

The screen blinks/window appears with black momentarily. How do I provide more information? Do I need to add a -g flag to the makefile?

$ ./MinecraftWeek
Config: Render Distance: 16
Config: Full screen mode: true
Config: Window Size: 1280 x 720
Config: Field of Vision: 100
Seed: 313758
making noise
Searching for spawn...
Spawn found! Attempts: 1 Time Taken: 0.002136 seconds
Segmentation fault (core dumped)

Latest merge pulls are kinda glitchy

My lack of git knowledge doesn't allow this;

I just want to revert the repo back to 01b2aa2 aka "Merge pull request #76 from cyborg00222/master from Nov. 14"

The "swimming physics" commit seems to have basically broken the collision detection, and the physics don't really work anyway

Thanks...

Compatibility Profile Error on macOS

Loading game...
Warning. Compatibility profile not supported on this platform.
Error. Unable to create the context. Retrying without shared context.
Warning. New context created without shared context.
Warning: The created OpenGL context does not fully meet the settings that were requested
Requested: version = 3.3 ; depth bits = 24 ; stencil bits = 8 ; AA level = 0 ; core = false ; debug = false ; sRGB = false
Created: version = 4.1 ; depth bits = 24 ; stencil bits = 8 ; AA level = 0 ; core = true ; debug = false ; sRGB = false
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Unable to load a shader: ERROR: 0:31: Invalid call of undeclared identifier 'texture2D'
ERROR: 0:32: Invalid call of undeclared identifier 'texture2D'
ERROR: 0:33: Invalid call of undeclared identifier 'texture2D'
ERROR: 0:34: Invalid call of undeclared identifier 'texture2D'
ERROR: 0:35: Invalid call of undeclared identifier 'texture2D'
ERROR: 0:37: Use of undeclared identifier 'rgbNW'
ERROR: 0:38: Use of undeclared identifier 'rgbNE'
ERROR: 0:39: Use of undeclared identifier 'rgbSW'
ERROR: 0:40: Use of undeclared identifier 'rgb
Abort trap: 6

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.