Author Topic: NPC Mecha Customization Mechanics  (Read 1090 times)

Offline Joseph Hewitt

  • Administrator
  • Hero Member
  • *****
  • Posts: 2552
    • View Profile
    • http://www.gearheadrpg.com
NPC Mecha Customization Mechanics
« on: August 04, 2006, 02:10:46 PM »
After thinking about it all day today, here's what I've come up with.

At first I wanted to avoid excessive randomization since it would cause the enemy's mecha to be different each time. I've changed my mind. First of all, you are not likely to be facing the same enemy at the same renown level over and over again. Also, the NPC will often be using different variants of the same mecha depending on the situation. So, the effort should be put into making sure that the theme comes across no matter what the NPC is piloting, not trying to make sure that the mecha stays the same between iterations.

The NPC will have a specialist skill and a theme picked at random during character creation. The choices for both specialty and theme will be constrained by the NPC's faction; each faction should have a list of preferred themes and specialties, although there should be a random chance of the NPC's selection being taken from outside.

Depending on the renown of the NPC (which should be set based on the difficulcy of the fight), his mecha will get a number of "modification points" to spend. If the NPC has the Mecha Engineering skill, this number of modification points will be increased.

I'll describe the modification process as though we were dealing with a pen and paper RPG. Each MP allows the NPC one roll on a mecha upgrade chart. There are different charts depending on what the NPC's specialty is. For example, the charts could look like this:

MECHA GUNNERY SPECIALIST (d10)
1-4   Weapon Upgrade
5-7   Extra Weapon
8-9   Defensive Upgrade
10    Movement Upgrade

MECHA WEAPONS SPECIALIST (d10)
1-4   Weapon Upgrade
5       Extra Weapon
6-7    Defensive Upgrade
8-10  Movement Upgrade

When an equipment upgrade is rolled, the custom parts list is checked for a part that matches the NPC's theme. The first upgrade taken will always be a weapon upgrade, since it's the weapons that will most visibly embody the themes. Movement upgrades will likely be handled as suggested by Francisco Munoz.

Weapon upgrades will replace the mecha's weapons with weapons taken from the theme item lists. The first weapon to be changed will always be the "primary weapon", which is either the most expensive weapon on the mecha or the biggest weapon that uses the NPC's specialist skill. Further weapon upgrades will replace secondary weapons with items of the same type from the theme list. Once every weapon on the mecha has been upgraded in this way, additional weapon upgrades will cause the primary weapon to be improved.

When upgrading a weapon, the upgrade will be chosen by searching through the list for a weapon which uses the same skill as the weapon being upgraded. The first applicable weapon whose point value is equal to or greater than the point value of the weapon being replaced is chosen.

Integral weapons will not be counted for the purposes of weapon upgrades.

Notice that no modifications are listed for the gyro/tarcomp; this is because the mechanics for these are likely to be changed in the near future.

The persona fragments dealing with combat should also make use of the NPC's theme. For instance, a pyromaniac NPC might tell the player "I'm going to burn you up!". I should also add a combat introduction persona fragment, to be used the first time a particular NPC is faced in battle. This fragment would explain the NPC's theme (or, alternately, some other aspect of his background or personality). For instance, an industrial NPC might tell the PC something like "Years of working at the shipyard have taught me to handle this mecha like my own body. Let's see if your theory can survive against my experience!". There could be introductory persona fragments correlating the different factions with each of their preferred themes, just to make sure that every NPC with the same theme doesn't give the same introduction.

What do you think? Are there any gaping holes in my brilliant plan? Of course, there are still a lot of details to work out. I think this will make for an interesting system, though.

Offline draconuszero

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
NPC Mecha Customization Mechanics
« Reply #1 on: August 04, 2006, 07:28:21 PM »
Just as a clarification, is this for your rival npc, or just any npc you face?  Overall, it sounds like a very intersting idea, so things can be a fresh rather than facing the same mecha over and over.

Offline macksting

  • Hero Member
  • *****
  • Posts: 1085
    • View Profile
    • http://forums.wintercomic.com
NPC Mecha Customization Mechanics
« Reply #2 on: August 04, 2006, 07:55:51 PM »
This sounds wonderful for the final Arena, where so many of your opponents chat with you anyway. :)
Hmm.
Gladiator: "Your death shall bring me glory and honor."
Ninja: "Weakness is death. I sense weakness in you."
Fire: "You thought you'd win until I showed up. It just burns you up, doesn't it?"
Airborne: "Death by particle beam, 20 seconds. Your wager?"
Heavy Weapons: "There won't be enough left of you to bury."

Offline Anticheese

  • Hero Member
  • *****
  • Posts: 651
    • View Profile
NPC Mecha Customization Mechanics
« Reply #3 on: August 04, 2006, 11:23:08 PM »
Gaping holes? I cant see many, But I would like to see it in action before I judge it...

