RFC: Arena for ai/script designers

General discussion for players of Oolite.

Moderators: winston, another_commander

Post Reply
User avatar
Simon B
---- E L I T E ----
---- E L I T E ----
Posts: 836
Joined: Thu Oct 23, 2008 5:54 am
Location: Red Beach NZ
Contact:

RFC: Arena for ai/script designers

Post by Simon B »

While I have been revamping the ships, I am aware that this adds only to the appearance of the game, not the game itself. The way to add to the game itself is to add behavior via ais (scripting etc).

This is an area which does not seem to get as much work as modelling - though there is some.

I'm proposing a sort-of competition - that scripters write a gladiater ai for standard fighter ships (we can give them their own roles) which can then compete in arena style duals ar death-matches - all ai vs ai.

We know we can get all ships with role "gladiator" (say) to load when a particular system is jumped into ... and the ai requirement will be that they all lay into each other. So you jump into a firefight which does not include you unless you fire on one of the gladiators.

Each gladiator uses it's own script - the idea is to see which script is best in combat survival. It can be worth bragging points for scripters.

The best scripts can be made available as custom ais in a special package - first stripping out the "must fight all gladiators" bits.

I can probably whack together a base oxp for this, using a really simple ai designating a target by role and adding all that role to one system when the player arrives. (Probably want them all to run for it, or jump out, when the police show up.)

This would be similar to the various robot-tank battle games out there.
Simon Bridge
[re2dux] [neolite]
"Everything is perfect down to every last flaw..."
HBT: The Book of Verse - Principia Discordia
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6312
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Post by Diziet Sma »

8) Very interesting concept... I like it, just wish I had the skillz to join in the fun! :(
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: RFC: Arena for ai/script designers

Post by Eric Walch »

Simon B wrote:
I'm proposing a sort-of competition - that scripters write a gladiater ai for standard fighter ships (we can give them their own roles) which can then compete in arena style duals ar death-matches - all ai vs ai.
The only attack command there is, is: performAttack. The attack strategy itself completely takes place in Oolite itself. Only in combination with a ship script you can do a bit. But that mainly comes down to know when to flee, like I did in the superCobra script.
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post by DaddyHoggy »

:(

A good idea while it lasted...
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Post by Frame »

I agree, it seems to be rather hard to do anything useful with it, since by design we can kill of any ship we want...

Code: Select all

PointSuperBeamWeaponAt = function(target)
{
target.explode()
}

PointBlackHoleGeneratorAt = function(target)
{
target.remove()
}
While I Like the Idea of arena style fighting coming to Oolite, "bot" Ai is mostly centered around not killing of the player/Opponent instantly.

I think we could rethink this into, make an AI the resembles realistic human behavior. An RHB ship so to speak. ofcourse we can do nothing about the actual fighting... other than deciding as Eric Walch wrote, when it should flee or jump out.

We could approach it Like this...

1. Leaving witchspace, do not make use of the general space lane. But do as players do fly a little away from the main lane, then fly towards the planet/navigation beacon. which way is totally random... (but then they will use the below)

2. Via a Script, make them emulate Torus Jump Drives, by setting their speed factor to about 32 * and refuel them as they run dry.. (or drop out of torus), and make sure they do not enter the emulated torus drive jump, when mass locked. (could also make for some interesting deaths, with head on collisions)

2.1 design a pirate AI/script that jumps victims via the emulated torus jump drive, as if he where a player.

2.2 make a hunter role like this too..

in short, anything the player can do, try to make an AI / script, that emulates that behaviour... beside fighting...

* In a custom mod, build on the open source, I have speeds listed. standard cob 3 did 0.350 max.. but 11.200 when in torus speed.

Torus Speed Factor is 32 since 350*32 = 11.200 ls
Injection speed factor is 7.0 = 2.450 ls for a cob 3 with a max standard speed of 0.350 ls.


Btw what do we call standard speed ??? surely not standard speed...

we have injection speeds, and torus speed.. standard needs a term, like impulse speed in star trek...

Anyway the human like behaviour script/AI should prove challenging enough..

Cheers Frame
Bounty Scanner
Number 935
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

I tried something like 2) with the hired guns. It worked in theory (I had calculations along similar lines to yours), but for some reason the player always seemed to far outstrip them in terms of speed when the real torus drive was used (and yes I did keep their tanks topped up).

So I'd be interested to see if people can get more realistic results than I did. For the record I ended up just moving them closer to the player if the gap got too large.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Thargoid wrote:
For the record I ended up just moving them closer to the player if the gap got too large.
Beam me forward Scotty. :wink:
User avatar
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Post by Frame »

Thargoid wrote:
I' but for some reason the player always seemed to far outstrip them in terms of speed when the real torus drive was used .


Different MaxSpeeds, will produce different torus speeds.

Asp for example is able todo 32*0.4 = 16.0 ls...

also this code sets the desired_speed, without any checks that reduces it

Code: Select all

- (void) setSpeedFactorTo:(NSString *)speedString
{
	desired_speed = maxFlightSpeed * [speedString doubleValue];
}
Diving further into the code, I can see where it checks if the ship has injection, from that it Aqquires the AfterburnerFactor, which is constantly 7.0f

So a ship having injectors, cannot emulate true torus speed

Code: Select all

- (void) increase_flight_speed:(double) delta
{
	double factor = 1.0;
	if (desired_speed > maxFlightSpeed && [self hasFuelInjection] && fuel > MIN_FUEL) factor = [self afterburnerFactor];

	if (flightSpeed < maxFlightSpeed * factor)
		flightSpeed += delta * factor;
	else
		flightSpeed = maxFlightSpeed * factor;
}
and

Code: Select all

- (float) afterburnerFactor
{
	return 7.0f;
}
There is no reason that a factor of 7.0 should be maximum, for ships with or without injectors..

So the code when it is set to a speed factor of 32, calculates the desired speed, and puts that into desired speed, not yet flight speed...

So it increases the speed to reach that speed, if the desired speed is greater than max speed.. it tests for the presense of a fuel injector and if true, it sets the maximum speed factor to 7.0f.

This is a bit Cludgy in my opinion, since we are limiting the maximum speed of ships to a factor of 7.0f. when infact it should be factor 32f. that is torus speed. That factor however should only be available when the ship is not mass Locked. However only Player mass locks...

We could think outside the box, write a special AI with a ship that has a max speed of 11200/7 = 1600.. however, that would conflict with attack behavior as when you enter performAttack, it goes at the player at maximum flightSpeed..

I'm thinking a solution would be to add an extra factor. When no ships are present, the factor is 32 and fuel is not checked...

When ships are present the factor is 7.0f if ships are present or 25 km from the surface of a planet...

but now it is time for bed... :wink: TBC
Bounty Scanner
Number 935
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

I know, I was playing with them based on the max speed of my own ship (a standard Cobbie3 at the time, for testing purposes).

As I said I always seemed to far out-distance them. I figured in the end it was due to the pauses and delays in the AI that stopped it being too intensive, but it was a difficult balancing act. But even with a huge max speed (I think at one point I ended up using over 100 speed multiplier in the AI) it still didn't work conclusively.

There is also the problem of thrust (acceleration and deceleration) to balance the responsiveness of the "fake torus" compared to the ship's normal maneuvering and combat. That is also a difficult balancing act.
Post Reply