Radius param for search() - Printable Version +- Colobot Forum - International Colobot Community (https://colobot.info/forum) +-- Forum: [Archive] New forum (2015-2019) (https://colobot.info/forum/forumdisplay.php?fid=76) +--- Forum: Colobot: Gold Edition Development (https://colobot.info/forum/forumdisplay.php?fid=62) +---- Forum: Game Engine & General Talk (https://colobot.info/forum/forumdisplay.php?fid=63) +---- Thread: Radius param for search() (/showthread.php?tid=740) |
Radius param for search() - melex750 - 03-16-2016 Would be nice for path finding & detecting objects near a point away from the robot. search(cat[, pos][, radius]); And maybe: object items[] = searchall(cat[, pos], radius); I actually already did this myself. RE: Radius param for search() - krzys_h - 03-16-2016 Adding the radius parameter makes no sense to me, it would be better to add all radar() parameters. searchall() is a great idea too RE: Radius param for search() - melex750 - 03-17-2016 I like the idea of using all radar parameters. But using angle and focus might be confusing. Maybe if the search function has an orientation of it's own, direction("search position") could be relative 0 angle for search. So it could be used and calculated in terms of right angles. Radius was just max parameter by a different name. Edit: Or just leave out angle and focus, replaced by position. search(cat, pos, min, max, sens, filter); RE: Radius param for search() - Mrocza - 03-18-2016 Radius for search can be done in a custom CBOT function pretty easily. Returning an array of all objects of certain category is even easier. I bet angular limitations are possible as well. Tho I don't see much of a use for those. You can choose a percise spot to look at anyway. Example: Code: object object::bettersearch(int cat, point pos, float rmin, float rmax) I didn't post in a while now did I? RE: Radius param for search() - melex750 - 03-19-2016 This is similar to what I was doing at first, but it was very slow to call such a function hundreds of times per minute. Which then made creating a path finding algorithm pretty pointless. The game engine already has this functionality, it only needed to be enabled. The A* algorithm I have now, is as fast and even more accurate than goto(). I imagine search() and searchall() as being built-in functions of the satellite that is usually in orbit above your position. |