• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 20:33
CET 02:33
KST 10:33
  • 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
RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
BGE Stara Zagora 2026 announced8[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3RSL Season 3: RO16 results & RO8 bracket13Weekly Cups (Nov 10-16): Reynor, Solar lead Zerg surge2
StarCraft 2
General
BGE Stara Zagora 2026 announced SC: Evo Complete - Ranked Ladder OPEN ALPHA When will we find out if there are more tournament Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win Weekly Cups (Nov 10-16): Reynor, Solar lead Zerg surge
Tourneys
RSL Revival: Season 3 Constellation Cup - Main Event - Stellar Fest Tenacious Turtle Tussle [Alpha Pro Series] Nice vs Cure $5,000+ WardiTV 2025 Championship
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 501 Price of Progress Mutation # 500 Fright night Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death
Brood War
General
Which season is the best in ASL? A cwal.gg Extension - Easily keep track of anyone BW General Discussion soO on: FanTaSy's Potential Return to StarCraft BGH Auto Balance -> http://bghmmr.eu/
Tourneys
[BSL21] RO16 Group B - Sunday 21:00 CET [BSL21] RO16 Group C - Saturday 21:00 CET [Megathread] Daily Proleagues Small VOD Thread 2.0
Strategy
Game Theory for Starcraft How to stay on top of macro? Current Meta PvZ map balance
Other Games
General Games
Nintendo Switch Thread The Perfect Game Stormgate/Frost Giant Megathread Beyond All Reason Should offensive tower rushing be viable in RTS games?
Dota 2
Official 'what is Dota anymore' discussion
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
Mafia Game Mode Feedback/Ideas TL Mafia Community Thread
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine Artificial Intelligence Thread YouTube Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Where to ask questions and add stream? The Automated Ban List
Blogs
Esports Earnings: Bigger Pri…
TrAiDoS
Thanks for the RSL
Hildegard
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2485 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
11938 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
Replay Cast
23:00
2025 KFC Monthly #3 - Day 2
Liquipedia
The PiG Daily
20:15
Best Games of SC
Clem vs Solar
Solar vs herO
herO vs ByuN
Reynor vs Nicoract
Clem vs herO
Solar vs MaxPax
PiGStarcraft548
LiquipediaDiscussion
LAN Event
18:00
LANified! 37: Groundswell
Discussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft548
CosmosSc2 50
PiLiPiLi 20
StarCraft: Brood War
Calm 4204
NaDa 40
ivOry 9
Dota 2
syndereN341
monkeys_forever309
League of Legends
JimRising 0
Counter-Strike
PGG 70
minikerr36
Super Smash Bros
hungrybox490
Other Games
summit1g11684
tarik_tv4609
C9.Mang0218
ViBE62
PPMD20
Organizations
Other Games
gamesdonequick717
StarCraft 2
CranKy Ducklings122
Dota 2
PGL Dota 2 - Main Stream120
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 20 non-featured ]
StarCraft 2
• Berry_CruncH95
• Hupsaiya 88
• HeavenSC 33
• davetesta31
• LaughNgamezSOOP
• AfreecaTV YouTube
• sooper7s
• intothetv
• Migwel
• Kozan
• IndyKCrew
StarCraft: Brood War
• Azhi_Dahaki48
• RayReign 24
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota21296
League of Legends
• Doublelift5119
• HappyZerGling115
Other Games
• Scarra1378
Upcoming Events
Replay Cast
7h 27m
WardiTV Korean Royale
10h 27m
OSC
15h 27m
Sparkling Tuna Cup
1d 8h
WardiTV Korean Royale
1d 10h
Replay Cast
1d 22h
Wardi Open
2 days
Monday Night Weeklies
2 days
StarCraft2.fi
2 days
Replay Cast
2 days
[ Show More ]
Wardi Open
3 days
StarCraft2.fi
3 days
PiGosaur Monday
3 days
Wardi Open
4 days
StarCraft2.fi
4 days
Replay Cast
4 days
The PondCast
5 days
Replay Cast
5 days
Liquipedia Results

Completed

SOOP Univ League 2025
RSL Revival: Season 3
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
CSCL: Masked Kings S3
Slon Tour Season 2
META Madness #9
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
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.