GDevelopApp / GDevelop-examples

Repository of examples and templates for GDevelop - the open-source, no-code game engine
https://gdevelop.io
54 stars 20 forks source link

New example - Advanced Platformer - Not-A-Vania Redux #23

Closed Silver-Streak closed 3 years ago

Silver-Streak commented 3 years ago

Describe the example

This is a complete remake of the first thing I ever made with GDevelop, Not-A-Vania. While I'm calling it Not-A-Vania Redux, the main idea was to show GDevelop users a platformer made with much more advanced concepts.

It includes: Finite state machines (FSMs), tweens, bitmap fonts and bitmap text objects, tilemaps, external event sheets, declaring variables via events, and instance object variables for event logic.

I believe the example is documented throughout in a way that can help users (who understand the basics of GDevelop), understand the more advanced concepts as well.

Screenshot 2021-07-02 125847 Screenshot 2021-07-02 141037

Checklist

Game folder

NAVRedux Project.zip

Bouh commented 3 years ago

This is an AWESOME game example!

image

Silver-Streak commented 3 years ago
  • Can we see for reducing a bit the respawn timer when we die into the hells? (not found in FSM events 😬 ) Do you mean when you fall into one of the big pits later in the level? If so there's probably some ways I can tweak it. (add a gradual fade to black underneath the pit that hides the death knockback)

If you mean ALL pits, that might be a bit harder.

  • Could be fine to register the project to get some analytics?

I think analytics are fine, but as this was meant to be closer to a released game state, I wanted to show disabling the analytics via events as there isn't a project-wide way of doing it. If we're against that I can remove it.

  • There is two bar very similar, stamina and health, the difference is only for size? If yes you can use one object or two with one resource, by using a 9-patch object to make a bar long or shorter.

I was working with the assets available from Itch.io, and couldn't find a good way to scale them accordingly without it working weird. I can try to change that, but I feel like having both the panel as a sprite and the actual bars as 9-patch sprites helps the players

4ian commented 3 years ago

Very nice! Would be an awesome example. A nitpicking on the gameplay, the attack is quite long and because the player can't move, it feels very "heavy" and lack a bit the speed and agility of a (recent) Castlevania game? You can feel angry against the character when you get it because it's slow at attacking so you have to anticipate everything. Might be worth checking this to make the gameplay a bit more fun/accessible?

Otherwise, great job there!

Silver-Streak commented 3 years ago

I'll dig into these changes this weekend.

arthuro555 commented 3 years ago

Here is my little "review":

The game is really big and I don't have that much time so I didn't look too much in depth but appart from those nitpicky concerns everything LGTM.

Silver-Streak commented 3 years ago
  • The package name should have com.example. so that users are warned to change it when exporting the game (to prevent installer issues)
  • It's probably an over-over-nitpick but I think the "scene opening experience" of the title scene is not that great

Easy enough, I can fix these.

  • Also a nitpick, but I would position the objects on the scene properly instead of repositioning them using those kinds of events.

I use positioning via events since there's no way to center it on the screen via the object themselves, and because during a normal game dev process I've found myself changing menu options numerous times. Centering them via events means no matter how much I change it, I don't have to reposition it.

For the fadeobject, having it as a much smaller object that gets scaled based off the camera/game size allows for a much smaller asset size (Performance) and allows me to change game resolution without having to resize the object. (I still REALLY think we need a way to get the game properties resolution width/height and the current running resolution (not window size))

So long as there's no huge concerns with the above, I'd leave it as is.

The reason: With this code, the collision check is run every frame, collisions checks requires usage of lots complex math that take time to compute, and object condition has to run once for each object. If you can, you want to avoid running those. As GDevelop quits executing conditions if one of the previous ones were false, you can avoid running the collision check if you have already triggered the boss fight.

I'll look into this.

  • I would move down those actions to the "game is previewed" condition (no need to bother running those actions if the objects are never shown)

Makes sense to me.

  • I would use one platform instead of 3 when possible to minimize collisions checks the platformer has to do (like the platform on the right):

