Page 2 of 3

Posted: Mon Feb 16, 2009 2:18 pm
by Kaks
Screet wrote:
Hmmm. What you say sounds to me the way that the current behaviour of the source code isn't appropriately doing it's job, but overreacting and thus causing troubles, not only for OSE but also for other popular OXPs.
Ships and main station behaviours are designed to provide a good gaming experience for people with just Oolite by itself without any oxp, and it's a very complex set of rules... altering one aspect of it in the core game will in 99.99% of cases (I'm being conservative here! ;)) lead to some surprising effects somewhere else...

On some occasions in Oolite you'd have escorts spinnig around in space, doing nothing when attacked.

The twiddling escorts problem plagued Oolite for years, and only now we seem to have got to the bottom of it. It was really difficult to track down, even with having the simplest possible code.

On the plus side, within an OXP you actually know that a big pirate ship is appearing in-system, and at least you have a chance to replace the standard behaviours with ones designed to cope with the new situation! :)


[edit]Anyway, before I got sidetracked I wanted to comment on that:
One idea that was actually Svengali's when we debated balance issues would be to create some sort of "power gradients" for ships that led to for example police with gradient "2.5-3.5" attack pirates of gradient "3" and so on. That could lead to more believeable behaviour, as a Tech 1 - GalCop Adder would then not insist on attacking a Tech 15 - pirate Constitution etc.
Sounds good! Hmmm, the thing is, the Adder should still be happy to attack if the Constitution is pretty weak & there's other cops around, only to disengage when the odds don't look so good anymore.... If we do a pure gradient one, you could have 20 ships running away from one, when 6 of them acting together could have won fairly easily... What about 4 of them calling for reinforcements, but staying out of range until new cops arrive? There's a lot of thinking needed to implement even the most common sense idea...

Posted: Tue Feb 17, 2009 12:13 am
by KZ9999
Kaks wrote:
Anyway, before I got sidetracked I wanted to comment on that:
One idea that was actually Svengali's when we debated balance issues would be to create some sort of "power gradients" for ships that led to for example police with gradient "2.5-3.5" attack pirates of gradient "3" and so on. That could lead to more believeable behaviour, as a Tech 1 - GalCop Adder would then not insist on attacking a Tech 15 - pirate Constitution etc.
Sounds good! Hmmm, the thing is, the Adder should still be happy to attack if the Constitution is pretty weak & there's other cops around, only to disengage when the odds don't look so good anymore.... If we do a pure gradient one, you could have 20 ships running away from one, when 6 of them acting together could have won fairly easily... What about 4 of them calling for reinforcements, but staying out of range until new cops arrive? There's a lot of thinking needed to implement even the most common sense idea...
Why not borrow the mechanics used for managing groups of NPCs in RPGs?

Most games I've dealt with over the years use (what I call) a sliding scale average. That is, the group's fight/hang back/flee stance is managed by averaging the aggression of the members of the group,+/- a small random factor, then comparing it to a simple sliding scale chart.

The point on which will trigger a certain behaviour on the scale is adjusted by the number of 'people' in the NPC group. Weaker foes will still attack if they have sufficient numbers. They will also tend to lose a greater number of the force before fleeing because their group behaviour reinforces their resolve. Stronger NPC's will attack with few number but are more likely to run when only a small percentage of the group is kill.

Some of the systems add a resolve factor to the fight/flee scale. Police would be more likely to attack or keep on fighting because their dedication to the GalCop. Pirates flee threshold would be lower because there's no profit in protracted fight.

The scaling systems would depend on the method of deciding the 'power gradients' but would be easy to express as an algorithm.

Anyway, that's my idea for adding another ingredient to the concept stew.

Posted: Tue Feb 17, 2009 12:39 am
by LittleBear
I think thats pretty much how the game works. When a Cop or hunter's AI does a scanforOffenders it randomly takes a number between 1 and 256 off the bounty score. Only if the score is +ive will the cop or hunter lock on and attack. So a ship with a bounty of 1 will take ages for the cop to find, but a ship with a bounty over 256 will be found immedatley. As a Cop only does a sweep every 5 seconds or so whilst on patrol, most times he'll miss low to medium bounty pirates If all the pirates have high bounties they'll all get attacked and wheather they win or lose the battle with the Cops, the space lanes get pretty empty as the ships duke it out, resulting in less action for the player.

So keeping typical pirates typical is probabley better for gameplay. High vaule pirates can always be added by script adding a random number in random places as a curve ball for the player.

Random Hits generates random attacks by thargoids, pirates and other special ships on space bars. If you happen to be docked at the time then you get a message informing you of the scap and you can launch to join in or stay docked. It also has some random scripted events, like victim's families coming after you and hunting builds up your "criminal_hatred_score" which can result in larger numbers of pirates attacking you or contacts being placed on you by the underworld from time to time. For the beta test these are off and a thargoid attack takes place on the bars 100% of the time, as I'm still not totally happy with the bar's and hunter's AIs and giving them lots of thargoids to shoot is a good test. For 1.4 it'll be random whats going on by the bars. Maybe nothing, maybe an attack by criminals or just a group of pirates accidently wandering into range.

It's probabley better to do stuff like this with a script, as then the OXP writer has a better control of whats going on.

Posted: Wed Feb 18, 2009 12:35 pm
by Eric Walch
Maybe it is possible to add big bounties without disturbing the balance to much. Within the code there is a differentiating between bounty and legal status The legal status is responsible for attack decisions. Currently they are almost always the same:

Code: Select all

- (int) legalStatus
{
	if (scanClass == CLASS_THARGOID)
		return 5 * collision_radius;
	if (scanClass == CLASS_ROCK)
		return 0;
	return bounty;
}
Internal only bounty is added and maintained as property of ships. Legal status is always calculated. It should be possible to add legal status as property. And for ships without this key, it will become the same as bounty. Currently there is only differentiation for thargoids.

Posted: Wed Feb 18, 2009 1:05 pm
by Commander McLane
Eric Walch wrote:

Code: Select all

- (int) legalStatus
{
	if (scanClass == CLASS_THARGOID)
		return 5 * collision_radius;
	if (scanClass == CLASS_ROCK)
		return 0;
	return bounty;
}
Internal only bounty is added and maintained as property of ships. Legal status is always calculated. It should be possible to add legal status as property. And for ships without this key, it will become the same as bounty. Currently there is only differentiation for thargoids.
:idea: So this is why the bounty scanner doesn't work on Thargoids, but returns much too high values.

..

Posted: Wed Feb 18, 2009 1:47 pm
by Lestradae
Eric Walch wrote:
Maybe it is possible to add big bounties without disturbing the balance to much. Within the code there is a differentiating between bounty and legal status The legal status is responsible for attack decisions. Currently they are almost always the same ...

... It should be possible to add legal status as property. And for ships without this key, it will become the same as bounty. Currently there is only differentiation for thargoids.
That sounds like a really good idea! It would also make sense ingame. A big bounty for a specially dangerous ship could then be some sort of "Wanted Terrorist" sign, reflecting the special danger this pirate ship is representing (and promising a Random Hits-esque bounty), without every Viper running to splash itself on some monster's windscreen.

Could something like that already go into 1.73? My problem at least would be solved, I would immediately implement the new distinction into my stuff.

The bounty scanner oxp would have to be updated, though, and it should be possible to read out the two different values (legal status vs. bounty). That would be a good thing, thargoids would then also have a correct readout concerning their bounty with a bounty scanner.

Cheers

L

Posted: Wed Feb 18, 2009 1:55 pm
by another_commander
Honestly, I would prefer the one-line script solution. Or alternatively, a few-more-lines script solution, that would also take care of possible balance issues. I find this kind of change going too deep into side-effects territory, if done on a core game level.

Posted: Wed Feb 18, 2009 3:44 pm
by Frame
Commander McLane wrote:
So this is why the bounty scanner doesn't work on Thargoids, but returns much too high values.
It works, it shows the current bounty, however, on pay out, everything is recalculated if certain conditions are true, like when a ship is a thargoid...

There is no way to, check what the collision radius of a ship is from java script.

And that is why the bounty scanner never can display the correct bounty for thargoids...

Posted: Wed Feb 18, 2009 3:57 pm
by Kaks
a_c, I second that!

If you start decoupling the two, you might end up with police ignoring offenders altogether... Not necessarily a bad thing if you are the offender, or know how to take care of yourself, but if you are a fresh faced jameson just out of Lave, it's a potentially disastrous situation:

Pirates attack you, a police patrol passes by and waves, and bam! Press space commander...

