GE Patcher Tutorial(latest)
Aviso
This tutorial is only applicable to version 0.3.X
.
GE Patcher is a tool used to modify Plants vs. Zombies 2 Gardendless game data, supporting custom modifications to plants, zombies, upgrades, the shop, levels, and more.
The version provided on the official website has the GE Patcher tool built-in.
Prerequisites
- JSON editor (VSCode/Notepad++ recommended)
- Game version ≥ 0.3.0
- JSON attribute structures for elements like plants and zombies. Please refer to Attribute Reference.
GE Patcher Basics
Press "F12" when the game starts to open the developer console. In the Console tab, output similar to the following will appear:
[GE Patcher] BaseDir: C:\Users\admin\AppData\Local\com.pvzge.app
The path provided is the GE Patcher's main directory.
Enter the following command to view in-game help, including the paths for custom JSON files:
gePatcher.help()
After the game finishes loading, run the following command to load all custom JSON files:
gePatcher.init()
After modifying a JSON file, please re-execute this command to apply the changes.
File Structure
Create a patches
folder within com.pvzge.app
with the following structure:
patches/
└── jsons/
├── features/
│ ├── PlantFeatures.json
│ ├── PlantProps.json
│ ├── PlantAlmanac.json
│ ├── ZombieFeatures.json
│ ├── ZombieProps.json
│ ├── ZombieAlmanac.json
│ ├── UpgradeFeatures.json
│ └── StoreCommodityFeatures.json
└── levels/
└── [LevelName].json
The features
directory contains Features
, Props
, and Almanac
files for modifying plants, zombies, upgrades, the shop, etc.
Files under the levels
directory are used to modify levels.
Files for original content that are not modified do not need to be created.
Features Files
Features File Structure
Features files contain the basic attributes of plants, zombies, and upgrades. The file structure is as follows:
PlantFeatures.json:Plant basic characteristics (structure example)
{
"PLANTS": [
{
"CODENAME": "peashooter"
}
],
"SEEDCHOOSERDEFAULTORDER": ["peashooter", "sunflower"],
"BASEUNLOCKLIST": ["peashooter", "sunflower"]
}
ZombieFeatures.json:Zombie basic characteristics (structure example)
{
"ZOMBIES": [
{
"CODENAME": "tutorial"
}
]
}
UpgradeFeatures.json:Upgrade attributes (structure example)
{
"UPGRADES": [
{
"CODENAME": "upgrade_starting_sun_lvl1"
}
]
}
Key Notes
- The
PLANTS
、ZOMBIES
andUPGRADES
arrays define modifications to existing entities. SEEDCHOOSERDEFAULTORDER
sets the default plant order in the seed chooser.BASEUNLOCKLIST
defines initially unlocked plants.
Features Modification Rules
Features modification rules apply to PlantFeatures
、ZombieFeatures
and UpgradeFeatures
files。
Each object in the PLANTS
(or ZOMBIES
, UPGRADES
) array will be merged into the original JSON after matching by the CODENAME
field. The merging rules are as follows:
- Array Elements: If the attribute type is an array, each value in the array will be merged according to element order. If a value in the array is an object, it will be merged recursively. If a value in the array is a primitive type, it will directly overwrite the value in the original JSON.
- Object Merging: If the attribute type is an object, it will be merged recursively. If there are attributes with the same key within the object, the value in the original JSON will be directly overwritten.
- Primitive Attributes: For primitive attributes with the same key, they are directly overwritten, i.e., replacing the value in the original JSON.
For other fields, such as SEEDCHOOSERDEFAULTORDER
/BASEUNLOCKLIST
, the original array is directly replaced.
Therefore, for any plant/zombie that needs modification, you must add an object to the PLANTS
(ZOMBIES
) array, and the CODENAME
field of this object must match the original plant/zombie in the JSON. For plants/zombies that do not need modification, this object does not need to be added.
Within a single plant/zombie object, only the CODENAME
needs to be filled. Other fields not filled will remain unchanged. If modification is needed, the corresponding fields must be added.
Importante
- Avoid modifying critical fields like
ID
or_CARDSPRITENAME
to prevent crashes.。 - GE Patcher cannot create new entities; it only modifies existing ones.
Example
To change the Peashooter's background to "epic" and the Sunflower's name to "Happy Flower":
{
"PLANTS": [
{
"CODENAME": "peashooter",
"OBTAINWORLD": "epic"
},
{
"CODENAME": "sunflower",
"NAME": {
"en": "Happy Flower",
"zh": "快乐花"
}
}
]
}
Props/Almanac Files
Props File Structure
Props files contain the numerical attributes of plants and zombies. The file structure is as follows:
PlantProps.json:Plant numerical attributes (structure example)
{
"objects": [
{
"aliases": ["peashooter"],
"objclass": "PlantProperties",
"objdata": {
"ShootInterval": 1.35,
"ShootIntervalAdditional": 0.15,
"PlantfoodPeaCount": 60,
"Cooldown": 5,
"CooldownFrom": 1,
"SunCost": 100,
"Toughness": 300,
"Family": "Peashooter"
}
}
]
}
ZombieProps.json:Zombie numerical attributes (structure example)
{
"objects": [
{
"aliases": ["tutorial"],
"objclass": "ZombieProperties",
"objdata": {
"ZombieSort": "Normal",
"CannotBeTossedByCitron": false,
"WalkSPS": 0.185,
"Toughness": 190,
"EatDPS": 100
}
}
]
}
Key Notes
- The
objects
array defines modifications to existing plants/zombies. - The
aliases
array indicates which plant/zombie the object belongs to. Currently, GE Patcher only reads the first item of this array. - The
objclass
indicates the type of the object, and its value must bePlantProperties
orZombieProperties
. objdata
contains the numerical attributes of the plant/zombie.
Almanac File Structure
Almanac files contain the Almanac information for plants and zombies. The file structure is as follows:
PlantAlmanac.json:Plant Almanac information (structure example)
{
"objects": [
{
"aliases": ["peashooter"],
"objclass": "PlantAlmanacProperties",
"objdata": {
"Elements": [
{
"TYPE": "SUNCOST"
},
{
"TYPE": "RECHARGE"
},
{
"TYPE": "TOUGHNESS"
},
{
"TYPE": "DAMAGE",
"VALUE": 20
},
{
"TYPE": "RANGE",
"SORT": {
"en": "Straight",
"zh": "直线"
}
},
{
"TYPE": "FAMILY"
}
],
"Introduction": {
"en": "Peashooters are your first line of defence. They shoot peas at attacking zombies",
"zh": "豌豆射手是你的第一道防线。他们会向僵尸发射豌豆。"
},
"Special": [],
"Chat": {
"en": "\"What is it like being famous?\"asked Peashooter while sipping his bottled water,\"I can't talk right now, I'm finishing my merchandising deal. Hold my fir coat.\"",
"zh": "“成为名人是什么感觉?”豌豆射手问了一句,抿了一口自己的瓶装水,“我现在没法说话,我正在完成我的销售项目,帮我拿一下我的毛皮大衣。”"
},
"DisplayOffset": {
"x": 0,
"y": 0
},
"BriefIntroduction": {
"en": "Shoots peas at the enemies",
"zh": "向僵尸发射豌豆子弹"
}
}
}
]
}
ZombieAlmanac.json:Zombie Almanac information (structure example)
{
"//": "basic",
"aliases": [
"tutorial"
],
"objclass": "ZombieAlmanacProperties",
"objdata": {
"Elements": [
{
"TYPE": "TOUGHNESS",
"SORT": {
"en": "Average",
"zh": "一般"
},
"PROGRESS": 0.25
},
{
"TYPE": "SPEED",
"SORT": {
"en": "Basic",
"zh": "普通"
},
"PROGRESS": 0.5
}
],
"Introduction": {
"en": "Regular Garden-variety zombie.",
"zh": "普普通通的前院僵尸。"
},
"Special": [],
"Chat": {
"en": "Basic Zombie hates the term \"Basic\". He doesn't consider himself some generic foe or common corpse. He's individual, darn it, and he's going to make a difference even if it kills you.",
"zh": "普通僵尸讨厌被称作“普通”。他不认为自己只是一个平凡的敌对者,甚至只是个随处可见的死尸。他可是很独立的,该死的,而且在你死之前他都会对局面造成影响。"
},
"DisplayOffset": {
"x": 0,
"y": 0
},
"DisplayScale": {
"x": 1,
"y": 1
}
}
},
Props/Almanac Modification Rules
Props modification rules apply to PlantProps
and ZombieProps
files. Almanac modification rules apply to PlantAlmanac
and ZombieAlmanac
files.
Each object in the objects
array is merged into the original JSON after being matched by the aliases
field, using the same rules as for Features
files.
For any plant/zombie that needs modification, you must add an object to the objects
array, and the first item of that object's aliases
array must be the CODENAME
of the corresponding plant/zombie. For plants/zombies that do not need modification, this object does not need to be added.
Within a single object, objdata
contains the numerical attributes or Almanac information of the plant/zombie. Only the attributes that need to be modified should be filled. Attributes not filled will remain unchanged.
Importante
Almanac
files are only used to modify the Almanac information of plants/zombies and do not affect the actual attributes of the plants.- Array attributes in
objdata
, such asElements
inAlmanac
files, will be merged according to element order. To modify the value of an item in the original array, you need to make the modification at the same position in the array.
Level Files
Place custom level files in patches/jsons/levels/[LevelName].json
.
- Filenames must match the in-game level ID (e.g.,
egypt1.json
). - Use
gePatcher.showLevels()
to view original level IDs (requires initializing GE Patcher first).
Store Files
StoreCommodityFeatures.json
replaces in-game store categories:
{
"Plants": [], // Plants
"Upgrade": [], // Upgrades
"Gem": [], // Gem items (purchased with coins)
"Coin": [] // Coin items (purchased with gems)
}
Omit categories you do not modify.
Debugging
- Check the console for errors during loading.
- Common errors:
- ❌
Failed to load...
: JSON syntax error. - ❌
Level file not found
: Filename mismatch.
- ❌
- Validate JSON using tools like JSONLint.