Tuesday, January 24, 2012

The GraphViewer Application

I have mostly finished up my Graph Viewer Application. It now reads a file with an extension ".graph" and dynamically displays it. Here is an example of such a file:

Graph.graph:
v(100,0)
v(-100,0)
v(0,100)
v(0,-100)
v(200,200)
v(200,-200)
v(0,0)
v(-100,-200)
e(6,0)
e(6,1)
e(6,2)
e(6,3)
e(6,4)
e(4,5)
e(1,2)
e(6,5)
e(1,7)
e(3,7)

As you can see, Vertices in the graph are denoted by v(x,y), and an edge connecting two vertices is denoted by e(v1,v2). The GraphViewer application then reads this file and displays it:


Now that I have this prototype up and running, I can start thinking about the mechanics of my RTS game. Imagine that each of these circles is a planet or star system, and that each line is a trade route. Every circle only has resources available that it generates on its own, or is "traded" from a neighboring planet. Thus (5) has resources generated from its own planet, and some from the planets (4), and (6). This is no "global" resource pool.

This will introduce a new level of strategy. An Enemy could "cut off" another world's resource by attacking a neighboring planet. The "capital" planet (which usually has the most resource usage) must be in center with the most neighboring planets just to sustain the capital planet. 

No comments:

Post a Comment