As I said earlier, I really don't think that making these sort of changes should be done this quickly, we really do need time to think of how all aspects of the game will be affected...

[edit]
@Frame: it's a bit of a kludge, but you could keep a manually populated list of known thargoid ship models to calculate the bounty. If you're targeting a thargoid, you can then look up the ship model & if it's in the array, bingo! :)

Posted: Wed Feb 18, 2009 4:13 pm
by Screet
Kaks wrote:
@Frame: it's a bit of a kludge, but you could keep a manually populated list of known thargoid ship models to calculate the bounty. If you're targeting a thargoid, you can then look up the ship model & if it's in the array, bingo! :)
I'm afraid that this would not work, as I've seen thargons with a bounty from 50Cr to way over 100Cr. For the big ships, there's even a larger difference, as they sometimes give no bounty, a bounty of a few credits...and can reach several hundred Cr in bounty! Especially if they did shoot at some police ship, there is no more link between the bounty and the ship type.

Screet

Posted: Wed Feb 18, 2009 4:36 pm
by Kaks
Oops, I stand corrected!

After a quick look at the code, it looks like "Eric's" collision_radius depends on the distance between thargoid & shooter when the thargoid dies, it's not the collision_radius of the thargoid ship itself! Frame, does this extra info help in any way?

Cheers,

Kaks.

Posted: Wed Feb 18, 2009 5:27 pm
by Eric Walch
The JS bounty property returns the legal status so the bounty scanner returns a value based on the collision radius with thargoids. On death you get the value stored as bounty in shipdata. And yes, currently the only way to display this correctly is by creating a database. But, how to identify a ship? Some have unique names, but others don't. For the bountyscanner it would be better to let the JS bounty property return the real bounty and not the legal status.

And I agree with A_C that differentiate between the two kinds of bounties could be serious work as these values are used throughout the whole code. Easiest would be for the scripter to just add a script that awards additional credits to the killer. Even better would be to award this money on the next docking with a nice mission screen. e.g. like the way thargoid wars does.

...

Posted: Wed Feb 18, 2009 6:29 pm
by Lestradae
Eric Walch wrote:
And I agree with A_C that differentiate between the two kinds of bounties could be serious work as these values are used throughout the whole code. Easiest would be for the scripter to just add a script that awards additional credits to the killer. Even better would be to award this money on the next docking with a nice mission screen. e.g. like the way thargoid wars does.
OK, if a long chain of code would have to be altered to achieve this then I retreat my wish.

I might either alter death actions so that the player gets a message and a reward in addition to the "normal" bounty, a mission screen also sounds nice.

Will look into the do-ability of those suggestions for OSE.

If you guys would decide to separate legal status and bounty, I would still consider this a good idea btw.

Posted: Wed Feb 18, 2009 9:47 pm
by LittleBear
A console message with death actions would be a nice way to go. (Could also randomise it a bit with descriptions), so the player would see "Bounty : 50 C" and "GalCop Special Branch Bonus : 120 C" or whatever. Or as Eric says just set a flag with death actions and when the player docks a screen informing them "For terminating James Narge, a horrid red rodent pirate from Lave, GalCop pays you an addional 120 C." in the same style as the payments for scooping pods.

Posted: Wed Feb 18, 2009 9:54 pm
by Screet
LittleBear wrote:
A console message with death actions would be a nice way to go. (Could also randomise it a bit with descriptions), so the player would see "Bounty : 50 C" and "GalCop Special Branch Bonus : 120 C" or whatever.
Hmmmm...I actually do like the previously mentioned idea of a "mission" screen. I'm not sure if it's that easy, but the Leviathan oxp keeps track of the destroyed ships. If something like that could be done, upon docking the player could be rewarded with an appropriate "GalCop Special Branch" screen, detailing the ship(s) shot down and their reward.

Since the player already will see a bonus when shooting down the ship, an additional text could spam the screen, especially with a long text. Furthermore, the player probably would not have a much higher sense of reward at that point.

If it's done as some "mission" screen upon docking, it re-creates the reward feeling and enhances it at a later time (when there's no action around).

I am sure that it would enhance the feel of it, similar to those scooping rewards when docking. Doesn't it add more fun than it would do if the scooping player would get an instant reward and no further text upon rescuing/capturing other captains?

Screet