140 Commits

Author SHA1 Message Date
cim
9aa62fc2bd JSAI: main station AI 2013-07-23 21:21:49 +01:00
cim
e880d8c12c JSAI: defense ship AIs 2013-07-22 23:15:17 +01:00
cim
363d7bbeb2 JSAI: Miner/Scavenger AI (the two are very similar, so one AI can do both) 2013-07-22 21:24:27 +01:00
cim
968eace6db JSAI: shuttle AI 2013-07-21 23:25:41 +01:00
cim
228344c540 JSAIs for Thargoids and Thargons.
Thargons now act as escorts for the warships.
2013-07-21 11:10:47 +01:00
cim
3cbeed8d11 Fix police station patrol behaviour, a few other minor bugs 2013-07-20 09:14:58 +01:00
cim
a4ae37c849 Change autoAIs for more testing what we have so far.
Set trader, pirate, escort, hunter, police AIs to JS by default
2013-07-19 22:51:43 +01:00
cim
5ce15389d6 Adjust waypoint setting methodology
New script method: ship.patrolReportIn(station)
2013-07-19 20:18:53 +01:00
cim
27e76f345f Add police lane patrol AI (acts as both lead and wingman) 2013-07-18 23:00:23 +01:00
cim
5db0182765 More fixes to pirate AI. 2013-07-17 22:44:26 +01:00
cim
99a1fac41e More work on the pirate AI
There's still a subtle bug in the logic somewhere that makes them sometimes return to attacking the player after having been paid off but before picking up all the cargo they've been given.
2013-07-16 22:33:42 +01:00
cim
8372845a9f More pirate AI work
Still not finished...
2013-07-15 23:14:47 +01:00
cim
3e9f6741e7 Make a start on pirate AI (doesn't work yet) 2013-07-14 23:11:25 +01:00
cim
b8da00024b Allow trader AI to make distress calls
JS-sourced distress calls don't automatically dump cargo or flee
2013-07-14 21:28:19 +01:00
cim
34ce5ed934 Add trader AI, more updates to AI library
ship.dumpCargo can now take optional number of items to dump (not for player ship)
2013-07-14 19:02:16 +01:00
cim
0e69dae8f4 Add escortAI, update and debug AI library, system.stations property 2013-07-13 23:18:05 +01:00
cim
3cdd7af7b1 Bounty hunter AI in JS 2013-07-13 19:13:30 +01:00
cim
9847b2fc45 Initial commit of priority-based AI library 2013-07-12 19:44:14 +01:00
cim
43f2efdcfb Merge branch 'master' into javascript-ai
Pull in coordinate precision
Fix Conflicts:
	src/Core/Entities/ShipEntity.m
2013-07-11 21:22:14 +01:00
cim
e9eae059c6 Allow ships to have JS-script-based AIs
AI will receive Javascript events shortly after main ship script does. JS AI shi
ps use nullAI.plist as their state-machine AI for simplicity. Likewise there is a nullAI.js which does nothing for ships with plist AIs.
2013-07-10 21:29:08 +01:00
cim
6d12aa177e Make navigation buoys rotate again 2013-07-03 17:43:49 +01:00
Chris Morris
3d6ceaf44e Adjust missile detonation for better compatibility with 1.76 code
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5604 127b21dd-08f5-0310-b4b7-95ae10353056
2013-01-05 16:28:11 +00:00
Eric Walch
731a74d62e Fixed some oddities with scooped and than released escapepods.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5594 127b21dd-08f5-0310-b4b7-95ae10353056
2012-12-29 10:19:33 +00:00
Chris Morris
6cf87ddc2a Fix some speeds in attack routines.
Make sure pirate escorts will redeploy properly in extended fights


git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5166 127b21dd-08f5-0310-b4b7-95ae10353056
2012-08-05 12:06:20 +00:00
Chris Morris
ae84915d19 Some AI changes and related tidying:
1) Make pirates with full holds (and other offenders using route1traderAI) less likely to go to main station, especially not fugitives. (Expansion of changes from r4770)
2) Experimentally ensure always at least one rock hermit in all non-nova systems. If normal generation does not place a hermit, one is added well away from all spacelanes.
3) New "ATTACKER_MISSED" AI event for when a ship tried to shoot a laser at its target but narrowly missed. Many stock AIs modified to treat this as a hostile action.
4) Tidy function/property names in docking code
5) Add checks for cloaking in some AI routines
6) Use weak refs rather than universal ID for targeting, and clean up


git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5144 127b21dd-08f5-0310-b4b7-95ae10353056
2012-07-29 20:21:11 +00:00
Eric Walch
0167b32938 - Added a new AI command 'setDestinationToJinkPosition'
- Updated several AIs with reaction to cloaked attacks.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4954 127b21dd-08f5-0310-b4b7-95ae10353056
2012-05-22 20:06:21 +00:00
Eric Walch
27bb46cacd - Added two new AI commands: 'storeTarget' and 'recallStoredTarget'
- Used both commands in pirate and missile AI for a better reaction on cloaked targets.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4941 127b21dd-08f5-0310-b4b7-95ae10353056
2012-05-16 12:46:14 +00:00
Eric Walch
6486df01b7 - Fixed compiler error on macs.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4915 127b21dd-08f5-0310-b4b7-95ae10353056
2012-05-08 07:54:13 +00:00
Jens Ayton
60f04a0867 Tweaked some Xcode file attributes and added terminal line breaks to make Unix tools happy.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4906 127b21dd-08f5-0310-b4b7-95ae10353056
2012-05-05 10:18:58 +00:00
Eric Walch
86bc4b2c36 - Added RESTARTED messages to some of the AIs that use the new fleeQMineAI to prevent leaving the ships idle.
- also added the q-mine warning inside becomeEnergyBlast so that custom q-mines also give a warning, albeit later.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4903 127b21dd-08f5-0310-b4b7-95ae10353056
2012-05-03 20:34:19 +00:00
Chris Morris
052f596e61 Improvements to (mostly Thargoid) AIs
Bug fixes:
1) Giving a ship an aft Thargoid laser and a forward Thargoid laser
   now has a different effect to giving it just a forward Thargoid
   laser. (It gives it double attack power with its laser; use sparingly!)
2) Thargoid laser rate of fire no longer depends on the frame rate.

AI upgrades:
1) Pilots with fear will attempt to flee from Q-Mines at top speed
2) Pilots without fear will attempt to blow up Q-Mines, then avoid the
   cloud if unsuccessful.
3) Ships with a Thargoid laser fitted will use the fact that they have
   an omnidirectional laser to their advantage in combat.
4) Ships with multidirectional weapons (thargoid lasers, plasma
   turrets) can now track multiple targets with those weapons, which
   need not be the primary target, and use these weapons as point
   defense. New AI commands have been added for optimal use of point
   defense, but even old AIs will do reasonably well.

New AI commands:
1) "addPrimaryAggressorAsDefenseTarget"
2) "addFoundTargetAsDefenseTarget"
3) "findNewDefenseTarget"
4) "clearDefenseTargets"

New AI alerts:
1) DEFENSE_TARGET_LOST
2) DEFENSE_TARGET_DESTROYED
3) CASCADE_WEAPON_DETECTED


git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4899 127b21dd-08f5-0310-b4b7-95ae10353056
2012-05-02 20:08:54 +00:00
Eric Walch
4038d0a9ec - experimentel, harder hardMisileAI. Does not explode when target cloaks, but instead travels to the spot were target cloaked.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4872 127b21dd-08f5-0310-b4b7-95ae10353056
2012-04-21 19:52:36 +00:00
Eric Walch
01a3b5c29b added cim's new missile script also to mac builds
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4863 127b21dd-08f5-0310-b4b7-95ae10353056
2012-04-20 07:32:19 +00:00
Chris Morris
590b2b407f Better way of setting and calculating missile damage
- revert r4853 changes to dealEnergyDamageAtDesiredRange
- instead, introduce ship.dealEnergyDamage(damage,range)
- apply new function to stock missiles, change default ship script for missiles


git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4861 127b21dd-08f5-0310-b4b7-95ae10353056
2012-04-19 20:05:30 +00:00
Eric Walch
14ec5bedc9 No longer shuttle launches from additional planets without nearby stations.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4852 127b21dd-08f5-0310-b4b7-95ae10353056
2012-04-14 20:58:44 +00:00
Eric Walch
79b17ebcef Added
- new behaviour BEHAVIOUR_LAND_ON_PLANET that takes care of the whole landing and removal.
- AI command: performLandOnPlanet. Works only very close (500 meters) to the planet surface were APPROACHING_SURFACE has be send. Otherwise returns: NO_PLANET_NEARBY
- ship event: shipLandedOnPlanet(planet)
- changed the old AI message LANDED_ON_PLANET from normal to reactToMessage.  The normal one never triggered because of ship removal in the same update.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4844 127b21dd-08f5-0310-b4b7-95ae10353056
2012-04-13 07:43:38 +00:00
Eric Walch
cb9e2a2cee - On scooping the cloak, the cloak now becomes repairable in tech level 15 systems.
- Improved the docking approach when arriving from the backside of a station.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4800 127b21dd-08f5-0310-b4b7-95ae10353056
2012-03-10 15:19:44 +00:00
Eric Walch
6fd5701273 - added two AI commands: setTargetToRandomStation and setTargetToLastStation.
- setTargetToRandomStation will select a random station from all stations within 'desiredRange'. Carriers and stations without npc_traffic are excluded. It returns "NO_STATION_IN_RANGE" or "STATION_FOUND"
- setTargetToLastStation sets the primary target to the last selected station. It returns "NO_STATION_FOUND" when the last station lo longer exists.
- Updated the route1traderAI.plist so that ships with bounty no longer go to the main station as default but start looking for a random station.

