Post Reply 
 
Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Naval AI with terrain & friendly avoidance, evasive maneuvers [2017-11-05]
2017-02-09, 06:22 PM
Post: #31
RE: Naval AI with terrain & friendly avoidance, evasive maneuvers [2017-01-18]
(2017-02-09 02:27 PM)Shaun Wrote:  This is great! Just needs support for paddles

I personally don't use paddle ships that often (or rather: at all Tongue), so probably not something I would prioritize. (Though there's a few things in the code that probably have to happen first, which I will look into soon.)

What would be needed to support them? Just driving spin blocks oriented left/right?

(2017-02-09 06:03 PM)CptLego Wrote:  @OP is it possible to set up a lua controller to switch shield mode from reflect to laser absorb? in adventure i dont really have that ability on other ships only the one im on and ofcourse i cant warp to the ship or get 3rd person view so they are truely independant.

I know this pain. But what would be used as a trigger to switch the shield mode? Lua can't read the laser detector. And unfortunately, the complex controller doesn't work over remote control.

(And there's a roundabout way for Lua to detect laser hits, but it requires: 1) no fuel engines, and 2) no resource sharing. Which seems lame...)

What I end up doing is putting two ACBs near the remote ships' "build origin" (you know, when you select a ship and hit "build" -- the place where the cursor starts). Then I just manually go to build mode and then hit the appropriate ACB.

Yeah, it's cheesy, but there doesn't seem to be any other way.

Other alternative to to teleport over and switch it yourself (by binding a key to those ACBs), which I usually do for my larger ships.

My Workshop | My FtD Lua Scripts
Find all posts by this user
Quote this message in a reply
2017-02-10, 12:37 PM
Post: #32
RE: Naval AI with terrain & friendly avoidance, evasive maneuvers [2017-01-18]
(2017-02-09 06:22 PM)ZerothAngel Wrote:  
(2017-02-09 02:27 PM)Shaun Wrote:  This is great! Just needs support for paddles

I personally don't use paddle ships that often (or rather: at all Tongue), so probably not something I would prioritize. (Though there's a few things in the code that probably have to happen first, which I will look into soon.)

What would be needed to support them? Just driving spin blocks oriented left/right?

(2017-02-09 06:03 PM)CptLego Wrote:  @OP is it possible to set up a lua controller to switch shield mode from reflect to laser absorb? in adventure i dont really have that ability on other ships only the one im on and ofcourse i cant warp to the ship or get 3rd person view so they are truely independant.

I know this pain. But what would be used as a trigger to switch the shield mode? Lua can't read the laser detector. And unfortunately, the complex controller doesn't work over remote control.

