Monday, February 25, 2013

BigWorld, Economy, New Ship Art -- mostly IN SPACE

I took most of the weekend, and got a few big pieces working:

Sector to Sector

I had refactored the planet code to be contained in a Sector object, and procedurally generated based on the coordinates of the sector, which then made it possible to fly off the edge of Sector(0, 0) to Sector(0, 1) and see new planets, but then fly back to Sector(0, 0), and all your old ports of call are still there. Pretty easy to get working, no real surprises there. I toyed with the idea of having 4 sectors in memory at once to permit drawing planets at the corners, but that was more work than I wanted to do at the time, so I just used a single sector, which I figured would cause problems if there were planets right up at the edge of a sector - planets could blink in and out as the player crosses the boundary.

Well, I expect that's happening, but I haven't seen it, yet, and space is large, so I'm going to conjecture it's not a big problem, and I'll work on other stuff.

I'm pleased that flying from sector to sector is currently a tense activity; you don't know if you've got enough fuel to reach there (at least with current levels of fuel expenditure). If I tweak the physics, I'll want to make sure I keep this level of danger.

Buying and Selling

Oh, I've had buying and selling in before, but now, when you buy and sell, you deplete the quantity of goods for sale, or deplete the amount of goods wanted. This causes prices to rise and fall. (I have a hard time keeping straight which prices I'm talking about, so the code has functions like "computePricesForPlayerSelling", which is cumbersome, but unambiguous.)

One side-effect of this is that you can take a profitable route and make it unprofitable, even before you account for fuel. So, pay attention, buying and selling technology starts out being quick cash in your pocket, but there's nothing keeping you from going broke buying high and selling low.

Ship Art

The first ship sprite I had in the game was a pretty simple geometric shape, reminiscent of old vector space games. I had a copy of "Bill Budge's Space Album" back in the day, and one of the games on that was a pair of spaceships flying around a planet. Not exactly SpaceWar, but along the same lines.

I've been planning to add an ability to buy new ships (to have something to do with all that cash, for one thing), and that means additional sprites. I had doodled some 30 different recognizable ships in a notebook, but that was a lot. I decided to narrow down things to three variables; speed, range, and cargo capacity. Each ship would either have a high or low value of each of these three variables. That makes 8 ships, which is a reasonable place to start.

I set out to draw sprites in GIMP, which isn't a terrible tool for the job. I don't know if some of my frustrations could be addressed by adopting better habits, or installing special plugins, but I'm able to get my work done. I'm shooting for a 16-bit color palette, which gives me structure for picking colors. I want yellow, and there's only a few of them, so I don't paralyzed with too many choices.

I started out making all my ships fit into a 32x32 pixel square, and then I realized that some of my ships would have to be a lot bigger, so that meant going back and redrawing some of my ships. Along the way, I used some photographic references, which led me away from the stylized, clean, look I was using elsewhere, so I went back and redrew some of my ships.

I now have 7 of the 8 ship sprites at a minimally shippable level of quality. I could go back and tweak them with all the time I have left, but I have to walk away from the art so I can get other stuff done.

Only a few days left. Buying new ships is an important piece of gameplay that still needs to be written, and then it's revisiting and improving stuff that's basically working now. This project's grown a lot from where I started it, but I'm pleased with where it's going.

No comments:

Post a Comment