// Genesaver: copyright 2003 Sam Stafford. //Enums, constants, and the like. enum Color { Black, Grey, Green, Red, Blue, Yellow, Cyan, Magenta }; //settings that can be configured by the user struct Settings { bool AA; bool AAline; bool shade; bool save; short mutate; short plants; // per 1000 ticks short cscale; // percent of default size short cspeed; // percent of default speed short cvision; // percent of default vision short camera; int gticks; // timesteps per screen short gwidth; // data points per screen short zoom; bool wake; bool grid; bool drawvis; int trail; bool lizard; }; //global state variables that are not directly saved or user modified struct FSettings { float gtime; float gstep; float ps; float pr; float ar; float am; float as; float at; float av; float ta; float whratio; //screen width/height ratio short ac; float alpha; bool demo; }; extern Settings settings; extern FSettings fsettings; #ifndef NULL #define NULL 0 //null #endif #define P_E 500.0 //Plant energy #define P_R fsettings.pr //Plant radius #define P_C Grey //Plant color #define P_S fsettings.ps //Plant spawning ( number of plants to spawn per step ) #define A_E 300.0 //Animal energy #define A_R fsettings.ar //Animal radius #define A_M fsettings.am //Animal metabolism ( A_M * dist = energy used ) #define A_Z 0.05 //Resting metabolism ( energy used per step ) #define A_D 0.4 //Animal digestion ( A_D * input = energy gained ) #define A_B -1.5 //Animal backup ( factor of extra energy burned ) #define A_S fsettings.as //Animal speed ( length of max step ) #define A_T fsettings.at //Animal turning ( max turn step, radians ) #define A_C fsettings.ac //Number of steps an animal needs to chew #define A_V fsettings.av //Visual distance #define A_A (float)1 //Wide angle of view #define A_L (float)0.2 //"Lookat" angle of view #define D_M settings.mutate //Number of times to mutate DNA on a split #define N_R 0.015 //Neuron radius when rendering brain #define N_L 0.03 //Neuron label "radius" #define C_WORLD 1 //"World" camera setting #define C_CHASE 2 //"Chase" camera setting #define C_GRAPH 3 //"Graph" camera setting #define G_TIME fsettings.gtime //Ticks per graph point #define G_STEP fsettings.gstep //Width in screen coords tween points #include "util.h"
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#9 | 5634 | Sam Stafford | Make vision configurable. | ||
#8 | 5393 | Sam Stafford |
Integrate in Marc's porting changes, and merge my own relevant winmain.cpp changes into main.cpp. (Thanks Marc!!!) |
||
#7 | 5366 | Sam Stafford |
A bit of infrastructure tidying and a minor performance enhancement - the genome is now not saved when running in "demo mode" in Windows, which eliminates that little pause when you close the Windows display dialog after modifying Genesaver settings. |
||
#6 | 5337 | Sam Stafford | Blur trails. | ||
#5 | 5090 | Sam Stafford | Option to draw a grid on the background (they appear in both world and chase view), set by the "gridlines" option in the settings file. | ||
#4 | 3356 | Sam Stafford |
Calculate display width/height ratio, if possible, and set default zoom level to prevent distortion. (Windows only, thus far.) |
||
#3 | 3354 | Sam Stafford |
Code refactoring - split "main" functions into main.cpp (non-Windows) and winmain.cpp (Windows), with all shared code going in util.cpp. No functional changes. |
||
#2 | 3349 | Sam Stafford |
Add a simulation variable "crtrspeed" that regulates the speed of the creatures. This allows those with blazingly fast CPUs to slow the action down. (Those with crawlingly slow CPUs are out of luck, since above crtrspeed=400%, the creatures just teleport around the screen.) |
||
#1 | 3052 | Sam Stafford |
Add Genesaver to the Public Depot. It's not in any way Perforce-related, but it does share a bit of code with Jamgraph, and it feels strange to have an open-source project that's not in the PD. |