Gdevelop: Pokémon-like movement

Created on 22 Nov 2018  ·  54Comments  ·  Source: 4ian/GDevelop

Hi!

I'd like to submit a new example to be added to GDevelop.
The project file is an attachment.

I confirm that any assets can be used freely by anybody, including for commercial usage.
They are all made by me.
game.json.zip

👌good first issue

Most helpful comment

That's funny, I also have an unpolished example of grid movement lying on my hard drive. ^^
I placed the sprites on the scene manually and converted their positions into a grid within a scene structure. Movement is done via lerp function iirc. Could probably polish it up at the weekend.
Three examples are better than two. 🤣

All 54 comments

Seems like you've not included any of the images in your zip. Can you modify your game so that images are in the same folder? Thanks!

Oh yeah, sorry. Here it is:
Pokémon Movement.zip

There were still wrong paths in your second upload, I corrected them here:
Pokemon.Movement.zip
Could you do a little more polish please? There is an empty Scene "Inside" without any content and the character doesn't show an animation when two direction keys are pushed at once.
Having some grass, bushes and walls in the background would make the example more visually appealing.

oh yeah sorry. I'll see

Is there anything you want me to change?

Some images are still referring to your computer (../../Desktop/...): you must move them in your game folder. To see why, try to move your game in another sub folder and the image of the player won't be available.

Also, I tried and there are large pans of the game area that were grey. Is that normal? It's important that we have high quality example, so that it reflects professionally on the game engine :)

Ok, I'll see

Ok, here it is. Anything else?
Pokémon Movement.zip

anything you want me to change?

There are a few things:

  • Could you remove the "Do =0 to the direction of Player" which are not useful.
  • There are a bunch of unused images in the resources, can you remove them too? (Project Manager > Game Settings > Resources > Right click on a resource > Remove all unused images).
  • Also would be interesting to have at least a house (object House) and handle collision with it (add an event without conditions, and with an action "Separate two objects". First object should be player, second object should be the House). Ideally put the House in a group called "Solid" and do the action between the Player and Solid.

You can also remove Nitro Bugz Main Character.png from the folder as it's not used it seems.

Trying to get the example as tiny and useful as possible ;)

Thanks! :)

Alright! Here it is, I made a fence instead of a house because I thought it'd be weird if there was a house and you couldn't go inside.
Pokémon Movement.zip
Anything you want me to add or change? I'm up for making a house that you can go inside of, but it'd be a bit longer.

Anything else?

Are there any other things you want me to change or add?

Now it looks like I'm spamming XD. Anything else?

Hey! I updated it a bit, anything you'd like me to change? I made it so the pixels aren't smoothed out so it has a Pokémon feel to it.

Pokémon Movement.zip

Let me check :)

Thanks for the update! Could you make the size of the game smaller? And replace the grass (and maybe path tile too) with some pixel art that is higher quality, like the character?
Also for the character and the fence, the size of the pixels are not the same:

image

"pixels" of the fence are smaller than pixel of the character.
I know that I'm a pain, but if we include an example with these things, this will reflect badly for new users on GDevelop as they will see it as something that is not polished. :)

If I can add my two cents on the matter, it's not really a Pokemon movement example if there's not a tile-based movement in act 😄
You can freely move in the four main directions in your example, while in PK you mostly tap the arrows to change direction and hold to make one step at the time. Take a look at this example: https://www.youtube.com/watch?v=bwP4Mxb3vJA

Yeah, OK. I'll see what I can do. Thanks.

Great work, Zeph-dev. I have been looking for something like this. But it is like MercurioC mentioned, one tap on the arrow key should move the player one tile unit, not continuously. The player always end up precisely in a tile instead of partially in it. Sorry if I am not making sense.

I know what you mean. It's kinda hard to make it work.

It's alright. Thanks for the reply.

Have a great day.

On Fri, Feb 1, 2019, 12:50 AM Zeph_dev notifications@github.com wrote:

I know what you mean. It's kinda hard to make it work.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/4ian/GDevelop/issues/764#issuecomment-459418194, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AjOmIMwj-CzkezjHzbgCYEldwcFy5l1Qks5vIx7fgaJpZM4Yv0pj
.

I'm currently working on an rpg type example with exactly this kind of movement 👍. Might be ready for the next beta 😁

Crap, I was going to do the same, so this example can be finally added, but with a cool idea behind for the style/theme.
Happily haven't started it yet, I'll check your example and if my way to do the movement and collision is different I will do it, two examples are better than one :smile:

Sure two examples are better than one 😄

I'm using a gridsize variable and moving the character until it's reached the cureent position + gridsize. If the player presses once then it moves until gridsize pixels is reached, if still pressed it adds another gridsize pixels and continues. This seems to work well.

To keep the player on a path or in an area I put an invisible object and check if the next movement will keep the player inside the collision bounds of the 'path' object.

I'll hopefully get the example up tonight or tomorrow so you can have a look 👍

I can't start to work on it in the next days anyway, so don't hurry for me please :)

That's funny, I also have an unpolished example of grid movement lying on my hard drive. ^^
I placed the sprites on the scene manually and converted their positions into a grid within a scene structure. Movement is done via lerp function iirc. Could probably polish it up at the weekend.
Three examples are better than two. 🤣

Here's first draft, I'm going to add a second indoor area and some interaction, in time could update with a dialog example when we have the new extension 👍

See Below!

Suggestions very welcome 😄

New zip below!

New example which reminds me about the screen guide in the editor is never the size when running the preview, is this a bug? See the GUI background which is supposed to be covering the bottom of the window/screen.

@zatsme That's surely because by default, the width of the game is adjusted to the size of the window. Disable this option in the game properties and see how it goes.
It's also possible that the size of the window of the preview is not exactly the size of the game, might have to look into this.

@zatsme I've tested and that looks really nice!
A few comments that could help improve the game and maybe at some point even make a starter with it! (I know that it's not finished though - but it's a great start).

  • The maps are a single sprite. While GD does not have a tiled map object (for now), I think it would still be useful to use a few tiled sprite to create the map:

    • Green background and roads are easily doable using tiled sprites objects

    • Same for walls, you can have tile sprites for user facing walls or side walls. Note that tiled sprites can be larger than a single tiles, so that there is a bit of variety when repeating the tiled image.

      image

    • In the same idea, this could be used as a "Forest" tiled sprites:

      image

    • You can have multiple "Forest1", "Forest2", "Forest3" objects to have different patterns for the forest.

    • You can also have a single sprite object, with one animation for each kind of tree/plant/grass/rocks, so that you can put a bunch of them and change the animation of instances in the properties

    • The red carpet could be a really good 9 patch ("Panel Sprite") object.

    • The decoration (tables, libraries on the wall, etc...) can also be sprites or maybe tiled sprites.

    • The idea of all of this is that even if GD is not tiled based, using multiple object allow to easily create different maps and explore things. It might be harder than using a tiled map object/editor BUT I think it's sufficient to start and do nice things.

Pretty sure people will love editing/creating new maps if we have multiple objects. :)

  • You've been using the condition "Always". As far as I see, it's useless, just put no conditions.
  • Events are copy-pasted between scenes: better using external events :)
  • Good usage of "Pause the scene and start XXX" 👍Rest of the events are pretty clear, putting a few groups/comments/external events might help to make this accessible to everyone.

What do you think? I think with a few improvements it could be a great starter.

I created the maps in tiled and exported to a image file, I intended to include the maps and tileset in the project so people could use tiled to change them. Because of this and no tiled support yet, I used the large images. Once we have tiled support then the problem dissapears! But for now it's probably best to change to sprites so as not to confuse users 🙄

I use 'Always' because it's obvious for beginners, which is the point IMHO?

I'll change to external events, add comments and make some extra sprites for the maps as you suggest so users can change the maps inside GD 👍

But for now it's probably best to change to sprites so as not to confuse users 🙄

Yeah, I know it takes more time, but this also make maps easier to edit directly in GDevelop. It's more time to invest to create objects, but then it's fairly quick to edit maps.

I use 'Always' because it's obvious for beginners, which is the point IMHO?

Tutorials and games should generally avoid always - because a "no conditions" is exactly the same, faster for the user (you don't have to add an extra condition), faster to read (no conditions is grayed, so just by lookingat the color you know that there is no conditions for this event) and avoid a function call during the game so in theory it's faster than using "Always". Always is only there for completeness, to be potentially used with the "Or"/"And" special conditions. But apart from this it should never be used - it's almost 99.9% useless.

I'll change to external events, add comments and make some extra sprites for the maps as you suggest so users can change the maps inside GD 👍

Nice! Look forward to the changes!! Will be super helpful for people who would want to start working on a RPG like/tile based game :)

