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

Better bot movement #4751

Closed
rawgni opened this issue Aug 26, 2016 · 13 comments
Closed

Better bot movement #4751

rawgni opened this issue Aug 26, 2016 · 13 comments

Comments

@rawgni
Copy link
Contributor

rawgni commented Aug 26, 2016

Short Description

Human does not go through building and bot shouldn't too.

Currently, the bot destination is being decided on every tick(), ie. the destination can change between tick. It will just get the nearest fort and take the shortest route (usually, straight path).

Possible Solution

Bot should decide which destination to go to, ie which fort to visit next, and stay that way until there is a reason to do so. Once the destination is fixed, we get the direction through Google Direction API. We can then continue using the current algorithm to move through the coordinates returned by the API. This will make sure we are walking on the road and not through buildings.

@k4n30
Copy link
Contributor

k4n30 commented Aug 26, 2016

@rawgni love the FR, but unless you intend on developing both of these, do you mind splitting them into 2 separate feature requests, because although they are related, they do not need to be achieved together and therefore one could be met independently of the other

@Lntnam
Copy link

Lntnam commented Aug 26, 2016

Google direction API doesn't work for a very short distance, i.e. it will just tell you to walk straight to the destination. Hence when two pokestops are close to each other, direction API won't help.

Altitude algorithm is important though. I too believe that randomizing the altitude is not a good choice because one's altitude should not keep jumping up and down unless you're walking in a mountain jungle. Change in altitude should happen gradually, or once after every few hundred meters.

@rawgni
Copy link
Contributor Author

rawgni commented Aug 26, 2016

@lntn I am not sure what you mean by not work. Are you saying that if the pokestop is close to each other , you shouldn't walk straight to it ?

@Lntnam
Copy link

Lntnam commented Aug 26, 2016

@rawgni what I mean is Google maps and its API is not accurate down to every meter, or at least the distance from where you can spin a pokestop. If you do a map search, it will only show you the direction (driving/walking) to the nearest road point, then tell you to walk over to your destination. This walking over part likely to be through building.

Another possible issue is walking direction API only work perfectly for a few country. If there happen to be flyover, bridge, highway, expess way etc... the direction API may mess it up and may tell you to walk/drive a few km for an exit & u-turn.

@rawgni
Copy link
Contributor Author

rawgni commented Aug 26, 2016

@lntn If the pokestop happens to be far from road point, then we can't stop it from walking through building. A human would probably need to get off the road to do the same.

I would think direction API will be quite accurate for most location that people bot in. Does it really matter if the bot ask you to drive a few more km for an exit ?

screen shot 2016-08-26 at 11 57 33 am
Check out the screen shot above. The red line is for train tracks, the blue line is for road.
The bot is basically crossing the train track, passing through a couple of houses to get to the other side of the road and back.

@mjmadsen
Copy link
Contributor

This can be achieved through using path.json

Applying it to all walkers would be rather difficult. But still a FR regardless. In the mean time, try to setup the dedicated paths.

@rawgni
Copy link
Contributor Author

rawgni commented Aug 26, 2016

@mjmadsen yep it's achieveable using path.json but wouldn't be nicer if we could do it without. not everyone wants/knows how to generate a path.json

Initially, i thought why can't we have the bot spawn at a position. look at all the available forts in the area, plans the route it wants to take for the day and execute it.

@mjmadsen
Copy link
Contributor

Yeah, that's while I'll leave it open as a FR. Once we can get all these basic elements in, it'll be fun to work on AI elements.

@alexyaoyang
Copy link
Contributor

alexyaoyang commented Aug 26, 2016

Using google direction api is already implemented with Polyline walker. Use polyline walker with FollowPath and you get this:
screenshot 2016-08-23 at 6 48 55 pm

@rawgni
Copy link
Contributor Author

rawgni commented Aug 27, 2016

@alexyaoyang this FR wants it to not have to depend on followpath. please read my reply to @mjmadsen above

@alexyaoyang
Copy link
Contributor

alexyaoyang commented Aug 27, 2016

@rawgni Hmm ok, the only other move task which allows you to use polyline walker is move to map pokemon for now. As time goes by, the other Follow tasks will implement using polyline walker too.

@th3w4y
Copy link
Contributor

th3w4y commented Aug 27, 2016

@lntn

.get_alt() implements that in the polyline class

Altitude algorithm is important though. I too believe that randomizing the altitude is not a good choice because one's altitude should not keep jumping up and down unless you're walking in a mountain jungle. Change in altitude should happen gradually, or once after every few hundred meters.

@th3w4y
Copy link
Contributor

th3w4y commented Sep 7, 2016

All the points in this issue are already implemented

@th3w4y th3w4y closed this as completed Sep 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants