The project ‘tct‘ (The Crime Tracer) fanned my wish to create a resource manager for the needs of the game. Generally, a resource manager increases efficiency in most cases because it uses internal caching and mapping. The resource manager of the project ‘tct‘ is written in Python and manages graphics, sounds and Pygame fonts.

We can use the resource manager in any case. Most importantly, when we want to increase performance, then we support caching for a resource. Caching is implemented with a buffer, a data structure specific key – value for the direct access [time complexity 0(1)] of the loaded resource. Specifically, we implement the mapper with the dictionary data structure where the keys are the file paths to the resources and values the resources themselves ready for access. Currently, the resource manager is only used for graphics, but could very well be easily extended to support new resources.

An interface could be created in Python for the resource manager and an implementation of it solely for the objects of Pygame so that it can be easily adapted to other frameworks. Those who already work with Python and Pygame can start using it.