Pycraft Progress Report
Tags: programming, python, opensource, gamedev
Published: 2022-02-20 13:00:28

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

* You can find the latest release of Pycraft (v0.9.3) here: https://github.com/PycraftDeveloper/Pycraft

* You can find the latest developer preview of Pycraft (v0.9.4-4) here: https://github.com/PycraftDeveloper/Pycraft/tree/Pycraft-v0.9.4-4

* You can find the latest feature preview for Pycraft (v0.9.5-0) here: https://github.com/PycraftDeveloper/Pycraft/tree/Pycraft-v0.9.5-0

* You can also find the latest documentation for Pycraft https://python-pycraft.readthedocs.io/en/latest/
_Although be aware there is a lot of changes occurring here._

## February the 1st - 2022

Pycraft progress update time! Today saw a significant tweak to the text wrapping engine (although not because there is a bug, more because it needed to be dynamic to work better in other GUIs) so now that engine now works in the benchmark section, where the first GUI has been changed, it's one of two GUIs in the menu that will be changed, the other being the results page which will have some minor text tweaks, with the same text wrapping engine. I've also spent today re-writing the theme section menu that appears right at the start, and I'm very pleased with the project! It's fully functional and I'm very happy and won't be making any more changes there. All I have left to do now is change the inventory sound to use the music function instead of the mixer function so the file is streamed, we need to do this because currently loading the music takes up over a gigabyte in memory, and isn't hardware friendly, that is the focus for tomorrow, and the amount of progress depends on how forgiving the project is to that change. Then it's the installer and documentation to do, and I'm close to a new release, this update won't be so feature rich! I've also been working on uploading the project to @sourceforge, that is going well, and is technically live, but I need a bit more time to continue the setup before I share a link!

## February the 2nd - 2022

Pycraft progress update time, today I switched the music that plays in the main menu from loading entirely and playing, which the other sound files use, to being streamed, which is much more CPU and memory efficient, it also decreases the load time and makes the game more accessible in lower powered devices. In addition to this I've made some bug fixes and tweaked the source forge page, which is public, but unfortunately GitHub for me was down this evening for a brief period, so instead changed tack and looked in depth at the performance of the project, it's more challenging to run than I'd like, there is a lot of processing that goes on in the background, which I'm looking to see if there is a solution for, but I have a good idea of things I can tweak (and I'm not going to remove or make features worse, but some things can be made more efficient), in addition to this I've also been working on getting Pycraft compiled, it works fine compiled to a directory because we can add in files that aren't taken by the program I've tried lots of programs and am close to a solution with auto-py-to-exe, but some files don't copy over and can be changed when we make the project as a directory, but when we change to one-file, and end up with a clean (.exe) file we cannot make the changes we need and this is why the project hasn't had a (.exe) release since the 3D engine change, but I'm working for a change their. Although I'm focused on the installer now, that's all that's left to do in this release! 

## February the 3rd - 2022

Pycraft progress update time, today I worked on the installer, adding in a tool for removing Pycraft from your system, you will be asked in a configuration menu the following: "would you like to remove everything" which is the default option then there is also "remove everything but keep my saved data" which will be used for updating Pycraft and more, then finally there is "remove Pycraft but leave the modules", which I think will be a nice tool for Software developers in python because the uninstaller is exactly reversed from the installer, so we remove all the files we need outside of Pycraft to run the project, and if you use those modules (like for example "@pygame_org") in other projects then you can choose not to remove those for now I've got the logic behind the project all programmed out, so now it's just the front end to do, with the graphics, which for me will take longer, but this update won't take long also I've been checking compatibility with the game engine and loading files, and have also been working on the new map design and dungeons (one is planned and gone through some basic CAD), I think once I've finished Pycraft v0.9.4, where the installer is the focus of Pycraft v0.9.5, and onwards, where we focus on the game engine, progress will be very efficient and not time consuming, based on lots of testing I have done (it's also very capable at rendering high fidelity scenes). The resource intensive behaviour of the project is also undergoing work too, and so is the (.Exe) file compiling process, with that currently working almost perfectly, so that will likely feature in the release of Pycraft v0.9.4 and later.

## February the 4th - 2022

Pycraft progress update time, progress in February will probably be mostly in the medium article and catching up with dev, and the reason I say this is because I'm a good way through the work needed in Pycraft v0.9.4-4, with the GUI tweaks and the framework/backend of the installer finished, (and now the first menu of the installer to, and some major performance optimisations) so theoretically this section is nearly finished! The thing that will likely delay the full release of Pycraft v0.9.4 is the documentation, I might have to cut writing the documentation if it's not really finished and then continue in Pycraft v0.9.5, but that's if I'm really behind, but progress has been going very well I am pleased to report and I'll be testing the uninstaller in just a few days, and I may share some photos if it is successful!

## February the 5th - 2022

Pycraft progress update time! Today I was working on solving the performance issues within Pycraft, and it's complex, it involves the new joystick implementation, it's very basic and I cannot customise it in a way that would be beneficial, it waits for an input from a controller, even if none is present, so we avoid this in the old implementation unless a controller is detected, otherwise it checks as soon as it can (very quickly) on repeat, and unless an input is given it stays that way, as a result of this we run the code in a thread, although we cannot stop the thread unless the user interacts with a controller (and if they don't have one to hand then it stays using as much performance), as a result, as well as the fact that the "Inputs" module is aging and not had an update in some time we decided to switch to a new implementation, I've been changing out the code now, and it has its advantages and disadvantages, and naturally I need to make the disadvantages as least noticeable as possible, although fortunately with the modular nature of Pycraft it means that I can make changes to the GUI/framework across the entire project very quickly, which of course I'm using to my advantage. It's too early to tell currently how well the new solution will work, but I have my fingers crossed because this need to change. In addition, all threads in Pycraft are now daemon, and the way the program closes has been cleaned up. The messages system on the home screen has also been changed, although again that's what I have just been redesigning so performance there is to be determined, but I'll know soon tomorrow how well that is going. Finally, I've also attached a copy of the PIL module to the installer, because it is required for the installation process, this is only going to feature in the final, compressed form of the installer, everything else can and will be handed when installing the project through PyPi, that's all for Pycraft progress today.

## February the 6th - 2022

Pycraft progress update time, I've made some progress today on the new joystick implementation, it's very nearly finished, the only thing left to do is the game engine section, and that's going to be the most difficult but due to the modular nature of the project I can make large scale changes quickly to the 2D menus and as a result that change has been made, but because the new controller implications is completely different and new to me (but much Finally, more efficient) progress has been slower than I'd like, additionally I've been working on a small change to the installer so that it changes theme based on the users option in the game, but that's something I am not focusing on, more of a challenge and part of the implementation of the uninstaller program, which isn't finished enough right now to share. I've also tweaked some features and removed some bugs and also changed some of the details on how events are handled in the game, so now if the user chooses to select to use the controller function, it doesn't wait for an event to be detected in pygame, which was causing significant issues for the project.

Thanks for reading folks!