- Bugfix: Activating the fuel injector while deceleration from torus speed, no longer drops the speed immediately to max-injector speed.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4770 127b21dd-08f5-0310-b4b7-95ae10353056
2012-02-08 19:45:39 +00:00
Eric Walch
fd073849fe - Ships that have a specific commodity defined as cargo, no longer get their bounty reduced to 10% when the pilot ejects.
- The scoop icon now correctly shows a full cargo hold when special cargo is transported.
- Added code that points the ships towards the station during stationkeeping. Main reason is that the player has something to watch when waiting.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4744 127b21dd-08f5-0310-b4b7-95ae10353056
2012-01-18 21:41:37 +00:00
Eric Walch
e5a6411d1a - using the js method 'launchPlayer()' during one of the two docking handlers has no longer any undesirable side effect.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4737 127b21dd-08f5-0310-b4b7-95ae10353056
2012-01-11 19:43:16 +00:00
Eric Walch
450c395138 - AI fix for homeAI. When multiple escape pods are launched, there is no longer a part suddenly disappearing.
- AI fix for looting to prevent a ship circling around a cargo pod as I witnessed the other day.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4673 127b21dd-08f5-0310-b4b7-95ae10353056
2011-12-02 17:18:30 +00:00
Eric Walch
cf7ed44372 - Launching traders with a 'sunskimmer' role now start with sufficient heat insulation for sunskimming.
- Added an AI command 'checkHeatInsulation' (returns either: INSULATION_OK or INSULATION_POOR)
- ship_temperature no longer becomes negative (and stays negative) after a witchspace jump from a hot area. (delta_t can be several seconds on the first update after a jump)

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4647 127b21dd-08f5-0310-b4b7-95ae10353056
2011-11-15 19:41:46 +00:00
Eric Walch
8316cc2a1d - Docking/launching ships now look at totalBoundingBox instead of boundingBox to see if they fit in the dock. Same boundingBox to totalBoundingBox change for calculating needed orientating to the dock while docking.
- enteringTraderAI now checks for interstellar space (in case of a misjump).

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4553 127b21dd-08f5-0310-b4b7-95ae10353056
2011-05-18 20:16:57 +00:00
Eric Walch
34b4427b41 - Ships disgorging from wormholes now also use witchspaceLeavingEffects
- Pirate Escorts now correctly follow their leaded trough a wormhole
- Added the AI message ACCEPTED_ESCORT to be able to send attack instructions to the escort when self in fight.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4523 127b21dd-08f5-0310-b4b7-95ae10353056
2011-04-24 10:07:33 +00:00
Eric Walch
5bea193153 - Added the AI command 'setDesiredRangeForWaypoint' to set a flexible range instead of the fixed value of 50, so that slow turning ships also can use the standard 'gotoWaypointAI.plist'
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4070 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-15 10:36:54 +00:00
Eric Walch
3873fdfe42 - Docking and launching ships now correct for the length of a docking corridor inside the station.
- Added an AI reactToMassage "STATION_LAUNCHED_SHIP", to allow an AI to react on a launch.
- fixed the missing "shipWillLaunchFromStation" event for NPC ships.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3923 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-30 09:27:44 +00:00
Eric Walch
029f2860fe Added a "distresMessageReceived(agressor, sender)" event handler.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3838 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-27 12:20:18 +00:00
Marc
b3647b67bc escape pods part II:
- player and NPCs can eject at all times now.
- if pod ejected in witchspace, it's game over for the player, unless overridden by oxp.
- if pod ejected in normal space, the player will always reappear at the main station, unless overridden by oxp!
- new worldScript event 'escapePodSequenceOver' to override escape pod behaviour: if at the end of the event player.ship.target is a dockable station, the player will reappear inside it, otherwise game over!
- new translation string: gameover-escape-pod

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3809 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-13 20:10:05 +00:00
Eric Walch
4f38b58b2d - Fixed a compiler warning in the last commit
- Added changes to interceptAI and policeInterceptAI

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3785 127b21dd-08f5-0310-b4b7-95ae10353056
2010-10-29 09:57:58 +00:00
Eric Walch
b4e88583c5 - changed code that made that every entity, including subentities got an escortGroup.
- further tweaks in jink setting for dealing with high speed approach
- added code to route1patrol that allows escorts in this AI to sometimes start escorting again.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3771 127b21dd-08f5-0310-b4b7-95ae10353056
2010-10-17 10:51:23 +00:00