#Running celeste for coding purposes ( reinforcement learning )

13 messages · Page 1 of 1 (latest)

glass fjord
#

I am doing a project on reinforcement learning for celeste. I already know of the celeset studio and tas mod for interacting with the game using python code. However, my goal is to train an "AI" using python code. Training can take a very long time and it requires the program to walk through a level 100s of times. The tas mod can spead up the game but it still requires rendering of the game. The rendering greatly increases the training time. Does anyone know of a mod or any method to run the game with python code to only update internal information without rendering the game? The agent it self only needs the values from the game. Rendering is only good for humans. So if someone knows something it would be appreciated.

full elbow
#

You could hook FNA's Game.Tick and throw out everything except calling update

ancient vessel
# glass fjord I am doing a project on reinforcement learning for celeste. I already know of th...

fna (and xna) have two loops, an update loop and a render loop, you just need to ditch the render loop (also those are not as separate as i make them sound like but thats the idea)

for controlling the game you could use IPC via unix sockets to control the game via python code but since i dont think theres a good python - c# interop lib you could use

finally there have been some attempts of this same thing for celeste, each one with different approaches, searching for "reinforcement learning" or similar may yield some results in this discord server

#

as an extra note: everest adds some overhead to the base game (and mods do too) so maybe you would want to patch the game directly if you have any experience with that

full elbow
#

everests overhead should be negligable

ancient vessel
#

aaand, im working in a mod that makes the game run as fast as possible, maybe use that as a base source to your mod since that includes removing some code that is only used for rendering but that has to run in the update loop
https://github.com/Wartori54/Hydrogen
sadly that mod is not finished yet

ancient vessel
icy girder
ancient vessel
#

goddamn it you dont know how much i hate not being able to react in modding_help posts MADeline

glass fjord
#

@ancient vessel So im not familiar with some terms. What is xna and fna? And when you say patching the game, do you mean making a self implemented copy of the game in python?

ancient vessel
#

okay lets start, celeste runs in purely c# and one important framework for when it comes to game making was xna, the issue is that it was derpecated, so fna was born, a foss reimplementation, so everest was made to always choose this one (because its supported and much easier to work with)
then we have everest, which uses monomod, a patching library for c# assemblies (binaries), but everest itself is not the most optimized mod loader ever, so you will lose some performance over vanilla for using it, at the cost of having to patch it manually
if you are not experienced with any of that, then forget about it, hopefully you will be able to run the game fast enough

glass fjord
#

@ancient vessel yeah im not as familiar with these concepts. My experience is more with machine learning and data science. So I am still unsure about what patching is. But it seems to me that you are saying that since I am not experienced that I should not try to do patching. and that I should just try to run the game with everest anyway since it is difficult? So is there any way to the first thing you said about trying to remove the rendering loop. Or do you think that would be too difficult?

ancient vessel
#

patching is basically modifying a preexisting app, in this case you are patching celeste, which is in a compiled form, so its not as straight forward as modifying the source code, thats why it is difficult if you dont know much about this topic in c#,
so basically your best bet is to learn celeste modding, and try to setup an environment where the render loop is not called and have your interop in there