Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schnarchnase advanced shopping lib #18

Open
wants to merge 19 commits into
base: Community
Choose a base branch
from

Conversation

Schnarchnase
Copy link

Advanced Shopping Library
new DoCourierUpgrade-function
Changed some Pregame-stuff
Disabled debug info

fixed a ward purchaise bug on Witchslayer
@ghost ghost assigned Kairus101 Jul 12, 2013
@Schnarchnase
Copy link
Author

Ty so far. Shall I do the changes immidiently or shall I wait for you?

You should be working on the submission version and not on the initial commit :)

@Kairus101
Copy link
Contributor

I don't mind, you can do either, you will most likely find it easier to do all of it at once, once I've done a full pass over it :)

Schnarchnase and others added 2 commits July 28, 2013 18:23
-Moved Reservations to teambotbrain (wanted them in shopping for easy
testing (no teambot handling...)

-fixed Witchslayer's itembuild (renamed variable)

-Renamed a lot of stuff

-fixed DoCourierUpgrade-function: wasn't working without
courier-parameter

-fixed GetSlot (Patch killed it)

-
@Kairus101
Copy link
Contributor

What I'd like is for all bots to have this automatically added to bots, with the default parameter, by replacing the current shopping. Bots can then change things about shopping lib via shopping.bCourierCare = 1 etc
This means removing the old shopping and replacing with your code - even crudely, I don't mind. Then it will be very, very close to approval, I'll just need to test it slightly more.

You'll need to go through all of your variables and make sure they have their type before the name, like nCost etc, S2 is VERY strict on this, and there are still quite a few that don't have them.

@Kairus101
Copy link
Contributor

So like, a comment in behaviorLib which has all shopping removed, and instead just says, view advancedShopping.lua etc

@Schnarchnase
Copy link
Author

There are a few major flaws in it :/

After testing some stuff:

  1. Shared Consumables (Wards) --> Bots need to know wat to do, when they get unrequested items (General behavior for ward placement? Put it back into cour?)
  2. Puzzlebox --> The workaround is pretty ugly and in general Cooldown-based items should be covered per API to prevent warnings and proper implementation (itemDef:IsInStock or itemDef:IsPurchaseble)
  3. item ownership --> I'll track the current used courier slots (inventory), because i don't know the items ownership (bots can put other bots items into their own stash - API Request?).
  4. Courier-loss : Items on the courier get lost, because bots can not pick up items on the ground (API Request)

(forgot 1 or 2 points though)

It seems to not work well in current matches, when people buy wards in courier / kill courier with bots items. This will happen frequently in human matches, so we should take a look for a better solution. While 2 and 3 are "minor" problems, 1 and 4 are crucial

@Kairus101
Copy link
Contributor

I'm not concerned about the puzzlebox fix nor shared consumables, simple, we disable wards for now - because bots can't use em. Hopefully bots storing others items in their own stash should be fixed soon. Courier-loss is a pain, but it isn't your problem, let someone else do that, or do it yourself after this has been approved :)

Schnarchnase and others added 9 commits October 10, 2013 03:28
till 780 (this version is NOT working)
FindItems() into botbraincore;
Removed shopping in behaviorlib
Set utility values for 'Don'tBreakChannel' and 'Pregame'
Fixed obvious code bugs in default
Find items and courier use seems to work just fine on default bots
Bug-Fix Setup function (setting things  to false)
Bug-Fix Item-Loss (Repurchase components)
@Schnarchnase
Copy link
Author

Okay I'm done so far. Fixed a little issue while further testing.

Have fun :)

@Kairus101
Copy link
Contributor

Don't worry about Mallocs comment, if need be I'll fork your branch when it is done and apply changes so it'd be a clean merge.
I have started testing and it is looking good so far, however I would like magmus, flint and witchslayer to override the current bots (it is either that or delete them, but I would rather the community have something to look at, and something for me to test with) So, fix all references to the now non-existent "advancedShoppingLib.lua" and replace the current bots with your example bots :)

ShoppingLib:
-Bug-Fix: rare purchase error (Firebrand into Dawnbringer syndrom)
-comments

Example bots removed
-Now sells the lowest value instead of the highest...

-update database after each purchase (consumables issue)

-gravekeeper: adjust tablet and steamboots values slightly
@Schnarchnase
Copy link
Author

Wow, something is really off since the last patch.

I didn't change anything at the purchase timings / courier behavior, but:
-bots buy before spawning in well at game start (first item may drop to stash) (did S2 change some loading stuff?)
-multiple cases of item migration (courier sending items to wrong bots (using couriers delivery(e)-spell) )
-game crashes after ~19 min of botgame (did anyone experience this while testing?)

@Kairus101
Copy link
Contributor

All of that reams really out of whack, I've never had a crash, and items did seem to be working.. O.o

@Schnarchnase
Copy link
Author

Ty for the fast response :)
I'll check my installation tomorrow. good night Sir :)

@Schnarchnase
Copy link
Author

I have found the reason for crashing. It is an endless loop. Due to fail delivery someone else's item may result into our bots invetory/stash.
The bot will try to sell this item later into the game, which causes failure.
"void IUnitEntity:SellBySlot(nSlot)" has no success message. If we try to sell items from courier we re-enter the fill stash opeartion after selling...

A fix will be up shortly, just testing it now.

€: ... Still looking for a item delivery fix

@Kairus101
Copy link
Contributor

Nice find :)

-Checking for item definition, if it matches with the input
-better autobuy reliability
@Anakonda Anakonda closed this Nov 6, 2013
@Kairus101 Kairus101 reopened this Nov 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants