• entries
    134
  • comments
    273
  • views
    173577

MiniMap, Inter-object communication, Saving Maps

Sign in to follow this  

292 views

MiniMap


As the title suggests, I got the minimap to work (more) properly. The minimap viewport rectangle is a bit off still, but at least it gives you a general impression of which part of the map you're looking at.

Instead of doing one pixel per tile I just made a map of very small tiles, like this: (isn't that cute?), and palette-shifted them to match the given terraintype. This would be tedious to render every frame, of course, so when a tile is changed it just gets drawn over individually -- there's no overlapping in the minimap like there is on the gamemap, so I can get away with it. (Which leads me to thinking that it'd be a good idea to draw Terrain/TerrainQuads and TerrainEffects to a single layer that's updated on-demand rather than every frame because I could totally get away with it!)

Oh, here's the screenshot:



Easy. Only an order of magnitude more difficult than I first thought it was going to be, which is quite good in the business of coding. I hear. Of course, to get an image element in the GUI to update based on changes in a random class without doing a bunch of stupid hacking was the real problem, which brings us to ...

Inter-object Communication


I modified GUI ImageElements and TextElements to accept a class that I'm calling "DynamicVariable" which can be defined in a GUI definition text file. So take the minimap as an example: It's given a target + varname, eg. "isomap","minimap", then it creates a link to a DynamicVariableCache in the class identified by the Relay as "isomap" and it updates from the variable labled "minimap" in said cache. Got that? Point is, it's more robust than before. A DynamicVariable will try to establish a link each update until it works, so order of creation is not an issue. (Now I just have to make sure that it can handle its link being broken and re-established with a different instance of the same object, though the situation has not come up in which this takes place.)

The GUI is coming together. I think I need to be able to minimize and move the minimap and do some other options on it ...

Saving/Loading Maps


Yeah, this was what I planned to be the next step today except I kinda balked at the prospect. I don't think that I have ever written files with Python before I wrote a little test this afternoon, so it's .. interesting and surprisingly easy -- when it's simple. And my maps are not. Marcel gave me some good advice on how to approach the problem (thanks!), so I think that I know where to start now.

Un(?)fortunately it really makes me want to refactor my isomap and isotile code now that I see what a mess they are in trying to sort how how to write them to file. Consider that all TODO. ... then once I've got THOSE working, I can start on gameplay ... or polish up the GUI more.. and then .. And so on with the putting off gameplay coding. Honestly, it's not my fault that I want everything working, it simply must. I swear, something will be happening by the end of January.

Speaking of January, I'm going to try to pick up some more graphic/design 'clients' then -- Need something to replace your programmer art with - at reasonable rates? Drop me a line!

Holiday non-schedule


I won't be doing MWF updates next week, possibly not until after the new year, 'cause ... you know, holidays! Let me just say "Have a Happy Fun Time" to everyone reading this.

'Til next time!
Sign in to follow this  


2 Comments


Recommended Comments

Quote:
Un(?)fortunately it really makes me want to refactor my isomap and isotile code now that I see what a mess they are in trying to sort how how to write them to file. Consider that all TODO. ... then once I've got THOSE working, I can start on gameplay ... or polish up the GUI more.. and then .. And so on with the putting off gameplay coding. Honestly, it's not my fault that I want everything working, it simply must. I swear, something will be happening by the end of January.


This sounds too much like me (re: my blog). :) "No, I still need to rewrite this and refactor this other part and this needs tweaking and oh... no, my game doesn't have any actual gameplay yet." But progress is still progress!

Share this comment


Link to comment
Maybe it's just about being a perfectionist, and in a good way, I hope. I suppose one could take it too far, but it is a perfectly reasonable to refactor a few times when the original design is clearly flawed (and this revealed by later expansion and interacting systems). But then we would justify it like that, wouldn't we? Such is the life of a perfectionist.

Share this comment


Link to comment

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