Hour 5

As spring break draws to a close, I find that I’ve only had time to put five hours of work into this project. Kinda scary, actually.

It’s screenshot time!

http://oak.cats.ohiou.edu/~gc355804/screenshot1.jpg

So what -is- that, exactly?

Well, the bottom layer is a background image with ‘Nulspace’, the little menu thingy, and the strange little five-minute-logo-that-actually-came-out-kinda-cool I made in paintshop. The grid is painted on top of the bottom layer. The little metal thingy is a sprite (of sorts), and is just there to make sure my sprite class works and is rendering correctly. No scrolling or anything has been added to this yet. Mostly this illustrates that the basic engine is working to my satisfaction (for now).

Annnyway, that’s about all there is to see at the moment. More as I figure it out.

Hour 3

After three hours, the core of the engine is complete, I have my containers for stuff, and the whole OpenGL thing is looking like it’s going to work out quite nicely. No more having to write DrawLine() stuff in SDL! WOOO! Hello glBegin(GL_LINES). Soo beautiful man. . . *sniff*

Also, figured out something neat in GL that really should’ve occurred to me but didn’t. Animations can be done using texture mapping. More on this and other random things I’ve found out about OpenGL in a different post, perhaps.

My next priority is to get tiling figured out. Once I do that, I’ll post a screenshot somewhere and link to it from the ol’ blog. From there, handling mouseclicks and scrolling will be next up on the list, followed by implementing a UI of some sort.

***Stats***

Lines of code : 495

Files : 8

Lines / minute : 2.65 lines (not necc. 100% code)

File with most code : engine.cc (130 lines; 26.3% of the total code)

File with least code : demo.cc (12 lines; 2.4% of the total code)

Code compiles : Yes

Code runs : Yes

Next scheduled milestone : Scrolling map area (8 – 10 hours)

On schedule : Yes

Hour 2

I have my basic structure set up and compiling. Gonna be something basically like:

//base class
class Sprite

//basic building
class Building : public Sprite

//not-so-basic building
class CoolBuilding : public Building;

The engine itself is just:

class NSEngine
{
Vector2D scroll_coords;

Tile** tiles;

void update();
void render();

public:

void init();
void run();
void exit();
NSEngine();
~NSEngine();
};

Pretty straightforward stuff, there. Now it’s time to take my pretty rotating (TEXTURED!! WOO!) triangle and turn it into a proper sprite . . . I expect this to take a few hours, and I need to get some sleep. Thus. . . this shall be placed on the to-do list for tomorrow, slightly above finishing setting up my SVN repo and below taking the ol’ car in for an alignment.

Hour 1

I kinda figured it’d be a good thing to wrap up the GL particle stuff I was writing to see how difficult using OpenGL as the heart of my app would be. That being said, I got impatient, said “screw it”, and dove in to this project. Now or never, y’know? Besides, done stuff with GL before, so it shouldn’t be -that- bad. (famous last words. . .?)

Anyway, after an hour spent getting my environment set up along with some initial programming, I have a spinning triangle appearing on the screen (and it will hopefully be turning into a textured square after a little bit more work). PREEEETTY!

More to come, folk(s), so stay tuned. . .

Game-Related ideas

Yes, that’s right. It’s another one of those posts where I spew random ideas onto the wiki.

After careful thought, I figured out that I really didn’t have a chance in hell of finishing all the aforementioned crap in 40 hours. Thus, I will be shooting to get the following done (and make the game playable):

1) Scrolling map area (8 – 12 hours)

2) Building construction / placement (16 – 18 hours)

3) Resource management (20 hours)

4) Generic building AI (in_range(target) ? shoot_at(target) : charge_weapon();) (22 hours)

5) Central building which controls other buildings; building radius constraints (26 hours)

Considering the way the last competition went, shooting to be done in 26 hours means I might have a chance of clocking in at under 40 to get this thing done.

General description of what I’m shooting for when I’m done:

The player starts with a central building at one corner of the map. The player gains resources at a constant rate, and can allocate them into one of three categories : virus, firewall, and network. Certain amounts of each type of resource will be necessary to construct buildings (of which there will hopefully be at least 6 or 7, but we will see). Map size is a 512 * 512 grid, with each grid cell = 8 pixels. Grid is optionally visible. Buildings are aligned to grid cells to place.

Buildings can be split into three categories: offensive, defensive, and resource. Offensive buildings shoot at any enemy buildings in range. Defensive buildings deflect incoming shots, reduce damage taken, etc. Resource buildings enhance resource income rate up to a certain amount (maybe; haven’t quite decided if I want these yet or not).

Buildings are constructed and placed instantly, but a connection is required to grow from the nearest building to the new building before the new building is activated. This is kinda strange / new / weird, and so it’ll be easiest to just see how it works it in the first version of the game. Might also change this if I don’t like how it works.

Objective is to destroy the enemy’s central building before he destroys yours.

That’s it in a nutshell. More to come as I think of it.