CC GENETIC ALGORITHM
If runs are taking too long, Consider disabling FLIP?
on page 3 of the settings (READ SETTINGS REFERENCE BELOW)
This is a mod of Celeste classic where you get to watch a genetic algorithm learn how to play Celeste classic.
Wiki page for the Genetic Algorithm
SETTINGS REFERENCE
CELESTE CLASSIC GENETIC ALGORITHM [CCGA] MOD BY ANTIBRAIN [SETTINGS REFERENCE] `FPS` : Simulation FPS. The timer in the corner will not be affected. You do not need to set it to a normal number. framerates like 22 and 46 are just fine. `# OF PLAYERS` : How many players to simulate at once. More players means it will learn faster, but too many can lag the machine. `CYCLE LEN` : How many cycles to run before selecting iteration to reproduce and grow. `ADDED PER C` : How many FRAMES to add after every cycle SET. [after `cycle>max_cycle`] `FALLBACK` : Min # of frames the ai is allowed to go back from preserved solution in the event of failure. `MAX_H YSPD` : If enabled, MAX_HEIGHT will ONLY be updated if THIS.SPD.Y==0 `COIN REWARD` : Amount of points given for collecting a coin. `BASE MUTATE` : The base mutate chance from 0-100%, without any deaths or changes. The mutate chance for each instance will never go below this number. `SFX?` : Toggles sound effects that instances can make. (dashing, jumping, etc) `MUSIC?` : Toggles music. `SHOW N` : Toggles whether to display each player's instance number on itself. Enable to keep track of players. `FLIP?` : Toggles whether to call flip() every frame to update the screen. When disabled, each frame will be updated instantly after the last frame. When disabled, It does break menus and cause a LOT of flickering, so use caution. `IMPRV FALLBK` : Number of frames to wait after last improvement to try again from improvement. `MTATE KEEP` : Toggles if kept frames can be mutated. `â–¤ PAGE X/Y â–¤` : Current page number. Left/right to view other pages. Numbers can be changed with L/R. Booleans [TRUE/FALSE] can be changed with any button. |
CHANGELOG
CELESTE CLASSIC GENETIC ALGORITHM [CCGA] MOD BY ANTIBRAIN [CHANGELOG] 1.0: - Initial release 1.1: - Added - This changelog - Changed - Balloons now reward the ai for collecting them THE FIRST TIME - This is to increase the chances of winning levels like 2800m and 900m, where balloons are the only way of beating them, and there isn't much vertical reward. 1.2: - Added - Reward coin collectibles that make ai happy when grabbed :D - This is to make sure the ai wont just ignore certain VERY IMPORTANT sections of levels. aka ALL OF 200M AAAAAAAAAAAAA 1.3: - Added - Several menuitem features to change how the AI "Learns", As well as sim speed and such. - Functions include: FPS (10-60), Weather springs reward the AI, Weather Walljumping rewards the ai (Based on height walljumped from), Reward granted from collecting a coin, Score penalty for dying, Frames added per generation, % chance to mutate each instruction not kept, and the ability to reset the AI, starting fresh with new params. - Changed - Coins no longer respawn once collected, as the ai would just die to get them again, and it follows the same path regardless of if the coin is there or not if it was collected at least once. (unless it died and the death pen is more then coin reward) 1.4: - Removed - Reset AI menuitem - Caused too many issues, might add back later once fixed. 1.41: - Fixed - "Last Improvement" Showed FRAME number instead of GENERATION number 1.5: - Added - Simple title screen with basic instructions - This is to allow changing settings before a simulation has been started. - Added - SRAND settings - Accessible when on title screen, select to enable, l/r to change seed. 1.6: - Changed - Dying now removes all collectibles. - This is to prevent the ai from just dying over and over again to keep getting the reward from grabbing coins or berries. 1.61: - Removed - Testing things i accidentally left behind (Whoops!) - Fixed - Typos 2.0 : - Major release - Removed - A ton of settings that dont work anymore - Removed - Some text that doesn't apply anymore - Added - Multiple players at once - Added - Fallback system - Based on deaths that generation. The more deaths the farther back mutations can be made, up to two seconds if 90% die, and 10 seconds if 100% die. This is to ensure that they dont get softlocked. - Changed - Its a real genetic algorithm now - Changed - Reward values - Higher death penalty - Changed - Height Rewards - Only counts as grounded if this.spd.y==0 - Changed - Most of the algorithm and code to work with multiple instances. - Changed - Title Screen - Changed - Keep system doesn't HAVE to keep "working" solutions if they are terrible 2.1 : - Fixed bugs - Changed - Fallback only resets to unmodified best if ALL instances die in a single generation. 2.2 : - Fixed bugs - Working towards fitness choosing error - For some reason, the program will choose a different instance then the one who was selected to reproduce, to reproduce. I have no idea why that is, as its not supposed to do that. Also sometimes instruction sets get boggled randomly and i dont know why. Patch in progress. 2.3 : - Fixed bugs - Note that this version is not public, due to some issues regarding the fitness function. 3.0 : - Added - Cycle Based system - Added - Ability to change `max_cycles`, and `frames_added_per_cycle` in pause menu. [SEE SETTINGS REFERENCE ABOVE] - After X cycles, Best of X cycles reproduces, Add X frames. - Changed - Algorithm now reproduces after `cycle>=max_cycle` - Removed - Old reproduction system - Fixed - Issue where system would choose wrong iteration to reproduce. - I'm not entirely sure what fixed it, but it definitely shows up way less now. - Changed - Reformatted [CHANGELOG] and [COMMAND REFERENCE] to be in code blocks, because i think it looks nice. 3.1 : - Changed - Default Population from 5 -> 10 - 5 Was simply too slow. 10 is low enough where the flickering wasn't too bad, and high enough where it wont take too long to beat scores and learn. - Updated - Cart label 3.21 : - Attempt to fix bugs - At STILL for SOME REASON just picks the WRONG instance to reproduce. Most of the time this wont really do much besides make it take longer to beat levels, but sometimes it can lead to them all dying over and over. 3.22 : - Added - Ability to change fallback length - This is to allow users to work around a suspected cause of the wrong_reproduce bug, until it is fixed. 3.3 : - Added - Many settings accessible from pause menu on title screen. See [COMMAND REFERENCE] Above for more info. 3.31 : - Changed - Each instance may only pick one coin up per generation - Changed - Coins no longer despawn on collect - These two fixes are to make sure that instances dont mess things up and devalue other, better instances. 3.4 : - Added - Ability to disable FLIP() call every frame - Note that this causes a lot of flickering and breaks the pause menu. - Removed - FREEZE function. Removed so that the whole cart will not freeze when an instance opens the big chest containing the gem. 3.41 : - Fixed - Timer silliness when FLIP() is disabled. 3.5 : - Changed - Fallback system only happens if all instances die in a run - Changed - Fallback duration is now no longer a dynamic parameter 3.51 : - Changed - Changed coin behavior back to what it was before - Coins now despawn on collect instead of instances only being able to collect one coin per cycle. 3.52 : - Fixed - Issue with fallback system not triggering properly, or even at all, upon a failure. 3.6 : - Fixed - LOTS of bugs - Removed - Ability to change death penalty - Changed - Death penalty is now a fixed penalty of "-16000" - Why keep bad solutions? - NOTE - Please note that, due to a few bugs, the ai will not always be able to complete levels quickly, or in rare cases, at all. - NOTE - With this new patch, it is now 100% possible for the ai to beat the game. 4.0 : - Added - AI now plays each level individually (eg, plays 100m until win, then plays 200m until win) - Added - Able to replay the entire run after ai reaches flag at summit - Fixed - SO MANY BUGS - Every known bug is now fixed!! Please let me know if you find any more issues with the cart. - Changed - Fallback is now by default 5f (5 frames) 4.1 : - Changed - Decreased mutate chance on death (70%->20% Per instruction) 4.2 : - Fixed - Issues when multiple instances interact with a single object at once 4.3 : - Fixed - Issues with fallback system (again) - Changed - MAX_FALLBACK is now a dynamic parameter. Repeated failures will increase fallback range. - FALLBACK (Setting) Is now the minimum value instead of the maximum value. See settings reference for more information on settings. - Changed - Default Population is now 25. - After a lot of testing, 25 instances was the best and fastest overall. Lower values such as 10 would generate suboptimal solutions, and large values like 50 would take a really long time. - Note - Larger population sizes generate better solutions but are slower, and small sizes will generate worse solutions, but are much quicker. 4.31 : - Changed - MAX_H YSPD (setting) is now false by default. 4.4 : - Changed - Keys now award bonus score - Changed - Cartridge ID is now #ccga 4.41 : - Changed - Keys are now worth 15 points, to prevent the ai from cheating - Changed - After ai's time is more then 900 frames, reset to best score. This is to avoid ram crashing. 4.42 : - Fixed - Issue where scores werent properly reset on level win 4.43 : - Added - Reset all instances if all of them died more then 25 times in a row - Changed - Reset all after 900 frames instead of going back to best 4.44 : - Changed - Minimum mutate chance per instruction is no longer dependent on current cycle - Changed - Mutate chance increase on death (+10 -> +30*(DEATH_ROW+1), where 'DEATH_ROW' is failures in a row) 4.5 : - Added - New coin type for when AI needs to save a dash 4.51 : - Fixed - Issue with new coin type collecting at wrong times - Fixed - Bad coin placement in one pregem level 4.6 : - Fixed - Issue with timer overflowing - It now will only overflow after 32768 DAYS (90 Years) - Fixed - Issue with springs not hiding when below crumble leaves. 4.7 : - Fixed - Issue where playback was being mutated - Fixed - Issue where too many players were being spawned during playback 4.71 : - Fixed - Issue with springs giving their reward more then once 4.72 : - Changed - Default Minimum Fallback length lowered (5f -> 2f) 4.73 : - Added - Now shows user current memory usage. 4.74 : - Fixed - Ai will no longer preserve garbage data. (Eg, if improvement at frame 100, only frames 1-100 are kept). - This may have fixed the replay issue. if anyone reaches the summit, please let me know via discord. (antibrain0) 5.00 : - Added - Speed based reward incentives - Ai will now strive for fast solutions in addition to working ones. If the ai finds a faster solution to a solved area, it will consider that an improvement. - Added - Since_improvement fallback and setting - Ai will reset itself to last improvement after a set number of cycles. 60 by default. feel free to change it in the options. - Added - Ai is now able to mutate kept solutions - This is to allow for the possibility for a faster solution. much smaller chance to mutate an instruction if it is being kept. - Changed - Default mutate chance is now 0.1% 5.01: - Added - Mutating kept frames is now toggleable (Off by default) 5.02: - Changed - Base mutate chance reverted to 0% 5.03: - Fixed - Issue where best frametimes were not being reset - Note - There is an issue with the replay system at this time. This bug is present in all versions of CCGA with the replay feature. A fix is being developed, but it will take a while due to me not knowing what in the world is even causing this bug. Thank you for understanding. |
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/media/68490/logo.png)
half an hour later,
last improvement gen: 88
generation: 300
kind of wish pico-8 had turbowarp like for scratch
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/media/13120/PFP_upscale.png)
This is an interesting experiment! I wonder if you'd get faster results by evolving a 2d matrix that determines actions based on the player's screen position rather than your current time-based list of actions.
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/media/76139/Spining_Duck.gif)
thats so cool, I wonder if you could do the same for other games as well.
After one about 55 minutes, I stopped. I think it couldn't get past gen 175.
![](/media/76139/57_Download (2).gif)
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/bimg/pi/pi16.png)
had the last one running for 13 hours, then v2 came out and now I'm up running it again :) cool stuff friend
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/bimg/pi/pi20.png)
Really cool with the improvements. Can you make it so that after you pass a level, you don't have to watch it redo all the levels before that level?
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/media/90120/3_pfep 2.png)
gen 220 to finish the level!!! gen 135 was the one that reached the strawberry platform and it was fabulous, and then gen 199 was the one to reach the end platform
if youre curious my settings were cycle 1, frame increase 1, 20 madelines
![](/gfx/set_like0.png)
![](/gfx/top_drop.png)
![](/bimg/pi/pi16.png)
@hwd2002 yeah i think we already have a bot that does that for every level called searchdelie in the celeste classic discord, except you have to give it a list of inputs to follow and it runs in python. i hope you didn't mean something else.
[Please log in to post a comment]