Totally valid, I'll get that changed.

  • While the game does reset the checkpoint when having a game over, it doesn't reset the lives count which stays at 0.

Thanks for calling it out, I'll get that fixed.

  • Instead of using a for each: You can use object selection: This one is redundant: This one is also not needed too as far as I can tell: For each events are less performant so they should be avoided unless really needed.

Sadly when I previously had object selection instead of foreach, only one ghost would activate at a time if 2 were within range. I'll poke at it again with your setup to see.

Midhil457 commented 3 years ago

Hi, I would also like to give a suggestion, related to the title screen.

The elements don't look like they belong together (Just my opinion). Maybe using some colors that are used in other parts of the game? I tried to experiment with the colors and I came up with this. I don't know if I made it better or worse. I don't know if the menu looks good Colors taken from various parts of the game Title3

:)

Silver-Streak commented 3 years ago

Hi, I would also like to give a suggestion, related to the title screen.

The elements don't look like they belong together (Just my opinion). Maybe using some colors that are used in other parts of the game? I tried to experiment with the colors and I came up with this. I don't know if I made it better or worse. I don't know if the menu looks good Colors taken from various parts of the game Title3

:)

Hmm... the menu elements are actually directly from the same asset pack as the in-game UI. I might be able to color match the grey slightly more? I'm not sure that's entirely worth the effort though, as I'm no artist. 😆 I'll see what I can do.

The title color matches the game over/congrats screen, though.

Midhil457 commented 3 years ago

Also, this example surely deserves a icon/thumbnail. It is in my opinion this is the most polished and finished example.

but It's your choice :)

Silver-Streak commented 3 years ago

Also, this example surely deserves a icon/thumbnail. It is in my opinion this is the most polished and finished example.

but It's your choice :)

Good callout, I'll fix that.

As far as the main menu: I did some checking, the title menu is the exact same greys used in the main game GUI, so I'm not sure there's much else I can change around it from a style perspective at this point.

Silver-Streak commented 3 years ago

Hey all!

I made what changes I could, here's the ones I remember off the top of my head. Please let me know if there's anything else needed.

Here's the updated project file. NAVReduxUpdate.zip

arthuro555 commented 3 years ago

A few gameplay comments:

For the wolves also, if you go to the boss then backtrack it will trigger the wolf even if you are not in fron of it. I wonder if it wouldn't just be easier to have a "wolf trigger" object that activates the wolf when the player touches it (both can be linked using an instance variable).

I use positioning via events [...] So long as there's no huge concerns with the above, I'd leave it as is.

Yep no worries it's fine.

Silver-Streak commented 3 years ago

A few gameplay comments:

  • I would really like it if it was possible to dash in-air

As within Castlevania 1, jumping is intended to be a definitive choice, I almost locked controls while jumping but decided that might be too harsh. (also since there's no easy way to stop platformer gravity mid-air, the amount of technical debt that would be required to implement something to make it feel "good" would counteract any benefits at this point)

  • You cannot hit the wolves when they are at the same height as you, you need to be on a lower platform (I think it wasn't like this before the update)

This is intentional, you were never supposed to be able to easily hit the wolves before, but I forgot to update their default hitbox. The design of the wolves was to teach you to try to dash through them or jump over them rather than attack (it's meant as "early teaching" to prepare the player for the boss)

  • I tested with a PS4 controller, and the game is fine though if possible I would add the option to also use the joystick instead of limiting it to the D-pad

Sure, easy enough. I'll look at this today.

  • The ghost enemies do not flip towards the player, I think they did before the update though?

It did not do that before, but I can add that, I'll look at this today. I'll probably have this flip during the attack phase.

  • A sound when the player is hit would be nice too

Makes sense, I'll see if I can find one or make one with JFXR today

For the wolves also, if you go to the boss then backtrack it will trigger the wolf even if you are not in fron of it. I wonder if it wouldn't just be easier to have a "wolf trigger" object that activates the wolf when the player touches it (both can be linked using an instance variable).

Hmmm...I'll look into this. Although it seems like adding a condition of "Hero.X() < Wolf.X()" may be the easiest.

arthuro555 commented 3 years ago

As within Castlevania 1, jumping is intended to be a definitive choice, I almost locked controls while jumping but decided that might be too harsh. (also since there's no easy way to stop platformer gravity mid-air, the amount of technical debt that would be required to implement something to make it feel "good" would counteract any benefits at this point)

This is intentional, you were never supposed to be able to easily hit the wolves before, but I forgot to update their default hitbox. The design of the wolves was to teach you to try to dash through them or jump over them rather than attack (it's meant as "early teaching" to prepare the player for the boss)

Makes sense

Although it seems like adding a condition of "Hero.X() < Wolf.X()" may be the easiest.

With easier I meant easier for someone looking at the code to understand.

Silver-Streak commented 3 years ago

I think the majority of the requested changes are now done.

Let me know if there's any other big issues.

Edit: Quick change, forgot to set preload on the new sound.

NAVRedux Project.zip

arthuro555 commented 3 years ago

I still have a few optional improvements in mind:

Else everything LGTM!

Silver-Streak commented 3 years ago

I still have a few optional improvements in mind:

  • Add option to dash using the right thumbstick

So I've tried this now....not sure about this one, I've applied it and it feels kind of bad for me on both my Dualshock and Xbox controller and it can lead to accidental dashes. I think I'll leave this out.

  • Prevent from changing the menu option while the fade out is happening

Makes sense. Updated.

  • Add window titles for each scene

This didn't really seem to make any impact as the player is not usually going to be watching the windows title, so I've left it out.

  • Make all the "utility sprites" (hitboxes, platforms...) images semi-transparent to see through them

I've done this for the project items...but I'm not sure if this is a good practice since users that are using the built in image editor won't be able to replicate this, since Piskel doesn't support opacity/transparency.

Regardless, I agree that it looks better on the example project so I've updated the ones I felt it made sense for.

Let me know if there's any other items. NAVReduxUpdate4.zip

arthuro555 commented 3 years ago

Not sure how I did it, but while fighting the boss I managed to die and get stuck in dying state without going back to the menu

https://user-images.githubusercontent.com/19349038/124504228-50dfb280-ddc7-11eb-8f42-965ae1165a13.mp4

Before closing the preview I have used the debugger to screenshot all relevant game state data: image image image image image

I think at some point before I managed to hit and dash at the same time as I was in attack animation but the boss didn't do me damage while going through me and my input was blocked.

Silver-Streak commented 3 years ago

Hmmm.....not sure what that could have been. You obviously went to the death animation. It looks like it somehow went to death AND gameover?

I'll poke around some.

Silver-Streak commented 3 years ago

@arthuro555 I've spent about 40 minutes trying to reproduce this. I cannot. 😢

Edit: Unless someone else can reproduce it, I think we're good to go live with this version, @4ian

arthuro555 commented 3 years ago

Yep I think it's ready to go too

Bouh commented 3 years ago

Hum this project is set up on multiple files option. I can package it in a single file, but there is a contraindication to use multiple file projects on distant repo?

arthuro555 commented 3 years ago

Huh? On the contrary, it is recommended to use multiple files when publishing to a repo to make conflicts more rare and easier to deal with.

Bouh commented 3 years ago

I was wondering about the link between scenes since they are in subfolders. Does the fetch that is done pull any file in subfolder or only some predefined. But yes it's better to split the project, I only ask if the fetch goes everywhere.

4ian commented 3 years ago

Ideally we would use multiple files as it's specifically made for working in teams and ease reviews. But currently opening a project from an example, either in the web-app or the desktop app, is restricted to single files only. This is because the project unsplitter (that read the files from a multiple project) is only implemented for local files (see LocalProjectOpener).

If you can for now open a PR with a single file that will still be good :)

Bouh commented 3 years ago

That was my concern, the pull request is open.