4ian / GDevelop

:video_game: Open-source, cross-platform game engine designed to be used by everyone.
https://gdevelop.io
Other
6.4k stars 717 forks source link

Pokémon-like movement #764

Closed ghost closed 2 years ago

ghost commented 5 years ago

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

4ian commented 5 years ago

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!

ghost commented 5 years ago

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

Wend1go commented 5 years ago

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.

ghost commented 5 years ago

oh yeah sorry. I'll see

ghost commented 5 years ago

Here it is! Pokémon Movement.zip

ghost commented 5 years ago

Is there anything you want me to change?

4ian commented 5 years ago

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 :)

ghost commented 5 years ago

Ok, I'll see

ghost commented 5 years ago

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

ghost commented 5 years ago

anything you want me to change?

4ian commented 5 years ago

There are a few things:

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! :)

ghost commented 5 years ago

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.

ghost commented 5 years ago

Anything else?

ghost commented 5 years ago

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

ghost commented 5 years ago

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

ghost commented 5 years ago

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

4ian commented 5 years ago

Let me check :)

4ian commented 5 years ago

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. :)

MercurioC commented 5 years ago

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

ghost commented 5 years ago

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

GeeDot commented 5 years ago

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.

ghost commented 5 years ago

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

GeeDot commented 5 years ago

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 .

zatsme commented 5 years ago

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

Lizard-13 commented 5 years ago

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:

4ian commented 5 years ago

Sure two examples are better than one 😄

zatsme commented 5 years ago

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 👍

Lizard-13 commented 5 years ago

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

Wend1go commented 5 years ago

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. 🤣

zatsme commented 5 years ago

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 😄

zatsme commented 5 years ago

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.

4ian commented 5 years ago

@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.

4ian commented 5 years ago

@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).

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

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

zatsme commented 5 years ago

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 👍

4ian commented 5 years ago

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 :)

zatsme commented 5 years ago

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 😄

4ian commented 5 years ago

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! :)

zatsme commented 5 years ago

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 😄

4ian commented 5 years ago

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 😬

blurymind commented 5 years ago

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 <notifications@github.com 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 .

4ian commented 5 years ago

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

ghost commented 5 years ago

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

4ian commented 5 years ago

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

zatsme commented 5 years ago

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! 🤔

4ian commented 5 years ago

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 :)

zatsme commented 5 years ago

Nothing special, just the profiler 😊

zatsme commented 5 years ago

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

Zat RPG Example.zip

4ian commented 5 years ago

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

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".

Hope it's a bit clear!

4ian commented 5 years ago

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 😏).

GeeDot commented 5 years ago

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 .