Home   Help Search Login Register  

Author Topic: Proper landingzone  (Read 4445 times)

0 Members and 1 Guest are viewing this topic.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Proper landingzone
« Reply #15 on: 03 Jun 2006, 16:41:41 »
Well, you need to compensate the gravity during flighttime and before the object is automatically erased. In a similar way as do the prototype script, try to update the vertical velocity component periodically. While testing, I would use "Shell73" instead of the bullet object, so you have more flight time available and uncomment the switchCamera line to follow the round while moving.

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re: Proper landingzone
« Reply #16 on: 07 Jun 2006, 10:07:36 »
Just before OFPEC went down I started on a script (suite of scripts and functions) to do this.  I've been waiting for OFPEC to be back to submit this.  The scripts and functions have descriptive headers, but if you have any questions just let me know and I will be glad to help you implement it. Here is what it can do:

Finds an LZ of a size you specify, in a search area you specify, with a slope that you specify.  It also makes sure the area is not in forest, not over water and not over other obstacles (buildings, trees, etc.).

To use it just put the Find_LZ folder in you mission folder, then in your init.sqs put this line:

[] exec "Find_LZ\find_LZ_init.sqs"

Once the Editor Depot is up and running I will submit a more formal version with a test mission and all.

Also, I made a script called fastland.sqs that forces a chopper to land where you want.  So you can use the above to find the LZ , then use fastland to make the chopper actually land there. It is not in this folder and I cannot find it now.  I will search for that tomorrow and add that as well.

See post below for newer version of find_LZ
« Last Edit: 08 Jun 2006, 03:33:07 by Raptorsaurus »

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: Proper landingzone
« Reply #17 on: 07 Jun 2006, 10:46:34 »
Thanks mate, but I did read your topic, and if you still define if a unit is in a forest or not from how high the object is above ground (difference in height from object to a another object that is placed there) I'm afraid it won't work. I also noticed the difference in height, so I ran a random loop to see how high certain objects are over ground (did this on a none-offical island). It showed that the forest parts used was from 0.4 m to 40-50 m above ground, while other objects were from 0.1 m to 18 m above ground :-\ On the island I most likely will need this it won't work too well. Though, I will try the script and see how well it works later on...too tired ATM :P

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re: Proper landingzone
« Reply #18 on: 08 Jun 2006, 03:32:03 »
I found a new way to determine if a unit is in a forest.

The find forest function does not use altitude to determine a forest.  Rather it uses the distance to a gamelogic placement.  It so happens that when the game logic is place at the location of the forest, the distance is always in the range 6.8 to 6.9 for the small tree forests and in the range 11.9 to 12.5 for the large tree forests. I am attaching the find_LZ folder, this version now has a demo mission. Also, it include the fastland.sqs script which will make a chopper land precisely where you want (even in a bad area if that is what you want).

What island are you using?  If it has new forest models, then I can modify the find forest function to work with those models as well.

