GDevelopApp/GDevelop-examples

Army vs Zombies

Opened this issue · 9 comments

Army vs Zombies is an example to show the users how you can build the mechanics of the famous puzzle game Plants vs Zombies.

Note: this example also got picked in the GDevelop example jam and ranked # 1❤️ here:
https://itch.io/jam/gdevelop-examples-jam-1/topic/2079624/official-gdevelop-example-game-jam-winners-list

  • I've followed all of the best practices.
  • My game has a proper name in the game properties.
  • My game package name behind with com.example..
  • My game has all events unfolded.
  • I've added myself as the author in the game properties.
  • I've included a file called "README.md" with a description in proper English, explaining what this example is doing.
  • I confirm that this game and all of its resources can be integrated to this GitHub repository, distributed and MIT licensed.
  • I've cleaned unused resources.

You can play the game in browser here:
https://vegetato.itch.io/army-vs-zombies

You can download GDevelop project here:
Army-vs-Zombies-V2.2.1 GDevelop project.zip

Congrats! I was very addicted to it, got around 30000 flames 😤

I know this might have been created in a rush cuz it was created for a jam.
Let's start here,

  • Remove unused resources
  • Use a single Box Object and use ID
  • Use tween instead of animation for colldown object
  • Unlock all the objects (The objects should be easily modifiable to the users)
  • Make behaviors for the building's tasks (shoot, create flames, etc..)

I can also help clean up and make the example ready :)

Congrats! I was very addicted to it, got around 30000 flames 😤

I know this might have been created in a rush cuz it was created for a jam. Let's start here,

  • Remove unused resources
  • Use a single Box Object and use ID
  • Use tween instead of animation for colldown object
  • Unlock all the objects (The objects should be easily modifiable to the users)
  • Make behaviors for the building's tasks (shoot, create flames, etc..)

I can also help clean up and make the example ready :)

Thank you <3
(remove unused resources):
Sure I will :3
(Use a single Box Object and use ID):
I don't understand what you mean here >.> can you explain please :3
Use tween instead of animation for cooldown object
you mean tween the object height ?
Unlock all the objects (The objects should be easily modifiable to the users)
Sure thing :3
Make behaviors for the building's tasks (shoot, create flames, etc..)
you mean make an extension Behavior for that tasks ?
but that wont be easy for the new users to use in their projects 🤔

Bouh commented
  • Remove unused resources
  • Remove empty events
  • README.md file is missing, this file contain a short description of the example, ~150 characters
  • There is an assets folder, but there is also a lot of assets not inside
  • Use a single Box Object and use ID
    He mean all these objects:
    image
    Can be merged to be one unique object with animation using ID for each cell of the table on scene.
  • Game can be soft lock by placing directly a shield hero. Disable it and force user to add one camp fire first.
  • Add comments to explain what the groups of event does.
  • Fix the game resolution to fit all screens (the scene was cropped when you rescale it).
    image
  • Use tween instead of animation for cooldown object, Yes one square texture and you tween the height size
  • Unlock all the objects in the scene editor (The objects should be easily modifiable to the users)
  • Make behaviors for the building's tasks (shoot, create flames, etc..)
  • Objects naming use PascalCase

If you can check cases of my checklist please do, it give to everyone an overview on the remaning paint points.
Also very important to let us know when you update your zip file!

I think there is something to do with look for iterate on Box, because you repeated the events for Box object twenty times for every build things.
So 20 x 3 = 60 groups can be reduce.

To sumarize:

  • The gameplay is nice
  • The project file need to be refactorized to reduce the events.

Before another review from someone else I think you can try to apply these first feedback, and then someone else will give a new look later.

Bouh commented

Hi, do you need more time or help?
Let us know!

[x] Remove empty events
[x] README.md file is missing, this file contain a short description of the example, ~150 characters
[x] There is an assets folder, but there is also a lot of assets not inside
[x] Game can be soft lock by placing directly a shield hero. Disable it and force user to add one camp fire first.
[x] Add comments to explain what the groups of event does.
[x] Fix the game resolution to fit all screens (the scene was cropped when you rescale it).
[x] Unlock all the objects in the scene editor (The objects should be easily modifiable to the users)
[x] Objects naming use PascalCase

For this points:
[] Use a single Box Object and use ID
[] Use tween instead of animation for cooldown object
[] Make behaviors for the building's tasks (shoot, create flames, etc..)

