Eco-Name version A0 (alpha-zero)
Conceptually the
EcoName is a way to allow for very efficient communication between ALife critters and food. This depreceated version was developed Never Rust and the
EcosystemWorkingGroup.
The eco-name is a list of comma-separated values stored in an object's name. This data can be read easily by
Detected functions during collisions or scans, and prevents the need for potentially resource-hogging
llListen calls.
The
EcosystemWorkingGroup used version "A0" (alpha-zero) for testing in Terminus in 2006. This version supports variables needed for basic eating.
Variables included in Eco-Name A0
List # | Variable | What is it for? | Data type |
0 | Proper Name | unchanging species name | 36 characters max |
1 | Eco-Name version | ensure correct version | 2 characters, "A0" |
2 | Type | determining if edible, other uses | 1 character: "P"lant, "A"nimal, "R"obot |
3 | Root Food | Energy amount from root | integer 0-9999 |
4 | Leaf Food | Energy amount from non-root | integer 0-9999 |
5 | Action | determining what the organism is doing | 3 characters, capitalized; i.e. "EAT" |
6 | Target Key | who the organism is doing Action to | 36 character key |
7 | Requested Food | how much the organism intends on eating | integer 0-9999 |
Example Eco-Name: Shark, A0, A, 1000, 0, EAT, 133b98a7-b49a-47a1-91ea-35bf7a14810a, 340
Explanation: The shark is an animal that offers 1000 energy if eaten. He is looking to eat (me!) and would like to eat 340 units of energy/food if possible.
Proposed Variables
...will be implemented as needed and agreed upon
- Sub-type (? characters) -- more specific type of creature (reptile, mammal, etc.)
- Damage Min (integer, 0-999) -- how much damage to do on collision / fight
- Damage Max (integer, 0-999) -- max damage (can be randomly decided)
- Channel (integer, -#) -- personal/species communication channel
- Color R (integer, 1-255) -- the organism's color, for visual recognition
- Color G (integer, 1-255)
- Color B (integer, 1-255)
- Attractiveness (string, 2) -- two-letter code for mating beauty
- Smell (string, 2) -- a two-letter code for whatever we might want
- Taste (string, 2) -- 2-letter code; how does the organism taste
- Touch (string, 2) -- 2-letter code for the texture/feel of the organism
- Sound (string, 2) -- 2-letter code for the sound being made (barking, tweeting, shouting, ribbiting, etc.)
- Visible State (string, 2) -- a two-letter code for whatever we might want -- will be useful to convey the health of the organism
- Signs (string, 2) -- some sort of non-verbal communication; usually species-specific
- Personal/2nd Name (string, 24) -- a personal name or other information
- Parent Key (key/string, 36) -- the organism's parent
- Generation (integer, 0-9999) -- generation #
Other Information
...that can be gotten from ll
Detected* functions and thus does not need to be in the Eco-Name
- Group to possibly check to see if they are in the Ecosystem group
- Key to identify the specific organism, and for sending email
- Link Number to see if you're interacting with the root prim or a "leaf"/leg
- Name to get the EcoName
- Pos where this thing is
- Rot is it looking at me? (probably better to use Target Key)
- Type to check for active scripts
- Vel to judge the critter's speed
Development and discussion:
http://groups.google.com/group/SL-EcoSystem/browse_thread/thread/6512bdda94a3b269
Thanks to Laukosargas Svarog for the original ideas! (
http://forums.secondlife.com/showpost.php?p=1042155&postcount=3)
EcoName Code
This open-source code is part of the
Ecosystem project. Please read the
EcosystemDisclaimer before using.
Please do not edit the code below. If you want to make changes, please create a new wiki page. Thanks.
// ~ ECO-NAME ~//
// These are the standard functions to access the Eco-Name.
// If you're going to make changes to these, please speak with Never Rust
// or others working on the Eco-system project to establish a new version number.
//
// Version A0 ("alpha zero" / initial testing)
// 0 - Proper Name (unchanging species name)
// 1 - Eco-Name version
// 2 - Type: "P"lant, "A"nimal, "R"obot, etc.
// 3 - Food/Energy amount from root
// 4 - Food/Energy amount from leaf
// 5 - Action ("EAT")
// 6 - Target Key
// 7 - Requested Food (how much you intend on eatting)
string MyProperName = "species name"; //!!! These need to be defined for the Eco-Name
string MyEcoNameVersion = "A0";
string MyEcoType = "A"; //A=Animal, P=Plant, R=Robot
string MyDietType = "P";
SetEcoName(integer FoodRoot, integer FoodLeaf, string Action, key TargetKey, integer EnergyRequested) {
list EcoName = [MyProperName, MyEcoNameVersion, MyEcoType, FoodRoot, FoodLeaf, Action, TargetKey, EnergyRequested];
llSetObjectName(llList2CSV(EcoName));
}
string EcoName2ProperName(string name) {
//if (EcoNameVersion(name) == MyEcoNameVersion)
return llList2String(llCSV2List(name), 0);
//else return "";
}
string EcoNameVersion(string name) {
return llList2String(llCSV2List(name), 1);
}
integer EcoName2FoodRootAmount(string name) {
if (EcoNameVersion(name) == MyEcoNameVersion) return llList2Integer(llCSV2List(name), 3);
else return 0;
}
integer EcoName2FoodLeafAmount(string name) {
if (EcoNameVersion(name) == MyEcoNameVersion) return llList2Integer(llCSV2List(name), 4);
else return 0;
}
string EcoName2Action(string name) {
if (EcoNameVersion(name) == MyEcoNameVersion) return llList2String(llCSV2List(name), 5);
else return "";
}
key EcoName2TargetKey(string name) {
if (EcoNameVersion(name) == MyEcoNameVersion) return llList2Key(llCSV2List(name), 6);
else return NULL_KEY;
}
integer EcoName2RequestedFood(string name) {
if (EcoNameVersion(name) == MyEcoNameVersion) return llList2Integer(llCSV2List(name), 7);
else return 0;
}
EcosystemWorkingGroup |
Ecosystem |
EcoName