How many missiles is too many?

General discussion for players of Oolite.

Moderators: another_commander, winston

User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

How many missiles is too many?

Post by Kaks »

While the number of missiles a player ship can have is capped at 16 - even for capital ships - we don't seem to actually have a missile limit for NPC ships.

I have seen some ships with 24 missiles out there, so my original thought was to cap the number of missiles an NPC can have to 32.

Is that number going to be too limiting for some oxps?
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Killer Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 2269
Joined: Tue Jan 02, 2007 12:38 pm

Post by Killer Wolf »

personally i think anything into double figures is pushing it, even for a pure combat ship.
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Post by Cmdr James »

Is there are reason to cap it?
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

I'm reworking the NPC missiles - that part of the code is very fast, but also very simple, to the point of being brain damaged*.

What I've noticed, though, is that:

a) missiles were supposed to be capped at 16 for both player and NPCs
b) that capping was never enforced for NPCs, and we've already got some NPCs with 24 missiles, possibly more missiles too.

Aside from other considerations, reworking that 'simple' code into something slightly sensible will make the game slightly slower. Capping the number of missiles will tell us how slower it's going to be - in the worst possible case - after the code change.


* The way the code has been since at least 1.65 makes missiles behave like subatomic particles until they're fired. We can tell how many there are, we can tell they're likely to be 'EQ_MISSILE's (ok, that bit can be overridden by a shipdata setting) but the engine doesn't know for sure which missiles are there until the missiles are fired. And we can't tell how many missiles the ship had to begin with, just how many it's got right now.
In addition to that, there's absolutely no way to specify 2 or more missile types for an NPC to have, under any circumstance (however, we do get variety from the 'quantum' fluctuations that can transform an 'EQ_MISSILE' into any other missile/bomb when fired).
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Cmd. Cheyd
---- E L I T E ----
---- E L I T E ----
Posts: 934
Joined: Tue Dec 16, 2008 2:52 pm
Location: Deep Horizon Industries Manufacturing & Research Site somewhere in G8...

Post by Cmd. Cheyd »

Cap it at 24 and make a JS event for when the player selects a new missile. They they can use JS script and an array to remove equipment and add new equipment in the missile slots so it would appear that they were rotating missile "banks". This would also let authors define say a 6 missile limit, but a java script limit of 24, so they could have 4 banks of 6. If that all makes sense. There's be some issues to work through - You'd have to be able to trigger the event, even if you were out of missiles or not when not at a full load for that bank, but you get the idea...
User avatar
drew
---- E L I T E ----
---- E L I T E ----
Posts: 2189
Joined: Fri May 19, 2006 9:29 am
Location: In front of a laptop writing a book.
Contact:

Post by drew »

How many missiles is too many?
The way I fly... one! :lol:

Cheers,

Drew.
Drew is an author of SF and Fantasy Novels
WebsiteFacebookTwitter
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Cmd. Cheyd, the player's missiles are already capped at 16 anyway.

The NPCs were the ones that could theoretically have 60000 'quantum' missiles up their sleeves, and there's no need for them to have banks of missiles, or an interface.

Anyway, I went ahead with both rewrite and 32 NPC missile capping, and there doesn't seem to be too many problems. The new code creates all the NPC missiles when the ships are spawned, and the proportion of EQ_MISSILEs to the more exotic varieties is exactly the same as before. But now we can remove / add specific types of missiles & generally treat NPC missiles in javascript the same way as we would player missiles... As an effect of those changes, the key max_missiles now works properly for NPC ships too.

And now we'll need to revisit the player's missiles. The code handling those is definitely clunkier (wastes more memory & processor cycles) than it needs to be...

Commander Cheyd, in theory someone could already write a 1.73.4 oxp to would replenish your entire missile bay once the last missile was fired. It's not quite the same as the banks of missiles you were talking about, but it might help people that might feel the current 16 player missiles limit a bit too er... limiting! :)


The way I fly... one! :lol:
I know that feeling! :D
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5525
Joined: Thu Jun 12, 2008 6:55 pm

Post by Thargoid »

But does it make sense for a capital ship or even a station to be such limited?Not that there aren't ways to work around it if desired anyway...
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

Well, we do need a semi-practical limit. The new code does open up a lot of scripting possibilities for missiles, though. You can now keep replacing NPC missiles immediately after firing, so in practice you now have unlimited NPC missiles. Before, you could easily have 64 or more missiles for NPCs. but once gone, they were gone for good!

You can even script ammo ships, ones that rendez-vous with other NPCs and/or the player, and replenish ammo. I might be a bit of a dreamer, but you could have some really epic battles now: as an example, you could have one really really strong ship moving slowly, being attacked by a fleet of very fast ships, each carrying a missile or 2, who need to go back to the ammo ship to restock their missiles...

And you can now award & remove equipment, & script damaged equipment & repair on npcs too...

