New... ball project... i guess.

  • 93 Replies
  • 45354 Views
Re: New... ball project... i guess.
« Reply #15 on: June 09, 2009, 18:48:28 »
I'm quite advanced at GML too, and I'm also good at finding GM's hidden power. 8) If you need any help, you can ask me too.

Quote
I need to find out why the ball keeps going higher after bounces; probably an error with the gravity settings.
Do you have the friction set to anything smaller than 0? If you set it to, say, -0.1, then it means that -0.1 is subtracted from the speed every step, making the ball speed up instead of slow down.

The moving engine seems pretty messed up. What actions/functions and events did you use for left and right movement?

There is no transparency for the dot sprite. Is this intentional?

Does your game use a simple BBP engine?

 :D

I'm very interested, or very interested, in helping you with your game. I also have a game in development now, though, so I won't always have time.

*

Offline OSad

  • 36
  • 0
    • View Profile
Re: New... ball project... i guess.
« Reply #16 on: June 09, 2009, 19:00:04 »
Woo, two interested ones! High five, now. o/

Anyway, let me tell you about some of the problems i'm having.

I haven't implemented friction because i thought setting the ball to bounce against the wall would work out alright. Later, i added the create event with the gravity set to 5, so the ball would go down instead of bouncing everywere. I didn't figured out WHY it just kept going up afterwards. If it goes too fast, it'll enter the speed of light and actually exit the stage entirely.

The dots are just little time killers to test out the movement. The left and right movements have left and right sprites each, thanks to the change sprite function. Other than that, they have the go left and go right functions with the press of the corresponding keys, and a 'no movement' function when you release them. Another problem is that if the ball is bouncing really high, and i release the movement key when it's close to the ground, it'll just stall there and reset the bouncing to that height. It's weird.

Also, this is irrelevant, but the dots have a create event with the set score function to relative 10. However, when they're 'created' again after catched, they don't update your score any further. It just stays at 20.

But yeah, the game will use the engine you suggested. Who should i credit for the work?

Re: New... ball project... i guess.
« Reply #17 on: June 09, 2009, 19:25:43 »
Quote
Later, i added the create event with the gravity set to 5
I think you should weaken it a bit... I never set my gravity to anything stronger than 1.

Quote
they have the go left and go right functions with the press of the corresponding keys, and a 'no movement' function when you release them.
Did you use the Move Fixed action? If yes, BAD.
The correct way: Make a Keyboard <Left> (NOT Key Press, just Keyboard) event and add the following code:
Code: [Select]
hspeed -= 0.5Then make a Keyboard <Right> event. Again, Keyboard, NOT Key Press. Add the following code into it:
Code: [Select]
hspeed += 0.5
Then, in the Step event, add friction.

I usually hate using actions. I find coding much more convenient.

Quote
Who should i credit for the work?
All the people who helped you.
In the credits screens I make, I credit the programmers, the artists (graphics and music), the people who gave me ideas, and sometimes other stuff.

Anyway, in my opinion, the Move Fixed action pretty much sucks and should not be used.
« Last Edit: June 09, 2009, 19:31:44 by youffle214 »

*

Offline OSad

  • 36
  • 0
    • View Profile
Re: New... ball project... i guess.
« Reply #18 on: June 09, 2009, 19:33:53 »
So i've implemented the engine, and the result is a slugfest. The game moves at, let me take a shot here, 10 frames per second?

It's identical to the engine you passed me, with the exeption of a true slowdown. Removing sprites and such has no effect on it.

*

Offline LPChip

  • You can only truly help other people by allowing them to fail.
  • 3510
  • 138
  • Excel at the thing you're the best at!
    • View Profile
    • LPChip Interactive
Re: New... ball project... i guess.
« Reply #19 on: June 09, 2009, 19:40:50 »
Must be something in the engine itself. You might need to change the order of the actions or something else. I'm not really a programmer for MMF, but slowdowns usually mean bad programming.
on the left, above my avatar.

MODPlug Central Forum
"If I tried to kill you, I'd end up with a big fat hole through my laptop." - Chironex

*

Offline OSad

  • 36
  • 0
    • View Profile
Re: New... ball project... i guess.
« Reply #20 on: June 09, 2009, 19:53:58 »
Must be something in the engine itself. You might need to change the order of the actions or something else. I'm not really a programmer for MMF, but slowdowns usually mean bad programming.

The actions are organized automatically by GM  :/ . There's not even a whole lot of them, anyway.

Here's the latest version.

http://www.mediafire.com/?sharekey=7d61b0ae157027db5e2bd628a2cb8cfde04e75f6e8ebb871

As you can see, it's slow. Really slow. Removing sprites/background/objects/actions doesn't affects speed. The engine works nicely, though. I also managed to fix the score. Have fun picking those dots!


Edit: Turns out, it was just the gravity doing it's thing. And since it was set too low, it behaved like a low gravity zone.

Download this version instead.

http://www.mediafire.com/?sharekey=7d61b0ae157027db5e2bd628a2cb8cfde04e75f6e8ebb871

It still has a couple of problems, the most noticeable one being in the lack of control after the ball starts bouncing around like crazy. It's still being sent flying after hitting a wall or a corner. It's not very convenient, 'nuff said.
« Last Edit: June 09, 2009, 21:46:16 by OSad »

