Difference between revisions of "AI War 2:Xml Modding Modular Ships"

From Arcen Wiki
Jump to navigation Jump to search
Line 39: Line 39:
 
*** Personally, I think that min_mark_level_to_function="X" and then having a blatantly more powerful module available later is creating busywork for players.  It's fun to get new things as a ship line marks up, but it's probably more fun to mix and match than to just select the new singular most powerful item.
 
*** Personally, I think that min_mark_level_to_function="X" and then having a blatantly more powerful module available later is creating busywork for players.  It's fun to get new things as a ship line marks up, but it's probably more fun to mix and match than to just select the new singular most powerful item.
 
*** For similar reasons, I'd honestly suggest staying entirely away from max_mark_level_to_function="X" on modular ships if you can.  Phasing out old modules will leave the interface cluttered and prevent players from customizing as much as they might want to.  But you certainly CAN do it, it functions.
 
*** For similar reasons, I'd honestly suggest staying entirely away from max_mark_level_to_function="X" on modular ships if you can.  Phasing out old modules will leave the interface cluttered and prevent players from customizing as much as they might want to.  But you certainly CAN do it, it functions.
 +
** However you handle your costs, please make sure that it is feasible and reasonable for the player to always spend all of their points at all times!  The game shows a warning to players who have not spent all their points, and so if you make it impossible for them to select the new cool thing plus spend the remainder of their points, they're going to complain because they now have a permanent notification sitting on their screen.
 +
*** No there's not a workaround for this, either, haha.  If we say "this is fine being un-spent," then when they get new points via an upgrade, it won't show them.  If we say "allocate X points for now as okay" then that could in theory solve it, but that's more complex and far less interesting than you just giving them some neat cheap options to fill out any build they have going on.
  
 
* '''unique_module_index''': In order to save data under the hood for which modules are enabled or disabled, this must exist for each module, it must be between 0 and 254, and there must be no duplicates for a given ship.
 
* '''unique_module_index''': In order to save data under the hood for which modules are enabled or disabled, this must exist for each module, it must be between 0 and 254, and there must be no duplicates for a given ship.

Revision as of 20:34, 20 February 2022

Modular ships have come to AI War 2 as of version 3.900! This guide is meant for folks who already understand how to design a non-modular unit, and it explains all the differences and new things that are specific to modular ships.

Overview

  • Modules are defined as an inseparable part of the ships that use them.
    • If you want to share a module between multiple ships, you'll either need to use copy_from (xml inheritance) or literally copy the xml.
  • Modules are all systems, but not all systems are modules.
  • There is a general limit of 254 systems, which also means 254 modules.
    • That said, if you're adding more than 50 or so, the player is probably going to have a bad time.
  • You can include non-module systems on a modular ship, and you can also default modules on at certain mark levels.
  • The ship will have a certain starting budget for modules (that can be zero), and a certain number of added module points per mark level (can also be zero, but both can't be zero for the ship to still be modular).
    • Players allocate these module points on modules of various costs, and that's how they customize their ship.
      • This is done from a new Module button in the Fleet Management window.
  • Modules are ship-line-wide, not ship-specific. So for instance if you have a bunch of spire cruisers that you want to customize, you have to do them in groups from each city that is bolstering that fleet.

Defining A Unit As Modular, And Giving It A Budget

Before you can do anything with the systems themselves, and before a ship will show the Module button in the fleet management window, you need to mark a ship as modular. To do that, you give it a module budget, either right off, or over time as mark levels increase.

It is possible to design ships that don't become modular until some mark level by giving a zero or negative starting module budget, and then giving positive module points per mark level. Let's not make it too complex on players, though.

  • module_points_from_start: This attribute goes on the modular unit, and says its starting budget. It can be any number, and the scale does not matter. If you want players to spend 50 points per module, and 100 for expensive ones, you can do that. Generally I would say smaller numbers are easier to understand, however.
    • Usually module costs of 1 for cheap, 2 for normal, 4 for expensive, and maybe something higher for Very Expensive (tm) seems like it will handle most cases.
    • You can use different module point scaling on different units, if you need to. All of the modules are baked into the unit they are a part of, as is the module budget, so it's a self-contained formula per unit.
  • module_points_added_per_mark_level: This is optional, but lets players earn more module points as their unit marks up. This is generally going to be highly desirable, but it's going to lead to extra power creep. Each module is getting more powerful as the player levels up, AND they're getting more modules? Make sure to account for that in your balance if that's how you do things.
    • An alternative to the power-creep approach is having everything be available from mark 1, and it's just a matter of which loadout is chosen. This duplicates the concept of things like the Riot Control Cruiser from AI War Classic, whereas the "more module budget over time" is more like champions.

Anyhow, for the ship itself, this is literally all you need to add, so that's pretty simple. The complexity comes in the systems.

Defining Systems As Modules

Normally, when a unit is assigned a system, it will always be a part of that ship (or available on that ship for only certain mark levels, perhaps). These types of systems are still present of course, and you can have these on a modular ship, too. For any system that is just to be an inbuilt normal part of a modular ship... do everything normally! Skip anything module-related and it will just be a core part of the ship and not available on the modules select screen for players.

For any modules that you want to define, however, those will all be systems. And THOSE systems have a number of specific attributes that are required to correctly identify them as a module, as well as stating how the module will be used.

  • module_point_cost: This is the first key attribute that tells the entire system that "hey, I'm a module, I am normally not going to be a part of this ship unless a player selects me. And if the player selects me, this is how many module points it will cost."
    • It is not possible to scale module costs by mark level. However, if you wanted to do something like that, the best approach would be the usual min_mark_level_to_function="X" (to make something not available until a later mark level) or max_mark_level_to_function="X" (to make something phase out at higher mark levels).
      • Personally, I think that min_mark_level_to_function="X" and then having a blatantly more powerful module available later is creating busywork for players. It's fun to get new things as a ship line marks up, but it's probably more fun to mix and match than to just select the new singular most powerful item.
      • For similar reasons, I'd honestly suggest staying entirely away from max_mark_level_to_function="X" on modular ships if you can. Phasing out old modules will leave the interface cluttered and prevent players from customizing as much as they might want to. But you certainly CAN do it, it functions.
    • However you handle your costs, please make sure that it is feasible and reasonable for the player to always spend all of their points at all times! The game shows a warning to players who have not spent all their points, and so if you make it impossible for them to select the new cool thing plus spend the remainder of their points, they're going to complain because they now have a permanent notification sitting on their screen.
      • No there's not a workaround for this, either, haha. If we say "this is fine being un-spent," then when they get new points via an upgrade, it won't show them. If we say "allocate X points for now as okay" then that could in theory solve it, but that's more complex and far less interesting than you just giving them some neat cheap options to fill out any build they have going on.
  • unique_module_index: In order to save data under the hood for which modules are enabled or disabled, this must exist for each module, it must be between 0 and 254, and there must be no duplicates for a given ship.
    • The order of these is fairly irrelevant, but if you don't specify any other sorting, then the interface will sort by the name, and then this if the names are duplicative.
    • With that said! Please don't change the unique module index after a savegame has gone to the wild! The savegames will remember which indices were active, not which modules by name, so if you renumber all your modules, that's scrambling player saves something fierce.
  • module_screen_sort_group: This is an integer that lets you visually sort ships into groups, or visually sort each and every one.
    • This is a great way to say "the default is always first (at sort 0), then the basic options are next (at sort 10), then the expensive stuff (sort 20 maybe), and then the auxiliary stuff (at maybe sort 90).
    • If you want to hand-order your module options, you can also do that with this, just giving each one a specific number. If I may make a suggestion? Skip by 10s or 100s if you do that, so you have room to insert new entries later. You can enter any numbers here, so don't just go 1, 2, 3, or you might find yourselves painfully reordering them later.
    • Do NOT reorder systems themselves in the xml, by the way! If you do, that's a potential scrambling of existing saves, too. Once systems are added, they are what they are. You can change the visual order with this. If you need to remove one... try to avoid needing to do that. Replace it with something else instead. Removing one would reorder all the ones lower in the xml than it, scrambling savegame data again.
  • module_is_enabled_by_default_at_mark_level: Unless you have some non-modular weapons that are applied from the start to a unit, it's very likely you want to apply a starting weapon or weapons to a ship, or it will seem to be unarmed when the player first gets it.