Move lineage fields from genome to creature#749
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| genome._frontAngle = Math::getNormalizedAngle(genome._frontAngle, -180.0f); | ||
|
|
||
| // Validate mutation rate fields | ||
| genome._lineageId = std::max(genome._lineageId, 0); |
There was a problem hiding this comment.
The method void validateAndCorrect(ObjectDesc& object); should be void validateAndCorrect(ExtendedObjectDesc& object);. Then the removed validations here can be move to this place.
There was a problem hiding this comment.
Done in 8023cc3: validateAndCorrect now takes ExtendedObjectDesc& and the creature lineage validation lives there.
| entityFactory.init(&data); | ||
| entityFactory.changeObjectFromTO(changeTO, objectTO, object); | ||
| if (objectTO.type == ObjectType_Cell) { | ||
| auto const& creatureTO = changeTO.creatures[objectTO.typeData.cell.creatureIndex]; |
There was a problem hiding this comment.
use a new method changeCreateFromTO (to be created in entityFactory)
There was a problem hiding this comment.
Done in 8023cc3: added EntityFactory::changeCreatureFromTO and call it from cudaChangeObject.
…eatureFromTO Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| creature->generation = creatureTO.generation; | ||
| creature->numCells = creatureTO.numCells; | ||
| creature->mutationState = creatureTO.mutationState; | ||
| creature->lineageId = creatureTO.lineageId; |
There was a problem hiding this comment.
use changeCreatureFromTO here. and extend changeCreatureFromTO to set the other attributes (numCells, generation, etc.) too.
There was a problem hiding this comment.
Done in c5483f3: createCreatureFromTO now sets only id + genome pointer and delegates the rest to changeCreatureFromTO, which was extended to set ancestorId, generation, numCells, mutationState, headUpdateId and the lineage fields.
…e lineage Migrate old-model genome lineage attributes to the creature on load; save writes them to the creature only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Creature-mode inspection returned early without calling changeCell, so edited creature attributes were never transferred and got reset on the next refresh. Add a regression test for the creature change transfer. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
| @@ -308,7 +308,12 @@ void _InspectionWindow::processObject(ExtendedObjectDesc& extendedObject) | |||
| { | |||
| if (_creatureMode) { | |||
There was a problem hiding this comment.
refactor: rename _InspectionWindow::processObject to processExtendedObject
then create 2 methods for processObject and processCreature
There was a problem hiding this comment.
Done in 02ae162: renamed the dispatcher to processExtendedObject (delegates by _creatureMode) and split the body into processObject and processCreature.
…reature Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Distinguishes an unset optional prevLineageId from a real value of 0. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summary
Move
lineageId,prevLineageIdandaccumulatedMutationsfrom the genome to the creature, where they conceptually belong. The fields become editable in the inspection window and are removed from the genome editor.Changes
Engine (CUDA)
Creature/CreatureTOgain the 3 fields (+isRelatedLineagemoved offGenome);Genome/GenomeTOlose them.EntityFactory,DataAccessKernels(TO↔entity,maxIds.lineageIdnow from creatures),MutationProcessor(accumulation + new-lineage now on creature),isRelatedLineagecallers (Attacker/Communicator/Reconnector/Sensor),GeometryKernelslineage coloring,TestKernels.EditKernels::cudaChangeObjectapplies creature lineage from the TO so inspection edits reach the live simulation.Host
CreatureDescgains the 3 members,GenomeDescloses them.DescConverterService,SerializerService(new creature ids, dropped genome ids),DescValidationService,DescEditService::randomizeLineageIds,GenomeDescEditServicepreview,GenomeDescHash.GUI
GenomeEditorWidget: removed lineage + accumulated-mutations widgets.InspectionWindow: 3 fields now editable on the creature; creature-change detection triggerschangeCell.Tests
getMutatedCreaturehelper.Testing
alien.exelinked (Ninja Release).EngineInterfaceTests155 ✓,PersisterTests64 ✓,EngineTests3048 ✓ / 3 pre-existing skips / 0 fail.🤖 Generated with Claude Code