OpenXcom Forum

Modding => Resources => Topic started by: Alex_D on October 12, 2020, 05:44:55 pm

Title: [UNIT] Drone Carrier Tank
Post by: Alex_D on October 12, 2020, 05:44:55 pm
This submod for XCF include graphics and rulesets designed to implement a new unit in X-Com. The unit is a 2x2 tank that can fire (spawn) other units controlled by the player. These spawned units can fight for X-Com, but they are lost and thus are not recoverable after battle.

As an example of these spawning units, the "X-Com cybermite" is implemented. These come in clips of 8 and are fired by the tank. The X-cybermite can melee attack as the original alien cybermite. In addition, the X-Com cybermite can self destruct if desired.

Other clips for other units may be implemented at a future date. The scripts optimized for XCF.

Comments are appreciated.

EDIT: See updated submod here: https://openxcom.org/forum/index.php/topic,8641.msg133134.html#msg133134 (https://openxcom.org/forum/index.php/topic,8641.msg133134.html#msg133134)
Title: Re: [UNIT] Drone Carrier Tank
Post by: Yankes on October 12, 2020, 06:09:37 pm
https://www.youtube.com/watch?v=2vj37yeQQHg :)
Title: Re: [UNIT] Drone Carrier Tank
Post by: HT on October 12, 2020, 09:05:43 pm
Very interesting! Can you copy the thread into the XCF mod subforum then, if only so that Solarius sees it? If it's good enough, he'll probably integrate this.
Title: Re: [UNIT] Drone Carrier Tank
Post by: Alex_D on October 13, 2020, 12:39:03 am
https://www.youtube.com/watch?v=2vj37yeQQHg :)

Hmm. That gives me ideas for the HOVERTANK version :)

Very interesting! Can you copy the thread into the XCF mod subforum then, if only so that Solarius sees it? If it's good enough, he'll probably integrate this.

He knows it. I mentioned it to him over Discord.
Title: Re: [UNIT] Drone Carrier Tank
Post by: Solarius Scorch on October 13, 2020, 12:52:35 am
I've spoken with Alex earlier and this is exactly what I wanted to do myself... Except that I planned a Hovertank version. And yes, it was definitely inspired by the Starcraft Carrier. :)
Title: Re: [UNIT] Drone Carrier Tank
Post by: Alex_D on October 13, 2020, 05:59:20 pm
I've spoken with Alex earlier and this is exactly what I wanted to do myself... Except that I planned a Hovertank version. And yes, it was definitely inspired by the Starcraft Carrier. :)

