GDevelop-examples icon indicating copy to clipboard operation
GDevelop-examples copied to clipboard

Boxy Box Pusher

Open mistafixxa069 opened this issue 2 years ago • 22 comments

Describe the Example

Boxy Box Pusher, or BBP for short, is a Sokoban example for GDevelop. It includes some simple systems like player movement and box pushing, you however can only move one box at a time and can't push a box with another box.

Checklist

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

Game folder

Sokoban Example.zip

mistafixxa069 avatar Apr 08 '22 14:04 mistafixxa069

Hi, great game! I didn't see any issues with the example except, that the readme's short description can be the project's description. Though you can keep the rest. And remove the first title

Midhil457 avatar Apr 10 '22 13:04 Midhil457

Hello Leo_Red

May I ask the specifics of what you mean by removing the first title?

Sincerely, Mistafixxa

On Sun, 10 Apr 2022 at 21:20, Leo_Red @.***> wrote:

Hi, great game! I didn't see any issues with the example except, that the readme's short description can be the project's description. Though you can keep the rest. And remove the first title

— Reply to this email directly, view it on GitHub https://github.com/GDevelopApp/GDevelop-examples/issues/242#issuecomment-1094273961, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATI67X36WU5RCPPUZ7LIZ5LVELIQXANCNFSM5S4VSOMQ . You are receiving this because you authored the thread.Message ID: @.***>

mistafixxa069 avatar Apr 10 '22 14:04 mistafixxa069

Thank you for submitting this example. This is a very good start. The events as well organized.

I have some suggestions:

  • The history could be a behavior and use an array variable instead of objects. This will avoid to have events for each objects and make the events easier to read.
  • The collision system could also be made a behavior with actions like "Character can move 'left' according to Box and Wall". It will make the logic as easy as reading English.
  • Custom points can be used to check the collision instead of relying on temporary objects. It's more performant and can be used in extensions.
  • Object names must start with uppercase.

D8H avatar Apr 16 '22 22:04 D8H

Actually, I want you to have this on hold as I have just developed a simpler and easier example template that might be more efficient and simpler.

Thank you reviewing this example...

Message ID: @.*** com>

mistafixxa069 avatar Apr 17 '22 06:04 mistafixxa069

I have updated the example

mistafixxa069 avatar Apr 20 '22 04:04 mistafixxa069

Good job on simplifying the events.

Some collision checks are done every frame. It doesn't affect performance much because Sokoban maps are not huge, but, as it's an example, it's still important to show optimized events.

Currently, the events do this:

  • Check if there are any obstacle 2 squares from the player
  • Check if there is a box 1 square from the player
  • Check in which direction the player is going

It should be done the other way around because checking the player input is really fast and if players don't move left, there is no need to check if they can push something this way.

  • There are unnecessary pick all conditions.
  • Any reason why tween is no longer used? Did you face some limitations with it?
  • The goal check can probably be done only at the end of a box push or at the end of a player movement.
  • Did you give up the rewind?
  • The camera following extension could be used to avoid the big formula.

GridBasedMovement extension

  • There should not be "?" in condition names and sentences.
  • Condition names (in the sidebar) can start with "Is" when it fit which is the case here
  • Avoid condition with negative phrasing NotMoving should probably be IsStopped.
  • Why is the speed multiplied by 4? What is the unit of length of the speed? It should probably be square per second².

D8H avatar Apr 21 '22 08:04 D8H

Got it, thanks!

On Thu, 21 Apr 2022 at 16:55, D8H @.***> wrote:

Good job on simplifying the events.

Some collision checks are done every frame. It doesn't affect performance much because Sokoban maps are not huge, but, as it's an example, it's still important to show optimized events.

Currently, the events do this:

  • Check if there are any obstacle 2 squares from the player
  • Check if there is a box 1 square from the player
  • Check in which direction the player is going

It should be done the other way around because checking the player input is really fast and if players don't move left, there is no need to check if they can push something this way.

  • There are unnecessary pick all conditions.
  • Any reason why tween is no longer used? Did you face some limitations with it?
  • The goal check can probably be done only at the end of a box push or at the end of a player movement.
  • Did you give up the rewind?
  • The camera following extension could be used to avoid the big formula.

GridBasedMovement extension

  • There should not be "?" in condition names and sentences.
  • Condition names (in the sidebar) can start with "Is" when it fit which is the case here
  • Avoid condition with negative phrasing NotMoving should probably be IsStopped.
  • Why is the speed multiplied by 4? What is the unit of length of the speed? It should probably be square per second².

— Reply to this email directly, view it on GitHub https://github.com/GDevelopApp/GDevelop-examples/issues/242#issuecomment-1104903224, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATI67X2H37BUPOLJ3GOLWHDVGEJYNANCNFSM5S4VSOMQ . You are receiving this because you authored the thread.Message ID: @.***>

mistafixxa069 avatar Apr 21 '22 10:04 mistafixxa069

The example can't use multiple file saving option (cuz the system doesn't support)

Midhil457 avatar May 03 '22 15:05 Midhil457

Ok, thanks for the clarification.

On Tue, 3 May 2022 at 23:27, Leo_Red @.***> wrote:

The example can't use multiple file saving option (cuz the system doesn't support)

— Reply to this email directly, view it on GitHub https://github.com/GDevelopApp/GDevelop-examples/issues/242#issuecomment-1116232050, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATI67X6JS7HD6NXFBZAV5RDVIFAXBANCNFSM5S4VSOMQ . You are receiving this because you authored the thread.Message ID: @.***>

mistafixxa069 avatar May 03 '22 16:05 mistafixxa069

wait, what do you mean? DM me pls

On Wed, 4 May 2022 at 00:01, Mista Fixxa @.***> wrote:

Ok, thanks for the clarification.

