• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 16:43
CEST 22:43
KST 05:43
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
TL.net Map Contest #21: Voting3[ASL20] Ro4 Preview: Descent6Team TLMC #5: Winners Announced!3[ASL20] Ro8 Preview Pt2: Holding On9Maestros of the Game: Live Finals Preview (RO4)5
Community News
Weekly Cups (Oct 6-12): Four star herO65.0.15 Patch Balance Hotfix (2025-10-8)71Weekly Cups (Sept 29-Oct 5): MaxPax triples up3PartinG joins SteamerZone, returns to SC2 competition325.0.15 Balance Patch Notes (Live version)119
StarCraft 2
General
Ladder Impersonation (only maybe) 5.0.15 Patch Balance Hotfix (2025-10-8) The New Patch Killed Mech! TL.net Map Contest #21: Voting Weekly Cups (Oct 6-12): Four star herO
Tourneys
Master Swan Open (Global Bronze-Master 2) Tenacious Turtle Tussle WardiTV Mondays SC2's Safe House 2 - October 18 & 19 Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Custom Maps
External Content
Mutation # 495 Rest In Peace Mutation # 494 Unstable Environment Mutation # 493 Quick Killers Mutation # 492 Get Out More
Brood War
General
ASL20 General Discussion BSL Season 21 BW caster Sayle BGH Auto Balance -> http://bghmmr.eu/ Brood War web app to calculate unit interactions
Tourneys
[ASL20] Semifinal B [ASL20] Semifinal A [Megathread] Daily Proleagues [ASL20] Ro8 Day 4
Strategy
Current Meta BW - ajfirecracker Strategy & Training Siegecraft - a new perspective TvZ Theorycraft - Improving on State of the Art
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread ZeroSpace Megathread Dawn of War IV Path of Exile
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
SPIRED by.ASL Mafia {211640} TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Men's Fashion Thread Sex and weight loss
Fan Clubs
The herO Fan Club! The Happy Fan Club!
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion MLB/Baseball 2023 NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
Inbreeding: Why Do We Do It…
Peanutsc
From Tilt to Ragequit:The Ps…
TrAiDoS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1210 users

Dota 2 Bot API Part 4: bloody creep variables

Blogs > LetaBot
Post a Reply
LetaBot
Profile Blog Joined June 2014
Netherlands557 Posts
May 21 2016 02:22 GMT
#1
Creating a Dota 2 Bot API Part 4: bloody creep variables

Part 1: http://www.liquiddota.com/blogs/503835-dota-2-bot-api-the-glutinitial-step
Part 2: http://www.liquiddota.com/blogs/508438-dota-2-bot-api-2-training-for-a-trainer
Part 3: http://www.liquiddota.com/blogs/508958-creating-a-dota-2-bot-api-part-3-float-on



Next up in the variables needed for a Bot API is determining to which team each entity belongs to.




If you want to try it yourself, keep in mind that you should start steam in offline mode and turn of your internet

1. After you made sure that steam is in offline mode and you have no internet, you start Dota 2 with the launch option: -console

Then start a bot game with you playing as Chen. Put your skill point in "Holy Persuasion".

2. You start of by finding the HP of an enemy creep. I choose a melee creep, but this works on all three types.
( Look at part 2 of my blog to see how to get the HP value )

[image loading]


3. Now press ctrl+T to start a new scan (or click on file->Add scan tab).

4. Search for an unknown integer between the memory address of the HP and that memory address + 3000 (in hex). Technically you have to search from the base of an entity, which is the memory address of the HP - BC , but since the offset we are looking for is beyond the HP we can fill in the memory address of the HP straight away.

[image loading]