[attachment deleted by admin]
« Last Edit: 08 Jun 2006, 03:35:48 by Raptorsaurus »

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: Proper landingzone
« Reply #19 on: 08 Jun 2006, 13:30:57 »
Using A Shau by Hawkins, but it's not released yet :-\ I'll give it a shot today and see how it works. Thanks mate :)

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: Proper landingzone
« Reply #20 on: 08 Jun 2006, 18:40:34 »
I've just tested it, and it won't work. I edited the overforest function to give back _cdis and put it in a hint. First of all the difference it gives back is usually 4.2 or 19.2, but it's sometimes 3.3, 0.3, 0, 11 etc. It changes too much to really be able to find a good spot. I tried putting new numbers into the function and check. It worked good in hilly areas, but it doesn't work at all on flat areas. There it gives back forest as a proper LZ because _cdis is either 0 or 11. If it was just 11 it wouldn't be a problem, but when it's 0 too, it won't work, cause then the script will think flat areas are forest too (or that forest is a good landingzone).

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re: Proper landingzone
« Reply #21 on: 08 Jun 2006, 22:31:20 »
Sorry to hear that it does not work with that island. :(  I tested it on all the BIS islands and it works fine.  Maybe there might still be a way to make it work.  I wonder why the values vary so greatly?  Maybe examining the actual forest models would help.  Do you know what forest models are used? I would like to have a look those and the island as well. I designed the overforest function by examining the BIS forest models.  That is why for instance the _z value is 18 in the nearestobject check, and why 36 is added to the user entered _rad (to make sure even areas near the edge of the forest would still be counted as overforest).  If the forest models used on the island are smaller or larger, then the search algorithm may have to be adjusted accordingly.  I would make the current function a check for BIS_forests and the new function a check for A_Shau_Forests.
« Last Edit: 08 Jun 2006, 22:56:15 by Raptorsaurus »

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: Proper landingzone
« Reply #22 on: 09 Jun 2006, 01:08:07 »
I'll send you a message (if I remember) when he releases the island. I think all the forest parts he's using is custom made and not yet released. So you'll have to wait for the island :-\ One solution to why the z value vary so much may be because he's placed these grassfields at the same spot at the forest some places. The forest I checked and got 0 back had grassfields in it (I think).

The forest parts are 50*50 m. I changed the _rad a bit to make it set the LZ outside forests in the areas it did work.

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re: Proper landingzone
« Reply #23 on: 09 Jun 2006, 02:42:33 »
The grass in the forest should not bother the function.  That is why I do a nearestobject at 18 m above ground, that way, the forest is always closer than stuff on the ground.  But if the grass and forest models have their origins the same distance from the ground, then that could be causing problems.  There is another completed A Shau Valley island at OFPNAM.com that has very high user ratings. Just for kicks I am going to test that island. If it works on that island, maybe you can use that one instead of Hawkins?

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Proper landingzone
« Reply #24 on: 09 Jun 2006, 09:24:28 »
Raptorsaurus, independently of the result (working or not) of the script, the idea itself is EXCELENT.

Offline Garcia

  • Members
  • *
  • Leeds United is the best football team...EVER!
Re: Proper landingzone
« Reply #25 on: 09 Jun 2006, 15:13:13 »
hmm...I dunno wtf was up yesterday when I tested only the overforest function...it seems to be working ok now. I changed the value in the function to be in a forest if _cdis was higher than 10...seems to work fine now. Though I have to find a proper _rad now. Not 100% happy. It seems to ignore good LZs because they're too close to the forest. So gonna fiddle around with that value. Though I got 1 problem. Since this is a vietnam island, there's shitloads of forests here. So when I search for a LZ in the middle of the jungle, it doesn't find a good LZ (thank god :P), but after some time it stops searching and "finds" a LZ somewhere long away from where I wanted the LZ, and sometimes in the middle of a forest. So what I need is to know where I can tell the script to actually search until it finds a good LZ, so it doesn't timeout and just find a LZ on a random spot on the map :)

Offline Raptorsaurus

  • Editors Depot Staff
  • *****
Re: Proper landingzone
« Reply #26 on: 09 Jun 2006, 21:02:10 »
I am glad it is working a little bit better.

The default search radius is 300 m in the AIland.sqs in the demo mission.  The way it currently works is; if no LZ is found in the original 300 m rad, then it searches in the next 300 m radius area centered at the choppers current circling position (the chopper circles the area while searching for an LZ. It repeats this until an LZ is found.  The best thing to do is find out what the worst case radius is (for the largest forest area) and then use that value (+ a little extra) for the search radius.  Also, with the Black Hawk chopper, you can get away with 15 m radius LZs so it has a better chance of finding LZs between non-forest trees and ground obstacles.  This will also help it accept areas close to the edge of the forest.

Last line of AIland.sqs:
Code: [Select]
[_craft, _pos, _LZrad, 8, 300, _mk, _code0, _cond, _code1, 3, _code2, 0, [_leaders, _units] ] exec "Find_LZ\find_LZ.sqs"
change 300 to 500 or whatever you find necessary:
Quote
[_craft, _pos, _LZrad, 8, 500, _mk, _code0, _cond, _code1, 3, _code2, 0, [_leaders, _units] ] exec "Find_LZ\find_LZ.sqs"

In the search_LZ_map_click.sqs change the last line:

Quote
[chopper, _pos, 20, [player], _mode, "RPT_LZ"] exec "AILand.sqs"

to:

Quote
Quote
[chopper, _pos, 15, [player], _mode, "RPT_LZ"] exec "AILand.sqs"

Also, in the overforest function, you might want to change the value that is added to _rad (at the begining of the code body) I add 36 to whatever value _rad has.  I did this to prevent the chopper from landing on the corrner of the square bis forests (the worst case corner to center in BIS forests is 36 m).  If the Nam forests have more rounded edges, then you might be able to change this value to 25 (for 50 m diameter round forests that should work fine, but play arround with the value).

Change this line in overForest.sqf:
Quote
_rad = (_this select 1) + 36;

to:

Quote
_rad = (_this select 1) + 25;
« Last Edit: 12 Jun 2006, 08:53:07 by Raptorsaurus »