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

Mission 1-3 goto() bug #732

Closed
Smok94 opened this issue Mar 16, 2016 · 19 comments
Closed

Mission 1-3 goto() bug #732

Smok94 opened this issue Mar 16, 2016 · 19 comments
Assignees
Milestone

Comments

@Smok94
Copy link
Contributor

Smok94 commented Mar 16, 2016

Try code:
object o = radar(BlackBox); goto(o.position);
Returns error: Location is occupied, so robot can't get to blackbox.

@tomangelo2
Copy link
Member

Couldn't reproduce that, robot goes to Blackbox like it should.
Do you have dev or release build?

@krzys-h
Copy link
Member

krzys-h commented Mar 16, 2016

goto() is known to be sometimes unable to find a path even if it's clearly there. Moving the bot around usually helps. We don't know what causes that yet.

@Smok94
Copy link
Contributor Author

Smok94 commented Mar 16, 2016

Version master 0.1.6 (more stable). It happens even i paste this code to my Wheel Grabber right after mission start. It happens for Tracked Grabber to. goto() is very high level function in my opinion, but sometimes get stuck or choses path in the way we don't want. It would be nice to see this function lower level components as Cbot functions, so we would be able to easily customize "goto".

@tomangelo2
Copy link
Member

goto() alghoritm will be rewritten in future.

@melex750
Copy link
Contributor

I think goto() finds GoalArea object and thinks it's occupied by BlackBox.

similar to:
int types[] = {Converter, Titanium};
object[] obj = radarall(types); // will return the same object twice. (Two Titaniums)

@Smok94
Copy link
Contributor Author

Smok94 commented Mar 17, 2016

My research so far:
Tried too restart mission many times. I happens every time. Tried to download again and overwrite game files (thought maybe mission file is corrupted). Tried to download and run 32-bit portable version (currently using 64 portable). No effect. If i pick up and drop BlackBox i place before program starts everything works right. Tried to launch program standing in front of BlackBox (before was picked up) - still nothing. Tried to launch program when robot stands behind BlackBox (between box and transmitting station) and it worked... one time.

@Smok94
Copy link
Contributor Author

Smok94 commented Mar 17, 2016

Trying to reach ExchangeStation and GoalArea with goto aslo makes problem. I think it's may be something about "z" position of objects.

@ghost
Copy link

ghost commented Mar 20, 2016

I just tested this with our older master compilations and I think it's actually something wrong with our official compilation of that unfortunate 0.1.5 & 0.1.6 releases or maybe even with whole current master branch! Latest dev builds and, uh, the 0.1.4 works fine with goto() that was a little corrected by @krzys-h for 0.1.4 release back then as long as I remember, but somehow 0.1.5 & 0.1.6 is almost completely disaster. In the dev branch still it's buggy but not as much unplayable that couldn't find a Black Box in mission 1.3.

I think it's time to verify our final compiling methods or master branch, it's looking mysterious...

@ghost ghost added this to the alpha-0.1.7 milestone Mar 20, 2016
@ghost
Copy link

ghost commented Mar 20, 2016

It's working in latest pre-0.1.7 dev builds so I think this issue can by related to this milestone and officially closed. I hope 0.1.7 master will not repeat the same mistakes again :) .

@ghost ghost closed this as completed Mar 20, 2016
@tomangelo2
Copy link
Member

To check that someone have to build that as a Release build, then test it. Release builds have -O3 flag, that might do some optimizations making goto() alghoritm less reliable.

@krzys-h
Copy link
Member

krzys-h commented Mar 20, 2016

I did test that some time ago, goto() is actually a bit more reliable on release builds because it calculates faster so it sometimes manages to finish before the command times out

@ghost
Copy link

ghost commented Mar 20, 2016

@krzys-h I don't get that. How goto() in release builds is more reliable when it refuses to goto'ing to position of the objects more often than in dev builds? I personally prefer to wait some more time for calculating precise way to objects than wait a second and often get ridiculus message that object is inaccessible from very beginning of the program. Stability > speed.

@krzys-h
Copy link
Member

krzys-h commented Mar 20, 2016

Stability SHOULDN'T differ between debug and release, the speed (and therefore allowed complexity of the path before it assumes there is no valid one) does, and the speed is BETTER in release builds. This is confirmed by testing I did some time ago.

@ghost
Copy link

ghost commented Mar 20, 2016

Ok, so why it stops the program instead of trying it's best to find the way in such obvious cases like this? IMO it only makes it less reliable and you can't even use this for example in Diversity contests.

@krzys-h
Copy link
Member

krzys-h commented Mar 20, 2016

Like I said previously, I have no idea why it fails in such obvious cases. I only know why debug vs release build matters in more complex paths.

@krzys-h krzys-h reopened this Dec 4, 2016
@krzys-h
Copy link
Member

krzys-h commented Dec 4, 2016

I did some testing yesterday and found a commit which caused this

@krzys-h
Copy link
Member

krzys-h commented Dec 4, 2016

No idea what actually caused it to fail after this commit, I'll look into that later

@krzys-h krzys-h self-assigned this Dec 4, 2016
@krzys-h
Copy link
Member

krzys-h commented Dec 4, 2016

It seems to be related to CTaskGoto::SearchTarget. When using std::map, the function returns:
ID=37 BlackBox
but when using std::multimap, it returns:
ID=35 GoalArea

@immibis
Copy link
Contributor

immibis commented Aug 4, 2017

I always wondered how goto knew which object to line up with...

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

5 participants