(And there's a roundabout way for Lua to detect laser hits, but it requires: 1) no fuel engines, and 2) no resource sharing. Which seems lame...)

What I end up doing is putting two ACBs near the remote ships' "build origin" (you know, when you select a ship and hit "build" -- the place where the cursor starts). Then I just manually go to build mode and then hit the appropriate ACB.

Yeah, it's cheesy, but there doesn't seem to be any other way.

Other alternative to to teleport over and switch it yourself (by binding a key to those ACBs), which I usually do for my larger ships.

That build origin is a Lamb good idea, i hadnt thought of that. thanks for the reply
Find all posts by this user
Quote this message in a reply
2017-05-23, 04:39 AM
Post: #33
RE: Naval AI with terrain & friendly avoidance, evasive maneuvers [2017-05-21]
Added AttackDistance option. When set (and it should be a number between MinDistance and MaxDistance), it represents the ideal attack distance for the vehicle which it will try to maintain independent of the other distance settings.

Also wrote up some basic docs, since with the addition of this new option + the somewhat recent switch of control to my 6DOF module, configuration has probably become more confusing than ever.

My Workshop | My FtD Lua Scripts
Find all posts by this user
Quote this message in a reply
2017-06-03, 06:15 PM
Post: #34
RE: Naval AI with terrain & friendly avoidance, evasive maneuvers [2017-05-21]
Did you get round to doing one for tank steering? ( I guess that is very like paddle steering, actually ). I guess it just needs to find all sideways-pointing propulsion & attach those to yaw for tanks, at least - that's slightly easier than working out which paddlewheel spinblocks to use. If not I'll throw it on the big list of things to look at I have...

ACB tank steering works, but the binary nature does reduce the tank's possible top speed considerably.

Poke my boat! mostly pre-2.0 learning & catalogue thread - Update: Heavy & light tanks 24/02/18 for 2.1. 6 ships made 2.0 aware. If it's not AotE I can't do it regularily - sea -> post processing -> eyestrain.
Find all posts by this user
Quote this message in a reply
2017-07-05, 11:38 PM
Post: #35
RE: Naval AI with terrain & friendly avoidance, evasive maneuvers [2017-05-21]
Can I set this script to use spin block rudders from After Cataclysm Mod?
Find all posts by this user
Quote this message in a reply
2017-10-21, 09:00 PM (This post was last modified: 2017-10-21 10:59 PM by ZerothAngel.)
Post: #36
RE: Naval AI with terrain & friendly avoidance, evasive maneuvers [2017-05-21]
Sorry, didn't notice these questions until now.

(2017-06-03 06:15 PM)Richard Dastardly Wrote:  Did you get round to doing one for tank steering?

I briefly tested in AotE, and it doesn't look like there's any way to do tank steering with wheels from Lua (aside from going through ACBs).

Wheels aren't visible from the Component_* methods, so treating them as propulsion wouldn't be possible.

They can only be controlled by using water or air controls (and setting the 'V' screen option appropriately). Ironically, they don't respond to land control signals.

Maybe they show up as spinblocks? I didn't bother to test that...

Edit: I'm a dumbass, they're treated as generic propulsion (like you said, which I missed). The Component_* interface only lets you set drive fraction on propulsion (a positive fraction), so you'd need to use I:RequestControl to drive the wheels. Though I'm still not quite sure how you'd do tank steering as you cannot simultaneously drive the wheels forward & reverse.

Edit2: Maybe drive them forward & reverse in alternate frames? Anyway, me personally, I would create a separate tank AI for this. There's some overlap (and I base my knowledge of tank tactics on Fury and Girls und Panzer), but not enough to justify packaging tank controls into every single script of mine that uses this naval AI. Tongue

Edit3: Alternating frames doesn't work. Just plain differential steering (i.e. no neutral steering) is all you can hope for using normal Lua controls. However, drive maintainers save the day again. One drive maintainer for the left track, another for the right, then you can throttle both independently very easily and even in opposite directions...

(2017-07-05 11:38 PM)Fernir Wrote:  Can I set this script to use spin block rudders from After Cataclysm Mod?

I don't have any experience with AC and unfortunately, I removed spinblock support some time ago. It wouldn't have supported a spinblock rudders anyway, that would need special coding.

As I only use spinblocks for aesthetics (and very rarely: for cheese), I probably won't be re-adding support for them (for a while, at least).

My Workshop | My FtD Lua Scripts
Find all posts by this user
Quote this message in a reply
2017-10-25, 07:12 PM (This post was last modified: 2017-10-25 07:13 PM by ZerothAngel.)
Post: #37
RE: Naval AI with terrain & friendly avoidance, evasive maneuvers [2017-10-25]
Made a few tweaks and additions to make it more suitable as a tank AI.

With the AttackReverse option true, instead of "flipping" AttackAngle (i.e. using 180 - AttackAngle) to maintain AttackDistance, it will instead reverse AttackDrive (still PID scaled, of course).

This, coupled with AttackAngle set to 0, makes it suitable for assault (or "forward broadside" lols) behavior. Great for tanks or airships that can turn in place, questionable for naval vessels. (Note, this script is yaw- and propulsion-based, there is no lateral movement at all. If you want "orbiting," look elsewhere.)

Also added links in the OP to all my script variants that use this AI. Maybe they'll be useful to other people, as long as you can decode the million other options.

My Workshop | My FtD Lua Scripts
Find all posts by this user
Quote this message in a reply
2018-02-02, 05:34 PM
Post: #38
RE: Naval AI with terrain & friendly avoidance, evasive maneuvers [2017-11-05]
Quick question. So, the way I build my fleet for campaign is more focused around a modern "task force" style, with multiple ships specialized for different purposes. What I'm trying to do is have the flagship (typically my primary offensive ship in the task force) in combat mode so that her AI settings determine the movement for the fleet. What I want is to have her escorts follow in formation, engaging targets as they enter range, avoiding obstacles, and conducting evasive maneuvers, but otherwise keeping in formation, or returning to formation. Is there a way to configure your Naval AI to do that? I could do it manually, using fleet move, but I find that battles tend to get away from me pretty quickly, and I'd prefer to let the AI control do as much as possible.
Find all posts by this user
Quote this message in a reply
2018-02-03, 09:25 AM
Post: #39
RE: Naval AI with terrain & friendly avoidance, evasive maneuvers [2017-11-05]
Pretty much all of my "AI" scripts override fleetmove. When switched to fleetmove, they will follow the flagship at the distance and relative position (and sometimes relative orientation, for the 6 DoF gunship-style scripts) that you designate. Terrain and friendly avoidance are still active.

However, there's no pseudo-random evasion nor any dodging of missiles/torpedoes. So the usefulness in combat is questionable. They just stay in strict formation as best as they can.

And by default, my "AI" scripts typically fall back to this behavior when in combat mode and out of combat.

So to answer your question, no, it doesn't meet all your requirements. You can either have them
  • In formation while out of combat and then they break to do their own thing when enemies are detected. (Leave them all in "combat" mode and put them all in the same fleet. Briefly switch to fleetmove to adjust relative positions.)
  • Or follow a strict formation in & out of combat with terrain & friendly avoidance active. (Put them all in the same fleet and switch all but the flagship to fleetmove.)
Also there's something weird either with the implementation or my interpretation of the available fleet variables in the Lua interface. So when designating relative positions, you have to do it as if the flagship was pointing due north.

My Workshop | My FtD Lua Scripts
Find all posts by this user
Quote this message in a reply
2018-02-05, 06:57 PM
Post: #40
RE: Naval AI with terrain & friendly avoidance, evasive maneuvers [2017-11-05]
(2018-02-03 09:25 AM)ZerothAngel Wrote:  *snip*

So, I think the option of leaving everyone in fleet move except for the flagship is probably going to be my best option for how I build my fleet. I tend to build smaller "screening" ships to handle close range defense, and provide extra point defense to the larger "heavy hitters" in a fleet. Sort of like a USN carrier battlegroup: the cruisers and destroyers provide some offensive firepower, but they mostly exist to protect the carrier. I know some rudimentary LUA (mostly from my KSP experience), so I might try and dig into your code to see if there's a way to put independent evasive maneuvering into the Fleet move functioning, if you don't mind.

Anyways, thanks for the response!
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)