5. After clicking on new scan, let the game play for a while (make sure you lock the HP value of the creep so it won't die).
6. Do a new scan with "unchanged value". Repeat this for a while.


[image loading]



7. Now cast Holy persuasion on that creep
8. Scan for "changed value"


[image loading]


9. scan again for values less than 100
10. Add the results to your address list


[image loading]


11. Now look for another melee creep of your team so that you can use the offsets from step 10 and see which values are the same. Those values can be used to determine which team a creep belongs to.

12. After finding the correct HP ( see part 2, some addresses have the same value but are only used for displaying the HP not actually using it in the game logic), take note of the memory address.


[image loading]

13. Now you calculate the offsets based on the memory addresses you got from step 10 . For example,

450CA114 - 450C9B2C = 5E8 (make sure that you put your calculator on "Hex")

You then take the offset and add it to the HP address you found in step 12. In the image below, it gives a value of 3, which is different than the value of 2 for our (holy persuasion) converted creep.

[image loading]


14. Eventually you come across an offset that gives the same value (in my case it was 8D4). It should be just 1 offset that is the same, but if you have multiple you can narrow them down by following the steps below for each address.



[image loading]


15. For each offset you can verify if it is correct. You will need to do this anyway in order to find out which value belongs to Radiant and Dire

16. Get the HP memory address of an enemy creep. Then add the offset you got from step 14 to it. This should give you the team value of that creep ( in my case 4 = Dire, 8 = Radiant , but this can change in an update).

[image loading]

17. To check if it is a team value, use "Holy persuasion" on that creep.

18. If it is correct, then the value should change to the team value of your team ( in my case 4 = Dire, 8 = Radiant , but this can change in an update).

19. If not, then use the other offsets you found at step 14.

[image loading]

---------------------------------------------------------------------------------------------


So the only things left now to make a very simple but already functional bot API is:
- Add a method to access and iterate over all the entities
- Translate the position of the entities and the camera into x,y coordinates on the screen


If you cannot win with 100 apm, win with 100 cpm.
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
May 21 2016 17:09 GMT
#2
and this is why we should probably wait for valve to open some api

at any rate I feel the bot for dota is going to be pretty crappy

are you by any chance the letaBot also for starcraft AI?
Life is run, it is dance, it is fast, passionate and BAM!, you dance and sing and booze while you can for now is the time and time is mine. Smile and laugh when still can for now is the time and soon you die!
LetaBot
Profile Blog Joined June 2014
Netherlands557 Posts
May 21 2016 17:43 GMT
#3
On May 22 2016 02:09 evanthebouncy! wrote:
and this is why we should probably wait for valve to open some api

at any rate I feel the bot for dota is going to be pretty crappy

are you by any chance the letaBot also for starcraft AI?



Yes I am the same LetaBot that develops a StarCraft bot.

If valve would release their own bot API that would be great ofc, but I doubt that they are going to release one.

Why do you think a dota bot is going to be crappy? The Dota 1 bots were subject to the restrictions of the JASS script engine from WarCraft 3.
If you cannot win with 100 apm, win with 100 cpm.
Yurie
Profile Blog Joined August 2010
11904 Posts
May 22 2016 08:38 GMT
#4
When you use memory search, can you see hp/mana etc of creeps and heroes that is outside the screen but visible for your team? I assume in single player you can see even things hidden in fog since it isn't hosted on the external server but your local server. That would make another variable you need to consider, is the AI cheating by seeing through FoW or not?
LetaBot
Profile Blog Joined June 2014
Netherlands557 Posts
May 22 2016 15:24 GMT
#5
On May 22 2016 17:38 Yurie wrote:
When you use memory search, can you see hp/mana etc of creeps and heroes that is outside the screen but visible for your team? I assume in single player you can see even things hidden in fog since it isn't hosted on the external server but your local server. That would make another variable you need to consider, is the AI cheating by seeing through FoW or not?



If you start the game as a server you can see these things yes. But you can build in a "CompleteMapInformation" flag just like in the BWAPI, where you can only access information in the fog of war (or even just on your screen) if that flag is set to true (with that flag set to false by default).
If you cannot win with 100 apm, win with 100 cpm.
Please log in or register to reply.
Live Events Refresh
OSC
18:30
Mid Season Playoffs
Ryung vs MojaLIVE!
Nice vs NightPhoenix
Cham vs TBD
MaNa vs TriGGeR
SteadfastSC233
IndyStarCraft 187
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SteadfastSC 233
IndyStarCraft 187
ZombieGrub98
Railgan 33
StarCraft: Brood War
Calm 2715
Larva 568
Mini 292
firebathero 131
Dewaltoss 80
Counter-Strike
fl0m1332
Stewie2K423
allub189
Heroes of the Storm
Liquid`Hasu548
Other Games
Grubby3275
FrodaN2139
Skadoodle283
Pyrionflax211
C9.Mang0151
Sick121
QueenE67
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• poizon28 95
• StrangeGG 50
• davetesta23
• Kozan
• AfreecaTV YouTube
• intothetv
• sooper7s
• IndyKCrew
• LaughNgamezSOOP
• Migwel
StarCraft: Brood War
• HerbMon 10
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• WagamamaTV559
Other Games
• imaqtpie1551
• Shiphtur348
Upcoming Events
PiGosaur Monday
3h 17m
OSC
1d 2h
The PondCast
1d 13h
OSC
1d 15h
Wardi Open
2 days
CranKy Ducklings
3 days
Safe House 2
3 days
Sparkling Tuna Cup
4 days
Safe House 2
4 days
Liquipedia Results

Completed

Acropolis #4 - TS2
WardiTV TLMC #15
HCC Europe

Ongoing

BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
C-Race Season 1
IPSL Winter 2025-26
EC S1
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025

Upcoming

SC4ALL: Brood War
BSL Season 21
BSL 21 Team A
RSL Offline Finals
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.