Introduction¶
The DeepSeek Harness (DSH) agent often struggles to interact directly with game windows in desktop environments. The DSH philosophy is “everything is a plugin,” but many games lack ready-made plugins or SDKs. When operating Plants vs. Zombies GOTY on a Windows or Linux desktop, the game’s main thread needs to provide state and execute actions. The qutongxi/dsh-pvz plugin uses a standalone Lua Mod to expose internal game interfaces to DSH, enabling the agent to perform planting, card selection, waiting, and manual coordinate clicking while keeping focus on other windows.
Plugin Overview¶
qutongxi/dsh-pvz is a DeepSeek Harness plugin for running Plants vs. Zombies GOTY on desktop via a Lua Mod. Maintained by QuTongxi and categorized as “Fun Role-Play,” its core value is handing game state reading and action control to DSH while the game logic continues to run on the game’s main thread, based on an existing game installation.
Installation & Activation¶
The plugin is installed via a custom plugin index rather than directly through the github:owner/repo format.
- Enable the built-in “Custom Plugin Index” on the “Plugins” page in DeepSeek Harness. Go to “Discover → Add Index Source,” paste the index URL below, then install and enable the plugin from “Discover → DSH PvZ.”
https://raw.githubusercontent.com/QuTongxi/dsh-pvz/main/market.json
-
In the same DSH configuration, ask “Check game installation.”
check_game_installationwill verify and download the corresponding runtime package for your OS from Releases, and install the Lua Mod. -
On first use, you need your own PvZ GOTY game files. The tool will detect Steam’s default installation directory. You can also tell DeepSeek: “Check game installation, the original game directory is
D:\Games\Plants Vs Zombies.” The directory must containmain.pakandproperties/resources.xml. The plugin copies resources to its own data directory and returns the actual save pathsaveDirectory. -
Ask “Start PvZ, continue my adventure progress.” If the game is loading or a dialog window appears, give it time to finish the transition. The game must run in a logged-in desktop session.
For subsequent versions, click “Update” under “Discover → DSH PvZ,” then ask “Check game installation.” DSH verifies the update source through the Git commit pinned by the index. If you previously installed the old version by directly entering github:QuTongxi/dsh-pvz, please uninstall that plugin under “Installed,” then install it once from “Discover.” The game’s save/ directory is outside the plugin’s installation directory, so this transition preserves your existing progress.
Environment Requirements¶
- DSH 0.2.2-rc.3 and compatible subsequent 0.2 releases.
- Windows 10/11 x64, or Ubuntu 24.04 x64 with an X11 desktop. On Linux, the system needs
tarand graphics/audio shared libraries. The installer will report any missing libraries.
sudo apt install libsdl2-2.0-0 liblua5.4-0 libopenmpt0t64 libvorbisfile3 libjpeg-turbo8 libpng16-16t64
- The Windows data directory is
%LOCALAPPDATA%\dsh-pvz; on Linux it is$XDG_DATA_HOME/dsh-pvz, or~/.local/share/dsh-pvzif not set. Saves are stored in each one’ssave/directory.
Waiting Strategy¶
The plugin provides the pvz_wait_config interface to read field descriptions and default YAML, and supports read, validate, and write operations.
-
Use
pvz_wait_config({action:"guide"})to view field descriptions and the default YAML. -
DeepSeek can use
readto view the active document,validateto verify, andwriteto save towait.yamlunder the data directory; the next wait cycle will automatically apply it. The installation check only creates the default YAML if the file is missing. Full documentation is available in the Waiting Configuration Manual.
Example configuration:
when: {mowers_below: 100}
Wakes up each time the condition is met;
when: {event: plant_bitten}
Wakes up at the start of a new biting event.
Gameplay Features¶
The plugin interacts with the game through the following interfaces.
State Retrieval¶
pvz_get_state returns the current level, phase, modal, and its available actions. Board state includes game ticks, actual card slots, costs, cooldowns, lawn-mower row, and zombies with IDs and logical x-coordinates. removedZombies compares two consecutive observations of the same board, recording IDs that have left the observation range and whether they had entered a death animation beforehand. Conveyor belt sun is null, card cost is 0, and nextCardCheckTicks is the game’s countdown to the next card deal check.
Waiting¶
pvz_wait({sun_at_least: 100, zombie_at_col: 4, zombie_row: 2, timeout_ms: 20000}) waits until any condition is met, a scene change occurs, or it times out. You can also wait for waves, available card slots, plant loss, or lawn-mower triggers. YAML-level priority determines whether to interrupt; maximum duration is 60 seconds, with cancellation support. Game state is read from memory by the plugin during observation and waiting periods.
Card Selection & Playing¶
pvz_choose_seed({seed: 1}) selects a Sunflower in the seed selection screen, returning only the actually selected card, remaining slots, and whether the level can start. The seed selection preview includes zombie types for this level. Dave’s lines and available actions are returned with the state. On failure, use retry_level or main_menu. Both regular levels and conveyor belt levels support pvz_plant({seed: 1, row: 3, col: 2}) to play by type. The legacy 1-based slot is also supported. The game handles card consumption, sunlight, cooldowns, and grid conflicts.
Shovel & Menu¶
pvz_shovel uses the unlocked shovel. pvz_menu with resume_saved continues an in-progress save; pause and resume control pausing; restart opens the restart confirmation; confirm_restart abandons the current board and restarts. Conveyor belt levels re-deal cards; seed selection levels re-pick seeds.
Coordinate Actions¶
pvz_click coordinates are in the game’s internal 800×600 logical space. Rows and columns start from 1; the approximate x-coordinate of a cell center is 80 × column number; zombies move toward smaller x-coordinates. Cherry Bomb covers roughly a 3×3 area around it; Potato Mine takes about 15 seconds of game time to arm.
Use Cases & Notes¶
Suitable for developers who need to control a game via DSH in a desktop environment, such as testing game automation logic, studying game state machines, or as an ecosystem extension example for DSH.
The plugin runs with the current DSH process permissions. Check the source code and license before installation. Linux environments require additional graphics/audio shared libraries; the installer will report any missing libraries.
In Summary¶
qutongxi/dsh-pvz exposes Plants vs. Zombies GOTY game interfaces to DeepSeek Harness via a Lua Mod, enabling the agent to perform planting, card selection, waiting, and manual actions while keeping focus on other windows in a desktop environment. The plugin is maintained by QuTongxi, categorized as “Fun Role-Play,” and is suitable for developers who want to test game automation logic in a desktop environment.
- Directory page: https://www.skillhub.cn/plugins/QuTongxi/dsh-pvz
- GitHub: https://github.com/QuTongxi/dsh-pvz