We're not quite there yet. We're still missing NPC shields, proper NPC manifests, and scripted contracts & passengers for NPCs (it's still a new feature for players too - and only available in trunk), but fingers crossed, they might be in EMMMMR post MNSR!
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

What I would wish for is a more sensible missile-use routine for NPC. Currently, if they have many, they tend to fire all of them at once. NPCs with a more limited supply tend to use them more wisely.

At least this is how it seems. I am not even sure if this is indeed coded somewhere, or I am just hallucinating this behaviour pattern.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Post by Kaks »

I must confess I've no idea! The missile usage is somewhere in the depths of the AI routines, and - so far - Eric is the only one who manages to understand that stuff without developing some strange facial ticks...

But hey, in 1.74 you'll be able to have it both ways. You can have an NPC max_missiles = 4 (max_missiles was meaningless for NPCs, so it was never used for them before 1.74), then in its ship script you can add an independent this.missileReserve javascript variable.

When this.ship.missiles.length < 2 you can always top up your NPC missiles with awardEquipent(), decrementing this.missileReserve as you do that.

The stuff above seems to be very possible in trunk already...
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
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 »

Kaks wrote:
I must confess I've no idea! The missile usage is somewhere in the depths of the AI routines, and - so far - Eric is the only one who manages to understand that stuff without developing some strange facial ticks...
When in attack mode, performAttack does every frame the next calculation (a bit rewritten for readability):

Code: Select all

	// use weaponry
	missile_chance = 1 + (ranrot_rand() % (3.2 / delta_t));

	hurt_factor = 16 * pow(energy/maxEnergy, 4.0);

	if (missiles_available > missile_chance * hurt_factor) [fireMissile];
Here is delta_t the time between two frames.

Or in plain english: the more missiles are present or the lower the ships energy is, the more likely it is to fire one. By itself this already caps max_missiles as in my opinion is was useless to award more than a few missiles. Defining more than a few missiles only leads to unrealistic, missive missile releases.

When we really want NPC ships with larger amounts of missiles, above calculation needs also something as the time since the last missile fired. (like it does for laser shots)
User avatar
wildstar
Competent
Competent
Posts: 48
Joined: Sat Nov 28, 2009 10:53 pm
Location: usa
Contact:

Post by wildstar »

Thargoid wrote:
But does it make sense for a capital ship or even a station to be such limited?Not that there aren't ways to work around it if desired anyway...
i agree that huge capital ships should have greater amount of missiles but they too need a random cap somewhere between 34 and 150 missiles in total depending on the size of the capital ship / battle cruisers or whatever ya wanna callem. couldn't the amount be based on an estimated amount of plausible weapons cargo space that one might imagine a particular ship to have?

how many did the enterprise in star trek have? ok i know this aint star trek and nor is this meant to be a realistic life in space scenario (or is it? Oo) but entertaining to say the least is what is should be. i think a capital ship running out of missiles might not be very entertaining if the missiles it did have are expended early on in the thick of battle.

I personally would imagine a limited number of missile launchers as there already are and aside from having a dozen or so immediately ready for replenishing those fired it would make sense to have a delay for continued replenishing of the missiles from weapons cargo bay.

the delay would be good so not to have npc ships dump a truck load of missiles upon you all at once.
Image B4 = Elite on c64 & now = Oolite1.73.4repositories UBUNTU OpenGL2.1.2 NVIDIA180.44 & vertex shaders eVGA GeForce7950GT512 P4-3.2mhz/3gb
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8501
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post by DaddyHoggy »

But by limiting the number of missiles is just a code fix - as Kaks explained, big capitol ships can be silently or obviously re-equipped with additional missiles on the fly (a continuous resupply from the armoury or a missile supply ship - both would make excellent oxps)
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
wildstar
Competent
Competent
Posts: 48
Joined: Sat Nov 28, 2009 10:53 pm
Location: usa
Contact:

Post by wildstar »

DaddyHoggy wrote:
But by limiting the number of missiles is just a code fix - as Kaks explained, big capitol ships can be silently or obviously re-equipped with additional missiles on the fly (a continuous resupply from the armoury or a missile supply ship - both would make excellent oxps)
right i agree. and while i do not know how much realism can be added and how accommodating the existing game code is it would be a nice AI based OXP to have larger ships have to send out for more supplies when needed after expending their larger supply of missiles or even fuel chaff and drones etc. while on (and i dont know if it even exists yet) a say SUPER STAR CRUISER could even be self sufficient while making and salvaging and scooping for some of these supplies. it would be cool to see a super mega ship launch smaller ships to go around scooping and salvaging. and it is easy for me to imagine little green dudes and dudettes cranking out missiles on an assembly line somewhere in one of the numerous areas of the mega ship.
Image B4 = Elite on c64 & now = Oolite1.73.4repositories UBUNTU OpenGL2.1.2 NVIDIA180.44 & vertex shaders eVGA GeForce7950GT512 P4-3.2mhz/3gb
Post Reply