• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 22:28
CEST 04:28
KST 11:28
  • 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
[ASL20] Ro24 Preview Pt2: Take-Off6[ASL20] Ro24 Preview Pt1: Runway132v2 & SC: Evo Complete: Weekend Double Feature4Team Liquid Map Contest #21 - Presented by Monster Energy9uThermal's 2v2 Tour: $15,000 Main Event18
Community News
Weekly Cups (Aug 18-24): herO dethrones MaxPax5Maestros of The Game—$20k event w/ live finals in Paris30Weekly Cups (Aug 11-17): MaxPax triples again!13Weekly Cups (Aug 4-10): MaxPax wins a triple6SC2's Safe House 2 - October 18 & 195
StarCraft 2
General
Weekly Cups (Aug 18-24): herO dethrones MaxPax What mix of new and old maps do you want in the next 1v1 ladder pool? (SC2) : A Eulogy for the Six Pool Geoff 'iNcontroL' Robinson has passed away 2v2 & SC: Evo Complete: Weekend Double Feature
Tourneys
WardiTV Mondays Maestros of The Game—$20k event w/ live finals in Paris RSL: Revival, a new crowdfunded tournament series Sparkling Tuna Cup - Weekly Open Tournament Monday Nights Weeklies
Strategy
Custom Maps
External Content
Mutation # 488 What Goes Around Mutation # 487 Think Fast Mutation # 486 Watch the Skies Mutation # 485 Death from Below
Brood War
General
No Rain in ASL20? BW General Discussion Flash On His 2010 "God" Form, Mind Games, vs JD BGH Auto Balance -> http://bghmmr.eu/ [ASL20] Ro24 Preview Pt2: Take-Off
Tourneys
[IPSL] CSLAN Review and CSLPRO Reimagined! [ASL20] Ro24 Group E [Megathread] Daily Proleagues [ASL20] Ro24 Group D
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates [G] Mineral Boosting Muta micro map competition
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread General RTS Discussion Thread Dawn of War IV Path of Exile
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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine The year 2050 European Politico-economics QA Mega-thread
Fan Clubs
INnoVation Fan Club SKT1 Classic Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2026 Football Thread TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion
World Cup 2022
Tech Support
High temperatures on bridge(s) Gtx660 graphics card replacement Installation of Windows 10 suck at "just a moment"
TL Community
The Automated Ban List TeamLiquid Team Shirt On Sale
Blogs
Evil Gacha Games and the…
ffswowsucks
Breaking the Meta: Non-Stand…
TrAiDoS
INDEPENDIENTE LA CTM
XenOsky
[Girl blog} My fema…
artosisisthebest
Sharpening the Filtration…
frozenclaw
ASL S20 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 3022 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
11865 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
PiGosaur Monday
00:00
#46
PiGStarcraft444
SteadfastSC140
EnkiAlexander 85
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft444
Nina 199
SteadfastSC 140
NeuroSwarm 129
RuFF_SC2 93
ProTech79
Nathanias 70
PattyMac 21
StarCraft: Brood War
Artosis 791
NaDa 71
Icarus 3
Dota 2
monkeys_forever747
capcasts13
Counter-Strike
taco 158
Super Smash Bros
hungrybox522
Other Games
summit1g8703
tarik_tv8061
shahzam1218
WinterStarcraft583
C9.Mang0398
ViBE253
Maynarde141
Organizations
Other Games
gamesdonequick1063
BasetradeTV19
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• rockletztv 48
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Stunt475
Other Games
• Scarra1073
Upcoming Events
Afreeca Starleague
7h 33m
hero vs Alone
Royal vs Barracks
Replay Cast
21h 33m
The PondCast
1d 7h
WardiTV Summer Champion…
1d 8h
Clem vs Classic
herO vs MaxPax
Replay Cast
1d 21h
LiuLi Cup
2 days
MaxPax vs TriGGeR
ByuN vs herO
Cure vs Rogue
Classic vs HeRoMaRinE
Cosmonarchy
2 days
OyAji vs Sziky
Sziky vs WolFix
WolFix vs OyAji
BSL Team Wars
2 days
Team Hawk vs Team Dewalt
BSL Team Wars
2 days
Team Hawk vs Team Bonyth
SC Evo League
3 days
TaeJa vs Cure
Rogue vs threepoint
ByuN vs Creator
MaNa vs Classic
[ Show More ]
Maestros of the Game
3 days
ShoWTimE vs Cham
GuMiho vs Ryung
Zoun vs Spirit
Rogue vs MaNa
[BSL 2025] Weekly
3 days
SC Evo League
4 days
Maestros of the Game
4 days
SHIN vs Creator
Astrea vs Lambo
Bunny vs SKillous
HeRoMaRinE vs TriGGeR
BSL Team Wars
4 days
Team Bonyth vs Team Sziky
BSL Team Wars
4 days
Team Dewalt vs Team Sziky
Monday Night Weeklies
5 days
Replay Cast
5 days
Sparkling Tuna Cup
6 days
Liquipedia Results

Completed

CSLAN 3
uThermal 2v2 Main Event
HCC Europe

Ongoing

Copa Latinoamericana 4
BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Qualifiers
ASL Season 20
CSL Season 18: Qualifier 1
Acropolis #4 - TS1
CSL Season 18: Qualifier 2
SEL Season 2 Championship
WardiTV Summer 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025

Upcoming

CSL 2025 AUTUMN (S18)
LASL Season 20
BSL Season 21
BSL 21 Team A
Chzzk MurlocKing SC1 vs SC2 Cup #2
RSL Revival: Season 2
Maestros of the Game
EC S1
Sisters' Call Cup
IEM Chengdu 2025
PGL Masters Bucharest 2025
MESA Nomadic Masters Fall
Thunderpick World Champ.
CS Asia Championships 2025
Roobet Cup 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 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.