I'm currently brainstorming about the implemention of advanced research and production functionality for UFO:AI. For that we need more information on hte location, skill and type of people that you (your company) employs.
For that i thought about a structure similar to the follwing:
New Header Information
#define MAX_EMPLOYEES 1024
#define MAX_EMPLOYEES_IN_BUILDING 64
// TODO:
// MAX_EMPLOYEES_IN_BUILDING should be redefined by a config variable that is lab/workshop/quaters-specific
// e.g.:
// if ( !maxEmployeesInQuater ) maxEmployeesInQuater = MAX_EMPLOYEES_IN_BUILDING;
// if ( !maxEmployeesWorkersInLab ) maxEmployeesWorkersInLab = MAX_EMPLOYEES_IN_BUILDING;
// if ( !maxEmployeesInWorkshop ) maxEmployeesInWorkshop = MAX_EMPLOYEES_IN_BUILDING;
// The definition of a employee
typedef struct employee_s
{
byte isWorker;
byte isScientist;
byte isSoldier;
char speed; // Speed of this Worker/Scientist at research/construction.
struct building_s *quaters; // The quater this employee is assigned to. (all)
struct building_s *lab; // The lab this scientist is working in. (only isScientist)
struct building_s *workshop; // The lab this worker is working in. (only isWorker)
struct character_s combat_stats; // Soldier stats (scis/workers as well ... e.g. if the base is attacked)
} employee_t;
// Struct to be used in building definition (-struct)
typedef struct employees_s
{
struct employee_s assigned[MAX_EMPLOYEES_IN_BUILDING];
int numEmployees;
int maxEmployees;
float cost_per_employee;
}
// This it the global list of scientists.
// Use this for saving and allocating.
extern employee_t employees[MAX_EMPLOYEES];
extern int numEmployees;
EDIT of client.h
typedef struct building_s
{
...
// removed maxWorkers, minWorkers and assignedWorkers
// ADDED
// A list of employees assigned to this building.
struct employee_s assigned_employees;
...
} building_t;
I don't get what (exactly)some values in building_s are for though:
* workerCosts
* produceTime
* fixCosts
* varCosts
I can guess some of them, but i'm not 100% sure.
Mind you that i didn't include alot of information about soldiers (e.g training-room, injured, etc..) sicne this is just a first draft to make it all work with research/production, not combat.
What do you think? Questions, comments, critics?
Werner