GithubHelp home page GithubHelp logo

grahambest / dark-souls-pvp-ai Goto Github PK

View Code? Open in Web Editor NEW

This project forked from metal-crow/dark-souls-pvp-ai

0.0 1.0 0.0 1.28 MB

AI for playing (and winning) in dark souls pvp

License: Other

C 96.08% C++ 0.88% Java 3.04%

dark-souls-pvp-ai's Introduction

Project King, The Dark Souls PvP AI

AI for playing (and winning) in Dark Souls PVP. Shown in a fully automated 24/7 stream: https://www.smashcast.tv/metal-crow

If you like this project, you should also follow:
https://github.com/eur0pa. Creator of dark souls pvp watchdog. Thanks man!
https://github.com/OrdinaryMagician. Various projects in dark souls 2, and assembly master.
https://www.youtube.com/user/Birdulon. Master reverse engineerer, seriously he found the Dark Souls 2 bullet params a week after it came out.

The most recent commit to master should always be tested and verified to perform well. Any work that may break or may not function well should be done in a branch.

Setup

  • Install Vjoy.
  • Create Vjoy controller with the config: x,y,z,rx,ry,20 buttons,1 discrete pov
  • Install Cheat Engine
  • Download Technojacker's DARKSOULS.CT table
  • Cheat Engine and the table are only used to lock the camera's x rotation to 3.141592. My method for doing this is a script that AOB scans F3 0F 11 83 44 01 00 00 80 BB 63 02 00 00 00, noops, then lock camera x via CE freeze.
  • The helper table I used (modified from Technojacker's) is here
  • Download the source code and compile with FANN. Add the FANN dlls and the vJoyInterface dll to the exe's folder.
  • Train the defense neural network (see the methods in InitalizeFANN, use the main method in there with them) and put the .net file in a folder in the .exe's location called "Neural Nets"
  • Or use the already trained nets in the latest release
  • (If you want the gui) Import the folder for the GUI into eclipse and run that. Or run the included .jar file.
  • Run the PvP AI whenever the opponent is ready.

Neural Networks

Defense Network Inputs:

  • Array of distance between AI and enemy over 0.5 second period
  • The angle the enemy is off from directly in front of the player
  • The enemy velocity
  • The rotation difference between the enemy and the player

Attack Network Inputs:

  • Array of distance between AI and enemy over 5 second period
  • Estimated stamina of enemy
  • Poise of enemy
  • poise damage of AI's attack
  • the AI's current poise
  • base poise damage of enemy's attack
  • array of AI's HP over time
  • stamina of AI
  • array of enemy animation types
  • current bleed build up
  • NOTES:
    • usually tell how they attack by how long it's been since they last attacked

TODO

  • TOP Priority

    • stand still on wakeup/kick
    • fix the mash r1 statagy from working
    • Fix backstab detection being wrong for value 2 rarly
    • types of backstab methods
    • Pivot
    • Counter strafe (triggered off bs detection, imrpove counter strafe subroutine to circle right way)
    • Roll (done automaticly, may need better repositioning code)
    • omnistep behind enemy
    • toggle escape kick
    • allow backstab subroutine to be circle strafed out of with higehr thresholding setting per method(for each's danger level)
    • 1 hand kumo toggling not working?
    • more advanced backstab tactics instead of only take available.
    • weapon attack speed analysis for trading avoidance
    • improve ai's vulnerablity to parrying. See improving trading analysis.
    • sometimes missing due to dead angling
    • impove bs neural network accuracy. try to bs with neural network on and using strafing, train with that
  • HIGH Priority

    • toggling timing off for some weapons (gold tracer,). why?
    • better velocity measure
    • when enemy weapon can poise break immediatly, do a more cautous back away attack style
    • If behind enemy, dont have to dodge, if their attack wont hit me.
    • spear game too strong. Dynamic range fix? no, i also just dont know how to fight spears.
    • should attack even when enemy attacking, just determine their direction and attack to their side or behind.
    • refine behind enemy safe state to be more behind enemy. Cone like?
    • any attack can be parried. allow ai to parry sometimes.
    • more specifications on neural network output. Defense net should return how exactly to avoid bs, not just detect it. Likewise for attack.
    • use more than 1 attack types, dynamic range for weapon attacks
    • get dynamic weapon range working, teach range. Should not keep moving forward once in weapon attack range. this also fixes bows not being dodged.
    • detect when player in backstab or parry, and when enemy in backstab or parry. know not to do stuff when they are.
    • make this strafe in the same direction as the enemy strafe
    • Teach poise. Additional inputs for attack neural network: Poise damage of the poise damage of AI's attack and poise of enemy. Their max is sent over wire, but how do i detect hits? Including phantom poise damage.
    • at closer ranges, perfect block and strafe for bs.
  • MEDIUM Priority

    • movement bug. jerky and sometimes off
    • true pathfinding. Read ripped maps
    • Get different base addresses for all possible enemies, allow switching of main target.
    • projectile or lingering hurtboxes.
    • Lock camera(x and y pos) programaticly, rotation x set to PI or 0 depending on map
    • Store all info to be printed in buffer and only print/send to gui on tick end, to save socket writes
  • LOW Priority

    • Some cacheing layer. The first time ex:distance is computed in a tick, it is stored in a cache struct, and all subsequent distance calls use the already computed value. Easier then passing it around. When the method is called, it checks if there is an entry in the cache, if not, it computes it and adds it, then returns the value. If there is, it returns that value. AT the end of each logic tick, the cache is invalidated.
    • ReadPlayer should read memory in chunks, not individual calls to ReadMemory
    • Better Vjoy loading/unloading
    • Have a build flag which determines if the program uses my handwritten neural network or a library's neural network

Using:

http://vjoystick.sourceforge.net (VJOY)
http://leenissen.dk (FANN)

dark-souls-pvp-ai's People

Contributors

alanyee avatar hansott avatar metal-crow avatar

Watchers

 avatar

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.