Wheee

So it seems that ConfigParser class is sort of handy.  When my game runs through and generates the tiles–or specifically, figures out which image to give the tiles, previously it would find the text file that detailed the thing’s coordinates.  It would then open said file and pull out the values and close it.  It would do this every single time for each tile whenever the view gets adjusted from the scope of the individual Tile object.  Using configparser it’s now set so that Scene handles under initialization, storing that info into memory, and then when finding out which tile to change, it just looks it up in the array that Scene made for it.  The result is that when you straddle the borders of the map and the view constantly recenters, the average framerate jumped from 10fps to 17fps (20 is the cap at the moment)!  Hurray for 70% improvement.

..And talk about overhead. a 17kb file that, in theory, will contain a list of each monster the player can encounter, takes up a meg of ram when stored into a List. This could get expensive in terms of memory, but I also surely am SEVERELY overestimating the number of creatures in the game.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


»
%d bloggers like this: