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
5.04.1:
- Changed - Temporarily removed some speed functions. GA now works as intended.
- Please note that speed based learning may not function in this version.
5.1 :
- Added - AI can now increase how long until a frametime fallback. (see settings reference `IMPRV MOD`)
- Can be disabled, of course.
5.2 :
- Added - Ability to seed RND(). See settings reference for more information.
- Fixed - Issues with kept solutions keeping garbage data.
- Fixed - Issue where frametimes were not being respected properly / being respected too much.
6.0 :
- Fixed - Replay system. Please dm "@antibrain0" on discord if you encounter any issues, or just leave a comment below.
- Changed - Increments for seed
6.1 :
- Changed - GA now presses an input for frame instead of toggling its held state when called.