How many missiles is too many?
Moderators: winston, another_commander
How many missiles is too many?
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?
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)
- Killer Wolf
- ---- E L I T E ----
- Posts: 2279
- Joined: Tue Jan 02, 2007 12:38 pm
- Cmdr James
- Commodore
- Posts: 1357
- Joined: Tue Jun 05, 2007 10:43 pm
- Location: Berlin
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).
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)
- Cmd. Cheyd
- ---- 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...
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...
Find my OXP's at:
Deep Horizon Industries - Your Planet Our Design
Deep Horizon Industries - Your Planet Our Design
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 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!
I know that feeling!The way I fly... one!
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
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...
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
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 inEMMMMR post MNSR!
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
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
- Commander McLane
- ---- 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:
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.
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.
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...
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)
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
When in attack mode, performAttack does every frame the next calculation (a bit rewritten for readability):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...
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];
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)
UPS-Courier & DeepSpacePirates & others at the box and some older versions
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?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...
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.
B4 = Elite on c64 & now = Oolite1.73.4repositories UBUNTU OpenGL2.1.2 NVIDIA180.44 & vertex shaders eVGA GeForce7950GT512 P4-3.2mhz/3gb
- DaddyHoggy
- Intergalactic Spam Assassin
- Posts: 8515
- Joined: Tue Dec 05, 2006 9:43 pm
- Location: Newbury, UK
- Contact:
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)
Oolite Life is now revealed hereSelezen wrote:Apparently I was having a DaddyHoggy moment.
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.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)
B4 = Elite on c64 & now = Oolite1.73.4repositories UBUNTU OpenGL2.1.2 NVIDIA180.44 & vertex shaders eVGA GeForce7950GT512 P4-3.2mhz/3gb