This commit is contained in:
161
src/documentation/Guide.md
Executable file
161
src/documentation/Guide.md
Executable file
@@ -0,0 +1,161 @@
|
||||
# A Simple Guide to Vanilla Navy Rework #
|
||||
|
||||
## Preface ##
|
||||
Hi, this is the author of VNR, MrPunk. VNR is a naval overhaul mod with a huge amount of new contents and mechanisms, though its core is still similar to vanilla. I bet most people, whether experienced in navy or not, might face a hard time adjusting to a fresh style of naval game. I'm not an expert, but I want to write down this guide with insights during my modding process, in an attempt to relieve players from duplicate learning.
|
||||
|
||||
You can play VNR in different ways. Stick to history if you want to do it in a realistic style, or create meta designs to simply be a winner. It's up to you which style to pick, and VNR always offers numerous things for you to achieve that.
|
||||
|
||||
## Designer ##
|
||||
Designer is the basic of VNR and the most important components you deal with. To design a ship, you need to know about your requirements and more. A good navy does not always equal to the United States Navy in real life, but it should fit in your overall strategy and geopolitical environment. Fortunately, VNR has a wide range of modules to help you customize your fleet. To begin with, I'd like to bring up the six dimensions of ship designs.
|
||||
|
||||
### Philosophy of Balance ###
|
||||
|
||||
**Firepower**
|
||||
|
||||
Firepower in HOI4 is split into 3 types of attacks, light, heavy and torpedo.
|
||||
|
||||
Light attack is provided by batteries on destroyers and cruisers, and secondary batteries on capital ships. Heavy attack is the damage done by heavy batteries on battleships or battlecruisers, and medium guns on heavy cruisers by a very small amount. While damage caused by guns is affected by armor of target which their ratio leads to very different damage and critical chance, torpedo simply ignores armor and can cause great damage and score more critical hits, but it's fired more slowly and suffers a great penalty on hit chance when screen efficiency is good. Given that enemy's screen efficiency is one vital factor in the equation, swiftly eliminating its screen ships paves the way to a grand victory because low screen efficiency of the other side will make dynamics at sea more favorable to your side.
|
||||
|
||||
A conclusion can be drawn here. Light gun is very efficient against light ships, with the other side's screen efficiency totally crushed, your fleet will have an upper hand in hitting and evasion. Heavy gun can do more damage to heavy ships due to its heavy armor piercing effects, though it's not common to see battleships sunk by it. Torpedo have a higher critical chance against heavy ships and carriers which often deals triple or even quadruple damages, but its setbacks are long loading time and low hit chance.
|
||||
|
||||
Carrier, on the other hand, is very different from all the firepowers mentioned above. Its damage relies on your air variants and sortie efficiency, and is only affected by weather, anti-air and night.
|
||||
|
||||
**Protection**
|
||||
|
||||
The protection of ships varies on different hulls. For example, destroyer has close to zero protection, cruiser has armor plates, while battleship possesses armor, scheme and torpedo defense systems.
|
||||
|
||||
When HP gets reduced to 0, the ship will be sunk. Typically, the two ways to avoid it will be enhancing your ship in terms of HP and armor strength. Having more HP brings obvious benefits that the ship can take more damage before sunk. Armor improves survivability with a different approach to reduce damage received each time it's hit. Based on the formula listed in intro panel, if armor piercing of a gun is lower than half of the armor, its damage is reduced to 20% of its original value. As a result, armor is extremely useful against guns.
|
||||
|
||||
Torpedo completely ignores armor and can cause great damage. Even torpedo defense system is not effective enough to save the ship if it gets hit by torpedo. But luckily, with a good escort force, torpedo will have a hard time penetrating the screen line to get your capital ships.
|
||||
|
||||
Contrary to most people's impression, anti-air is also a part of protection facing aircrafts and carriers. Good AA provides damage reduction or even evasion when attacked by planes, and it gets more bonus from the overall AA from your fleet, factored to align with the ship's. That means a ship without anti-air gun can also benefit from other ships' AA, but anti-air guns are mandatory if you want to shoot down the plane.
|
||||
|
||||
**Speed**
|
||||
|
||||
Besides stacking armor, another way to improve your ship's survivability is to increase its speed. Higher speed helps reduce ship's hit profile which is compared with hit chance of guns to determine whether your ship is hit or not. As an effective measure to evade gun fires, however, speed is useless against planes. In order to get a higher speed, avoid stacking too many guns or armors on a hull. Generally speaking, you'd better make capital ships around 30kn, light ships 35-40kn.
|
||||
|
||||
**Reliability**
|
||||
|
||||
The impact of reliability is not superficial, but it determines how likely the ship may suffer a critical hit or damaged in accidents. Many immature or complex modules such as quad guns and missiles will cause loss of reliability, making the ship very vulnerable in combat and training, just like the Swedish warship Wasa. In my opinion, low reliability is somewhat tolerable on platforms with higher HP, but it's definitely not recommended on light hulls.
|
||||
|
||||
**Detection**
|
||||
|
||||
Detection, or recon, is a very important factor to gain initiativeness in naval combat. It is divided into surface detection and sub detection, with influence on spotting enemy fleet or submarines. Greater detection is always good, but it's also expensive, so only vanguard fleet is usually composed of fast and dedicated recon ships.
|
||||
|
||||
**Cost**
|
||||
|
||||
Unless you are playing as US or UK, building a large fleet takes too much time and IC, and it may hamper your army production. This is especially true for countries like Germany or Soviet Union which requires army focus more than anyone else. As a result, keeping the cost of shipbuilding programs under control can make the whole experience of your game smoother.
|
||||
|
||||
### How to Design Your Ship ###
|
||||
|
||||
If you can fully understand the six dimensions, now it's time to design your first ship!
|
||||
|
||||
**Carrier**
|
||||
|
||||
Carrier serves as the main source of damage in battle, and it's heavily relied on its aircrafts. The most important thing about it is the capacity, which requires you to mount as many hangars as possible. However, having too many hangars will certainly degrade speed and other metrics, especially that organisation and HP will impact sortie efficiency. Thus, you should keep the degradation under control.
|
||||
|
||||
**Heavy Ship**
|
||||
|
||||
You can't skip heavy ships, such as battleships and battlecruisers, in your fleet. While screen ships escort capital ships, these heavy ships will escort carriers and boost their survivability by drawing aircrafts' attack. It's hard to summarize the key to such ship because it literally needs every aspect to be perfectly balanced. Firepower may not be the keypoint on battleships since their maximum HP is almost immortal compared to guns' heavy attack, but armor and AA are needed to protect itself and other ships, especially carriers. In that case, a historical battleship is more than sufficient to be included in a strike taskforce.
|
||||
|
||||
On the other hand, battlecruiser is not a good option despite its advantage of speed. Its chance to receive critical hit is higher than battleship, which battleship with high speed engine is already fast enough.
|
||||
|
||||
As for super heavy battleships, you can mount one gun on it to fully utilize its high HP, but normally it's not recommended.
|
||||
|
||||
**Cruiser**
|
||||
|
||||
Unlike vanilla, heavy cruiser and light cruiser in VNR are not defined by its gun caliber but by role. Yet there are still differences between cruiser guns. Light medium guns are similar to their origins, but medium guns have bonus on HP and armor to simulate a linear relation between survivability and tonnage. In VNR, heavy cruiser plays the role of cruiser killer instead of being useless in capital line, it's more flexible and can perform actions in both capital line and screen line based on the role you give it. As mentioned above, cruisers use light attack to eliminate screen ships and crush enemy's screen efficiency, creating a more favorable situation for your fleet to fire on the enemy. To achieve that, you need to pursue a fast and light-gun-centric design in order to keep up with destroyers and wipe out enemy's screen line as fast as you can.
|
||||
|
||||
Cruiser is not only used for attack, but also some supporting jobs, such as scouting, and sometimes it can be a luxurious option for anti-submarine and mine warfare. That's where the role system gonna help you to fully dig out all its potentials. Radar picket cruiser is perfect for spotting enemy fleet. Colonial cruiser is cheaper, good supplement to colonial empire like UK and also a second best choice for minor countries. Then you have large cruiser and missile cruiser if there are sufficient IC power within your nation. The list goes on, but one thing for sure is that cruiser offers the most possibilities in all kinds of ships.
|
||||
|
||||
**Destroyer**
|
||||
|
||||
Destroyer is weak at the first glance, but it has the best speed and visibility in the game. Since destroyer's gun is almost useless against any ships but itself, torpedo is often used as the main weapon of destroyer, making destroyer heavily depending on the diminishment of your enemy's screen efficiency. Besides, destroyers also shoulder the most important mission in the fleet, which is to maintain screen efficiency by their numbers. Therefore, cost should always be the top priority when designing a destroyer, and there are a series of roles to achieve that.
|
||||
|
||||
Typically, the generic destroyer role can handle most scenarios. Escort destroyer is cheaper and expert at anti-submarine, and frigate can reduce the cost even more with numerous degradations in other aspects. Of course, you can also try to go another way to improve quality of your destroyer. Roles like destroyer leader and super destroyer can both enhance its performance in terms of firepower and protection at the cost of a sharp increase in IC. Destroyer leader may look redundant in the list, you are correct, that's also the reason why this type of ships was eventually outdated in history.
|
||||
|
||||
**Submarine**
|
||||
|
||||
Subs are greatly nerfed compared to vanilla in terms of competing with a proper fleet, but they are still lethal towards convoys. There isn't much choice for each slot on submarine like other ships, and that makes the design of submarines quite linear and easier since all you have to do is updating it with new hulls or new modules.
|
||||
|
||||
AI in VNR has been enhanced to carry more depth charges and sonars, which is a major challenge to sub-centric games. As a result, you should try to lower your sub visibility as much as possible. Mount every useful module, including snorkel and pressure hull, on your sub and keep them updated to the latest.
|
||||
|
||||
### Special Hulls ###
|
||||
|
||||
Special hulls are ships that can't be simply represented by generic ship hulls. They are made for flavor and immersion. Using them does not always give you a good result in naval battle.
|
||||
|
||||
**Battlecarrier**
|
||||
|
||||
Battlecarrier is a hybrid ship with features from both battleship and carrier, you can make one by putting conversion deck on rear slots of the heavy hull. Although it has heavy guns, battlecarrier is considered as carrier and is in the carrier line, and it's restricted by the max carrier limit. Furthermore, battlecarrier can't get any bonus from doctrines, and its high conversion cost also blocks the possibility to build the fleet around it.
|
||||
|
||||
**Super Heavy Battleship**
|
||||
|
||||
In fact, super heavy battleship has no fundamental difference from ordinary battleships. It's just larger and more expensive with dedicated armor and engines.
|
||||
|
||||
**Escort Carrier**
|
||||
|
||||
A cheap but very weak carrier. Escort carrier is unlocked around 1940-1941 in the techtree, it's basically a toy for major powers as the carrier count limit largely restricts its usage scenario, but it's still a perfect choice for anti-submarine missions in secondary theaters.
|
||||
|
||||
**Super Carrier**
|
||||
|
||||
Just like Essex or Midway post-refit, super carrier is a weapon with no shortcoming. By combining with modern carrier modules such as large armored hangar, steamed catapult and side lifts, a super carrier can possess a capacity of 130-150 planes. Except for its incredible cost, super carrier is the best type of carrier in the mod.
|
||||
|
||||
**Panzerschiff**
|
||||
|
||||
Panzerschiff in VNR or revived armored cruiser in KRNR, is basically a cruiser with heavy guns, though there is a limit set to prevent super heavy guns being installed on it. Just like the real armored ship in history, it has some advantages in one-on-one combat against cruisers, such as better guns and armor, making it an intermediate option between battlecruiser and heavy cruiser. The problem is, panzerschiff is stuck in the middle, so it can't fully cover either's job.
|
||||
|
||||
**Auxiliary Ship**
|
||||
|
||||
The max range of the fleet is calculated by average range of all ships within, so mathematically speaking you can boost it by adding long-range ships to your fleet. However, if you know maths very well, you may notice once the average surpass a certain value, it will bring the increase rate to a stagnation, so it's unwise to put too many auxiliary ships together because the range bonus is reaching the upper limit.
|
||||
|
||||
To keep it away from the frontline, auxiliary ship is considered as capital ship, which means it can provide escort efficiency for your carrier just like battleship does. It's weak without doubt, but really really cheap.
|
||||
|
||||
## Techtree ##
|
||||
|
||||
Techtree is the soul of VNR and also the most interesting part of the game. Compared to base game, the naval techtree has been expanded in width and depth, from bonuses to modules. From the first glance, it may look complicated for people who love short and condensed techtree. It is large but you don't necessarily have to research all of them, and I will try to make your decision easier. Note that not all techs are worthy, you have to choose wisely and try not to overwhelm yourself.
|
||||
|
||||
### Naval Tree ###
|
||||
|
||||
**Destroyer Branch**
|
||||
|
||||
Destroyer is the fundation of any navies, so there is no reason that you should skip this part of the tree, unless you don't want to play navy at all. As I mentioned in designing section, cost is the key element of destroyer variants, so any tech that lowers IC cost of a ship is certainly a must. The research on destroyer should be centered around the job you give them in your fleet. Anti-submarine is one of the most common tasks handled by destroyer, making depth charge and sonar technologies become the theme of this branch. Typically, that's all you need to have to make a decent destroyer. When I say "decent", it stands for "a ship that works under most circumstances regardless of which country you are playing", but there are exceptions that you will be against different enemies.
|
||||
|
||||
**Cruiser Branch**
|
||||
|
||||
Cruiser can make incredible damage on light ships in the battle when it gets into close combat stage. Therefore, if you want to build a nice surface fleet, don't hesitate to give your cruiser the best guns and armors. Although you have many options in cruiser's tree, the process becomes easier that you only have to choose those improve it in terms of things you really need, including firepower, speed and armor.
|
||||
|
||||
**Heavy Armor Branch**
|
||||
|
||||
This branch is composed of battleship armor scheme and armor processing technologies. The necessity depends on whether you are going to include heavy ships in your fleet and when you want to exclude them. If heavy ships still hold a place in your fleet, you should update these techs to the latest whenever there's a chance, otherwise just leave it alone.
|
||||
|
||||
**Battleship Branch**
|
||||
|
||||
Battleship branch is actually quite flexible because you can drop it from anywhere if it's no longer needed in your fleet. But if you want a good cold war era experience, at least research hulls to gain access to cold war fire-control/nuclear-fleet technologies. Back to the base tree, battleship techs prior to the 1930s are very useful despite not being mandatory. Its sub techs during the early 1940s are not recommended for their crummy bonus unless it's out of roleplay. After all, not many people will need excellent battleships but just-okay ones.
|
||||
|
||||
**Carrier Branch**
|
||||
|
||||
I can't stress more about the dominating power of carrier in reality and mod. Except for some early sub techs of carrier which only apply little bonus, most carrier techs are extremely useful and will definitely give you an upper hand in the battle. My suggestion is to skip techs before 1932, and get all of them after that.
|
||||
|
||||
**Submarine Branch**
|
||||
|
||||
Submarine is useless against anything but convoys because of AI's ASW improvements. Submarine research should be centered around lowering visibility and improving torpedo attack, other techs remain optional no matter what bonus they offer.
|
||||
|
||||
### Naval Support Tree ###
|
||||
|
||||
**Gun Branch**
|
||||
|
||||
You need guns everywhere, so there is basically no reason to skip this branch. Except for super heavy guns and rocket artillery, get all techs to the latest if you want to have a decent fleet.
|
||||
|
||||
**Torpedo Branch**
|
||||
|
||||
Torpedo techs are needed by both submarines and torpedo ships, and overall torpedo weapons are nerfed in accuracy but buffed in damage. Keep it up to date if your fleet is heavily relied on torpedo.
|
||||
|
||||
**Auxiliary Branch**
|
||||
|
||||
The auxiliary branch is split into three sub-branches, port facilities, auxiliary ships and fuel silos. Basically designed for immersion, you can just skip the whole branch without need to worry about missing important bonus or modules. Of course, if you want to experience this part of the mod, there are some useful techs.
|
||||
|
||||
The branch of port facilities aims at accelerating building and repairing speed of naval infrastructure such as shipyard and naval base, but I won't recommended you to finish this line due to poor bonus.
|
||||
|
||||
Auxiliary ship branch is centered around the debate over "range or speed". Speed branch is relatively better since it's one of the six dimensions of ship designs and it offers some exclusive modules like raider cruiser.
|
||||
|
||||
As for fuel branch, its research cost is insignificant with little bonus, making it an irrelevant factor in your game.
|
||||
174
src/documentation/Modding_Tutorial.md
Executable file
174
src/documentation/Modding_Tutorial.md
Executable file
@@ -0,0 +1,174 @@
|
||||
# Vanilla Navy Rework Modding Tutorial #
|
||||
|
||||
Hi there, this is MrPunk, in this file I will try to explain everything about VNR technically.
|
||||
|
||||
## Topics ##
|
||||
|
||||
1. [File Structure](#file-structure)
|
||||
2. [Post-loading Mechanism](#post-loading)
|
||||
3. [Interesting Features Breakdown](#interesting-feature-breakdown)
|
||||
|
||||
|
||||
## File Structure ##
|
||||
|
||||
### Common ###
|
||||
|
||||
Common is where the fundamental materials of the game are stored, usually it includes technology, national focus, decisions and much more.
|
||||
|
||||
The files in this folder will be loaded at game starts (in the loading screen), so if the game never made it to the menu, more likely it's caused by bugs in Common.
|
||||
|
||||
**Structure**
|
||||
|
||||
- ai_equipment
|
||||
|
||||
The ship design templates are stored here, each file within indicates a type of ship, with specific templates of each level of the hull. AI will replace the template with newer ones if it has enough navy XP, weighted by the AI factors in the file. The variable "role" is the keyword telling AI what to produce in its strategy.
|
||||
|
||||
- ai_strategy
|
||||
|
||||
AI production strategies are stored here. Using the role defined in ai_equipment, it directly tells AI what to produce, and assigning a value to it determines how AI are willing to produce such templates. Theoretically, any value over 0 will make AI execute the strategy, unless the number of AI's dockyard is too low to make that happen.
|
||||
|
||||
- decisions
|
||||
|
||||
A place where decisions definition is stored. Currently it has the behemoths and naval introduction related decisions.
|
||||
|
||||
- defines
|
||||
|
||||
Here you modify some static constants in the game mechanism. As the formula set in the code, defines provide a way to scale the effects.
|
||||
|
||||
- on_actions
|
||||
|
||||
It declares some starting, global and triggering variables, including intro panel display and definition of major naval powers.
|
||||
|
||||
- scripted_effects
|
||||
|
||||
Basically they are like functions in programming, purely customized effects. All the starting tech setup and naval variants are stored here.
|
||||
|
||||
- scripted_gui
|
||||
|
||||
Just the starting intro panel.
|
||||
|
||||
- scripted_localisation
|
||||
|
||||
Defines alternative text for behemoth events. (used by different countries)
|
||||
|
||||
- technologies
|
||||
|
||||
title says all
|
||||
|
||||
- units
|
||||
|
||||
Containing units, equipments and modules definition of the mod.
|
||||
|
||||
Units are basic combat unit in the game such as carrier, destroyer and battleship. Equipments is more specifically the ship hulls you see in the game. Definition including allowed modules on each slot, and base stats such as speed, armor, fuel consumption. Modules are the parts you put in every slot in ship designers. Plus, ship names are stored in names_ships sorted by country tag.
|
||||
|
||||
### Events ###
|
||||
|
||||
Events are, well, just events..
|
||||
|
||||
Nothing to put here, it's very easy to understand.
|
||||
|
||||
### GFX ###
|
||||
|
||||
All the pictures, icons and 3D assets are put here.
|
||||
|
||||
**Structure**
|
||||
|
||||
- army_icons
|
||||
|
||||
The ship insignia and their tooltips
|
||||
|
||||
- event_pictures
|
||||
|
||||
Nothing special
|
||||
|
||||
- interface
|
||||
|
||||
- counters
|
||||
|
||||
Small and green icons shown the number of ships when you hover on your fleet.
|
||||
|
||||
- equipmentdesigner
|
||||
|
||||
Stores the icons of ship modules and topviews
|
||||
|
||||
- navalcomabt
|
||||
|
||||
Stores icons of ships shown on the left side of the screen when you select a fleet, it's also used in naval combat panel.
|
||||
|
||||
- technologies
|
||||
|
||||
Stores icons of ships in the tech tree and designer. Tech icons are also put here under navy_tree.
|
||||
|
||||
- Others
|
||||
|
||||
Some textures used in tech tree and backgrounds.
|
||||
|
||||
### History ###
|
||||
|
||||
This part is loaded after you select a country and start the game. Mostly there are country definitions such as leaders/parties/techs and starting military.
|
||||
|
||||
All files start with 00_vnr will be loaded as starting navy of that country. The empty files are just for overriding the vanilla ones.
|
||||
|
||||
### Interface ###
|
||||
|
||||
This folder is in close relation to GFX, which it defines the name of GFX files, the UI lookings and which location the GFX should show up.
|
||||
|
||||
**Structure**
|
||||
|
||||
- equipmentdesigner
|
||||
|
||||
The topviews in ship designers are defined here. Each hull and module has its texture defined in these files, or it won't show up in designer.
|
||||
|
||||
- .gfx files
|
||||
|
||||
Any files end with .gfx is the definitions of picture/icon texture. It directly points to the location where these icons are stored.
|
||||
|
||||
- .gui files
|
||||
|
||||
Any files end with .gui is the UI definition, including size and position of these elements.
|
||||
|
||||
### Localisation ###
|
||||
|
||||
The texts of events, technologies, etc.
|
||||
|
||||
|
||||
## Post-Loading ##
|
||||
|
||||
The most interesting feature of VNR is the post-loading mechanism. For so long, there are many navy mods out there, but they all have to change the files within history/countries, for that's where tank/air/ship designs are defined. In instance of a large naval overhaul mod, you have to modify these files to make new modules and new hulls working. It's very common on mods such as NRM.
|
||||
|
||||
Despite being the most sraightforward approach, it will bring harms to compatibility and robustness throughout basegame updates. The country history files store more than starting variants, it also has leaders, historical events, political status and national spirits. Overwriting such files is a complete disaster when it comes to compatibility. Even a minor fix on the country's starting stability will be incompatible, depending on the loading order, it may break its variants too.
|
||||
|
||||
To counter it, the post-loading mechanism is created. It is not some fancy skill, but I want it recorded, so the late comers know how to do that.
|
||||
|
||||
The basis of post-loading is achieved in following steps:
|
||||
1. Put all vanilla ship hulls to a hidden and disallowed techs, this blocks any variants using these hulls from appearing and won't cause any crash/error, because variants using blocked techs will be unlocked after the tech is researched. But in this case, it will never be researched. Then simply replacing them with hulls with different IDs is going to form the basic of your designer.
|
||||
|
||||
2. Overriding all vanilla units history files. Unlike country history files, the unit files are less sensitive for they only take effects when it's loaded in your script. Combining step 1 and step 2 will give a clean state on game start, no country has naval variants or fleet. Then you may load your own.
|
||||
|
||||
3. Loading customized units and designs is the last step. It is achieved through hidden events. Some people say game is an art of interaction, and here is how I load everything without you even noticing it. By completing step 2, no country has navy upon game start, but as you may notice, there is an intro panel. The intro panel draws your attention, and your first reaction is to click continue. A trigger is set there, when it is clicked, it will set a global flag, telling the loading event to take effects. The effects are modified to have no popup, and done in an instant. Then you get everything set.
|
||||
|
||||
Reference files:
|
||||
|
||||
events/00_navy_rework.txt
|
||||
|
||||
common/scripted_guis/00_navy_rework_welcome_splash_gui.txt
|
||||
|
||||
## Interesting Feature Breakdown ##
|
||||
|
||||
1. **Multiple customized ship icons for one hull**
|
||||
|
||||
NSB and BBA have introduced a new style of designer to the game, which you can choose the sprite for your tank/airplane from numerous icon presets. But ship designer still adopts the tradition from MTG that only equipment icons are available. Fortunately, this new feature is actually supported, just not applied.
|
||||
|
||||
This is achieved through graphic_db which is the database for icons in equipment designer. It seems that, even though ship designer owns a standalone UI, the way of accessing database is common among all designers. To do it, create a file for ship icons in gfx/interface/equipmentdesigner/graphic_db, then try to assign pool of icons to each hull and tag. For details, you can refer to tank and air icon files in the same location, the style and grammar are identical.
|
||||
|
||||
As for unique icons of starting variants, that is actually a workaround. You can add a line "icon = xxx.dds" in the variant definition.
|
||||
|
||||
2. **Ship role system**
|
||||
|
||||
The ship role system is what creates more variants. Before that, most naval mods simply add a lot of hulls to represent new type of ships, but they in fact are not so different from the base platform. For example, destroyer leader, destroyer and escort destroyer. Offering different bonus, the ship role also allow or disallow certain categories of modules.
|
||||
|
||||
3. **Dynamic title for ship designer**
|
||||
|
||||
As you may notice, the title of ship designer has dynamic effects in the mod, which it will change according to the tag's historical ship designing organization, such as DNC of Britain and BuC&R of America. Dynamic localisation doesn't work here because the title is an embedded element in UI.
|
||||
|
||||
To change it, you need to edit the original text of the title to an empty string first. Then, make a scripted gui attached to equipment designer with only an instantTextBox. Since scripted gui is the only way to put scripted localisation on UI, you can then modify the gui to make it responsive at last.
|
||||
@@ -1,140 +0,0 @@
|
||||
###########################
|
||||
### Vanilla Navy Rework ###
|
||||
###########################
|
||||
Hi there, this is MrPunk, in this file I will try to explain everything about VNR technically.
|
||||
|
||||
###########################
|
||||
### Topics ###
|
||||
###########################
|
||||
1. File Structure
|
||||
2. Post-loading Mechanism
|
||||
3. Interesting Features Breakdown
|
||||
|
||||
|
||||
###########################
|
||||
### File Structure ###
|
||||
###########################
|
||||
1. Common
|
||||
Overview
|
||||
Common is where the fundamental materials of the game are stored, usually it includes technology, national focus, decisions and much more.
|
||||
|
||||
The files in this folder will be loaded at game starts (in the loading screen), so if the game never made it to the menu, more likely it's caused by bugs in Common.
|
||||
|
||||
Structure
|
||||
a. ai_equipment
|
||||
The ship design templates are stored here, each file within indicates a type of ship, with specific templates of each level of the hull.
|
||||
AI will replace the template with newer ones if it has enough navy XP, weighted by the AI factors in the file.
|
||||
The variable "role" is the keyword telling AI what to produce in its strategy.
|
||||
b. ai_strategy
|
||||
AI production strategies are stored here. Using the role defined in ai_equipment, it directly tells AI what to produce, and assigning a value to it determines how AI are willing to produce such templates. Theoretically, any value over 0 will make AI execute the strategy, unless the number of AI's dockyard is too low to make that happen.
|
||||
c. decisions
|
||||
A place where decisions definition is stored. Currently it has the behemoths and naval introduction related decisions.
|
||||
d. defines
|
||||
Here you modify some static constants in the game mechanism. As the formula set in the code, defines provide a way to scale the effects.
|
||||
e. on_actions
|
||||
It declares some starting, global and triggering variables, including intro panel display and definition of major naval powers.
|
||||
f. scripted_effects
|
||||
Basically they are like functions in programming, purely customized effects. All the starting tech setup and naval variants are stored here.
|
||||
g. scripted_gui
|
||||
Just the starting intro panel.
|
||||
h. scripted_localisation
|
||||
Defines alternative text for behemoth events. (used by different countries)
|
||||
i. technologies
|
||||
title says all
|
||||
j. units
|
||||
Containing units, equipments and modules definition of the mod.
|
||||
Units are basic combat unit in the game such as carrier, destroyer and battleship.
|
||||
Equipments is more specifically the ship hulls you see in the game. Definition including allowed modules on each slot, and base stats such as speed, armor, fuel consumption...
|
||||
Modules are the parts you put in every slot in ship designers
|
||||
Plus, ship names are stored in names_ships sorted by country tag.
|
||||
|
||||
2. Events
|
||||
Overview
|
||||
Events are, well, just events..
|
||||
|
||||
Structure
|
||||
Nothing to put here, it's very easy to understand.
|
||||
|
||||
3. GFX
|
||||
Overview
|
||||
All the pictures, icons and 3D assets are put here.
|
||||
|
||||
Structure
|
||||
a. army_icons
|
||||
The ship insignia and their tooltips
|
||||
b. event_pictures
|
||||
Nothing special
|
||||
c. interface
|
||||
c.1. counters
|
||||
Small and green icons shown the number of ships when you hover on your fleet.
|
||||
c.2. equipmentdesigner
|
||||
Stores the icons of ship modules and topviews
|
||||
c.3. navalcomabt
|
||||
Stores icons of ships shown on the left side of the screen when you select a fleet, it's also used in naval combat panel.
|
||||
c.4. technologies
|
||||
Stores icons of ships in the tech tree and designer. Tech icons are also put here under navy_tree.
|
||||
c.5. Others
|
||||
Some textures used in tech tree and backgrounds.
|
||||
|
||||
4. History
|
||||
Overview
|
||||
This part is loaded after you select a country and start the game. Mostly there are country definitions such as leaders/parties/techs and starting military.
|
||||
|
||||
Structure
|
||||
All files start with 00_vnr will be loaded as starting navy of that country.
|
||||
The empty files are just for overriding the vanilla ones.
|
||||
|
||||
5. Interface
|
||||
Overview
|
||||
This folder is in close relation to GFX, which it defines the name of GFX files, the UI lookings and which location the GFX should show up.
|
||||
|
||||
Structure
|
||||
a. equipmentdesigner
|
||||
The topviews in ship designers are defined here. Each hull and module has its texture defined in these files, or it won't show up in designer.
|
||||
b. .gfx files
|
||||
Any files end with .gfx is the definitions of picture/icon texture. It directly points to the location where these icons are stored.
|
||||
c. .gui files
|
||||
Any files end with .gui is the UI definition, including size and position of these elements.
|
||||
|
||||
6. Localisation
|
||||
Overview
|
||||
The texts of events, technologies, etc.
|
||||
|
||||
|
||||
###########################
|
||||
### Post-Loading ###
|
||||
###########################
|
||||
|
||||
The most interesting feature of VNR is the post-loading mechanism. For so long, there are many navy mods out there, but they all have to change the files within history/countries, for that's where tank/air/ship designs are defined. In instance of a large naval overhaul mod, you have to modify these files to make new modules and new hulls working. It's very common on mods such as NRM.
|
||||
|
||||
Despite being the most sraightforward approach, it will bring harms to compatibility and robustness throughout basegame updates. The country history files store more than starting variants, it also has leaders, historical events, political status and national spirits. Overwriting such files is a complete disaster when it comes to compatibility. Even a minor fix on the country's starting stability will be incompatible, depending on the loading order, it may break its variants too.
|
||||
|
||||
To counter it, the post-loading mechanism is created. It is not some fancy skill, but I want it recorded, so the late comers know how to do that.
|
||||
|
||||
The basis of post-loading is achieved in following steps:
|
||||
1. Put all vanilla ship hulls to a hidden and disallowed techs, this blocks any variants using these hulls from appearing and won't cause any crash/error, because variants using blocked techs will be unlocked after the tech is researched. But in this case, it will never be researched. Then simply replacing them with hulls with different IDs is going to form the basic of your designer.
|
||||
2. Overriding all vanilla units history files. Unlike country history files, the unit files are less sensitive for they only take effects when it's loaded in your script. Combining step 1 and step 2 will give a clean state on game start, no country has naval variants or fleet. Then you may load your own.
|
||||
3. Loading customized units and designs is the last step. It is achieved through hidden events. Some people say game is an art of interaction, and here is how I load everything without you even noticing it. By completing step 2, no country has navy upon game start, but as you may notice, there is an intro panel. The intro panel draws your attention, and your first reaction is to click continue. A trigger is set there, when it is clicked, it will set a global flag, telling the loading
|
||||
event to take effects. The effects are modified to have no popup, and done in an instant. Then you get everything set.
|
||||
|
||||
Reference files:
|
||||
events/00_navy_rework.txt
|
||||
common/scripted_guis/00_navy_rework_welcome_splash_gui.txt
|
||||
|
||||
############################################
|
||||
### Interesting Feature Breakdown ###
|
||||
############################################
|
||||
1. Multiple customized ship icons for one hull
|
||||
NSB and BBA have introduced a new style of designer to the game, which you can choose the sprite for your tank/airplane from numerous icon presets. But ship designer still adopts the tradition from MTG that only equipment icons are available. Fortunately, this new feature is actually supported, just not applied.
|
||||
|
||||
This is achieved through graphic_db which is the database for icons in equipment designer. It seems that, even though ship designer owns a standalone UI, the way of accessing database is common among all designers. To do it, create a file for ship icons in gfx/interface/equipmentdesigner/graphic_db, then try to assign pool of icons to each hull and tag. For details, you can refer to tank and air icon files in the same location, the style and grammar are identical.
|
||||
|
||||
As for unique icons of starting variants, that is actually a workaround. You can add a line "icon = xxx.dds" in the variant definition.
|
||||
|
||||
2. Ship role system
|
||||
The ship role system is what creates more variants. Before that, most naval mods simply add a lot of hulls to represent new type of ships, but they in fact are not so different from the base platform. For example, destroyer leader, destroyer and escort destroyer. Offering different bonus, the ship role also allow or disallow certain categories of modules.
|
||||
|
||||
3. Dynamic title for ship designer
|
||||
As you may notice, the title of ship designer has dynamic effects in the mod, which it will change according to the tag's historical ship designing organization, such as DNC of Britain and BuC&R of America. Dynamic localisation doesn't work here because the title is an embedded element in UI.
|
||||
|
||||
To change it, you need to edit the original text of the title to an empty string first. Then, make a scripted gui attached to equipment designer with only an instantTextBox. Since scripted gui is the only way to put scripted localisation on UI, you can then modify the gui to make it responsive at last.
|
||||
Reference in New Issue
Block a user