*

Offline Pick Yer Poison

  • 782
  • 3
  • One cool cat.
    • View Profile
Re: New... ball project... i guess.
« Reply #21 on: June 10, 2009, 04:58:38 »
I think I've figured out why the ball goes nuts when it hits a corner. Let me guess, you have the wall sprites set to precise collision checking? If you do, that could be it. Those wall sprites have one pixel missing in each corner, and that might at least be contributing to the problem, if precise collision checking is on.

Also, when the ball hits a wall (in the event), do you just have the bouncing action, or is there something else there too?
« Last Edit: June 10, 2009, 05:51:40 by pick yer poison »

Re: New... ball project... i guess.
« Reply #22 on: June 10, 2009, 15:08:51 »
Quote
when the ball hits a wall (in the event), do you just have the bouncing action, or is there something else there too?
Just the bouncing action. Why is anything else needed?

Quote
it was just the gravity doing it's thing
In the engine I posted, the room speed was set to 60 instead of 30, because I wanted to make it go smoothly. To prevent it from going too fast, I had to divide all movement speeds by two.

*

Offline OSad

  • 36
  • 0
    • View Profile
Re: New... ball project... i guess.
« Reply #23 on: June 10, 2009, 18:10:46 »
Right, before i add the next version, i need to know how to implement a standard jump function to the game. Like in WaDF, you hold down the jump key, the ball goes higher with each bounce. You let it go, it starts to slowly go down with each bounce.

Any ideas?

*

Offline Pick Yer Poison

  • 782
  • 3
  • One cool cat.
    • View Profile
Re: New... ball project... i guess.
« Reply #24 on: June 10, 2009, 19:31:38 »
Quote
when the ball hits a wall (in the event), do you just have the bouncing action, or is there something else there too?
Just the bouncing action. Why is anything else needed?
I just wanted to make sure there wasn't anything else that could possibly be doing anything. You never know! :/

Right, before i add the next version, i need to know how to implement a standard jump function to the game. Like in WaDF, you hold down the jump key, the ball goes higher with each bounce. You let it go, it starts to slowly go down with each bounce.

Well, I'd suggest that you start off with a variable that has the maximum "up" movement speed that you want. Then, whenever the player holds 'S' (I'm just using the WaDF controls to make it easier to understand; obviously, you don't need to use those), then have the speed increase by a set amount as long as long as it is smaller than that variable (if it's not, do nothing, so that he can bounce from high places correctly :P). Then, upon collision with the ground, if the player is not holding 'S', lower the speed he goes up at by the same amount until it is the normal bouncing speed (as in, what happens when he first starts out). If the speed ends up lower than that for some reason, just do the same thing but set it to that speed. Do the opposite if the player holds 'A'; just make his speed drop by that same amount as long as it is greater than the minimum jump speed. Also, you probably will want to make a reference variable that records what his speed is each time he bounces. That would make things a lot easier  ;)

Re: New... ball project... i guess.
« Reply #25 on: June 10, 2009, 19:46:43 »
Nice way of doing it, pick yer poison. I am making a WaDF fangame, but I couldn't find a way to make the ball jump higher and higher, so I made it that when you press S the gravity switches from down to up and vice versa XD

*

Offline OSad

  • 36
  • 0
    • View Profile
Re: New... ball project... i guess.
« Reply #26 on: June 10, 2009, 21:16:43 »
Well, i'm going on a trip tomorrow, and it'll probably extend itself to monday, so i won't be able to make anything new here. Not to mention i haven't actually learned to use a variable. It's complicated stuff. Sorry.

Still, i leave the development files with both youffle214 and pick yer poison, if they wish to make any changes whatsoever to it. Have fun toying with it.  :^^:


*

Offline vdweller

  • 139
  • 8
  • JapanStache!
    • View Profile
    • vdweller's freeware games
Re: New... ball project... i guess.
« Reply #27 on: June 10, 2009, 23:47:57 »
In order to make a decent game in Game Maker (and every other Program/language, for that matter), one must heavily rely on scripting.

Maybe if you gather more experience in Game Maker, you will persuade people to work along with you. The Game Maker community is also a good place to learn stuff.

*

Offline Pick Yer Poison

  • 782
  • 3
  • One cool cat.
    • View Profile
Re: New... ball project... i guess.
« Reply #28 on: June 10, 2009, 23:48:41 »
Messed around a bit with the BBP file. I think I've got something now!

Download here.

*

Offline OSad

  • 36
  • 0
    • View Profile
Re: New... ball project... i guess.
« Reply #29 on: June 11, 2009, 04:19:12 »
Change of plans. The trip is cancelled. Work will continue as in everyday.

Maybe if you gather more experience in Game Maker, you will persuade people to work along with you. The Game Maker community is also a good place to learn stuff.

I've thought about going to the game maker community several times now. But i thought it was best to ask for help from the nifflas community itself, so the game wouldn't suffer any... and let me put it like this: "Outside influence"... from other game makers. So, in order to make a ballistic experience, i need ballistic experts. Not monkeys.

Messed around a bit with the BBP file. I think I've got something now!

Download here.

Well, that's just the ball engine that has been implemented.

Wrong file?  :shifty: