GithubHelp home page GithubHelp logo

jalabhar / elden_bot Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 279 KB

This repo contains code for a bot that learns to fight Elden Ring bosses with the use of Neural Networks and gradient-free optimizers. (WIP)

Python 100.00%

elden_bot's Introduction

Elden_Bot

This repo contains code for my take at a bot that learns to fight Elden Ring bosses with the use of Neural Networks and gradient-free optimizers. (WIP)

Works by processing stacks of screen captures and outputs a probability distribution over available commands.

Controls for the bot are as provided in the Custom_Controls.csv in this repo, which differ from the standard in-game controls. Either the csv or the in-game settings must be adjusted so they match each other.

This project requires the game to be run in 800x450 resolution. Some in-game info, such as status bars, is extracted by hardcoded coordinates and might need to have these coordinates adjusted.

To run the bot at train mode, run the file train_env.py. The file test_env.py loads the saved set of parameters and runs the bot without further training.

The bot is currently set up to run in the open world,with instructions to navigate to Margit, The Fell Omen from the Castleward Tunnel Site of Grace in the walk_to_boss function. To fight other fog gate bosses, the function walk_to_boss in the Elden_Bot.py file should be modified accordingly, so the character is positioned in an adequate position to engage in the fight. It is also capable of searching for open-world bosses, though it's not able to find them consistently.

The training process can be unstable, as the game sometimes crashes during training. if that happens, just restart Elden Ring and then restart the training process by running train_env.py again. The program saves checkpoints that will be used as reference for the continuation of the training process should a crash happen. Before the training begins, a Site of Grace of your choice should be marked as favorite in the in-game map, as the bot uses this to reset the run at each iteration.

A set of parameters saved after a few iterations is available in this repo as a numpy file named 'EldenBrain.npy'. This is provided as an example of how the bot works, and only works with the model architecture in its current configuration. Any modifications will require starting the training process from scratch. Please note that the set of parameters provided is the result of only a few iterations of training, therefore being far from a converged sample, and is not a proper example of the model's full potential.

This project has been developed and tested exclusively in Windows 11 with Python 3.10, using a PC with a Intel i7 8700 CPU and a NVidia GTX 1070 GPU with 6GB VRAM,and 16GB RAM. The game was running at 800x450 resolution with all graphic settings defined to low in order to ensure stability. Better hardware would certainly run it at better quality, though it would be unlikely to have any impact in the bot's effectiveness.

elden_bot's People

Contributors

jalabhar avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

korosys

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.