Oolite Bulletins

For information and discussion about Oolite.
It is currently Mon Nov 19, 2018 7:20 am

All times are UTC




Post new topic  Reply to topic  [ 22 posts ]  Go to page 1 2 Next
Author Message
PostPosted: Sun Jul 15, 2018 7:17 pm 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral

Joined: Wed Feb 28, 2007 7:54 am
Posts: 5289
Following up on the discussion in this topic, I have made some tests with a slightly modified flee AI and I was quite happy with the result. I therefore submit this change for your further testing and consideration.

The change applies to ships with accuracy greater than 0. Dumb ships will continue to act dumb and flee in straight lines, but more often than not, you will be encountering pilots who will react more like a normal pilot would. "Clever" NPC pilots now check your position against theirs when fleeing and, if they feel that they are sitting in your sights, they will attempt to react. Most of the times they will try to jink more in order to get out of the way of your guns, but sometimes, in an act of desperation, they will turn and try to land a few hits on their attacker, hoping to surprise them. Current probability is 65% continue fleeing, 35% go evasive and consider an attack and they are open to suggestions.

The change required to test this:
Function performFlee in ShipEntityAI.m is changed to:
Code:
- (void) performFlee
{
	if (behaviour != BEHAVIOUR_FLEE_EVASIVE_ACTION)
	{
		behaviour = BEHAVIOUR_FLEE_TARGET;
		[self setEvasiveJink:400.0];
		frustration = 0.0;
		if (accuracy > COMBAT_AI_ISNT_AWFUL)
		{
			double aspect = [self approachAspectToPrimaryTarget];
			// alert! they've got us in their sights! react!!
			if (aspect > 0.9995 || aspect < -0.999)
			{
				behaviour = randf() < 0.35 ? BEHAVIOUR_EVASIVE_ACTION : BEHAVIOUR_FLEE_EVASIVE_ACTION;
			}
		}
	}
}
Test binary for Windows x64 here.


Top
   
PostPosted: Sun Jul 15, 2018 8:11 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sun Jul 19, 2015 1:09 pm
Posts: 548
I will test this later tonight and report back. Thank you so much for taking a look at this!


Top
   
PostPosted: Sun Jul 15, 2018 8:17 pm 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral

Joined: Wed Feb 28, 2007 7:54 am
Posts: 5289
Thanks, looking forward to seeing the results. For completeness, there is one more small change that has been made in order to generate the test executable and I forgot to mention earlier. In the method setEvasiveJink in ShipEntity.m, the line that reads
Code:
if (accuracy >= COMBAT_AI_IS_SMART)
has been commented out. Now all non-dumb ships do proper jinking manoeuvers.


Top
   
PostPosted: Sun Jul 15, 2018 8:21 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sun Jul 19, 2015 1:09 pm
Posts: 548
Out of curiosity, what is the distribution of dumb ships in the game? How is accuracy set for the default NPCs? Is that dependent on the type of system?


Top
   
PostPosted: Sun Jul 15, 2018 9:42 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sun Jul 19, 2015 1:09 pm
Posts: 548
Hmm, I just realized now that these modifications are for the source code and not for any game files post-compilation, right? I am quite unfamiliar with Oolite compilation and this might take me a while to figure out. Sorry about that!


Top
   
PostPosted: Sun Jul 15, 2018 9:47 pm 
Offline
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
User avatar

Joined: Sat Jul 04, 2009 9:31 pm
Posts: 13395
Location: Corke's Drift
Simply drop the .exe into your (Windows x64) Oolite build, and run it (probably requires Oolite trunk).

_________________
Those who seek gold dig a lot of earth, but find little


Top
   
PostPosted: Sun Jul 15, 2018 11:06 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sun Jul 19, 2015 1:09 pm
Posts: 548
Hadn't realized there was a link to a compiled exe file. Thanks Cody!


Top
   