Hovertank using the X-Com sprites (then it's a simply turret change plus some easy extra rul code for the HT version),

or hovertank using a new sprite, just for extra flavor?

I can definitely see a tank that looks and behaves like the SCC, even firing shielded drones that fire lasers and suicide explode when required. :o  What sort of secondary weapon this machine ought to have?
Title: Re: [UNIT] Drone Carrier Tank
Post by: Solarius Scorch on October 13, 2020, 11:24:52 pm
I meant a completely new sprite, just hovering. I don't have any graphic yet, but I imagine something similar to the Large Alien Drone.

I don't know if it should have any secondary weapon at all, since it just deploys drones... Maybe something supportive instead? A medikit would be silly, and smoke is trivial...
Title: Re: [UNIT] Drone Carrier Tank
Post by: Yankes on October 14, 2020, 01:27:12 am
Repair beam? You can shoot your drones to fix them.
Title: Re: [UNIT] Drone Carrier Tank
Post by: Solarius Scorch on October 14, 2020, 01:51:42 am
Repair beam? You can shoot your drones to fix them.

Yeah, something like that. Requires some big brain time though - implementation aside, introducing such a concept would mean more changes, like other ways to fix drones.
Title: Re: [UNIT] Drone Carrier Tank
Post by: JustTheDude/CABSHEP on October 14, 2020, 12:03:32 pm
Yeah, something like that. Requires some big brain time though - implementation aside, introducing such a concept would mean more changes, like other ways to fix drones.

Nanomachines, son. Sounds like the easiest way to introduce the concept of fast in-combat repairs of robotic units, while keeping it belivelable. Nanite repair grenade and such would be possible.

While I don't know anything about coding, I also (sort of) came up with solution for repair implementation. If it would be possible to somehow make armor on certain units degrade faster than on others, then it could be used.
Giving drones a lot of armor, but also a lot of damage vulnerabilities (like 200% base, instead of 100%) then armor would act like drone HP, while normal HP would act as "internal critical damage" that wouldn't be possible to repair in combat. Then the repair bits could be taken from 40k mod, from their "Servitor" that has inbuilt weapon that "heals" armor on attack and is used for that purpose.
Title: Re: [UNIT] Drone Carrier Tank
Post by: Solarius Scorch on October 14, 2020, 02:05:54 pm
Nanomachines, son. Sounds like the easiest way to introduce the concept of fast in-combat repairs of robotic units, while keeping it belivelable. Nanite repair grenade and such would be possible.

I'll be blunt about this: iudging from what we see in the game, the proposed level of nanotechnology far exceeds not only X-Com, but even the aliens themselves. An Ethereal would consider it "pure science-fiction".

If such technology existed in the game, everything would be completely different. None of the weapons or units would make sense. Heck, none of the tactics enabled by X-Com mechanics would make sense, since everything would be about nano cloud warfare.

Add to this the dubious value of nanomachines on a battlefield in general - due to very poor resistance to sunlight, heat, even mild chemicals etc.

Nanotech is very promising, but mostly in medicine, as the inside of a human body is much friendlier than the outside, and also the potential applications are much more subtle than "build a tank". If you really want macro-scale effects, I'd rather suggest doing something like the "living metal" from 40k, or the T-1000 structure - but it's not exactly the same thing as a nano cloud, and still above Cydonia tech level.

Sorry, I don't mean to bash the idea, and I really appreciate the brainstorming, but I really want to get this point across - nanomachines are not an answer to every engineering problem.

While I don't know anything about coding, I also (sort of) came up with solution for repair implementation. If it would be possible to somehow make armor on certain units degrade faster than on others, then it could be used.
Giving drones a lot of armor, but also a lot of damage vulnerabilities (like 200% base, instead of 100%) then armor would act like drone HP, while normal HP would act as "internal critical damage" that wouldn't be possible to repair in combat. Then the repair bits could be taken from 40k mod, from their "Servitor" that has inbuilt weapon that "heals" armor on attack and is used for that purpose.

The 40k solution is indeed the closest thing I can think of. I'd really like a real engine solution, though. The real problem being the weapon only applicable to mechanical units - but there is not even such tag, and tying it to zombiImmune, bleedImmune etc. might be a bit clunky. Negative damage based on a special resistance would work, but would make armour entries look weird (a human unit would still show "resistance" to this "damage type" as 0%). This is why I'm not that keen on drone repair as a feature, given the current options.
Title: Re: [UNIT] Drone Carrier Tank
Post by: Yankes on October 14, 2020, 07:09:55 pm
For "only mechanical" can be solved by custom script tags (in weapon and armor), this could be even expand to whole category of targets and what can affect them (more generic version of resistances).
Title: Re: [UNIT] Drone Carrier Tank
Post by: Solarius Scorch on October 14, 2020, 08:04:47 pm
For "only mechanical" can be solved by custom script tags (in weapon and armor), this could be even expand to whole category of targets and what can affect them (more generic version of resistances).

Yeah, I thought about something like this, but I haven't worked out all the details yet. I am now busy with some big changes and I'm not really in the position to carefully design this part. But I'll appreciate it if someone else gives it a try.
Title: Re: [UNIT] Drone Carrier Tank
Post by: Yankes on October 14, 2020, 08:30:11 pm
Code: [Select]
carefully design this partProbably this is only hard part there, how exactly it should work to have best results for gameplay/immersion.
Title: Re: [UNIT] Drone Carrier Tank
Post by: Alex_D on October 14, 2020, 09:00:31 pm
Code: [Select]
carefully design this partProbably this is only hard part there, how exactly it should work to have best results for gameplay/immersion.

Can it be done via a tag next to the armor(or unit) to identify whether the unit is susceptible to this/that special type of healing weapon (via scripts)?
Title: Re: [UNIT] Drone Carrier Tank
Post by: Yankes on October 14, 2020, 09:23:33 pm
This is trivial, you need two tags, one on weapon that enable this behavior, and another in armor that allow to choose correct target,
then in damage script add something like this (this is not correct script only idea):
Code: [Select]
weapon.getTag a Tag.NEED_SPECIAL_TARGET;
unit.getTag u Teg.SPECIAL_TARGET;
if neq a 0;
  if neq a u;
    set power 0;
  end;
end;
This make that if weapon have set tag `NEED_SPECIAL_TARGET` then it only can "damage" armor that have setted `SPECIAL_TARGET` with same value.
Title: Re: [UNIT] Drone Carrier Tank
Post by: The Martian on October 15, 2020, 11:32:30 am
This is trivial, you need two tags, one on weapon that enable this behavior, and another in armor that allow to choose correct target,
then in damage script add something like this (this is not correct script only idea):
Code: [Select]
weapon.getTag a Tag.NEED_SPECIAL_TARGET;
unit.getTag u Teg.SPECIAL_TARGET;
if neq a 0;
  if neq a u;
    set power 0;
  end;
end;
This make that if weapon have set tag `NEED_SPECIAL_TARGET` then it only can "damage" armor that have setted `SPECIAL_TARGET` with same value.

This looks like it will be very useful, thank you for sharing your code Yankes.

Much more efficient than using up one of the specilized damageType: and having to configure it for all units and weapons involved.

(I could be wrong as I am still very unfamiliar with the syntax of scripting, but I think there may be a typo on line 2. Should Teg.SPECIAL_TARGET instead be Tag.SPECIAL_TARGET?)
Title: Re: [UNIT] Drone Carrier Tank
Post by: Yankes on October 15, 2020, 04:54:22 pm
This was only draft, and have omissions and bugs, and yes correct is `Tag`.
Title: Re: [UNIT] Drone Carrier Tank
Post by: Solarius Scorch on October 15, 2020, 05:15:16 pm
Thanks, I'll have a look when I have some free time!

If someone else wants to give it a try and introduce this feature in XCF, I would be interested in merging it.
Title: Re: [UNIT] Drone Carrier Tank
Post by: Alex_D on October 15, 2020, 10:51:47 pm
FYI, for those who think drone-launching land vehicles aren't a thing:
https://www.thedrive.com/the-war-zone/37062/china-conducts-test-of-massive-suicide-drone-swarm-launched-from-a-box-on-a-truck (https://www.thedrive.com/the-war-zone/37062/china-conducts-test-of-massive-suicide-drone-swarm-launched-from-a-box-on-a-truck)
Title: Re: [UNIT] Drone Carrier Tank
Post by: Solarius Scorch on October 16, 2020, 12:27:14 pm
FYI, for those who think drone-launching land vehicles aren't a thing:
https://www.thedrive.com/the-war-zone/37062/china-conducts-test-of-massive-suicide-drone-swarm-launched-from-a-box-on-a-truck (https://www.thedrive.com/the-war-zone/37062/china-conducts-test-of-massive-suicide-drone-swarm-launched-from-a-box-on-a-truck)

Very interesting, though hardly surprising. :)
Title: Re: [UNIT] Drone Carrier Tank
Post by: Alex_D on October 21, 2020, 06:59:35 am
Version 1.1 of the submod.

A new unit has been added. A very  alien-looking Hovertank Carrier.
A new drone unit has been added: A flying attack drone.

All art based on a certain game that starts with Star and end with Craft.

Comments are appreciated.

EDIT: Code optimized. No other change. Thanks to Meridian for the tips.