lolbaum / blockgame Goto Github PK
View Code? Open in Web Editor NEWPrototype for a sandbox game based on Minecraft
Prototype for a sandbox game based on Minecraft
When dispaling around 10 lines of text, the game already has framedrops and wont run smothly.
The RenderText()
function is very inefficient (it's still based on the Tutorial from learnopengl). For every character aney quad is created and directly send to OpenGL via glDrawArrays()
.
It would propably be more efficient to store the vertices in a vector and preloading the capacity so it doesn't need to be reallocated so often and then dawing all quads at once. Additionally a monospace Font could be used so the quad wont need to be recalculated each time.
Another idea is to create one inctance of each ASCII character and then using GLs instancing functionality to display the text.
Currently the blocks / textures are hard coded in serveral Places. These Values should be replaced with a call of a functon of the BloackTypeManager. All Chunks consits of Blocks, which have an int as BlockType. This BlockTypeInt should then be passed to the BTM and return requested information about this Bloacktype eg. texture, opacity, hardness, ect.
If I want to change the settings (config.json
), I need to close and restart the game.
So to reload the settings (including the window size) at runtime, I'll need to add a callback to every game component that uses the config.
Currently all user Input will be treat the same way while the whole time the program is running. At the moment that's no problem because the player is always in the same sate - he's moving around removing or placing Blocks with a click and selecting them with the Numbers 1...9.
But for further features Like an interactive inventory GUI or a chat new states of input need to be added.
That's why an InputHandler should be implemented, which forwards the user input to the correct Component (PlayerContoller, Inventory Drag n Drop, Chat, ect.) depending on the input state.
Currently the Players Position is directly changed when moving. If a general Player Velocity was Used it will be easier tho add gravity and other forces.
It doesn't really matter, but I think I still want to add one to this Project.
It should be free to use and distribute for everyone, as long as they credit this Project.
Maybe GLP or MIT would be right. But I don't know much about licences... Well I gonna do that later
At ceratain agnles white stripes occour at the edges of blocks. They are nor visible all the time but still annoying.
Currently the code and the libraries are a Mess. That's why the Structure and Building Process of this Project should be changed so it's easy to complile it on different Operating Systems.
At a high sight distance the chunk loading / generation can really decrease the performance. That's why the chunk loading will be refactored into it's own thread
the following videos will be used as reference for the implementation:
https://www.youtube.com/watch?v=WGr4Z9uzS0Y (GamesWithGabe)
https://www.youtube.com/watch?v=bQDVVuov_sU& (GamesWithGabe)
At low FPS the player can't jump as high as normally, probably because some part of the velocity isn't applied using the delta time.
on branch strange-linux-issue I fixed a bug that made the game crash on my Ubuntu 22.04.3 laptop.
now the Textures of the Items in the Inventory bar are not displayed correctly. It looks like the UV coords are either 0 or y has a random value. y changes when moving.
the StandaradBlockTextures of the BlockItemTypes are initialised correctly at first, but are overwritten later...
Currently the 'sky' is just a solid background color (the GL clear color of the color buffer). Thats pretty boring. It would be much cooler if there were moving clouds. Usually this is solved with a Cubemap, but that would be hard for a dynamic environment. My Idea is to add a skybox and use a shader with something like raymarching on it to calculate the clouds on the fly.
For the shader is plenty of reference on Shadertoy.com
details coming soon...
==28010== Conditional jump or move depends on uninitialised value(s)
==28010== at 0x188900: createDir_IfDoesNotExist(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) (in /home/baum/fun/BlockGame/build/mainLinux)
==28010== by 0x168B3E: SuperChunk::initialize() (in /home/baum/fun/BlockGame/build/mainLinux)
==28010== by 0x14C9DB: main_function() (in /home/baum/fun/BlockGame/build/mainLinux)
==28010== by 0x14E7D5: main (in /home/baum/fun/BlockGame/build/mainLinux)
==28010== Uninitialised value was created by a stack allocation
==28010== at 0x188866: isDir(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&) (in /home/baum/fun/BlockGame/build/mainLinux)
==28010== Conditional jump or move depends on uninitialised value(s)
==28010== at 0x155A02: bool glm::operator==<float, (glm::qualifier)0>(glm::vec<3, float, (glm::qualifier)0> const&, glm::vec<3, float, (glm::qualifier)0> const&) (in /home/baum/fun/BlockGame/build/mainLinux)
==28010== by 0x154AA4: bool glm::operator!=<float, (glm::qualifier)0>(glm::vec<3, float, (glm::qualifier)0> const&, glm::vec<3, float, (glm::qualifier)0> const&) (in /home/baum/fun/BlockGame/build/mainLinux)
==28010== by 0x150F11: LocalPlayer::update() (in /home/baum/fun/BlockGame/build/mainLinux)
==28010== by 0x150BED: LocalPlayer::LocalPlayer() (in /home/baum/fun/BlockGame/build/mainLinux)
==28010== by 0x14C9EA: main_function() (in /home/baum/fun/BlockGame/build/mainLinux)
==28010== by 0x14E7D5: main (in /home/baum/fun/BlockGame/build/mainLinux)
==28010== Uninitialised value was created by a stack allocation
==28010== at 0x14C0EB: main_function() (in /home/baum/fun/BlockGame/build/mainLinux)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.