How long untill we can expect it in a GH2 Alpha?

Offline Joseph Hewitt

  • Administrator
  • Hero Member
  • *****
  • Posts: 2552
    • View Profile
    • http://www.gearheadrpg.com
NPC Mecha Customization Mechanics
« Reply #4 on: August 05, 2006, 02:15:04 AM »
Quoting: draconuszero
Just as a clarification, is this for your rival npc, or just any npc you face?

This is for any NPC who has a Character ID that takes part in a mecha battle. So, it would affect your opponents as well as any friendly NPCs that you fight against. The hordes of faceless grunts without CIDs would all be stuck using stock mecha.

Quoting: Anticheese
How long untill we can expect it in a GH2 Alpha?

Well, I'm quite worked up over it, so I'd expect to see it soon. :)

Offline macksting

  • Hero Member
  • *****
  • Posts: 1085
    • View Profile
    • http://forums.wintercomic.com
NPC Mecha Customization Mechanics
« Reply #5 on: August 06, 2006, 08:37:30 PM »
Shweet.

Offline Joseph Hewitt

  • Administrator
  • Hero Member
  • *****
  • Posts: 2552
    • View Profile
    • http://www.gearheadrpg.com
NPC Mecha Customization Mechanics
« Reply #6 on: August 07, 2006, 12:07:36 PM »
I started work on the system today. Fortunately, we are now on summer schedule at the school, which means we start earlier but get extra breaks throughout the day. So, I had plenty of air-conditioned time to work on GearHead.

If no skill specialty can be found, a theme and specialty are assigned when a NPC's skill level is set. The skill specialty is picked from a list associated with the NPC's faction. After that, the theme is picked from a list based on the NPC's faction, job, personality traits, and skill specialty.

So far so good. Next, I've started work on the mecha customizer itself. The customizer procedure is given a mecha, a skill specialty, a theme, and a number of modification points. Modifications are added until the points run out.

I'm starting with a simplified case- only weapon upgrades are being applied. I'll add additional upgrade types one at a time. Here are the comments for the weapon upgrade procedure (I haven't started writing the code in between yet):

{ Step one- locate the weapon to remove. }
{ If no weapons can be found at all (degenerate!), cut to the AddWeapon }
{ procedure instead. }
Each weapon in the mecha records the number of times it has been upgraded. When a new upgrade is requested, one of the weapons with the lowest upgrade total is selected to be upgraded. The mecha's "primary weapon" should be chosen as the first weapon to upgrade, then not selected again until all other weapons have been upgraded as well.

Note that I now need a procedure to determine what counts as a mecha's primary weapon. This will usually be the most expensive non-intrinsic weapon, but I think the NPC's specialist skill should also have something to do with it. When modifying a BuruBuru, usually the Shaka Cannon will be selected as the primary weapon. A character specializing in Mecha Weapons should treat the Axe as the primary weapon instead.

Hmm.. Maybe I can dispense with the notion of primary weapons altogether. Just always select the weapon with the fewest modifications, or the most expensive one that uses the PC's preferred skill, or just the most expensive one.

{ Step two- locate a new weapon from the parts list which: }
{ 1) is of the same basic type as the weapon being replaced, }
{ 2) has a value greater than that of the weapon being replaced }
{    but smaller than any other weapon matching 1. }

Every Theme gear has an equipment list in its invcoms. Because the gears are selected by value, I don't think I need to sort the lists in any way, but it will be important to make sure that the graph of lowest to highest value not have any gaping holes in it.

{ Step three- perform the swap. }
{ Record the number of upgrades + 1 in the new weapon. }

{ Step four- check to make sure the MV is as good as it ever was. }
{ If the MV has improved, this modification costs one point extra! }

That's it. I'll be working out the implementation tonight and tomorrow. I'll let you know how that works out.

Offline macksting

  • Hero Member
  • *****
  • Posts: 1085
    • View Profile
    • http://forums.wintercomic.com
NPC Mecha Customization Mechanics
« Reply #7 on: August 07, 2006, 08:04:01 PM »
Personally, I suggest just testing each of these ideas out, simplest first (that being "most expensive non-intrinsic") at varying point values, to figure out how well it works.
An important question. Will this incorporate AI routines which will select amongst the weaponry appropriately? If not, you may want to build around the AI routines, lest the Theme system never be noticed.

Offline Joseph Hewitt

  • Administrator
  • Hero Member
  • *****
  • Posts: 2552
    • View Profile
    • http://www.gearheadrpg.com
NPC Mecha Customization Mechanics
« Reply #8 on: August 08, 2006, 12:14:15 AM »
Quoting: macksting
An important question. Will this incorporate AI routines which will select amongst the weaponry appropriately? If not, you may want to build around the AI routines, lest the Theme system never be noticed.

Well, I'm hoping that it'll work fine with the current AI routines, especially now that Peter Cordes has tweaked them a bit. If not then I'll figure something out then.

Offline peter

  • Jr. Member
  • **
  • Posts: 77
    • View Profile
NPC Mecha Customization Mechanics
« Reply #9 on: August 08, 2006, 03:14:56 AM »
Quoting: Joseph Hewitt
Well, I'm hoping that it'll work fine with the current AI routines, especially now that Peter Cordes has tweaked them a bit. If not then I'll figure something out then.


 Yeah, the AI gives signficant weight to weapons that the pilot is more skilled with, as long as said weapon is in range.  The AI tries to do as much damage as possible to the target it has selected, but also to hit with something.  Ideally saving a high-damage but harder to hit with weapon for next turn when they have a clear shot.  When attack+mods and defense skill are close to equal, one point of accuracy is rated equal to 2 points of DC.  (and DC includes bonuses for ARMORPIERCING, BRUTAL, HYPER, spot weakness... :)  The weapon selection routine does pretty well.  Further work on the AI would probably do best to start by re-designing how the AI selects targets, and maybe looking at point values, or damage of the target.

 The optimal range decision code doesn't take into account the relative skill with different weapons, though. :(  So a close-combat specialist who also had some long-range weapons might not want to close all the way to hand-to-hand range.  This is something that might benefit from some intervention by the NPC specialty code.  (e.g. fighting and weapons specialists get their OptMin and OptMax set to 0 and 1 or 2.)

Offline Joseph Hewitt

  • Administrator
  • Hero Member
  • *****
  • Posts: 2552
    • View Profile
    • http://www.gearheadrpg.com
NPC Mecha Customization Mechanics
« Reply #10 on: August 08, 2006, 04:22:42 AM »
I've got the procedure ready, and it compiles, so now I'm working on a theme and an equipment list to go with it. My first theme is going to be "Pyromaniac", since it's a pretty easy one to think up weapons for and there's a bunch of incindiary weapons in the STC file.

I just thought of a problem, though- if the primary weapon is chosen for upgrade, but there isn't a weapon in the parts list more expensive than it, then no weapon will get upgraded at all. Oops. I'll probably find all kinds of other bugs once I start the real test.

Offline Joseph Hewitt

  • Administrator
  • Hero Member
  • *****
  • Posts: 2552
    • View Profile
    • http://www.gearheadrpg.com
NPC Mecha Customization Mechanics
« Reply #11 on: August 08, 2006, 10:24:35 AM »
After a few false starts I've successfully tested the "Pyromaniac" theme. The weapon upgrader works well, and the effects are quite evident in-game. A few points, though:

1) Did you know that the laser in the head of the Buru-Buru is more expensive than the shaka cannon? So, it always gets picked as the primary weapon.

2) There's some kind of a bug wherein an otherwise healthy Wraith will spontaneously disintegrate. I suspect the culprit is somehow the flight movemode. This only seems to happen on a peaceful map, not usually in battle.

3) Lots of weapons are going to be needed for each theme: I'd say a full load would consist of 10 each big guns, small guns, melee weapons, and missile launchers.

That's about it for now. I'll let you know when I have more bugs to report.

Offline Francisco Munoz

  • Sr. Member
  • ****
  • Posts: 401
    • View Profile
    • http://www.wesnoth.org
NPC Mecha Customization Mechanics
« Reply #12 on: August 08, 2006, 10:50:28 AM »
You should give priority weigths to weapons instaled in weapon mounts (lets say x2) and hands (and x3)
 They are "percieved main weapon" and as they are easiest to swap usually makes more sense to have somebody swap them.
 Andmaybe you shiould also add some kind of penalty to weapon in modules overstuffed (total weigth lowered by 10% per each complexity point extra in the module)

Offline macksting

  • Hero Member
  • *****
  • Posts: 1085
    • View Profile
    • http://forums.wintercomic.com
NPC Mecha Customization Mechanics
« Reply #13 on: August 08, 2006, 07:18:56 PM »
That you're using Peter's AI tweaks told me all I needed to know. It sounded like he drastically changed the way weapons were selected. Should work great. :)

Offline Joseph Hewitt

  • Administrator
  • Hero Member
  • *****
  • Posts: 2552
    • View Profile
    • http://www.gearheadrpg.com
NPC Mecha Customization Mechanics
« Reply #14 on: August 09, 2006, 12:34:44 AM »
Quoting: Francisco Munoz
You should give priority weigths to weapons instaled in weapon mounts (lets say x2) and hands (and x3)

Good idea, and pretty easy to work in.

Quoting: Francisco Munoz
Andmaybe you shiould also add some kind of penalty to weapon in modules overstuffed (total weigth lowered by 10% per each complexity point extra in the module)

I think that either A) overstuffing should be prohibited, or B) overstuffing modules will cost extra modification points. This is likely to be an issue when I get around to adding the movement upgrades, since most of the high-end models are fully stuffed already.