DEV Community

Cover image for Pycraft Progress Report
Tom Jebbo
Tom Jebbo

Posted on

Pycraft Progress Report

This is transferred roughly weekly from my Twitter profile (here: https://twitter.com/PycraftDev) to here on Dev! This is for the week 11/04/2022 - 17/04/2022.

April the 11th – 2022

Pycraft progress update time! I've arrived back from my business trip now and have spent the afternoon making progress to Pycraft, currently not yet added controller support for the map screen, but I have added in an "overclock-fps" variable that Is used in measuring performance and improvements to the code by removing all FPS limits in every section of the game, this will not be a feature that can be enabled in game and will be only changeable in code, for now, later this will be part of the "unlimited" FPS Option in the redesigned settings menu! I'd like to now say that, when I make changes and add features to Pycraft I try to check every section of the project, but a large amount of the GUIs are currently not used, with the exception of the credits and settings menu The other elements are based largely on the same structure, however sometimes I'll add features and some GUIs will not be changed for some reason, perhaps time constraints or because there is better implementations coming, and some GUIs appear to be "left behind" Now when I go to change the controller implementation in the inventory and map sections of the project I realised they are running a bit behind on features, so have been doing a bit of a spruce up and performance improvement there as I add in changes Another section that will be improved is the tkinter information menu that was much more used in earlier revisions, but somewhat forgotten, this is part of some large performance improvements coming to the project!

April the 12th - 2022

I am pleased to announce that Pycraft v0.9.5-1 is now finished, I'll be uploading that tomorrow morning and it features all the performance optimisations, transition animations and wide ranging controller support for the project So today I've made more performance improvements to the project and added controller support to the map GUI section, as well as fixing a few bugs and improving performance, mainly also changing the map icon, which was a (.jpg) file with transparency effects not added In game, this combined lead to the white box/fill around the icon, this currently doesn't link to the position of the camera on screen, and the map its self doesn't correspond to the 3D object For now, it's coming very soon though, so expect changes there If not in Pycraft v0.9.5 then soon after!

April the 13th - 2022

it’s been a super busy day here for Pycraft progress, to start with I've shared the latest update, Pycraft v0.9.5-1 on GitHub, and also started the redesign of the game engine section, it's a huge task and one that will take several days And the aim is to add lighting effects to the game, although I'd like to add that I'm sprucing up a lot of other features too, already the implementation of lighting has been added, but not the "world" placeholder we are using currently, and there is also no current Skybox, but there is now directional movement, in Pycraft v0.9.5-1 we can move around the game with the controller adjusting automatically so if I move forwards and turn then I will continue to move forwards instead of off at the same axis, this was an issue With the keyboard, but that now doesn't matter as movement is now directional. Additionally, mouse movement is much improved, you can now move the mouse as far as you want and not have to worry about hitting the edge of the window, and is also faster. But at the same time Controller support hasn't been added, nor has sprinting, there will be re added, along with the skybox, and lighting and current place holder model. This has already meant a much higher improvement in FPS, from a theoretical max of 350 to locked at 500, the maximum on mid-tier hardware. It’s important to also note that there will be changes later in development to better utilise multiple cores and better hardware. The game engine is now much more CPU bottlenecked, but that's likely because a lot of the graphical elements have yet to Be added, which will put more strain on the GPU making the game more balanced. Also playing at high resolution does reduce this somewhat, although we are far from finished and this will already make a big difference, I'll show an image of the progress made tomorrow!

April the 14th - 2022

Today I've made more advances towards the completion of the game engine redesign, I've added in the skybox and also tweaked in game movement slightly to now include the footstep sounds and also to accelerate the player into a "sprinting" Mode like we did in the old game engine. However, we have a minor problem with lightning in game; this is about to get fairly complex although I'll do my best to explain fully!

So, ModernGL is a wrapper for OpenGL, a library written in C for game design. We can Efficiently load objects into video memory using "Buffers", these are called VAOs (Vertex array objects) and contain details of the object that are crucial for rendering it to the window. These Buffers contain VBOs that store the mesh of vertices and how they will be Drawn by the GPU. Now in ModernGL we have two options for creating 3D objects, we can load presents for basic objects, like cubes and spheres, or we can use the "scenes" library which allows us to load 3D files. No matter which option we choose they both create
VAOs that we just talked about. However, there is a minor difference in functionality here, which appears to be a limitation of the library but not OpenGL, so hopefully there will be a work around.
Allow me to explain; we are able to see an object on screen using either Render or draw, for ModernGL presents, we can use Render, and for the scenes we can use Draw, they both have the same basic functionality, they make that object visible on screen, however when we get more complex, we can apply GLSL programs to the render function but not the draw function, and there is no way to switch between each one. This means that if we create an object in ModernGL, we can (fairly) easily add shadows to it, however for scenes we can't.

But remember what I said, they both are stored as VAOs either way So hopefully, although this remains untested for now, we can mimic the render function by manipulating some of ModernGL’s subroutines, although this remains untested, if this doesn't work then we have a problem, but I see no reason why it shouldn't. It just means that Development at this stage may take slightly longer, a few days to a week depending on how bad.

On the plus side though, I've accidentally managed to make a HUD effect for the game, and although this will not be present in Pycraft v0.9.5-2, it will appear later!

April the 15th - 2022

I've made some amazing progress today, I shared that earlier, but in case you missed it, I've now added shadow mapping to Pycraft, this now works will all of Pycraft's objects, from the terrain to other objects when they are added However, one thing we still need to figure out is texturing the object But this is a big breakthrough, and in doing this finally put the last pieces together on how we will be making the HUD for the game later on, I've also added controller support to the project More specifically the game engine, and also added a sprinting mode, most of this is the same features as the old implementation now, but I'm also updating some features for performance and simplicity, and some sections are fundamentally different so did need reprogramming Also Pycraft is very performant which is great, at 1440p we can reach frame rates up to 420 Hz on an old test rig, a Ryzen 5 3400G and GTX 1050 meaning there is a lot of head room for adding more detail, and this is without doing an in depth analysis of the project!

April the 16th - 2022

Today I've been busy working on a few features, mainly with how we are positioning the window on screen and linking it to the rest of the program, currently when we start the project and open the game engine, we send all of the variables under "self" Or "class_startup_variables" identifier to the game engine, so they can be accessed by the project, but then don't currently have a way to return them, this may not initially seem like an issue, and certainly doesn't prevent the program from running, but does mean we Cannot share data out of the game engine and this is important for a variety of uses, for example making the change in size between full screen and windowed mode continue when transitioning between different windows But this comes in light of today also adding support in full for the inventory and map functionality to the game too, including a much more reliable way to take screenshots, and although this is untested may be now compatible with multiple monitors!

April the 17th – 2022

Pycraft progress update time, I can say that I'm nearly finished with Pycraft v0.9.5-1, today I've restructured most of the game engine, it was previously in Pycraft v0.9.5-0 and earlier using an iterative approach to render each frame Similar to the rest of the project, but then when we added in shadow mapping, even though the main section of the project was unchanged I couldn't get the display to refresh, so instead we used a recursive technique and was plagued by errors, because the project would Quickly generate a recursion error (or runtime/stack overflow error) and made switching between the other GUIs a challenge, however today we finally managed to find a fix, we needed to do some relatively simple ModernGL calls, but this didn't seem clear in the Documentation, this has made a negligible difference in performance but is still very fast, all I've got left to do in Pycraft now is adding in more footstep sounds, controller support and some minor structural changes and improvements to hopefully improve performance.

Thanks for reading folks!

Discussion (0)