Second 0 Posted June 18, 2007 So. Is there anyway to get line of sight from spot A to spot B and detect that is there anything that will break it (mostly conserning buildings). I'm trying to give AI possibility to detect building corners (where AI should then move) so that they could seek for betters positions for firing and watching and maybe even work more cautiously when crossing corners or turning in corners. I'm trying to do it with objects (timed handgrenades) which are set to fly in fast speed (velocity) from A to B and after short time they get deleted... It works somehow but results are gained slowly and they are mostly unreliable (i don't know a way to detect collosion of handgrenade and some object) + It doesn't look or hear very nice when grenades are flying and bounching from walls. Share this post Link to post Share on other sites
Blanco 0 Posted June 18, 2007 Somebody on OFPEC is working on a line of sight script.I'm also looking for a working LOS script/function for my searchlight script. So far he's able to detect the bounderies of a building by the boundingbox command and check if there's something in between two units. Streets, trees and bushes are a problem because the bounding box values are way too large for the object For example, the boundingbox for some of the streetsections are 3m high. Most boundingboxes for trees are too wide. Excluding objects by pd3 names is also a problem because there too many names to check. A lagfree string comparison function to check for substrings is also not avialable at the moment. If BIS would give us some real string functions and a list of unclassed map objects, the situation would be improved. Share this post Link to post Share on other sites
Second 0 Posted June 19, 2007 Bounding box returns extreme points of buildings or objects... If building is more complicated than only a box, L-shaped building forexample, then it cannot determe all corners of building (only extreme points are returned). This is what i am getting with my experiments. Best bet for most reliable info, that i've can think of, is to make object that has these kind properties: -it's velocity is set to [0,0,0] instantly when it hits something. Falls to ground and doesn't bounce anywhere (bullets and grenades aren't very good because of this: low hit-angles causes them to bounce). -It shouldn't be visible and don't have any kind audible data attached. Don't know does velocity of object bring some noise of it's own (don't remeber that did barrels/shut down vehicles at high speeds produce bit of a noise) -It shouldn't damage anything even if it hits objects (soldiers mostly) at speed of 100 or 1000 meters in second. This far i've found that only handgrenade and smokeshells doesn't kill it's target (soldiers and such) when hitting it at high speeds. Then using this object (sending it with setvelocity to it's journey) as surrounding's "low range"-sensor of soldier to detect solid surfaces and free space. Problem with longer distances would be that object falls to ground by gravity and stops. but i need to sensor distances of less than 20 meters. Can that kind system be created to be lag free... Or is there possibility to create that kind of object... So it's highly likely that i need to use that boundingbox+modeltoworld too. Btw: Good luck with your searchlight. Share this post Link to post Share on other sites
whisper 0 Posted June 19, 2007 Perhaps finding a way to fire a laser designator in the direction of your target and check if actual laserTarget ends before or after your intended target, relative to you. If it's "after" (farther away, or same pos), then you have LoS, if it's "before" (closer) then there's an obstacle in between. The "only" issue is finding how to fire this lasertarget Big one, if you ask me. + could perhaps lead to little issues if AI appears to detect the laserTarget and bomb it Share this post Link to post Share on other sites
Second 0 Posted June 19, 2007 Quote[/b] ]The "only" issue is finding how to fire this lasertarget Big one, if you ask me.+ could perhaps lead to little issues if AI appears to detect the laserTarget and bomb it I just tried to use ammo classnamed laserbeam, but it's impossible to be affected with setpos or setvelocity, because of it's simulation-type i'd quess. Right no i'm having self made ammo-addon that uses shotbullet as simulation with no audio, visual properties and not affecting damage of anykind... Only thing is that if it hits object which is man-class, then object suffers from impact: his arms&weapon shake to random direction... No biggie hopefully. And there's tracer visible from ammo and i haven't yet haven't tested it in lowlight conditions EDIT: Disabling tracer isn't big deal i'd quess, but effect of impact might become such, atleast it's very anoying if teammate bombs player with it and player tries to aim something... Need to research more about this. Share this post Link to post Share on other sites
whisper 0 Posted June 19, 2007 That's why you need to use the laser designator launcher itself, because of the simulation type, the laserTarget is kind of instantly on target. Which is better in your case : you don't have to launch an ammo tracker along flight path, just verify laserTarget position relative to you and your target. But, big but, how to fire this laser designator? No clue atm Share this post Link to post Share on other sites
Second 0 Posted June 19, 2007 I didn't found a way to use laserdesignator. but now that addon works like it should: no impact on humans and no tracers. Next thing is to get script compatible with AI... Checking for alleys and streets is being guite a hazzle. Altough they try to do it, but script is too limited at the moment to allow them to do it well... Lots more of optimizing and brainstorming. Share this post Link to post Share on other sites
dmarkwick 261 Posted June 19, 2007 Not much to contribute here, but I did note last night that the occlusion sound effects (how a chopper sounds muffled when behind an object from the player's point of view) is based on something that certainly looks like LOS. Share this post Link to post Share on other sites
Second 0 Posted June 20, 2007 Not much to contribute here, but I did note last night that the occlusion sound effects (how a chopper sounds muffled when behind an object from the player's point of view) is based on something that certainly looks like LOS. And same happens when they target something, they do get LOS. But that is done by 'boundingbox'-command i would quess (same with dynamic sounds)... That might explain lots of their urban-stupidness. As Blanco said they might get values with 'boundingbox' which tells that object is 3 meter high, when to player it seems to be much lower (like 0.5 meters high). Overhauling LOS system complitely... Now that is a challenge I'm getting script somewhat AI-cooperative. Share this post Link to post Share on other sites
Second 0 Posted June 20, 2007 I'm getting script somewhat AI-cooperative. Blah! It freezes fps in combat, because of script(s) tries to take over some parts of AI. Very complicated... Too complicated it seems I'm freezing this project. LOS-thing works well (and that doesn't cause lag ), but trying to get AI to check "blind area's of AI" is't very easy, takes too much resources and effect that AI gains from it is too small: more like eye candy in safe enviroment and deadweight in combat. Not to mention spaces where is lots of "extra" objects like Rahmidi island village's market carden. Has AI has been patched to better urban-warfare-stage in 1.08? They seem to work even better in my limited testings. Share this post Link to post Share on other sites
mr.peanut 1 Posted June 22, 2007 Could you post the results of your LOS work so far? I did code a 2D LOS based on bounding boxes, but roads have 2-3m high bounding boxes and tree bounding boxes are huge! Share this post Link to post Share on other sites
Scrub 0 Posted June 22, 2007 Not sure what you're using this for, but can you use the command for a unit to target something and use the confirmation they have a bead on it for your use? (like in a hull down situation?) Would be very nice to have LOS.. good luck! Share this post Link to post Share on other sites
Maddmatt 1 Posted June 22, 2007 If you are actually trying to change the AI, it would be much better to work with the FSM files. Share this post Link to post Share on other sites
Second 0 Posted June 22, 2007 If you are actually trying to change the AI, it would be much better to work with the FSM files. It was more like experimental project for AI. FSM would do much better, but positive effects of my project were so small to AI that it has no use (more like eyecandy). Requires many AI-features to be "shut down" from AI to make it cooperative and that has severe setbacks. In general: I did create item (bullet) that flies almost like laserbeam (In very straight line). But it goes thru bushes and such. To prevent that from happening, i'd quess that it would require to use laserbeam (laserdesignator's ammo) or objects that uses laser's simulationtype (laserdesignate)... But seems that laser's simulationtype is kinda "locked". No setpos works and no setdir works. And i'm not sure is it even kind like "hidden" from scripter. Doesn't return classname forexample, if my memory serves me well. Hmm... Other thing would be to make invisible object that has laserdesignator as weapon, and it would be used to get LOS. Can that be done? Anyone? Share this post Link to post Share on other sites