Click to share on Facebook (Opens in new window)

Resource Manager in Python & Pygame with Caching and Mapping

Filed under: Electronic Games , Projects — Leave a comment July 22, 2012 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

39.074208 21.824312 Rate this:

Share this:.
Click to share on Facebook (Opens in new window).

Click to share on LinkedIn (Opens in new window)

Click to share on Twitter (Opens in new window)

Click to print (Opens in new window)

Click to email this to a friend (Opens in new window)

Like this:.
Like Loading.
Related.
Tags: caching, dictionary, , game, mapping, , resource manager, .

The Crime Tracer Comments RSS feed Leave a Reply Cancel reply

Enter your comment here.
Fill in your details below or click an icon to log in:.
Email (Address never made public) Name Website You are commenting using your WordPress.com account.
( Log Out /   ) You are commenting using your Google account.
( Log Out /   ) You are commenting using your Twitter account.
( Log Out /   ) You are commenting using your Facebook account.
( Log Out /   ) Cancel Connecting to %s Notify me of new comments via email.
Notify me of new posts via email.
« Fosscomm 2012 (Serres).
The project ‘clg’ (Cell Life Game).
».
(79).
(21).
(15).
(26).
(4).
(7).
(55).
(24).
(4).
(16).
(14).
(4).
(7).
(10).
(78).
(11).
(9).
(1).
July 2012 M T W T F S S  1 2345678 9101112131415 16171819202122 23242526272829 3031   « May Sep ».
(2).
(4).
(1).
(1).
(2).
(1).
(1).
(1).
(2).
(1).
(9).
(1).
(8).
(1).
(1).
(2).
(4).
(7).
(1).
(1).
(1).
(8).
(12).
(1).
(2).
(1).
(2).
(1).
(2).
(1).
(1).
(4).
(20).
(13).
(5).
(2).
(10).
(13).
(10).
(10).
(20).
287,006 hits.
Send to Email Address Your Name Your Email Address Cancel Post was not sent – check your email addresses.
Email check failed.

Please try again Sorry

your blog cannot share posts by email.
%d bloggers like this:.