It's very hard to create a map with sprites and multiple anims, you can place the sprites and then go through the properties changing the anims but it's a long process.

A interim suggestion (not sure how easy it might be to implement?) until we have tiled support is:-

Have a tile place mode in current IDE, where the tile is visible to the user while being placed in the grid, and the ability to change the anim up/down with a keystroke, this would make it much easier to place tiles.

Also a Random mode, like Tiled, where you can place a tile and it will randomly select the anim to use.

If we had these two things it would greatly improve the user experience until Tiled support is available 😄

Remember that you can ctrl/cmd + click to duplicate an instance, it's not a lot but can still be helpful to quickly duplicate and put a lot of instances with a given animation.

Have a tile place mode in current IDE, where the tile is visible to the user while being placed in the grid, and the ability to change the anim up/down with a keystroke, this would make it much easier to place tiles.

The thing is that these shortcuts would be specific to the Sprite objects, so this require more planning and proper architecture to handle all kind of objects to benefit from this.
But taking your notes! :)

If you are taking notes, then this is exactly what I mean...

tiled

The selected Sprite/Tile is attached to cursor and in grid system, click and you can paint with the tile. A random option would allow the sprites anim to be randomly selected for each painted grid square to produce the effect on the grass with flowers and rocks etc 😄

Yup I see the idea. Note that this is not necessarily a good idea to even develop this for GDevelop for now, because it's bad for performance to be using so much little sprites - well it can works but the idea behind a tiled map object is to optimize the rendering a lot.
It's also why I suggest to use a bunch of tiled sprite, even for grass/plants/trees where you can use a semi random pattern with a tiled sprite. It's still fine to use sprites for some objects :)
But if this is to be done, this should be on a tiled map object, otherwise I'm afraid of people painting maps of thousands and thousands of sprites and then complaining of performance 😬

All those draw calls :o btw this can totally be done but it would require
an active tool type interaction behavior with the scene editor. I was
thinking about it too.
Ideally we could be using the official pixijs renderer for tiled, adopt it
to GD in some way. Fork it if we have to. Rpg maker mv is currently using
it too, so it might have some limitations imposed on the design

On Mon, Feb 4, 2019, 10:57 PM Florian Rival <[email protected] wrote:

Yup I see the idea. Note that this is not necessarily a good idea to even
develop this for GDevelop for now, because it's bad for performance to be
using so much little sprite - well it can works but the idea behind a tiled
map object is to optimize the rendering a lot.
It's also why I suggest to use a bunch of tiled sprite, even for
grass/plants/trees where you can use a semi random pattern with a tiled
sprite. It's still fine to use sprites for some objects :)
But if this is to be done, this should be on a tiled map object, otherwise
I'm afraid of people painting maps of thousands and thousands of sprites
and then complaining of performance 😬


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/4ian/GDevelop/issues/764#issuecomment-460446964, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AGMbVQXERzwtQp3fqObxvniTFGvwcJn4ks5vKLragaJpZM4Yv0pj
.

an active tool type interaction behavior with the scene editor

Yes, I'll add ability for extensions providing objects to have interactions directly on the scene editor if we come up with a working tiled map object :)

Ideally we could be using the official pixijs renderer for tiled, adopt it
to GD in some way. Fork it if we have to.

Any official/community supported renderer would be the way to go :) Even if it's not as full featured as other software, it's fine again to start simple. I would avoid forking anything because this is possibly a ticket for spending days and nights debugging/upgrading things. The less we have to do, the better we can concentrate on providing a great software.

I link the discussion here, let's continue here if we want to discuss about it :) https://github.com/4ian/GD/issues/503

I'll leave that in the hands of you then. Good luck

Do you think you'll have time for the suggestion I made or should I just go with what we have now?

I can finish it this weekend, I made most of the changes already, just some last bits to do. I tested the performance of the different ways to render the gfx... Was interesting, individual sprites for everything ran ok with the map sizes in use but far slower than using the original (whole map image), or groups of images in a tiled sprite (new design) which were both very fast and almost identical performance! 🤔

Nice! How did you test the performance exactly?

But yeah, when using individual sprites, the GPU has to draw lots of small squares. When drawing the whole map it's faster, and when using tiled sprite it's just a few additional squares to render + some texture change - so performance should be nearly identical while keeping flexibility of designing the level :)

Nothing special, just the profiler 😊

Here you go, it's got a lot of your suggestions so is more instructive 😄

