Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
More Weapon slots + IFV business
#16
thats what i thought, what about the ROF magic?
Reply
#17
Not even with saved targets?
Like, assume a Mammoth Tank with cannon and missiles.
Three targets, tank_1, tank_2 and aircraft.

Code:
vector<targets> tempTargets;
while(!this->guardArea->getNumTargets()) {
    if(tempTargets.empty() || tempTargets.size() < this->getGunNumber())
        while((tempTargets.size() < this->getGunNumber()) && (this->guardArea->getNumTargets() > tempTargets.size()))
            tempTargets.push_back(this->pickTarget());

    for(int i = 0; i <= tempTargets.size(); i++)
        if(this->canCurrentlyAttack(tempTargets.at(i))) // if there is currently a gun available that can attack that target,
            if(this->attack(tempTargets.at(i))) tempTargets.erase(i); //... attack it // attack attacks, returns true if the target was destroyed
}
tempTargets.clear(); // to clear targets if not all were destroyed, but they are not in the guard area anymore
Absolutely pseudo code and totally oblivious of the actual game code (so there's no point criticizing the actual code), just to illustrate the idea - basically just pick a target for each weapon, store them all in a list/array/vector/whatever, then run through them - if that target can currently be attacked with any weapon, attack it, if not, go to the next target and try that. Ideally, the target selection would be smart to pick targets for the different weapons - so in this example, the Mammoth would pick tank_1 and aircraft, fire at tank_1, fire at aircraft while it can't fire at tank_1, and ignore tank_2 until tank_1 was destroyed.

Not sure if that's possible, just throwing out an idea. It would, of course, also have to account for the whole target-following logic.
Forum Rules

(01.06.2011, 05:43:25)kenosis Wrote: Oh damn don't be disgraced again!

(25.06.2011, 20:42:59)Nighthawk Wrote: The proverbial bearded omni-bug may be dead, but the containment campaign is still being waged in the desert.
Reply
#18
hmmmm
my guess is that it'd still be too difficult to acctually implement, since you're completely re-writing the way you target things. same could be said for the ROF and weapons firing, but, firing a weapon takes less "magic" than firing at multiple targets.

how can i say this in a simple way...

or easier to interperate way...

well, with ROF, all you're dealing with is 1 choice, "can i fire this weapon yet?" if you have more than 1 weapon to fire, then you have the "which weapon should i fire?" choice, so, only really 2 at max

when dealing with multiple targets, you're dealing with a few things:
questions:
1. how do i know what units i should fire at?
2. where should i point my turret?
3. what unit should i shoot this weapon at? (you've just gotta be assuming more than 1 weapon)

Answers:
1. you're looking at, basicly, telling it to attack more than 1 unit at a time, do you assume they'll auto target?
2. 1 way to solve this could be to create more turrets for the unit, it'll probably be a lot of work, but, could be considered an extention of more weapons, anyway, the question still remains, if i wanna shoot a cannon at a tank, a mini gun at an infantry, and a rocket an the aircraft flying overhead, where should i point me turret? the tank, infantry, or aircraft?
3. do i fire 1 weapon at each target? this is hard to answer, 1 possible way to do this could actually be to give each weapon independant targetting, eg, a cannon turret, a minigun turret sitting on top of it that can turn independantly, perhaps instead of on top, at the back, so, we're looking at multiple turrets here again, and, a missile launcher that actually has omnifire.

TBH, you'd wanna consider multiple turrets, though not needed with omnifire, and having weapons with independant ROF before you'd even consider allowing weapons to fire at different targets.

the only exception to this is that you could consider burst weapons, like, Desolator deploy fire weapon kind of weapons that could self trigger if an enemy, maybe not our primary target, enters firing range, but still hard to do.


TBH, these are the kinds of questions we should be asking outselves for writting plan outlines for Charriot specifications, rather than YR hacking ¬.¬
Reply




Users browsing this thread: 1 Guest(s)