Game concept:
GAMEPLAY
The player will start out with a colonized planet / moon. On the planets / moons, the player can build space station or planetary improvements. From the space stations, the player can build ships.
Ships are used to explore the universe, expand the players control, gather resources, and destroy the enemy. If anyone has played Homeworld you'll understand the kind of look and feel I am going for.
There is research, resources, and customizable ships.
The game world is made up of solar systems interconnected by phase lanes.
THE MACRO-VERSE
This is the highest viewing level of the universe. The player can only zoom in from here.
The player will be able to see all solar-systems that have been discovered. The solar-systems will be represented by small spheres or maybe billboards with player logos. Each solar system will have one or more "phase" lane(s) that allow game objects to move from one solar system to the next. Each phase lane will be represented by a line that is draw between two solar systems.
SOLAR-SYSTEM
This is the next viewing level. The player can zoom out or zoom in.
This is a 3d mostly top-down view a solar system. A Star in the middle and a number of space objects slowly orbiting the star. At this level not very many objects can be seen, mainly the planets and their moons, some asteriods and resource spots. I want to display billboards for objects that are to far/small to see.
PLANET / MOONS / ASTERIODS / RESEARCH POINTS
This would be the final level of view for the game. The player can zoom in close to view game objects or zoom back out to the solar system.
This is a 3d mostly top-down view of a sector of the solar system. All objects will be visible, and objects to small to see will be replaced with billboards.
What I have so far:
I have a few c++ classes for player, space objects, and planets. I have a solar system class that uses std::list to store all the objects within, which I am including the source for at the bottom of this post. This is where the design starts to fade, how do I interconnect the whole universe, should I have a master list of all run-time game objects or should it be broken up into smaller chunks based on sector. The std::list approach doesn't seem to be the way to go for collision detection and user interaction. How do I translate mouse click into game events. After playing around with the tutorials for IrrLicht, I was able to create a demo that moves a single ship to a point "close" to where the mouse click, but now I need to do this for multiple objects, so I need a better approach to send events to game objects. How would I change the GUI interface based off the object selected? Things like this are holding me back to getting past main. I am looking for any feedback, advice, or comments would be appreciated.
My sector.h file (solar system, space object, and planet definitions)
Code: Select all
#ifndef __SECTOR_H__
#define __SECTOR_H__
#include <enginedef.h>
namespace GameEngine {
class space_obj {
public:
space_obj (void);
virtual ~space_obj (void);
virtual void create_obj (vector3df pos, f32 size, char* meshname);
private:
space_obj (const space_obj& o);
space_obj& operator= (const space_obj& o);
core::vector3df mPos;
};
class planet : public space_obj {
public:
planet (void);
~planet (void);
void create_obj (vector3df pos, f32 size, char* meshname);
private:
planet (const planet& p);
planet& operator= (const planet& p);
};
class sector {
public:
sector (void);
~sector (void);
void create_sector (void);
private:
sector (const sector& s);
sector& operator= (const sector& s);
core::vector3df mPos;
std::list<space_obj*> mObjs;
};
};
#endif // __SECTOR_H__
Code: Select all
#include "sector.h"
#include "engine.h"
namespace GameEngine {
space_obj::space_obj (void) :
mPos(0,0,0)
{ }
space_obj::~space_obj (void)
{ }
void space_obj::create_obj (vector3df pos, f32 size, char* meshname)
{
engine::get_engine()->get_scene()->addAnimatedMeshSceneNode(
engine::get_engine()->get_scene()->getMesh(meshname), 0, -1, pos);
mPos = pos;
}
planet::planet (void) :
space_obj()
{ }
planet::~planet (void)
{ }
void planet::create_obj (vector3df pos, f32 size, char* meshname)
{
engine::get_engine()->get_scene()->addAnimatedMeshSceneNode(
engine::get_engine()->get_scene()->getMesh(meshname), 0, -1, pos);
engine::get_engine()->get_scene()->addAnimatedMeshSceneNode(
engine::get_engine()->get_scene()->getMesh("data\\PlanetIce1.3ds"), 0, -1, pos+vector3df(40, 0, 15));
engine::get_engine()->get_scene()->addAnimatedMeshSceneNode(
engine::get_engine()->get_scene()->getMesh("data\\PlanetIce1.3ds"), 0, -1, pos+vector3df(-25, 0, 25));
}
sector::sector (void) :
mPos(0,0,0),
mObjs(0)
{ }
sector::~sector (void)
{ }
void sector::create_sector (void)
{
mObjs.clear();
mObjs.push_front(new space_obj());
mObjs.push_front(new planet());
mObjs.push_front(new planet());
mObjs.push_front(new planet());
mObjs.push_front(new planet());
mObjs.push_front(new space_obj());
std::list<space_obj*>::iterator iter = mObjs.begin();
(*iter++)->create_obj(vector3df( 0, 0, 0), 400, "data\\Star_Green.3ds");
(*iter++)->create_obj(vector3df( 175, 0, 900), 20, "data\\PlanetIce0.3ds");
(*iter++)->create_obj(vector3df( -900, 0, 130), 30, "data\\PlanetIce0.3ds");
}
};