Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 21 posts ] 
    9robin3
  Thu May 22, 2014 4:51 pm
Robin Andblom
User avatar
Member

Party Mascot
Hello! I am working in GM8 and have a problem with the game. I tried to make everything in 64 x 64 sprites so that everything is as big, making up a "perfect" grid. The problem is that objects gets stuck in the corner. That's why I did the object masks smaller. But then they loose their grid cordinates (meaning that objects move too far and get stuck still).

Also, sometimes, the objects doesn't move all the way to the wall even if I have set "precise collision checking". These pictures may help, but maybe they don't show the spaces that the objects leave between each other so well. I hope you understand what I'm talking about. There is something I've done wrong since they stop too early or move till they're stuck in the wall objects (Brown boxes area). I am sure that you are aware of the "Bug" in Game Maker where objects get suck in each other as long as you have the "stop movement" action and the solid option on.

Please help!


PICTURES:

Image

Image

Image

Well I can explain how I made it work so far:

I have 9 shape objects:

1 TRIANGLE, CIRCLE and SQUARE Object (These are the DEFAULT and when other shape object types stops, they turn into this one!)
1 TRIANGLE, CIRCLE and SQUARE IN MOVEMENT Object
1 TRIANGLE, CIRCLE, and SQUARE "OFF" Object.

When you click on any shape (THE STANDARD/DEFAULT OBJECT) Arrows appears that shows you ways you can move. You can only move over grey areas (not Brown). When you click any Arrow and the shape starts moving, the one you move Changes into "OBJECT"MOVING". Other SHAPEs are turned into "OBJECT OFF". Then an object is created that destroys all Arrow buttons (step event) whenever a shape is moving (so that only 1 shape can move at a time). When a move is finished and a shape stops (at walls, other SHAPEs) the Arrow destroying object is deleted and ALL Shapes are turned into the Default again, making it possible to move the same or Another object shape again.

I hope I did a good explanation here!

DEMO DOWNLOAD:
https://www.sendspace.com/file/wfeh7g


Thanks in advice!

_________________
MY PAGES:
MY HOMEPAGE
MY FB GAME PAGE
MY YOUTUBE

__________________________________________________________________________________________
GAMES IN PROGRESS:

Image

Image


Last edited by 9robin3 on Mon Jul 21, 2014 3:47 pm, edited 3 times in total.

Top Top
Profile      
 

    9robin3
  Sat May 24, 2014 12:29 pm
Robin Andblom
User avatar
Member

Party Mascot
Somebody help?

_________________
MY PAGES:
MY HOMEPAGE
MY FB GAME PAGE
MY YOUTUBE

__________________________________________________________________________________________
GAMES IN PROGRESS:

Image

Image


Top Top
Profile      
 

    Xilef
  Sat May 24, 2014 12:54 pm
User avatar
Staff

Big Dumb Guy

Location: UK
Never used gamemaker before but the "getting stuck on collision mask grid" bug is a familiar thing to me for games.

Here's some pseudo code that will cause this stuck in corner bug (And generally other sticking bugs, including not entirely meeting the edge of the maze).
Expand to see the code.

It looks fine, but the problem is moveDirection is interpolated by the frame-rate.
In this case, the object may never touch the side of walls if the frame-rate is low as the movement is making the object potentially leap a massive distance into the wall and if it moves into a corner when the frame-rate is low but then the frame-rate increases then the object will become stuck as it jumped, say [20px,20px] to get into the corner, but you're now moving [2px,2px] to escape, however you made such a massive leap into the corner while your FPS was 59 but when your FPS is 61 the leap is not big enough to escape the corner on one of the checked axis, the movement is invalid and you cannot move.

The same thing will happen if your FPS drops and you move directly into a wall and then the FPS increases, although you'll need a bigger leap to get stuck into a straight wall than into a corner.


That is my guess as to what is happening, but as I don't use gamemaker I can't be sure, I don't even know if you have to write movement logic in gamemaker.


