Ignore:
Timestamp:
07/11/24 17:15:51 (4 months ago)
Author:
Maciej Komosinski
Message:

Color mutations in f1 and f4, and a new syntax for "allowed modifiers" (opposite to previous "excluded modifiers") with optional probabilities for each modifier

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/geneprops.h

    r1305 r1313  
    11// This file is a part of Framsticks SDK.  http://www.framsticks.com/
    2 // Copyright (C) 1999-2023  Maciej Komosinski and Szymon Ulatowski.
     2// Copyright (C) 1999-2024  Maciej Komosinski and Szymon Ulatowski.
    33// See LICENSE.txt for details.
    44
     
    1313
    1414
    15 #define F14_MODIFIERS_VISUAL "DdGgBb"
     15#define F14_MODIFIERS_BASIC "LlRrCcQqFfMm"
    1616#define F14_MODIFIERS_RARE "EeWwSsAaIi" //An expdef would need to handle many of these properly/specifically to ensure reasonable behavior, and hardly any expdef does. Modifying initial energy of a creature as a result of its genes (Ee) is in general not a good idea, but may make sense in some specific competitive biological simulations. Weight (Ww) works only in water, and in water sinking/going up should usually be caused by real "intentional" activity of a creature, not by its inherited weight. Stamina (Ss) is no longer needed as destructive collisions are not supported, and even if they were, some expdef would need to impose reasonable restrictions on the value of this parameter (e.g. similar to normalizeBiol4()) so there is some cost associated with it, and the specific consequences of destructions should be defined as needed. For assimilation (Aa), there is a dedicated parameter in CreaturesGroup. Ingestion (Ii) influences how fast energy is transferred to Parts of a creature, and optimizing this property may make sense in experiments where energy is present in the environment and can be ingested - if needed, this modifier should be enabled for mutation.
    17 #define F14_MODIFIERS "LlRrCcQqFfMm" F14_MODIFIERS_RARE F14_MODIFIERS_VISUAL
     17#define F14_MODIFIERS_COLOR "DdGgBb"
     18#define F14_MODIFIERS_COLOR_SPORADIC "D(0.01)d(0.01)G(0.01)g(0.01)B(0.01)b(0.01)" //add a small chance so that color mutations can rarely occur. Functionally they are neutral so we do not want to waste computational resources on creating and evaluating such duplicate individuals, but it is nice to have visually distinct "lineages" by allowing propagated color genes to be extremely rarely modified. Also, if these color modifiers have positive probability, all newly created sticks are assigned a random color immediately on creation.
     19
     20#define F14_MODIFIERS     F14_MODIFIERS_BASIC  F14_MODIFIERS_RARE  F14_MODIFIERS_COLOR
    1821
    1922
Note: See TracChangeset for help on using the changeset viewer.