Zat RPG Example.zip

Great job! Love the door that closes when you come back from the shop/hut! 😄
Still a few comments:

  • You're always using Pause the scene and start a new one. At some point, this will exhaust the computer memory and crash the game, as you're always create scene on top of a scene, which is on the top of another one. In a way, you're stacking scenes. Prefer:

    • Changing scene
    • Or better: pause the scene forest to start scenes that are "inside buildings". Then when you want to come out of the building, use "Stop and go back to previous scene". Finally, use some global variable to say to the original scene (i.e: forest) that you just came out of a building, so the player should be put back on its previous position (otherwise, the Forest scene will be unpaused, but the player will again be on the tile to go in the shop!* (see end of message for more info))
  • The way you detect is you want to enter in a building is using tiles. It's perfectly fine, but you're also using the direction of movement for this. I think it's fragile. If I change the map to have the exit of the shop on the right or the top, then I'm blocked in the shop (because according to events you have to walk in the bottom direction).

  • Finally, it's a bit related to my second point: you're handling in a single external event sheet all the movement of the input (which is fine) AND also the changes between scenes.
    This is becoming complex because you have to use same objects, like "Shop" to enter in the shop (that's fine) but also... to get out (weird huh?).

Instead, have common events that just handles movement in the external events sheets. And have a few events (as few as possible) inside each scene that do the logic specific to these scenes. For "Forest", it will be to trigger starting the shop or hut scenes when the player collides with Shop or Hut objects. For "Shop" or "Hut", it will be an event that, when the player collides with some invisible called "Exit", will then: 1) Set a global variable to say that getting out and 2) call "Stop the scene and go back to the previous one".

  • Note about going back to the previous scene: when you go back to a previous scene, it's a good idea to set, in an action just before, a global variable like to tell that the player just came out of a building (for example, set variable "PlayerJustExitedBuilding" to 1).
    Then, the Forest scene can verify that if this variable is 1. If yes: move the player on a tile a bit bottom (so that it does not collide with the entry anymore), set the animation so that he looks toward the bottom, and reset the variable to 0 (and reset any variable related to movement).
    (If you don't do this, the scene will start again at the exact same moment when you paused it. So events will be run, and the player, as it's colliding with a Hut or Shop object, will be sent back in the Hut or Shop)

Hope it's a bit clear!

If you don't understand, I'll try to do it but have to find some time.
I believe that with more tiled sprites and some more generic events it could be a great starter.

I imagine that we could even create a set of events functions, that would be useful to create a RPG gameplay with a few events! (this will be part of the feature for sharing functions 😏).

hi guys, could u guys kick me out. I keep getting these emails. thanks

On Fri, Mar 8, 2019, 8:27 AM Florian Rival notifications@github.com wrote:

If you don't understand, I'll try to do it but have to find some time.
I believe that with more tiled sprites and some more generic events it
could be a great starter.

I imagine that we could even create a set of events functions, that would
be useful to create a RPG gameplay with a few events! (this will be part of
the feature for sharing functions 😏).


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/4ian/GDevelop/issues/764#issuecomment-470755993, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AjOmIPd3P5I9B43Hq9hsiZ_iEv7b83Klks5vUa5ZgaJpZM4Yv0pj
.

hi guys, could u guys kick me out. I keep getting these emails. thanks

At the bottom of the email, mute the thread!

If you don't understand, I'll try to do it but have to find some time.
I believe that with more tiled sprites and some more generic events it could be a great starter.

I imagine that we could even create a set of events functions, that would be useful to create a RPG gameplay with a few events! (this will be part of the feature for sharing functions 😏).

I understand, been coding logic for years, but a bit lazy and not much time 😆 🤣

I'll try to do some more this weekend! 👍

@zatsme if you have an updated project file about this somewhere, let me know :)

This should be not too hard to finish and make in a real example, marking as a good first issue.

Hi 4ian, I wish I had time to make more examples for GD5 but not at this moment ☹️

The zip from 3/3/2019 above is the latest code I have 👍

Still watching progress though, this past year GD has really kicked on, great work all! Hopefully will be back having fun with GD soon 😃

Zat

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Phenomena3 picture Phenomena3  ·  5Comments

Wend1go picture Wend1go  ·  5Comments

blurymind picture blurymind  ·  5Comments

BWPanda picture BWPanda  ·  4Comments

Jose-Moreno picture Jose-Moreno  ·  5Comments