struct Image { AG_SURFACE *ag_; SDL_SURFACE *sdl_; IMAGE *next; }; struct Vertex { float x,y,z; float radius; // radius int r,g,b,a; VERTEX *connections; int n,s; // vertex is part of a bezier curve int flags; // glow int sr,sg,sb,sa, // start and end colors for a ramp color animation er,eg,eb,ea; int anim_type; // particle color animation type: pingpong, up, blink (fast up), strobe (oscillate), pulse (slow up) int frame; // frame counter on this vertice IMAGE *texture; VERTEX *next; }; #define VERTEX_GLOW 1 struct Vector { VERTEX *vertices; // pair float directionxy, directionyz; VECTOR *next; }; struct Polygon { int r,g,b,a; int flags; float rotationxy,rotationyz; VERTEX *vertices; POLYGON *next; }; // Usually just a beginning and an end pose, or just a beginning for static. struct Animation { int flags; int frames_to_next; float rotationxy,rotationyz; POLYGON *polygon; ANIMATION *next; }; // Behaviors for munitions, automatons, lifeforms struct Behavior { int id; char *script; NUMBER_LIST *compiled; // compiled script VARIABLE_DATA *globals; }; #define BEHAVIOR_AIM_TARGET #define BEHAVIOR_SEEK_TARGET #define BEHAVIOR_DOGFIGHT_TARGET #define BEHAVIOR_AIMABLE #define BEHAVIOR_GUARD struct Material { int id; char *name; IMAGE *compiled; // compiled texture ready for display IMAGE *texture; // one or more bitmaps (animated) IMAGE *bump; // one or more bitmaps (animated) int flags; // material rendering flags int r,g,b,a; // basic tint color and opacity int diff_r,diff_g_,diff_b; // current animation frame color int frame; // frame counter int length; // 0 to animation length bool pingpong; // Does the animation pingpong float speed; // animation framerate int ramp_start_r, ramp_start_g, ramp_start_b, ramp_start_a; int ramp_end_r, ramp_end_g, ramp_end_b, ramp_end_a; int flags_ramp_type; // sin, cos, square, triangle waveform selection flags float glossyness; // Glossyness float glow; // Glow float bumpiness; // How bumpy is this? MATERIAL *next; }; #define MAT_SOLID 0 #define MAT_LIQUID 1 #define MAT_GAS 2 #define MAT_FLAG 4 // material contains colors attributed to a group #define RAMP_SIN 1 #define RAMP_COS 2 #define RAMP_TRIANGLE 4 #define RAMP_SQUARE 8 #define RAMP_RANDOM 16 #define RAMP_PERLIN 32 // A manufactured part, object description etc used in construction, used in space, planets and inside travel locations. struct Component { int id; int type; // purpose of component int flags; int r,g,b,a; // light color if its COMPONENT_LAMP, associated shot color tint if GUN GENETICS *genetics; char *name; // like LX-300 or Metal Plated Armor or Divine Widgets char *manual; // show during a player ? inquiry RESOURCE *resource; // resource int hardpoint; // used only when this component is mounted on a hardpoint float cost; // cost per 1.0 quantity (value) float mass; // mass of 1.0 quantity float vote; // votes float quantity; // # or metric tonnes float quality1, quality2, quality3, quality4; PLAYER *producer; // item's creator PLAYER *designer; // item's designer STRING_LIST *reviews; // customer reviews VERTEX *pivot; // a pivot if the item is fittable on a hardpoint (used for hardpoint items) VERTEX *hardpoints; // a list of hardpoints (used on hulls, foundations) VECTOR *emissions; // a list of emission vectors for hardpoints and dispensors; also used in locomotion as COMPONENT *next; }; // flags #define COMP_STACKABLE 1 // used for GUN components, determines if the guns can be stacked /* qualities 1,2,3,4 */ #define COMPONENT_HULL 1 // starship or terrain vehicle hull q1: hull rating q2: armor #define COMPONENT_FOUNDATION 2 // tile for building on planet surface q1: foundation flags (see below) #define COMPONENT_POWERSOURCE 3 // dynamo, fusion cell, combustion engine type object #define COMPONENT_RESOURCE_GATHERER 4 // gathers a particular resource q1: resource #define COMPONENT_HARDPOINT_LAUNCHER 5 // launches fighters or missiles q1: launchable munition q2: #define COMPONENT_HARDPOINT_HOLD 6 // cargo q1: capacity #define COMPONENT_HARDPOINT_GUN 7 // fires a munition q1: munition type (see below) q2: #define COMPONENT_HARDPOINT_SCANNER 8 // has a set scanning range and ability q1: distance q2: spread range #define COMPONENT_HARDPOINT_LIGHTSOURCE 9 // a lamp q1: distance, q2: spread range #define COMPONENT_HARDPOINT_TRACTOR_BEAM 10 // q1: range q2: strength q3: specialization #define COMPONENT_UNIT_DISPENSER 11 // factory or other dispensary q1: production type #define COMPONENT_RESOURCE 12 // item or material found on planets or in deep space #define COMPONENT_LOCOMOTION 13 // q1: 1=thruster, 2=wheel, 3=robotic leg or 4=tred #define COMPONENT_COMPUTER 14 // computer or electronic component q1: computer flags q2: power use #define COMPONENT_COMMODITY 15 // something bought or sold q1: sector type (see below) #define COMPONENT_TARGETTING 16 // q1: item increases targetting efficiency q2: #define COMPONENT_ARMOR 17 // item increases a vehicle's armor q1: armor rating bonus #define COMPONENT_ARTIFACT 18 // item provides some special increase, can be sold for profit q1: bonus_code q2: amount // Blueprints stored struct Blueprint { int id; char *name; int version; int type; int flags; float max_scan; char *commercial; // text PR "commercial" for the item COMPONENT *components; // list of components VERTEX *ofs_components; // vertex offset BEHAVIOR *behavior; float quantity; int permissions; // User-only, Group-only, Commercial Market, Free/Open BLUEPRINT *next; }; #define BLUEPRINT_MUNITION #define BLUEPRINT_WEAPON #define BLUEPRINT_FOUNDATION #define BLUEPRINT_GROUND_LOCO #define BLUEPRINT_VERT_THRUST #define BLUEPRINT_LAT_THRUST #define BLUEPRINT_WALL #define BLUEPRINT_DOOR #define BLUEPRINT_SENTRY #define BLUEPRINT_TARGETING_COMPUTER #define BLUEPRINT_BRAIN_IMPLANT #define BLUEPRINT_COMMODITY #define BLUEPRINT_HULL // Object manufactured from blueprint *by science or nature struct Object { int id; float x,y,z; // location MAP2D *map; // the map this object is on float rotationxy,rotationxz; float vx,vy,vz; // velocity float ax,ay,az; // acceleration float speed; bool visible; // is this object visible? (for special administrative objects) int crew; // crew contained in this object PLAYER *owner; BLUEPRINT *blueprint; BLUEPRINT *contents; OBJECT *configuration; OBJECT *next; }; struct Genetics { int id; char *name; int health; float speed; float melee; // melee damage float aggressiveness; // -1 = flees, 0 = neutral, 1 = attacks on sight int flags; bool flora; // true=flora false=fauna bool sentient; // can a player be this lifeform=true char *name_mask; // naming the sentient: c,v,0-9 are valid characters char *groups[10]; // naming the sentient: up to 10 groups of consonants, designated by 0-9 int font; ANIMATION *description; // walking animation BEHAVIOR *behavior; GENETICS *next; }; struct Lifeform { char *name; float x,y,z; // location float rotationxy,rotationyz; // direction float vx,vy,vz; // velocity RELATIONSHIP *relationships; BEHAVIOR *conciousness; // instantaneous behavior from genetics->behavior OBJECT *equipment; // weapon, armor float damage; GENETICS *original; LIFEFORM *next; }; struct Planet { char *name; int flags; float r,g,b; // tint to planet (effects ground material, reflected light tint) GENETICS *biosphere; // list of lifeforms found on this planet SYSTEM *system; PLANET *orbitting; // if null SYSTEM *orbitting_; PLANET *moons; POLYGON *description; float mass; // MT float density; // 0-1.0 float rotation; // 0-1.0 radians float reflectivity; // how much light is reflected? float radius; float gravity; float temperature; float orbital_range; float seismic_activity; // ricter float precipitation; // MATERIAL *lithosphere; // mineral content on planet, expects solids NUMBER_LIST *lithodensity; // mineral content, where quantity=how common the mineral is int lr, lg, lb; // color of the lithosphere MATERIAL *atmosphere; // defines the atmosphere content, expects a gas MATERIAL *ocean; // defines the predominant oceanic content, expects a liquid int rings, ring_type, ring_r, ring_g, ring_b, ring_a; int craters; // defines the crater content of the surface float crater_size; // defines the size of the largest craters char *core; char *name; float x,y,z; MAP2D *surface; PLANET *next; }; // Links two 2d Maps or places on a 2d Map struct Portal { MAP2D *dest; OBJECT *doorway; // defines what is entered float x,y,z; // where on source map float dx,dy,dz; // destination x,y,z int flags; // 2-way, 1-way, requires key, no vehicles PORTAL *next; }; // Planet surface, ship/star interior, ruins or caves struct Map2D { int id; LIFEFORM *population; OBJECT *contents; IMAGE *tiles; // image version drawn from tiles MATERIAL *tiles[][]; // tiles POLYGON *marks[][]; // pock-marks, explosion craters PORTAL *portals; MAP2D *next; }; #define WEATHER_SNOW 1 #define WEATHER_LIGHTNING 2 #define WEATHER_RAIN 4 #define WEATHER_EARTHQUAKES 8 #define WEATHER_FLOODS 16 #define WEATHER_CYCLONE 32 // tornado, hurricane.. #define WEATHER_VOLCANO 64 #define WEATHER_METEORSTORM 128 #define WEATHER_COMETSTORM 256 struct Star { float x,y,z; int r, g, b; float density; float radius; int biosphere; ANIMATION *description; char spectral_class; char *name; STAR *next; }; struct System { int id; char *name; float x,y,z; STAR *system; PLANET *planets; PLAYER_LIST *population; SYSTEM *next; }; struct Galaxy { float x,y,z; float rotationxy,rotationyz; SYSTEM *systems; PLAYER_LIST *population; GALAXY *next; }; struct Universe { GALAXY *galaxies; PLAYER_LIST *population; }; // A multi-player company, guild, alliance struct Group { char *name; // can be changed, but must be unique float assets; // pooled assets int r1,r2,r3; // group colors (up to 3) int g1,g2,g3; // int b1,b2,b3; // OBJECT *vault; // vaulted objects // group mail PLAYER *founder; // can manually adjust alliance ratings with players, leads the "group fleet" GROUP *next; RELATIONSHIP *relationships; }; struct Fleet { char *name; PLAYER *leader; PLAYER_LIST *members; FLEET *next; }; struct Relationship { PLAYER *player; // GROUP *group; char *title; // title associated with player int strength; // votes toward your existence, considered by council census RELATIONSHIP *next; }; #define STRENGTH_BFF 1 #define STRENGTH_ALLIED 2 #define STRENGTH_FRIENDLY 3 #define STRENGTH_NEUTRAL 4 #define STRENGTH_ANNOYED 5 #define STRENGTH_ENEMY 6 #define HAPPY(x) ( if ( x < 5 ) ) struct Player { char *username; // your username char *password; // your password, blank if NPC char *name; // your player's name int mode_flags; // what mode is player in (boarding?) GENETICS *race; // your player's race LIFEFORM *life; // your player's life FLEET *fleet; // your fleet char *description; // your personal description char *personal_log; // your personal log char *log; // your activity log int council_status; // earned or perm status float skill_mining; // gained by using a mining laser float skill_business; // gained through trade float skill_piloting; // gained through piloting float skill_engineering; // gained through repair float skill_rigging; // gained through ship rigging float skill_chemistry; // experts get munitions design float skill_medical; // experts get to try for skill genetics float skill_genetics; // life form creation float skill_design; // skilled gained by using the component editor float skill_leadership; // ability to lead, gained through experience float skill_xenoarcheology; // float skill_xenobiology; // improves your ability to take xenobiological samples float skill_base_planning; // gained by building your base int kills; // kill count float credits; // how much money you have OBJECT *ships; // first one is player's ship, rest are ships in player's fleet PLAYER *next; RELATIONSHIP *relationships; }; struct Player_list { PLAYER *player; PLAYER_LIST *next; };