Weapons range variable?

Weapons range variable?

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Weapons range variable?

Post by PauloMorfeo »

Is it possible to have, for example, missile towers have a range of x for ground units but y for airborn units?
j5mello
Posts: 1189
Joined: 26 Aug 2005, 05:40

Post by j5mello »

yes and no. it can be done but not on one weapon. U would have to make two weapons (anti-gorund and anti-air) and jam the one ur not using.
User avatar
BlackLiger
Posts: 1371
Joined: 05 Oct 2004, 21:58

Post by BlackLiger »

j5mello wrote:yes and no. it can be done but not on one weapon. U would have to make two weapons (anti-gorund and anti-air) and jam the one ur not using.
Then someone needs to make a patch to change that. It's been done before. the C&C games always had AIRBOOST as a tag.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Yes but that would still be hardcoded behaviour to split between air and ground units. Just use two weapons that have disjunct onlytargetcategory tags.
User avatar
BlackLiger
Posts: 1371
Joined: 05 Oct 2004, 21:58

Post by BlackLiger »

KDR_11k wrote:Yes but that would still be hardcoded behaviour to split between air and ground units. Just use two weapons that have disjunct onlytargetcategory tags.
Viable for OTA style units. If I recall, spring has a 32, is it, weapon maximum for a unit before it begins to lag badly with calculation. Thats with 1 unit. Now, for a mod I've been designing, I want a unit with at least 9 different, independant weapons. I can have 3 of them on the map without much lag. Therefore, as 1 of them is an anti tank/anti air missile, it'd become 10 by your method. Annoying, but bearable. However, what about a mod with 10 weapons by default on a unit? that becomes 11, so lag occurs after 3 units are built. Which annoys the hell out of players.
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Post by PauloMorfeo »

But wouldn't that mean that the unit would have it's firepower doubled?

I mean, it could have it's ground weapon *and* it's air weapon shooting at the same time, if it hapens to have both a ground and an air target. Suposedly, a Missile Tower only has *one* weapon.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Paulo: Jam the weapon if the other weapon has aimed or shot recently.

Liger: What do you have that many weapons for? Are you sure you couldn't turn some of them into one weapon that uses multiple firepoints?

This is still very special case behaviour that IMO does not belong into the engine, if you want tons of weapons that behave differently against different targets use multiple weapons.
User avatar
BlackLiger
Posts: 1371
Joined: 05 Oct 2004, 21:58

Post by BlackLiger »

KDR_11k wrote:Paulo: Jam the weapon if the other weapon has aimed or shot recently.

Liger: What do you have that many weapons for? Are you sure you couldn't turn some of them into one weapon that uses multiple firepoints?

This is still very special case behaviour that IMO does not belong into the engine, if you want tons of weapons that behave differently against different targets use multiple weapons.
Independant targeting of each weapon on a different target.

I dont want this tank surrounded by infantry and only able to shoot at 1 of them....
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Make sure their firearcs differ, then. The Trireme in CvC has eight lasers to attack eight targets at once but in practice it always fires all of them at the same target.
User avatar
BlackLiger
Posts: 1371
Joined: 05 Oct 2004, 21:58

Post by BlackLiger »

KDR_11k wrote:Make sure their firearcs differ, then. The Trireme in CvC has eight lasers to attack eight targets at once but in practice it always fires all of them at the same target.
Shouldn't the code simply disable the other guns and only use the one that can aim at the target, in your method?
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Targets don't change if you let an aim function fail. What KDR means is that one weapon get a 135° firearc to the left and the other 135° to the right for example, then both weapons could engage different targets to the left and right of the unit.
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Post by PauloMorfeo »

KDR_11k wrote:Paulo: Jam the weapon if the other weapon has aimed or shot recently.
...
Like j5mello said. That is a scripting thing, right?

Would i be able to jam it for the weapon's reload time or would it need to be jammed for a specific time? If i need to specify a time for the jam in the script, that will mean that that unit is unmaintainable since every single time i want to rebalance it by changing reload times, i would have to recompile it's script...
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Let's say Weapon1 and Weapon2 are technically the same, during their Aim function they check a static var and if it's true they assume the other weapon is blocking stuff. Whenever one of them fires it sets the var that blocks the other and starts a function that will reset it after the reload time is over (make sure you kill this function with a signal if a Fire function is called again before the blocking ends, just in case).

All weapons follow the same targeting logic so they'll usually pick the same target if it's not invalid for some of them because of fire arcs or target categories.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Post by 1v0ry_k1ng »

just look at the E&E ural. it often targets 2-3 sepearate opponents at once.
User avatar
BlackLiger
Posts: 1371
Joined: 05 Oct 2004, 21:58

Post by BlackLiger »

hmmm. Interesting. I'll keep that in mind.

That said, many of my things have this multiple weapons that do the same job on different arcs (like a tank with a machinegun turret on 3 sides (front, left, right) to defend against infantry)
Post Reply

Return to “Game Development”