Wednesday, October 22, 2008

Minor update

Just a minor update before I forget about it. I've got 4 exams and 4 projects due in the next 8 days, so I'll likely (or shouldn't) get much done on this. I have, however, successfully figured out how to connect the gameplay loop to an event timer so that after the passage of X amount of time, the geoscape clock automatically updates. A few bugs surfaced though... in that it's possible for the forced refresh of the zoom to interfere with the forced refresh of the time update... (which makes for some interesting things as it's rendering the ascii matrix) I've got a few ideas how to fix this. Also, I've got an invisible variable properly moving the horizon, now I just need to modify the rendering methods so that they access this variable to see if it should render the element in question as day, dawn/dusk, or night. That's about it. I'm pretty sure that this project will go on hiatus for a month in November as I direct my extra time towards the NANOWRIMO. (National Novel Writing Month) I'll likely post on here about my progress with that, and at the very least, have a link to my progress bar as I slog through 50K (or more) words in 30 days.

Saturday, October 18, 2008

More Geoscape

So, as you can see, I've done a bit more work with the geoscape. I've added the time/date window, which properly increments through arbitrary amounts of time and such (except it doesn't yet correct for leap year, as if that really matters) Also, I've added the 'controls' though, none of them do anything yet. However, I HAVE added zoom in and zoom out functions, though the x,y coords of the view screen don't change when you zoom in/out. (I'd like the zoom to focurs on whatever is in the center of the screen. Perhaps I'll fix that later. A few more lines of code and this will actually progress through time with the user being able to change how quickly time progresses. I currently have the capability for the world map to include differing colors, textures (IE, desert, arctic, etc) I just haven't gone in and changed any of the #s to something else. Once I get the time progressing, I'll add in the night/day progression when you can actually see where night and day are on the world map, then I'll add the layer(s) which will let me see where the (if any) bases are, and cities perhaps. (though I doubt I'll put in any cities right now, at least, not more than 2 or three, just enough to make sure it works. I think I'll have the cities be asterixes or something on the world map, and the ASCII characters will be followed by a sequence of city names, in the order that the asterixes were found in the map file. I could do the same the countries, except that I don't know how I would define country borders, through the map. I could make it a bit more simple, and just have a country's capital/center of mass or something be labeled and connected to it's starting pay amount... and anytime there is any activity that would cause a country to increase/decease its payout, the location where said thing happened will be calculated for its distance from the nearby countries. Or something... but I might not do that.

Wednesday, October 15, 2008

Just a bit.

I fiddled around with my code and fixed the color output for the geoscape window. I also changed it so that scrolling makes it jump 5 sqaures at a time and shift-scrolling takes it to ten. I fixed a weird bug that caused the bounds-checking when moving to get borked. The fix is just a hack though, until I figure out where I got X and Y values crossed. But, out of this, I have the basic framework for all of the file-parsing (I assume that I'll have rooms and components of levels saved as editable text files) functionality. Next, I'll implement a zoom (which will basically print every other unit in the array (though, will arbitrarily place 'important' units nearest where they actually are, IE, Bases and the like.)

Tuesday, October 14, 2008

Geoscape


I've just been fiddling with the Geoscape, which appears once you select a difficulty. This is what I have so far. (It loads the world map from a text file when the game is started) and yes, that is a scrollable window, using the w-a-s-d keys. The colors are off for some reason, but I'll have to figure that out later. Also, I'll need to streamline things because the scrolling isn't as smooth as I'd like it to be.

Monday, October 13, 2008

I guess I could start with the beginnig



So, I've been cobbling things together, building stuff, writing LOTS of method stumps and stuff. I'm slowly plodding through, trying to implement things... allow myself to implement things in the future, etc. When the code is executed, this first window appears first. (It'll likely follow a nifty ASCII graphic image in the future)

Selecting "New game" causes the next image to appear, and from there, a WorldManager object is created with the proper difficulty level.
I find that as I do things, I write code in one method until I have a chunk of it that seems to go beyond what that method was meant to do, so I cut it out and put it in its own method. I don't know if this is the normal way of doing things; I've never programmed anything this large before.

I still have all of the tactical code that I wrote before, (only a fraction of what I'll eventually have) but it's just floating around in unacessable methods. Next I've got to build the 'geoscape' setup and get some of its functionality working. This is quite good fun, and once again, I should be doing Calculus 2.

Friday, October 10, 2008

Multiple windows goodness, less cumbersome data structures!


Nothing too fancy; I've just reorganized some things so that they make more sense and follow encapsulation rules better. Also, I made a message window which will receive any/and all messages such as "out of time units" and the like. I should really be working on my Calculus 2 homework.

Monday, October 6, 2008

Just a little further

There! I have expanded my color/background choices so that for each color option, there are four levels of background darkness... you know, to help make the atmosphere correct... you know, for the night missions.

I've got an ad-hoc setup right now that allows the display manager to access the character and information representing the color scheme. I might change it, but I'll have to think about which things I want in which places. Mostly, I just wanted to see if it could work.

Beginning of the redesign


After doing more thought and planning (of which I still need to do much more) I realized that I didn't have any way to easily change the color of the characters I was printing to the screen. I just started to rewrite my display manager class and I have a working proof-of-concept for this. each aspect of a world map/etc will be a 2 dimensional(or three dimensional once I implement different layers/levels) array that will store an object in each array index that will have two things: a character (to be displayed) and a short integer that will be plugged into an array which holds SimpleAttributeSets. I'm sure that this isn't the best way to do this, but it works. I'll leave it alone for now. I'm not sure if I want to have the array with characters and style attributes completely separate from the world array (which would hold linkedList objects to show which things are in a specific square), or if these would be one-and-the-same... and there would just be a public method in the world class that the display class can access (which will return an object with the character and style data)

Saturday, October 4, 2008

Kneeling, changing the look direction

Well, I have implementing the toggling of standing and kneeling. Also, when you move a direction, you also end up facing that direction once the move has completed. (and you have the option of just changing the unit's look-direction without first moving)

But... I don't think I'll add any more features until I finish a reorganizing of my data structures and stuff... It's getting cumbersome quite quickly. To the flowcharts!!!

Wednesday, October 1, 2008

Yay for KeyEvents!




So, I've got a working Java frame with working KeyListeners. It's kind of nice, because it's easier now to issue commands.