Code Monkey home page Code Monkey logo

coachai's Introduction

GitHub top language or click the red bar ^ This BWAPI-AI/UDAI (User-defined AI) works as an in-game helper and also as an online replay analyzer. It can help the players at-all-levels to improve, also to test and sense and remember things that weren't easy/possible before.

Note:

  • CoachAI works only with StarCraft v1.16.1 using ChaosLauncher.
  • When playing in ICCUP, the game is logged and you'll get the win/lose points, this won't happen if one of the players is Computer.
  • In multiplayer matches (ICCUP/Lan), CoachAI will auto send message every 10s (for the 1st 2m) to each human enemy until they all acknowledge/accept that CoachAI-player has multiple advantages (cheats), so nobody can use it as a deceiving/hack tool. Also the non-CoachAI-player can send a messsage “noCoachAI” during the 1st 2m, to force the CoachAI-player to leave. (in team matches, messages sent automatically to allies, press Shift+Enter to send to all, or the CoachAI-player won't get it)
  • The CoachAI can run on Windows XP starting from BWAPI v4.4.

Features in-game & in-replay::video_game: :movie_camera:

  • A RealTime measure for Macro = spent minerals + spent gas (Terran repairs not accounted), many players still measure it just by the used supplies at specific time or by inaccurate replay analysis tools, in-replay you can know @any second who is the best Macro player (same as the score screen you see at the end of game/replay).
  • Want to know how many unit/building has been lost in-game/in-replay ?, just select one of the same type.
  • The # of units/buildings and also the ones in-progress, and the remaining build time for each one in progress, also the remaining time for each Tech/Upgrade in progress.
  • Buildings that has Rally Point will draw a line to the RP.
  • Displaying the number of the assigned mineral workers on each Nexus/CC/Hatchery.
  • WorkersCut measure, counts the time that Nexus/CC has been idle, if you have 2 bases the counter will be doubled, 3 -> tripled, etc.., it works for P & T, not Z.
  • Idle Workers measure displays the number of idle workers, and the total lost time (as with Workers Cut, this increase when there is more Idle Workers).
  • Minerals Above measure that counts the time of being above 750/1000 minerals.
  • Detecting the game speed, by just looking at the FPS value: 24=Fastest, 21=Faster, 18=Fast, 15=Normal, etc..

Features in-game::video_game:

  • The # of Minerals/Gas workers from all bases.
  • The # of idle production buildings (for Zerg, only the number of Larvae displayed), also the buildings IdleTime for Protoss.
  • The # of idle of idle fighting units (only non-worker units that canAttackMove: HT, Siege-Mode Tank, Lurker cannot, Medics can !).
  • The # of all killed enemies during the game.
  • The # of all current enemies, their supplies, Minerals/Gas, upgrades, in-progress things and you can even see the enemies while they move in the dark/fog.
  • MacroLog: Logs all build/train/upgrade actions and its time during the game (Tech/Upgrade logged only when its finished, unlike the reply Bo recorder).
  • Hotkeys tracker/counter: Tracks how much you press a specific hotkey.
  • The total time of WorkersCut and the number of lost workers due to that.
  • WorkersCut log (only 2+ seconds cut is calculated): to see when exactly in the game you've stopped making workers and for how long (I personally record my screen to see what I was doing, because replay is not always an option).
  • MineralsAbove log: logs the time when you're above certain amount of minerals, and for how long that was, to see when exactly you forgot to Macro.
  • Customizable notification sound and period when WorkersCut happens (5s), idle worker exist (5s) or you've missed multitasking (30s/20s).
  • Screen-Multitasking: A counter for each screen you step into, with total jumps during the game, the average stay @1 screen, the total stay on each screen for above 5s (customizable live, by editing totalTimeOnScreenOrSelectionAbove) and finally, a customizable notification sound when you stay @1 screen for above 30s (customizable live, by editing sameScreenWarningEvery).
  • Selection-Multitasking: A counter for each selection you select, with total switches during the game, the average focus @1 selection, the total focus on each selection for above 5s (customizable live, by editing totalTimeOnScreenOrSelectionAbove) and finally, a customizable notification sound when you focus @1 selection for above 20s (customizable live, by editing sameSelectionWarningEvery).
  • The TimedBo: all of us forget 1 or more things that was planned before the game, so a written Bo and tips on the game screen that dynamically highlights "What now/next?" while alerting with sound and pronouncing the current step in English JIT and allowing for more step-details to be shown/pronounced out of the succinct Bo form, will accelerate the familiarity with a specific build remarkably.

Features in-replay::movie_camera:

  • Showing the # of units/buildings & the types of tech/upgrade for each player (just select any player's unit to display the infos).
  • Showing the replay duration beforehand, and also the replay name, date, game title, game type and the map used.
  • Showing each unit order and drawing a line to the order target if there is a target.
  • Recording each player Bo. Only the 6th worker is logged for each player to see his split skill, for more info see replayLogUnitsFor/replayLogSupplyFor in the json file.
  • Easily distinguishing which players against which on team replays, (even SC:R doesn't has this !, maybe time to write some code lazy Blizzard ?)
  • During team replays showing JIT if playerX allied with playerY, and if playerY also did the same.
  • Automatic highlighting of idle workers.
  • Recording the max number of idle workers of each player, and when that happened.
  • The screen will automatically move to where a Nuclear launch is positioned (Comsat scan or Storm autoMove is disabled by default).
  • An intuitive/easier way to toggle vision of the selected player (and his allies) by pressing F7 (SC:R requires that you blind ALL other players individually to get the vision of 1 player which is not smart, here we just need to select a player/or 1 of his allies to see the required vision).
  • Displaying live score of produced/killed/lost units/buildings, to get the current state of players, this is about unit/building control (more close to micro, same as the score screen you see at the end of game/replay).

AnyRace_CoachAI.json::wrench:

This config file allows the player to modify/disable/enable many values:

  • autoTrainWorkers (default=false): trains 1 worker @time from each base until "maxWorkers" number reached (for Zerg only 1 Hatchery is used for producing).
  • maxWorkers (default=50): only works if autoTrainWorkers = true
  • autoMine (default=false): makes workers gather Minerals/Gas automatically like in SC2, so there is no idle worker.
  • autoBuildSuppliesBeforeBlocked (default=-200): if you set it to 6, the AI will try to build supply units when its 24/30 (for Zerg only 1 Hatchery is used for building)
  • maxProductionBuildingQueue (default=2): prevent the player from queuing more workers/units from the same production building.
  • workerCutWarningEvery (default=5): in seconds
  • idleWorkerWarningEvery (default=5): ^
  • idleProductionBuildingWarningEvery (default=10): ^
  • idleFightingUnitWarningEvery (default=20): ^
  • totalTimeOnScreenOrSelectionAbove (default=5): see Multitasking above
  • sameScreenWarningEvery (default=30): see Multitasking above
  • sameSelectionWarningEvery (default=20): see Multitasking above
  • logWorkersAndSupplyProduction (default=false): include Probes/Pylons, etc.. in the MacroLog.
  • logUnitsProduction (default=true): include Dragoons/Zealots, etc.. in the MacroLog.
  • workersCutCalculationPeriod (default=540): affects both game/replay, calculates WorkersCut for the specified 1st minutes in the game/replay.
  • replayLogUnitsFor (default=420): in-replay Bo recorder, for how long to log units production. (until 7:00)
  • replayLogSupplyFor (default=40): in-replay Bo recorder, for how long to log the supply units & the supply indicator. (like 12,Nexus --> until 40/?)
  • dontDrift (default=-1): initiates a custom CountDownTimer, just like seen in some missions, but you can use it in any map to practice/polish specific task/timing, when the timer ends the game will too, you can set it in seconds, it works whether its a game start or a saved game, when it reaches 00:15, visual/sound warning will start (this helped me remembering to save the game-state @lets say 6:00), in order to master the game-phases/tasks partially 1st, then as a whole.
  • workerCutLimit (default=3600): you can set this to 120 (as a goal/target), this will end the game immediately if you intermittently cut workers for 2 minutes in the default 1st 9 minutes.
  • workerCutLimitForOnce (default=-1): same as above but a 1 time continuous cut with this value (lets say 20s) will end the game.
  • spend_more_minerals_WarningFor (default=900): minerals sound warning "Spend more minerals", if minerals 500-750 its every 3s, if > 750 its every 1s, until the default 15 minutes, that doesn't happen in the multitask/macro maps, because it has it already.
  • mineralsAboveLog (default=750): logs the time when you're above certain amount of minerals, and for how long that was, to see when exactly you forgot to Macro.
  • stickyScreen (default=1): which screen to display by default ?, 1 = TimedBo, 2 = WorkersCut log & MineralsAbove log, 3 = Idle Production & Fighting units & Multitasking.
  • autoGameSpeed (default=true): some values could go wrong if game speed isn't Fastest=24 FPS, like mine > 750 time, you can set it to false to allow game speed changes.
  • replayAutoMoveToScanOrStorm (default=false): set it to true if you don't want to miss any action !
  • TimedBo1: an editable dynamic build order that appear on-game screen, it highlights/pronounces what should be done now JIT. Use ';' to move any extra step-details out of the succinct Bo form, to highlight an important TimedBo step (that you keep forgetting), add “!” as the 1st character, like: “04:00 !gascut end”.
  • TimedBo1 Tips: a block of text that appear below a specific TimedBo, you can use "\n" to move to a new line, you can also use ';' here.
  • Tips1: an editable custom tips that appear on-game screen when pressing F7, you can use "\n" to move to a new line.

Message shortcuts::pencil:

The player can input some text the UDAI can understand:

c1="show me the money", c2="black sheep wall", c3="operation cwal", c4="power overwhelming", c5="staying alive", c6="there is no cow level".

? (Only in-replay, obviously!)=Who wins?

Hotkeys::key:

F5=Toggle between the display of the MacroLog (Up,Down=Scroll through the MacroLog when more than one page exists) & the Hotkeys tracker. When on the Hotkeys tracker screen, you can briefly see other screens by pressing Ctrl or Shift, pressing Shift will also show the game type. (in-replay F5 switches between different screens).

F6 (also in-replay)=Toggle the display mode of in-progress units/buildings.

F7=Switches between the preset custom tips.(in-replay F7 toggles the vision of the selected player)

F8=Switches between all players infos (press Ctrl for more), this is useful while observing games and will draw the selected player's army/orders/destinations even while moving in the dark/fog, pressing Ctrl+Shift toggles the in-progress mode.

F9=Finds the idle workers (like in SC2).

F11=Toggle CoachAI's sounds on/off.

F12 (also in-replay)=Hide/show the CoachAI's drawing/text.

Ctrl+F1,F2,F3=Switches between the TimedBos.

PgUp=increase game speed, PgDown=decrease game speed, End=/speed 0 will run EXTREMELY fast, Home=reset speed to Fastest (24 FPS) Note: speed will revert to 24 FPS if "autoGameSpeed: true".

Space=while busy you can press Space to pronounce the next step in the TimedBo.

Comma|Period + #=pronounce a specific step in the TimedBo up to 19 (ie: for step3 press ", + 3", step13= ". + 3").

Tilde (~) (also in-replay)=Displays buildings gaps values and ground units sizes, for quick and easy reference to better walling.

Shift|Ctrl + F12= Pause|resume the game, when paused you can only move the screen during a multiplayer match. With some trick this allows pausing a multiplayer game for more than 3 times, which gives the player enough time to comprehend a complex situation and analyse the game-state quickly.

To re-build this project::hammer:

  • Setup Visual Studio 2017 choosing the following components: requirements

Known issues::space_invader:

  • The hotkey tracker is buggy when adding units using shift, also when a unit is lost it still shows as an existing one.
  • Cancelled unit/building/upgrade/tech appears in ReplayBo/MacroLog, for a cancelled upgrade/tech you'll additionally get a 'None' item below it.

What about ?:tokyo_tower:

  • VR tools like VoiceAttack/VoiceBot that make the AI do game actions just by voice.

Screenshots::camera:

in-game:

CoachAI in-replay: replay1 replay2

Installation::rocket:

  • If you don't have Starcraft v1.16, a mini ver can be downloaded from ICCUP.
  • Extract BWAPI Revamped pack contents to the game folder.
  • Extract GitHub release (latest SemVer) contents to the game folder, replace any files, then run "StarCraft ChaosLauncher.exe".

Chat with someone now ? 💬 Discord Hits

coachai's People

Contributors

captain-majid avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar

Forkers

josu3e

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.