they are really really big to change, for example:
Changing the box objects to Animations ID, will require to change literally 85% of the events in the project (almost the entire game).
Tween insisted of animation cooldown, again more than 70% of the events is related to this as the cooldown work as a lock in the game to avoid building while its going, so almost all the events have a condition to check if the cooldown animation finished, and require replacing to tween finished or object height condition.
Build behaviors for the building tasks, once again everything is related to the building process in the game, changing it or replacing it with a behavior will require to change almost everything in the events.

i know you guys are searching for the cleanest examples, but I cant just remake the entire game for the exact same output but just cleaner, its too much.

Thanks for the reviews ❤️.
Note: Download link & Gameplay link updated.

D8H commented

i know you guys are searching for the cleanest examples, but I cant just remake the entire game for the exact same output but just cleaner, its too much.

Don't worry, we won't ask you to do repetitive tasks. From a quick glance, I would say that there will be about 100 times less events at the end of the review. It could actually save you time for your next projects. I personally learned most of what I know about coding from peer reviews.

I suggest that we do it step by step and when you face a change that seems too long or impossible to do, explain the issue here and we'll try to find a solution together.

For the first step, let's try to factorize the building system. Here some hints:

  • Use 20 instances of the same Box object. Don't use any animation or variable to tell them apart.
  • Allies can be put at the center of Box using the "center position" action.
  • "Create an object from its name" action allows to use the same events to build any kind of Ally.
  • The Ally palette could use variables to know which kind of Ally to build and at which cost.

Use 20 instances of the same Box object. Don't use any animation or variable to tell them apart.

Not possible, because every box (1-20) have its own variables to check if its empty or not, for example:
at the beginning of the scene all the boxes have the Boolean Empty set to false, when you drag any building and place it on any box, that box will change its Empty Boolean to True, which mean its now filled, and if you drag another building to that box, you wont be able to put it, because that box is Filled (have the empty Boolean set to True), when enemies kill that building on any box, that box will change its Empty Boolean to False, so you can place another buildings on it now, same thing apply to the kick button.

so its not possible to make 1 object/box that contain all the variables, yet each instance of it have its own Boolean.

Allies can be put at the center of Box using the "center position" action.

i know but the characters canvas are not the same, that's why I set the center manually for each building.

"Create an object from its name" action allows to use the same events to build any kind of Ally.

I know that action, but what exactly you are suggesting to use it for ? at what events it should be replaced with ?
(Details needed).

The Ally palette could use variables to know which kind of Ally to build and at which cost.

I didn't understand this point nor why its required.

D8H commented

Use 20 instances of the same Box object. Don't use any animation or variable to tell them apart.

Not possible, because every box (1-20) have its own variables to check if its empty or not, for example: at the beginning of the scene all the boxes have the Boolean Empty set to false, when you drag any building and place it on any box, that box will change its Empty Boolean to True, which mean its now filled, and if you drag another building to that box, you wont be able to put it, because that box is Filled (have the empty Boolean set to True), when enemies kill that building on any box, that box will change its Empty Boolean to False, so you can place another buildings on it now, same thing apply to the kick button.

so its not possible to make 1 object/box that contain all the variables, yet each instance of it have its own Boolean.

Instances of the same object don't necessarily have the same variable values. When an ally is dropped on a box, the variable "Empty" can be set only for this instance (the one where the cursor is, probably the only one picked).

Allies can be put at the center of Box using the "center position" action.

i know but the characters canvas are not the same, that's why I set the center manually for each building.

If the asset center is not at a logical location it can be customized.
Moving an object from its center to the center of another object will work no matter the objects sizes.

"Create an object from its name" action allows to use the same events to build any kind of Ally.

I know that action, but what exactly you are suggesting to use it for ? at what events it should be replaced with ? (Details needed).

The Ally palette could use variables to know which kind of Ally to build and at which cost.

I didn't understand this point nor why its required.

We can come back to this part later.

Hello :3
after this long time, I considered returning to the project and fix what it takes in order to get the example merged with GDevelop based on the reviews :)
So here is the new updates I did based on the Reviews (Update 2.2.1):
• Deleted all box objects and replaced them with only 1 object (Box) and gave them ID.
• Reduced the amount of duplicated events by adding sub-events.
• Increased the volume of Kick sound effect.
• Fixed a bug (building guardian at box 15 was not working) (reported by tristian long time ago during the voting period of the jam.
• Replaced the cooldowns from animations to Height size/subtract/add/set.
• Changed the cooldown speed for each build (Fire: fast | Pistol: Slow | Guardian: Slower).
• Removed the hidden objects used for colliding to collect the money and replaced it with the actual bar collision.

And now the example is ready for another review :)

You can download the new example v 2.2.1 here:
Army-vs-Zombies-V2.2.1 GDevelop project.zip