Space Engineers

Space Engineers

此物品与 Space Engineers 不兼容。想知道为什么此物品不能在 Space Engineers 中使用,请查看指导页面
评价数不足
Attack Drone AI Script V0.13 (No longer compiles)
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
6.668 KB
2015 年 5 月 12 日 下午 7:49
2015 年 8 月 6 日 上午 7:30
7 项改动说明 ( 查看 )

订阅以下载
Attack Drone AI Script V0.13 (No longer compiles)

描述
*Updates broke the script and since I'm not really into SE anymore I won't be fixing it. Leaving it here as example though.*

This is a AI script for a fully autonomous attack drone.

To start off, I suggest using my small attack drone frame. It is is preconfigured for the script and can be found here:
http://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=441893688

Feedback is very welcome!
What features do you want?
Do you know any ways to make the current features better?
Rate for publicity!

==============================================================

Features:
- Can detect and engage enemies within 50m, but will chase beyond that. (sorry, max sensor range)
- Will turn front toward enemies (fast and accurate if configured correctly) and start to fire.
- Target leading when firing and correction for shell speed.
- Will attempt to keep the target at about 35m (by default).
- Will not move through obstacles, and will try to go around them (by going left or right).
- Will orbit the target.
- Will target functional blocks, not armor.
- Option to select what kind of blocks will be targetted.
- Configurable by settings at the top of the script.
- Picks the first working block, so if you have multiple it will pick another block if the one it was using is destroyed.
- Will tell you what block is missing in the programmable block GUI (through exceptions).
- Will not shoot friendlies with default range settings (50m). Because of max sensor range if set to shoot at targets more than 50m away friendlies may still be shot.

Planned features (If I feel like it in the future):
- Ability to navigate to given coordinates (waiting to see if autopilot gets updated to a more useful state for scripts).
- Engaging targets based on their antenna / beacon?
- Communication with friendly drones?

Known Issues:
- The drone may not be able to avoid obstacles other than the target at high speeds, as sensors only have 50m range.
- General 50m sensor range problems.
- Sensors only provide the drone with *one* target, this means the drone has no real control over what to engage. It has to wait (goes to idle mode) for the sensor to switch to a new target if the current target isn't satisfactory.

==============================================================

Changelog (v0.13):
- Added selective targetting of blocks (only guns or power gen atm).

Changelog (v0.12):
- Updated drone to target the first functional block it finds on the enemy, instead of the center. (The bounding box of a ship didn't update as you shot it up)
- Ignores targets without functional blocks.

Changelog (v0.11):
- Made drone target the center of the craft rather than the origin.
- Made drone aware of the size of the target (important when slowing down from high velocities).

Changelog (v0.1):
- Improved navigation and targeting (by alot)
- Added a bunch of settings and explanations at the top of the file.
- Added Ability to chase targets that have been detected by the sensor even if they leave the sensors range.
- Added simple maneuvering around objects.
- The script now shows an error message in the programmable block if a required block isn't found.
- Added friendly fire avoid.
- Added target leading when firing and correction for shell speed.

==============================================================

Usage:
Install the script on a ship that has all the required components.
Set the ownership of all blocks (otherwise the drone will attack you).
Modify the settings at the top of the file (if you want).
Recompile the script and run it.
Have a timer block that starts the program and starts the timer itself at 1s.

Required Components (drone may function without some of these, but with less functionality):

- Gatling Guns (may be multiple):
Name must contain "[Gun]" and the "shoot" option must be on. (turn the gun itself off first though).

- Gyroscope (may be multiple):
Name must contain "[Gyroscope]" and the "override controls" option must be checked. Must also be placed on the floor with the little round thingey facing to the front.

- Sensor for enemies:
Name must contain "[Sensor Enemies]", set it to max range and whatever you consider to be an enemy.

- Sensor for friendlies:
Name must contain "[Sensor Friendlies]", set it to max range and whatever you consider to be a friendly.

- Sensor Up:
Collision sensor for the "up" direction, name must contain "[Sensor Up]". Must be in a line above the Enemy Sensor.

- Sensor Right:
Collision sensor for the "right" direction, name must contain "[Sensor Right]". Must be in a line right of the Enemy Sensor.

- Sensor Front:
Collision sensor for the "front" direction, name must contain "[Sensor Front]".

- Sensor Back:
Collision sensor for the "front" direction, name must contain "[Sensor Back]".

- Sensor Left:
Collision sensor for the "front" direction, name must contain "[Sensor Left]".

- Sensor Down:
Collision sensor for the "front" direction, name must contain "[Sensor Down]".

- LCD / Text panel (Multiple should work, but I think there's a bug in the game with it):
Name must contain "[Program Screen]", set public text to show for some info.

- Timer:
Name must contain "[Program Timer]". This timers action should be to run the programmable block and start it's own timer at 1s (can be more if you like).

- Thrusters in the back (may be multiple):
Name must contain "[Thruster Back]"

- Thrusters in the front (may be multiple):
Name must contain "[Thruster Front]"

- Thrusters on the left (may be multiple):
Name must contain "[Thruster Left]"

- Thrusters in the right (may be multiple):
Name must contain "[Thruster Right]"

- Thrusters in all Up/Down dir:
The program doesn't use these yet, but the drone needs it for the dampeners.

- Programmable block, enough reactors, might wanna have an antenna:
The obvious stuff.