On Tue, 3 May 2022 at 23:27, Leo_Red @.***> wrote:

The example can't use multiple file saving option (cuz the system doesn't support)

— Reply to this email directly, view it on GitHub https://github.com/GDevelopApp/GDevelop-examples/issues/242#issuecomment-1116232050, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATI67X6JS7HD6NXFBZAV5RDVIFAXBANCNFSM5S4VSOMQ . You are receiving this because you authored the thread.Message ID: @.***>

mistafixxa069 avatar May 03 '22 16:05 mistafixxa069

Oh, my bad. Didn't realise they were tilesets 😅

Midhil457 avatar May 04 '22 04:05 Midhil457

Sorry but the example doesn't works see in video:

https://user-images.githubusercontent.com/1670670/167639385-8d87f871-d09d-42eb-b956-0e34be743a54.mp4

Bouh avatar May 10 '22 13:05 Bouh

Try using the latest version of the extension, it's still in the extension checking phase I think

Message ID: @.*** com>

mistafixxa069 avatar May 10 '22 14:05 mistafixxa069

@mistafixxa069 I can't make it work with the extension. The same problem happens.

I tried to reuse the extension made by @D8H for PixelPerfectTopDownMovement. We have almost the same result, there is still a few fixes to do I guess?

sokoban.zip

Bouh avatar May 10 '22 15:05 Bouh

huh, will try to fix the issue tommorow

On Tue, 10 May 2022 at 23:42, Aurélien Vivet @.***> wrote:

@mistafixxa069 https://github.com/mistafixxa069 I can't make it work with the extension. The same problem happens.

I tried to reuse the extension made by @D8H https://github.com/D8H for PixelPerfectTopDownMovement. We have almost the same result, there is still a few fixes to do I guess?

sokoban.zip https://github.com/GDevelopApp/GDevelop-examples/files/8663020/sokoban.zip

— Reply to this email directly, view it on GitHub https://github.com/GDevelopApp/GDevelop-examples/issues/242#issuecomment-1122561417, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATI67X3UVIIVG2LXE2A3FSLVJJ7VFANCNFSM5S4VSOMQ . You are receiving this because you were mentioned.Message ID: @.***>

mistafixxa069 avatar May 10 '22 15:05 mistafixxa069

Fixed it

mistafixxa069 avatar May 15 '22 13:05 mistafixxa069

  • Did you check what I've done in my zip file here? I optimized a lot the resources, the objects, the layers, and the zorder, and lot of stuffs.

  • What is for the extension ObjectHistory ?

  • [ ] Game description: A simple sokoban example for Gdevelop GDevelop

  • [ ] Set a custom package name

  • [ ] Add a timer or the new Wait action, when we press a key to move, because if we stay a bit too much on the pressed key the player move to the next case, it's hard to be precise.

  • [ ] Moves text on bottom left, delete the related events for the position, instead use the anchor behavior, (use the 5.0.133, the behavior has been improved to be easier to use!)

Bouh avatar May 20 '22 09:05 Bouh

The object history extension was supposed to be my solution to the undo feature the original had. Also, did I not remove the text? Huh, that's an extra object

mistafixxa069 avatar May 23 '22 01:05 mistafixxa069

I've made some changes on top of Bouh version:

  • Fix player movement and animation
  • Reorganize the events in groups
  • Use Tweens to simplify the player animation
  • Make collision checks only once when the player chooses a move for efficiency
  • Use a small dedicated extension for box pushing
  • Remove the camera scrolling because it makes me car sick

https://www.dropbox.com/s/xu9t303bkue61jd/sokoban_REVIEW.zip?dl=1

You said that levels are from Boxxle. This game is probably under copyrights. Levels must be copied with respect of licenses or done from scratch.

D8H avatar Jun 16 '22 08:06 D8H

Got it. Will design new levels

On Thu, 16 Jun 2022 at 16:25, D8H @.***> wrote:

I've made some changes on top of Bouh version:

  • Fix Player movement and animation
  • Reorganize the events in groups
  • Use Tweens to simplify the player animation
  • Make collision check only once when the player chooses a move for efficiency
  • Use a small dedicated extension for box pushing
  • Remove the camera scrolling because it makes me car ill

https://www.dropbox.com/s/xu9t303bkue61jd/sokoban_REVIEW.zip?dl=1

You said that levels are from Boxxle. This game is probably under copyrights. Levels must be copied with respect of licenses or done from scratch.

— Reply to this email directly, view it on GitHub https://github.com/GDevelopApp/GDevelop-examples/issues/242#issuecomment-1157378919, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATI67X25XNUXO64ZRG5CSLTVPLQFXANCNFSM5S4VSOMQ . You are receiving this because you were mentioned.Message ID: @.***>

mistafixxa069 avatar Jun 16 '22 09:06 mistafixxa069

Hello @mistafixxa069 Any news about this example? It would be a very good example even with only 2 or 3 levels. Maybe there are some open-source level packs that could be used.

D8H avatar Nov 23 '22 09:11 D8H

I actually submitted a new one! You can check it out here: https://github.com/GDevelopApp/GDevelop-extensions/issues/663

On Wed, 23 Nov 2022 at 17:23, D8H @.***> wrote:

Hello @mistafixxa069 https://github.com/mistafixxa069 Any news about this example? It would be a very good example even with only 2 or 3 levels. Maybe there are some open-source level packs that could be used.

— Reply to this email directly, view it on GitHub https://github.com/GDevelopApp/GDevelop-examples/issues/242#issuecomment-1324760814, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATI67X47QQHY2WJ7OQUBG2LWJXPBPANCNFSM5S4VSOMQ . You are receiving this because you were mentioned.Message ID: @.***>

mistafixxa069 avatar Nov 24 '22 10:11 mistafixxa069