Giter VIP home page Giter VIP logo

patoke / re-plants-vs-zombies Goto Github PK

View Code? Open in Web Editor NEW
71.0 6.0 9.0 120.46 MB

A project to rebuild all functionality via reverse engineering from the GOTY version of Plants VS Zombies (and expand upon it)

License: Creative Commons Zero v1.0 Universal

C 10.58% C++ 88.69% Shell 0.01% CMake 0.72% Reason 0.01%
decompilation plants-vs-zombies plantsvszombies pvz pvz-custom rebuilt reversing decompiled reverse reverse-engineering

re-plants-vs-zombies's Introduction

re-plants-vs-zombies

A project focused on decompiling the latest functionality from the first PvZ title and expand upon the game and its engine

The SexyAppFramework dating as back as 2005 is a very old game engine and it does not follow proper C++ conventions as per modern standards nor does it use a modern renderer backend

This project aims to modernize the engine by using features from the latest C++ standards aswell as replacing the old legacy DirectDraw and Direct3D7 renderers for the modern GLFW cross-platform wrapper aswell as expanding upon an old (now deleted) decompilation project of PvZ version 0.9.9 by Miya aka Kopie to get the best possible PvZ experience both for modders and players alike

DISCLAIMER

This project does not condone piracy

This project does not include any IP from PopCap outside of their open source game engine, this will only output the executable for a decompiled, fan version of PvZ

To play the game using this project you need to have access to the original game files by purchasing it

Roadmap

Currently focused on

  • Add x64 support for the base game (Partial)
  • Replace the old renderer backend for GLFW (WIP)
  • Replace all Windows only code for cross-platform GLFW counterparts (WIP)

Left for when we have a working x64 build using GLFW

  • Add all functionality from the GOTY version of the game
    • Achievements (Partial)
    • Zombatar

Possible future features

  • Create an easy to use modding API for the game
    • Parse zombies from files
    • Parse plants from files
    • Parse maps from files
    • Add scripting for custom sequences

Installation

Visual Studio Community

Open the folder containing the CMakeSettings.json, wait until cache finishes generating and build the project

Other (Sublime, Visual Studio Code, etc..)

Run the following commands (assuming you have CMake installed with Ninja) where the CMakeSettings.json file is located

cmake -G Ninja -B cmake-build

cmake --build cmake-build

If running these commands does not create a successful build please create an issue and detail your problem

After you build, the output executable should be in the Debug or Release (depending on your build target) folder inside SexyAppFramework

Then you want to copy that executable inside of the original game's root folder (or copy the contents of the original game folder inside the previously mentioned folder)

After that you should be able to just open the built executable and enjoy re-pvz!

Contributing

When contributing please follow the following guides:

SexyAppFramework coding philosophy

From the SexyAppFramework docs:


The framework differs from many other APIs in that some class properties are not wrapped in accessor methods, but rather are made to be accessed directly through public member data. The window caption of your application, for example, is set by assigning a value to the std::string mTitle in the application object before the application’s window is created. We felt that in many cases this reduced the code required to implement a class. Also of note is the prefix notation used on variables: “m” denotes a class member, “the” denotes a parameter passed to a method or function, and “a” denotes a local variable.
Contributor markings
Whenever you need to leave a comment for other developers to find you should do so with the following grammar:
  • Always include the name of the contributor as in:
    • @Contributor
  • For todos include the todo marking as in:
    • @Contributor todo
  • Always add a colon to specify that the start of the comment starts there
    • @Contributor todo: Thing went wrong!
  • If a new function has been reversed and you have found the address in the latest version of the game (or have reversed a certain class member offset) please note it as follows:
    • @Contributor GOTY: 0xADDRESS

Thanks to

  • @rspforhp for their amazing work decompiling the 0.9.9 version of PvZ
  • @ruslan831 for archiving the 0.9.9 decompilation of PvZ
  • The GLFW team for their amazing work
  • PopCap for creating the amazing PvZ franchise (and making their game engine public)
  • All the contributors which have worked or are actively working in this amazing project

re-plants-vs-zombies's People

Contributors

patoke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

re-plants-vs-zombies's Issues

Where does most of the codebase come from?

Hi Patoke,

My name's Aaron and I've been fiddling with this decomp for a bit (getting it to build with the extra x64 registers and from clang+cmake instead of visualstudio, stretch goal making the thing work on native Linux for giggles) and I'm wondering how this decompilation came together. I have a few questions and I can't work out how to contact you outside of a GitHub issue so here I am:

  1. How much of the work is your own and how much was done by Kopie?
  2. Is it a fork of https://github.com/rspforhp/PVZdotnet-ready-to-mod (which appears to be the mobile version) or is it something else? I couldn't make sense of Kopie's public repos.
  3. Is there a community I can talk to about the reversing effort and is it all in Chinese?
  4. Since I don't have a windows machine to test the build in a sane environment, I don't know how much of this decomp is working but I still have already found a few bugs (mostly related to uninitiated values) which I might submit a pull request for soon. I expect they're not a problem in VS because it clobbers the exact right value for things to be coincidentally clobbered but I don't know. Anyway I'm wondering where the build is at, does it run? I expect since you're talking about achievements and stuff it probably does. I've gotten a good way through resources unpacking before it kills itself (I think Wine is having a hard time with the widechars. Or I've just messed something up..)

Thanks very much for your time and your hard work on this project I think it's very cool,

Aaron.

Have some problem with sdl and sdl_image in gl branch.

image

I'm trying build new graphics in gl branch with VS2019 and get some new problems:
sdl,sdl_image git have no "build" forlder insteal it may be change to build-scripts (i tried and pass for the problem).
glwl forlder not include in project or may be visual studio cant findout ( i tried use glwl in the internet and pass for the problem ).
But Building get error with the problem in the image and i cant find solution for that.

Hope that with two of my problem can contribute to this git and fix it for users who use VS2019

[Suggestion] Basic documentation

maybe add in the tools folder a file that contains basic documentation like how to add a delay between something and other basic stuff, would be very cool

height isn't a const

In imagelLib.cpp at line 71 it declares a variable called height. It's later used where a const should be.
Screenshot 2024-02-12 172705
I don't know much C++ so hopefully someone can help

Contact Information?

ive been working with a older decomp, and just saw this now.
is there any way i can contact you? it would be neat to discuss this decompile. i may have some fixes too if they arent already fixed, but im just building as i type this.

i mostly use discord, "spaghetto207".

Cmake build failing

As stated in the build steps, the following command is run:

cmake --build cmake-build

This however results in a build failure:

Looking for a ASM_NASM compiler failed with the following output:
-- The ASM_NASM compiler identification is unknown
-- Didn't find assembler
CMake Error at CMakeLists.txt:2 (project):
  No CMAKE_ASM_NASM_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "ASM_NASM" or the CMake cache entry CMAKE_ASM_NASM_COMPILER to the
  full path to the compiler, or to the compiler name if it is in the PATH.

I have defined ASM_NASM in my environment variables.

This was tested in both Visual Studio and Visual Studio Code

Error when trying to run

It says it can't find bass.dll, I have the Plants vs. Zombies game files, where do I put them?

building issue

when i try to run "cmake -G Ninja -B build" on the sexy-vk branch, this happens

"-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:8 (project):
No CMAKE_C_COMPILER could be found.

Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.

CMake Error at CMakeLists.txt:8 (project):
No CMAKE_CXX_COMPILER could be found.

Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!"

Error when trying to run

When running the built executable in GOTY and OG files with the up-to-date bass.dll it fails to run with the message: The application was unable to start correctly (0x000007b).

Building problems

Collected a list of bugs with the game built from the source of the sexy-vk branch:

  • Zen Garden Crashes
  • No yellow background behind tooltips
  • Seeing Stars crashes with no error message
  • Imitater crashes when selecting him
    I would try to fix these although I don't know nearly enough C++ to try and solve these

Font loading problems in sexy-vk branch

When I try to debug the game, the console prints out this:

FATAL ERROR: Font Descriptor Error in data/BrianneTod16.txt
Unknown Command on Line 101:

FATAL ERROR: Failed to load font: data/BrianneTod16.txt

I have the game files for Plants vs. Zombies in the out/build/x64-Debug directory, what could be causing this?

When trying to compile a build in visual studio 2022 it gives this error

I tried to compile a build debug from the main branch and I got this error all this in visual studio 2022
Just clone the repo and try to compile as the instructions said
2024-03-07 15_22_54-re-plants-vs-zombies-vanilla - Microsoft Visual Studio

I also leave this here since I have no idea where to report it, I tried the minerscale fork and tried to compile when doing so everything seemed to work fine until I got an error with vulkan so I installed the vulkan sdk and it was fixed but when I put compile it the game stayed on a black screen with sound the game seems to work but it does not render
I say it here in the hope that Minerscale will look at it and also if you read this add a place to your fork where reporting bugs would be useful

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.