Help with an evolution simulation

0 favourites
  • 8 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I made a simulation designed to have creatures evolve however I'm having an issue. Each cell has a priority to decide what it should do depending on it's surroundings which it detects with it's sensors. To make it simple right now it just says if it can see food set action to 1 but for some reason it's not working. Here's what I have so far, I intend to keep working on it but if anybody has some way to help me with this bug please let me know or post a capx with your solution ^-^ https://www.dropbox.com/s/gga249clhmsg6 ... .capx?dl=0

  • Sorry I can't open it because Iam using rr227 and your using rr228. I don't update unless its a stable release because sometimes the beta releases have bugs in them.

  • No problem

  • PixelPower, dude, you would find this so dang interresting. Because, this will pontential grow to a very nice game.

    This is gonna evoluate in a hell of job to pick the right instances. You have problems allready.

    Let me (to my best knowledge) show you the problems in 2 events.

    Event 27.

    https://drive.google.com/open?id=0B1SSu ... EdFOFJVMk0

    Instance variable Animal is the UID of the cell array.

    Every instance pinned to a certain animal has that variable. Wich is great. You planned picking.

    I feel that Cell > (action) > pick by UID ... UID = Eater.animal is easyer , but that is taste, i guess.

    I am not sure if the conditions you used has to be true to make the event true. I never used it that way.

    But.

    The conditions pick (when there is only 1 collision happening, and that is a very risky assuming)

    1 Eater

    1 Food

    & the Cell that goes with the Eater.

    The actions.

    Destroy the picked food (perfecty)

    Then Add 30 to the instance variable of a unreferenced AnimalContainer.

    Unreferenced ? Well it has no pick condition, so it is unreferenced.

    When you run an action on an unreferenced object, that action runs on all instances of that object.

    There will be 30 added to the instance variable of ALL AnimalContainer.

    Add the condition >> AnimalContainer >> pick by UID >> UID = Eater.Animal, to include/pick the right AnimalContainer.

    I am not sure why you picked the Cell. No actions adress the Cell. Did you forget something to do in that Array ?

    Or did you start with using a Container to pick all those instances and keep them togheter.

    Wich is a great way to do this stuff.

    But, you had to change your mind because each animal can have more Eaters and more Brains. In that case Containers indeed not gonna work out fine.

    But your code still seems to be acounting for containers.

    Event 28.

    https://drive.google.com/open?id=0B1SSu ... GtEek5uS0U

    Pick all sensors, picks them all.

    The pick by evaluate picks from those sensors the one who's UID = a certain Brain.UID.

    But, again, Brain is unreferenced. Therefor you feed it all Brains. Yet you forced it to chose 1.

    So, it compares to the Brain with IID=the first on in the list.

    Result: It picks the first created Sensor that goes with the first created Brain. 1 Sensor.

    The actions.

    Again. Brainsignals is unreferenced. So it sets the locations for every Brainsignals to zero.

    Event 29, the subevent.

    Subevents pick from the objects that are picked in its top event.

    So it checks if that 1 sensors is overlapping Food. Food is unreferenced, so in this case that is fine.

    It checks if that 1previous picked sensor overlaps with any of the Food.

    If there is a overlap, that sensor (still the wrong sensor, anywayz) stays in the picklist. Else the picklist for sensors wil be empty. (that does not make them unreferenced)

    Brain is unreferenced. So it compares all Brain to find one with the UID of the picked sensor.

    I dont think you have a Brain with UID = 0, luckely.

    So if that 1 (weird picked) sensor overlaps food AND if it finds a brain that goes with it, then it will (action) set location 0 of all BrainSignals to 1.

  • Ok I think I've found this issue or at least part of it. I deleted everything with the food and just simply stated

    If Sensor.Animal = Brain.Animal: Destroy sensor

    For some reason thought sometimes the sensor isn't destroyed, I checked if their animal value was the same and it was so I can't imagine what the issue is

    I changed it to

    Brain.Animal = Sensor.Animal: Destroy sensor

    Now it always works unless one of the animals lacks a brain, then none of the sensors on either animal is destroyed. Why is this and how can I fix it?

  • Looks like by setting it to

    For each sensor

    Brain.Animal = Sensor.Animal

    It works properly

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • If the sensor objects are always present with the actual "cell" object... you may want to consider using CONTAINERS

    ~Sol

  • Sensor's aren't always present but thanks ^-^ And I've got most of it done, I only have one issue now

    In the beginning all of the animals parts are pinned to the properly but in their offspring it looks like they're being pinned to random things. Any idea on what's going on? Here's the new capx https://www.dropbox.com/s/gga249clhmsg6 ... .capx?dl=0

    I think I may just have too much going on at once? Because in the debugger I can see it takes a while for everything to update itself

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)