PostPosted: Mon Jul 16, 2018 5:55 am 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 2215
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
I'm looking forward to trying this out this afternoon! Thanks, a_c!

_________________
My OXP's
YouTube: Oolite Teaser Trailer


Top
   
PostPosted: Mon Jul 16, 2018 12:27 pm 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral

Joined: Wed Feb 28, 2007 7:54 am
Posts: 5289
Quote:
Out of curiosity, what is the distribution of dumb ships in the game? How is accuracy set for the default NPCs? Is that dependent on the type of system?
Hard question. Each ship type has its accuracy set by different parameters. Some (like pirates) depend on system governments and some others have their accuracies set based on generic expectations (like trader opportunitsts and hunters belonging in a pack expected to generally be good pilots). There is plenty of randomness involved too.

Check oolite-populator.js in the core scripts folder for occurrences of the _setSkill(ship, bias) method. That's where the magic happens.


Top
   
PostPosted: Mon Jul 16, 2018 12:37 pm 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral

Joined: Wed Feb 28, 2007 7:54 am
Posts: 5289
Oh, and btw, core ships' AI does not go beyond 5.0. If you want higher level AIs, you need to OXP it.


Top
   
PostPosted: Mon Jul 16, 2018 12:43 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sun Jul 19, 2015 1:09 pm
Posts: 548
Thanks for all the info. I still did not have the chance to test that executable but I will do so tonight.


Top
   
PostPosted: Mon Jul 16, 2018 5:35 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Thu Jun 20, 2013 10:22 pm
Posts: 1186
Quote:
Most of the times they will try to jink more in order to get out of the way of your guns, but sometimes, in an act of desperation, they will turn and try to land a few hits on their attacker, hoping to surprise them. Current probability is 65% continue fleeing, 35% go evasive and consider an attack and they are open to suggestions.
Nice idea but IMHO 35% seems a tad high for a potentially suicidal 'act of desperation'.
Realistically 10% might even be too high but if one assumes that such behaviour might make combat more interesting then it should perhaps happen once in a while rather than once in a blue moon.

_________________
"With our thoughts, we make the world" :-)


Top
   
PostPosted: Mon Jul 16, 2018 8:48 pm 
Offline
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral

Joined: Wed Feb 28, 2007 7:54 am
Posts: 5289
Quote:
Nice idea but IMHO 35% seems a tad high for a potentially suicidal 'act of desperation'.
Realistically 10% might even be too high but if one assumes that such behaviour might make combat more interesting then it should perhaps happen once in a while rather than once in a blue moon.
Remember that the 65-35 percentages are not based on the total of ships you encounter, but on the ships that will be directed to use the bits of the new AI. Some ships still fly straight when fleeing and from those that don't, 35% may chose to break the run and attack. In reality you should be seeing desperation attacks less often than what it initially looks like.

But let's be sure first that the AI works, then I would be more than happy to drop the flee attacks a little.


Top
   
PostPosted: Tue Jul 17, 2018 1:20 am 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Sun Jul 19, 2015 1:09 pm
Posts: 548
@another_commander The behaviour of the AI seems better from what I can tell but I did have some crashes using this executable together with the latest nightly. @phkb did you have more success testing this?


Top
   
PostPosted: Tue Jul 17, 2018 2:53 am 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 2215
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
I had a couple of long play sessions, where I noted all the different behaviours in action. I didn’t see a lot of the “fly in a straight line” escape option, but I was possibly in a slightly biased environment (mission testing with particular ship roles), so that might not be important. I found I regularly had to break off shooting at a fleeing ship because they were juking under injectors to throw off my aim, and I was getting hammered by other ships who were lining up behind me. In all I found the experience much more satisfying. So, first impressions are positive. I’ll have another go this afternoon and report back again.

I didn’t have any crashes I could link to this change, but then I built my own exe rather than use a_c’s download.

_________________
My OXP's
YouTube: Oolite Teaser Trailer


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 22 posts ]  Go to page 1 2 Next

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited