• entries
    18
  • comments
    12
  • views
    17024

Multithreading!

Sign in to follow this  

1029 views

Been a bit buizy with school, but found enough time to make a system where the level is generated in a separate process. The idea is that I can use that later to pregenerate the next level while still playing the previous one. Unfortunately, I can't do much loading while the level is being generated since I don't know what type of objects will be on the map. I might implement a system to load some common monster types ahead of time, and then unload unload and load any differences based on the actual level.
I am also kinda confused on what the best way to handle errors is. Right now the game keeps on running but does nothing if it has crashed since the level generation process is still running. A try... finally... that closes that process could work, but I don't know what would happen if that process throws a error.
The process itself was really easy using the "Multiprocessing" Library. It handles calling functions, sending complex objects, arguments, terminating, joining, and most of the stuff I thought I might have to do myself using subprocess. (That would have been a nightmare)
My todo list:

  • Propper progress bar on level generation, I broke my old console based system.
  • Loading the generated next level
  • Finding a way to customize the level generator for special rooms etc.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now