Top Top
Profile      
 

    Amy
  Sun May 25, 2014 12:58 am
User avatar
Staff

Big Dumb Guy
Is there any way to say "if object is close to grid, snap to grid"?


Top Top
Profile      
 

    9robin3
  Sun May 25, 2014 3:18 pm
Robin Andblom
User avatar
Member

Party Mascot
Xilef wrote:
Never used gamemaker before but the "getting stuck on collision mask grid" bug is a familiar thing to me for games.

Here's some pseudo code that will cause this stuck in corner bug (And generally other sticking bugs, including not entirely meeting the edge of the maze).
Expand to see the code.

It looks fine, but the problem is moveDirection is interpolated by the frame-rate.
In this case, the object may never touch the side of walls if the frame-rate is low as the movement is making the object potentially leap a massive distance into the wall and if it moves into a corner when the frame-rate is low but then the frame-rate increases then the object will become stuck as it jumped, say [20px,20px] to get into the corner, but you're now moving [2px,2px] to escape, however you made such a massive leap into the corner while your FPS was 59 but when your FPS is 61 the leap is not big enough to escape the corner on one of the checked axis, the movement is invalid and you cannot move.

The same thing will happen if your FPS drops and you move directly into a wall and then the FPS increases, although you'll need a bigger leap to get stuck into a straight wall than into a corner.


That is my guess as to what is happening, but as I don't use gamemaker I can't be sure, I don't even know if you have to write movement logic in gamemaker.



I don't really understand this, but I'll try that code after all. But where do I put it and what does it do?

_________________
MY PAGES:
MY HOMEPAGE
MY FB GAME PAGE
MY YOUTUBE

__________________________________________________________________________________________
GAMES IN PROGRESS:

Image

Image


Top Top
Profile      
 

    9robin3
  Sun May 25, 2014 3:20 pm
Robin Andblom
User avatar
Member

Party Mascot
Princess Amy wrote:
Is there any way to say "if object is close to grid, snap to grid"?


I don't really know, Amy:P I hope I can fix it somehow. You know some levels of Shapez can't be completed since the shapez (objects) gets stuck too "early" or doesn't move all the way to a wall since they get stuck in EVERY corner.

thanks anyway

_________________
MY PAGES:
MY HOMEPAGE
MY FB GAME PAGE
MY YOUTUBE

__________________________________________________________________________________________
GAMES IN PROGRESS:

Image

Image


Top Top
Profile      
 

    Xilef
  Sun May 25, 2014 6:42 pm
User avatar
Staff

Big Dumb Guy

Location: UK
9robin3 wrote:
I don't really understand this, but I'll try that code after all. But where do I put it and what does it do?

It's pseudo code, not real code (I don't know gamemaker), also it's code that explains a possible cause of the problem.

You might be best off uploading a copy of your game development file with the bug and having someone take a direct look at it.


Top Top
Profile      
 

    9robin3
  Sun May 25, 2014 8:28 pm
Robin Andblom
User avatar
Member

Party Mascot
Xilef wrote:
9robin3 wrote:
I don't really understand this, but I'll try that code after all. But where do I put it and what does it do?

It's pseudo code, not real code (I don't know gamemaker), also it's code that explains a possible cause of the problem.

You might be best off uploading a copy of your game development file with the bug and having someone take a direct look at it.


thank you I will^^

_________________
MY PAGES:
MY HOMEPAGE
MY FB GAME PAGE
MY YOUTUBE

__________________________________________________________________________________________
GAMES IN PROGRESS:

Image

Image


Top Top
Profile      
 

    9robin3
  Mon May 26, 2014 5:13 pm
Robin Andblom
User avatar
Member

Party Mascot
Please download the game Project file and identify the "errors":

HERE IS THE PROJECT FILE:
http://www.sendspace.com/file/48sx5w

INFO:
Please click on this topic link, OR in the Picture link saying "Shapez" in order to learn how to play the game.

SHAPEZ TOPIC:
http://www.hbgames.org/forums/viewtopic.php?f=78&t=78234

HOW I MADE THE GAME LOGICS (you can check yourself):


Thank you very much for helping me!

_________________
MY PAGES:
MY HOMEPAGE
MY FB GAME PAGE
MY YOUTUBE

__________________________________________________________________________________________
GAMES IN PROGRESS:

Image

Image


Top Top
Profile      
 

    9robin3
  Sat May 31, 2014 12:27 pm
Robin Andblom
User avatar
Member

Party Mascot
Somebody?-.-

_________________
MY PAGES:
MY HOMEPAGE
MY FB GAME PAGE
MY YOUTUBE

__________________________________________________________________________________________
GAMES IN PROGRESS:

Image

Image


Top Top
Profile      
 

    9robin3
  Tue Jun 10, 2014 8:07 am
Robin Andblom
User avatar
Member

Party Mascot
Ok I still need help here lol

_________________
MY PAGES:
MY HOMEPAGE
MY FB GAME PAGE
MY YOUTUBE

__________________________________________________________________________________________
GAMES IN PROGRESS:

Image

Image


Top Top
Profile      
 

    9robin3
  Fri Jun 27, 2014 10:02 am
Robin Andblom
User avatar
Member

Party Mascot
Well I still need help with this:P

_________________
MY PAGES:
MY HOMEPAGE
MY FB GAME PAGE
MY YOUTUBE

__________________________________________________________________________________________
GAMES IN PROGRESS:

Image

Image


Top Top
Profile      
 

    Stardust
  Sat Jul 19, 2014 3:50 am
<3 Army of Love <3
User avatar
Retired Staff

Sewer Rat

Location: NY
Do you still need assistance with this? The demo you linked to is no longer available and it's difficult to see what's going on without either that or screenshots of the event pages. The only suggestion I can give with the information you've provided is to try using the "Align to Grid" function under the Move tab after the movement is finished (there's a check in the Control tab for Align to Grid, as well).

_________________
Avatar by the very talented Lissy Elle!


Top Top
Profile      
 

    9robin3
  Sun Jul 20, 2014 8:15 pm
Robin Andblom
User avatar
Member

Party Mascot
Yes I still need help! I can upload a demo straight away!

_________________
MY PAGES:
MY HOMEPAGE
MY FB GAME PAGE
MY YOUTUBE

__________________________________________________________________________________________
GAMES IN PROGRESS:

Image

Image


Top Top
Profile      
 

    9robin3
  Sun Jul 20, 2014 8:19 pm
Robin Andblom
User avatar
Member

Party Mascot
DEMO DOWNLOAD:
https://www.sendspace.com/file/wfeh7g

_________________
MY PAGES:
MY HOMEPAGE
MY FB GAME PAGE
MY YOUTUBE

__________________________________________________________________________________________
GAMES IN PROGRESS:

Image

Image


Top Top
Profile      
 

    Stardust
  Mon Jul 21, 2014 4:19 am
<3 Army of Love <3
User avatar
Retired Staff

Sewer Rat

Location: NY
I downloaded the demo and I'll take a look at it when I have blocks of free time. It's going to take me some time to troubleshoot because I'm still familiarizing myself with Game Maker, but hopefully I'll find a solution fairly quickly. :)

_________________
Avatar by the very talented Lissy Elle!


Top Top
Profile      
 

    9robin3
  Mon Jul 21, 2014 3:42 pm
Robin Andblom
User avatar
Member

Party Mascot
Ok alright. Well I can explain how I made it work so far:

I have 9 shape objects:

1 TRIANGLE, CIRCLE and SQUARE Object (These are the DEFAULT and when other shape object types stops, they turn into this one!)
1 TRIANGLE, CIRCLE and SQUARE IN MOVEMENT Object
1 TRIANGLE, CIRCLE, and SQUARE "OFF" Object.

When you click on any shape (THE STANDARD/DEFAULT OBJECT) Arrows appear that shows you ways you can move that shape object. You can only move over grey areas (not Brown). When you click any Arrow and the shape starts moving, the one object you move Changes into "OBJECT MOVING". Other SHAPEs are turned into "OBJECT OFF". Then an object is created that destroys all Arrow buttons (step event) whenever a shape is moving (so that only 1 shape can move at a time). When a move is finished and a shape stops (at walls, other SHAPEs) the Arrow destroying object is deleted and ALL Shapes are turned into the Default again, making it possible to move the same or Another object shape again.

I hope I did a good explanation here!

_________________
MY PAGES:
MY HOMEPAGE
MY FB GAME PAGE
MY YOUTUBE

__________________________________________________________________________________________
GAMES IN PROGRESS:

Image

Image


Top Top
Profile      
 

    Stardust
  Wed Jul 23, 2014 5:09 pm
<3 Army of Love <3
User avatar
Retired Staff

Sewer Rat

Location: NY
After a little poking around, I found a solution and it's much simpler than I thought it was going to be. xD

Image

That's all you need to add. A collision event with the wall object that snaps the object to a 16x16 grid (the command is in the Jump section of the Move tab there). :) You should add that to the events of collision with other objects, as well. From my quick tests, that seems to fix the problem.

As a side note and suggestion, you could use variables inside the shape objects instead of having three different objects for each shape. It would involve some conditional branches in most events, but it would clean up the coding a lot. It's not a big issue now, but if you start adding more to the game, having the extra objects will make troubleshooting harder.

_________________
Avatar by the very talented Lissy Elle!


Top Top
Profile      
 

    9robin3
  Thu Jul 24, 2014 11:18 am
Robin Andblom
User avatar
Member

Party Mascot
Stardust wrote:
After a little poking around, I found a solution and it's much simpler than I thought it was going to be. xD

Image

That's all you need to add. A collision event with the wall object that snaps the object to a 16x16 grid (the command is in the Jump section of the Move tab there). :) You should add that to the events of collision with other objects, as well. From my quick tests, that seems to fix the problem.

As a side note and suggestion, you could use variables inside the shape objects instead of having three different objects for each shape. It would involve some conditional branches in most events, but it would clean up the coding a lot. It's not a big issue now, but if you start adding more to the game, having the extra objects will make troubleshooting harder.



Thanks a lot man (but I use 32 x 32 grids!) I will try this out and later change every shape into 1 each. But how do I do this using variables? Right now I don't use any coding at all.

Thanks in advice!

_________________
MY PAGES:
MY HOMEPAGE
MY FB GAME PAGE
MY YOUTUBE

__________________________________________________________________________________________
GAMES IN PROGRESS:

Image

Image


Top Top
Profile      
 

    Stardust
  Sun Jul 27, 2014 7:14 pm
<3 Army of Love <3
User avatar
Retired Staff

Sewer Rat

Location: NY
I'm not entirely sure how the grid command works - 16 x 16 was the one I found to be successful. I don't know how 32 x 32 would work because I didn't try it, but 64 x 64 created some interesting results. xD

In the control tab of events, there are various options for variables. They work the same way they do in RPG Maker with 2 exceptions:

1. You MUST define them at the beginning and set them to 0 (or what their default value would be) before using conditional branches.
2. You give variables their names as you're using them (vs. working from a list). Make sure you have unique names for your variables separate from your objects and sprites! Otherwise it might mess up conditional branches.

If you use conditional branches (Test Variable), you could combine them into one object each fairly easily.

_________________
Avatar by the very talented Lissy Elle!


Top Top
Profile      
 

    9robin3
  Wed Jul 30, 2014 7:43 pm
Robin Andblom
User avatar
Member

Party Mascot
Thanks mate:) right now I'll stick with what I have but I might try that later on:)

_________________
MY PAGES:
MY HOMEPAGE
MY FB GAME PAGE
MY YOUTUBE

__________________________________________________________________________________________
GAMES IN PROGRESS:

Image

Image


Top Top
Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ] 


Who is online

Users browsing this forum: No users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group