Jump to content


Photo
- - - - -

Learn Gml From Scratch


  • Please log in to reply
34 replies to this topic

#1 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 05 September 2007 - 11:57 AM

Title: Learn by making a Pool Table
Description: Learn Complex Object Interactions, Ball2Ball Collision
Type: .gm6 source file (zipped)
GM Version: 6.1 (unregistered)
File Size: 250KB to 600KB depending on tutorial selected
Download: Pool Table Tut Files


It is said that one learns nothing unless he makes mistakes....

Join me in the design of a pool table game. You will progressivelly be introduced to GML and the various features you can use to make a game.

It starts very timidely and progresses to more advanced techniques you will find useful to master GML and Game Maker...

You will see the mistakes I have made and how I fixed them. You will also find some game maker quirks that you should be aware of.

As it stands, limited information is given in the Info button of each file to see what is being done to the file. But, each file contains very little changes from the previous one so, it should be manageable to see what's been done... I plan to add more descriptive information in each file...

Download PoolTableBeginer.zip
This is the startup file set. See the game take form from the beggining.
9 files total.
From adding images to adding objects and handling collision.

Download PoolTableIntermediate.zip
This is the next set, 10 files. See basic techniques be elaborated into more advanced solutions.
Better collision to cue and table objects design and object behaviour
Friction, momentum absorbtion

Download PoolTableAdvanced.zip
This set is the last set, more comming. It starts the get complicated real quick but should still be manageable.
Putting it all together and adding features like intelligent objects and a cue design window.

Download PoolTablePro.zip
This 4 files set covers how to create a drawing program; a cue design room. How to record your play and how to apply rules to the game; an editable rules file containing code executed by the game to provide the game flow and the game rules.

;) Pro Download PoolTableFluffingUp.zip
This set, concentrates on fixing old newbie code and fluffing up the pool table by adding better graphics, better code that uses image_angle and scaling, Alpha masking and an introduction to Top Down 3D!
It also covers 3D and 2D lighting and simple shadows.
I tried to keep every feature introduction small so there are a few files (18... 7MB).

Enjoy!

General Information
Now, billiard physics can be complicated.
Ball bounce one another depending on angle, speed, mass, stiffness, surface friction and rotation (spin).

Ball bounce on bumpers with the same formula. But the deformation of the bumber is much more.
You'd never hit at 45deg and bounce at -45deg on a real table.
At this moment, billiard balls bounce off one another taking speed, mass, angle and stiffness (momentum absobtion) into account but not spin and surface friction (transfer of spin).
The balls bounce off the banks without taking bank deformation and spin into account, but use stiffness to slow the ball down.

The balls have friction set to slow balls down like on a table carpet.

When we are done, we will have all the components of a pool table and game related objects
Balls
Banks
Pocket Banks
Pockets
Ball Trays
Ball Racks
Kitchen
Lines
Spots
Cues
Rules Systems
to name a few....

Once complete, we will be able to create pool tables using objects and make them all interact with one another the way the real life objects work.

The rule system will act like the ref in a match and make the player follow the rules, detecting fouls, scratches, what ball to hit first, ext.

The rule system will be able to arbitrate a snooker match, a 9 ball match, any type of pool game we can think of.

Eventually, we will be able to dynamically create pool tables of different sizes for different games.



More to come.... If I don't get bored with it.

For the search engine
Pool
Pool Table
Pool Table Physics
Pool Ball
Pool Ball Physics
Billiard
Billiard Table
Billiard Table Physics
Billiard Ball
Billiard Ball Physics
Snooker
Ball Collision
Drawing Application
Paint Application
Drawing Program
Paint Program
Rule System


Edited by icuurd12b42, 03 April 2013 - 04:42 PM.

  • 2

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#2 ColdOneK

ColdOneK

    GMC Member

  • GMC Member
  • 183 posts

Posted 21 September 2007 - 03:34 AM

I liked it, thanks for sharing =)

and I can't believe noone else does.
  • 0
Currently Making a tactical turn based strategy role playing game...with an adventure mode, optional card play, and board game mode.--Iso styled, loveable characters, engaging story...--Currently in Pre-Production
Posted Image

#3 JamesW

JamesW

    GMC Member

  • GMC Member
  • 232 posts

Posted 23 September 2007 - 12:24 AM

Simply put, you rock.

I hope you don't mind me turning the end-result into an actual game...it would be quite fun...
  • 0
D.A.N.C.E like there's no tomorrow!
Online Gaming Forums - Join Today!

#4 pranav

pranav

    GMC Member

  • New Member
  • 2 posts

Posted 20 October 2007 - 03:24 PM

Thanks.I was looking for this :P
  • 0

#5 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 27 October 2007 - 05:36 AM

I liked it, thanks for sharing =)

and I can't believe noone else does.

<{POST_SNAPBACK}>



Simply put, you rock.

I hope you don't mind me turning the end-result into an actual game...it would be quite fun...

<{POST_SNAPBACK}>



Thanks.I was looking for this :)

<{POST_SNAPBACK}>


Whoa! I totally forgot I transfered this to the tutorial section and missed the posts!! Thanks guys and use it as you wish.
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#6 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 30 December 2007 - 06:43 AM

Download PoolTableFluffingUp.zip
This set, concentrates on fixing old newbie code and fluffing up the pool table by adding better graphics, better code that uses image_angle and scaling, Alpha masking and an introduction to Top Down 3D!
It also covers 3D and 2D lighting and simple shadows.
I tried to keep every feature introduction small so there are a few files (18... 7MB).

Enjoy!

Edited by icuurd12b42, 30 December 2007 - 10:42 PM.

  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#7 Codester93

Codester93

    GMC Member

  • New Member
  • 31 posts

Posted 31 December 2007 - 05:55 PM

Wow this is really helping me, I am learning alot from this. Thanks for posting this, I bet this is helping alot of other people. Obviously there lots of people who download and dont post. With 2000 some views and 5 posts(not including mine), people are to lazy to post how its helping them :P

Codester93
  • 0

#8 TrueBooleanFalse

TrueBooleanFalse

    GMC Member

  • New Member
  • 14 posts

Posted 02 January 2008 - 09:45 PM

it seems the 'fluffing up' gmk is not loading, says 'site unavailable' did you exceed bandwidth or did the file get taken down?
  • 0

#9 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 04 January 2008 - 03:54 AM

it seems the 'fluffing up' gmk is not loading, says 'site unavailable' did you exceed bandwidth or did the file get taken down?

<{POST_SNAPBACK}>

Well, Host For Food was down for a few hours that night...

Edited by icuurd12b42, 14 January 2008 - 05:56 AM.

  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#10 bobert123

bobert123

    GMC Member

  • New Member
  • 25 posts

Posted 21 March 2008 - 11:32 PM

are you still releasing more to this or did you stop. if so do you have any clue to when it will be released
  • 0

#11 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 25 March 2008 - 09:56 PM

are you still releasing more to this or did you stop. if so do you have any clue to when it will be released



It's 99% done. I have to leave somthing for you guys to do...


If I ever add more, it would be to fix a tiny bug (when cue ball sinks while auto aim is ON) and finalise the rule system.
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#12 x-death

x-death

    Flash Developer

  • GMC Member
  • 3402 posts

Posted 24 April 2008 - 01:06 AM

i dont know if this has been pointed out already but sometimes at random stages of time while i was playing the final product after this had had helped me so much the stick would disappear and the aiming would screw up and the mouse would be stuck in the centre of page!

i have no idea why it was happening but i guess you would probably be able to fix it if you ever work on it again, and if you do ever work on it again i would suggest making 8 ball rule system.

but all in all for what it is atm i love it, its very helpful and i wouldn't say just for new users also older users but just not as much, i remember when i first entered this topic i was expecting another guide which explained what variables were and stuff...

but yeah 10/10 good job!
  • 0
If your interested in having a flash website programmed for you at a cheap price. you can message me!

Resources: My Pack
My Galleries: Deviant Art, Pixel Joint
Examples: Pausing System, External Loading
Guides: Pixel Art, Creating Games, Reviewing Games
Games: A.C.W, Thunder God, Ip Utility, Rocketive

#13 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 29 April 2008 - 11:30 PM

i dont know if this has been pointed out already but sometimes at random stages of time while i was playing the final product after this had had helped me so much the stick would disappear and the aiming would screw up and the mouse would be stuck in the centre of page!

i have no idea why it was happening but i guess you would probably be able to fix it if you ever work on it again, and if you do ever work on it again i would suggest making 8 ball rule system.

but all in all for what it is atm i love it, its very helpful and i wouldn't say just for new users also older users but just not as much, i remember when i first entered this topic i was expecting another guide which explained what variables were and stuff...

but yeah 10/10 good job!


Yes, it's a bug I introduced... Sorry about that... Press H twice. The cue should return.
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#14 Hitman0769

Hitman0769

    GMC Member

  • New Member
  • 20 posts

Posted 03 June 2008 - 03:46 PM

Thank you for posting this example. I have downloaded it today and hope to absorb GML through your example and the Conversion Guide (D&D 2 GML) so I may use GML for my own projects. Are you hosting any other tutorials/guides/examples ??? :P holl@ at ya niNja

-Hitman
  • 0

#15 rage88

rage88

    GMC Member

  • New Member
  • 10 posts

Posted 12 July 2008 - 11:34 PM

Thanks for this tut mate, i was hoping to make a pool game, just one question... is there away to code it so that when a ball is potted a message comes up with like "well done you potted ball number 1" or something like this??? this would really help me if you could tell me how to do this... thanks mate
  • 0
Signature removed. Read and FOLLOW the signature rules or your account will be closed.

#16 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 14 July 2008 - 07:37 PM

Thanks for this tut mate, i was hoping to make a pool game, just one question... is there away to code it so that when a ball is potted a message comes up with like "well done you potted ball number 1" or something like this??? this would really help me if you could tell me how to do this... thanks mate



There are different ways to do that... You can have code in the pocket or the tray objects that detect the ball that was sunk... Or use the rule system. Whichever method is less confusing for you... I recommends the rules system because that is the best way to make a pool game from one spot (file)... It's GML so you can do what you want... Hard coding the game logic can be done in the pockets and tray and cue.... Though this method will spagetti on you... That's why I made the rule system.



@hitman, yes, I do have a few tutorials and dlls that come with tutorials.
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#17 Ploofafa

Ploofafa

    GMC Member

  • New Member
  • 61 posts

Posted 16 July 2008 - 07:19 PM

One little thing, it may be just be something I missed... but.. Within the very first part of learning, you randomly introduce coding..now.. if I had just begun I would have no clue what coding was (And don't) . That's just me. =P
  • 0

#18 WesIvey

WesIvey

    GMToychest Admin

  • GMC Member
  • 306 posts
  • Version:GM:Studio

Posted 17 July 2008 - 03:54 AM

Thanks for this tut mate, i was hoping to make a pool game, just one question... is there away to code it so that when a ball is potted a message comes up with like "well done you potted ball number 1" or something like this??? this would really help me if you could tell me how to do this... thanks mate

make each pot an object, and when the ball collides with the object make the BALL show the window.
  • 0

#19 iluvfuz

iluvfuz

    GMC Member

  • GMC Member
  • 1452 posts
  • Version:GM:Studio

Posted 20 July 2008 - 02:29 AM

Cool, I'll try it out. Does is work for GML beginners--who understand the concept and some coding for GML?
  • 0

#20 mrsmes

mrsmes

    GMC Member

  • GMC Member
  • 1506 posts
  • Version:GM:Studio

Posted 21 July 2008 - 09:10 AM

it gives a error saying:
Arrow Ball: Not implemented
but what is Arrow Ball?
  • 0

Assuming I helped you out in a questions and answers topic won't you return the favour by helping me with one my coding problems, or recommend some one who can chat to me over pms about helping and how to overcome my obstacles, after all lets just say I did help you or them or many people with similar problems, in that topic.

Here i have a topic for those of you struggling with type writer text and mugshots in your games especially if it is a rpg see the link below for more info

http://gmc.yoyogames...howtopic=619103

almost no code needed, only uses two events.

click here for the l8est version of feed the alien pizza, it has some major polished up features.


#21 nashia118

nashia118

    GMC Member

  • New Member
  • 154 posts

Posted 01 August 2008 - 04:36 AM

Oh wow! This is absolutely amazing. I love this. It helped me out a lot! :)
  • 0

#22 rayofash

rayofash

    GMC Member

  • New Member
  • 14 posts

Posted 02 August 2008 - 02:53 AM

These are good but I think they need to be a bit more descriptive. You didn't explain the use of views (the room was huge but the game window was small and it scaled nicely, I'm not too familiar with GM so it took me a while to figure out how you did that), and you didn't show how you added movement to the ball (I didn't see a function or script anywhere for it).
  • 0

#23 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 25 November 2008 - 09:48 PM

These are good but I think they need to be a bit more descriptive. You didn't explain the use of views (the room was huge but the game window was small and it scaled nicely, I'm not too familiar with GM so it took me a while to figure out how you did that), and you didn't show how you added movement to the ball (I didn't see a function or script anywhere for it).



I'm pretty sure I explain the scaling I used in one of the tutorial files... And the tutorial that introduces the view should explain it somewhat... It's all very far back in my head though
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#24 edgespear

edgespear

    GMC Member

  • GMC Member
  • 729 posts

Posted 26 November 2008 - 08:50 PM

This is awesome. You never cease to amaze me icuurd :( It should be made into an online multiplayer thinggeh..

Edited by edgespear, 26 November 2008 - 08:51 PM.

  • 0

I am in the GM Reflex Test! I got 0.13!

#25 mrperson

mrperson

    GMC Member

  • New Member
  • 513 posts

Posted 26 November 2008 - 08:53 PM

Ill so use this! Thanx! :(
  • 0

If I was able to help you, please click the green (+) icon in the lower-right of my post. Thank you!

I am known as Jacic on yoyogames.com and a lot of other places
Born-again christian and loving it!

#26 gmkooler

gmkooler

    GMC Member

  • Validating
  • 6 posts

Posted 27 November 2008 - 04:14 AM

sweet stuff dude! :(

#27 greyzebra

greyzebra

    GMC Member

  • GMC Member
  • 119 posts
  • Version:GM:Studio

Posted 31 May 2012 - 01:01 AM

will definitely try this. thank you for sharing!
  • 0

#28 Genaut

Genaut

    GMC Member

  • GMC Member
  • 156 posts
  • Version:GM:Studio

Posted 27 March 2013 - 07:13 PM

When I try download this I get this message:

icuurd12b42 – PoolTableFluffingUp.zip

User does not have enough bandwidth for you to download this file. Perhaps you should encourage them to Upgrade their account.

 

Anybody can upload the files to another host?


  • 0

#29 van0014

van0014

    GMC Member

  • GMC Member
  • 301 posts
  • Version:GM8.1

Posted 03 April 2013 - 12:22 PM

I am also looking for these files. Are there any mirrors?

 

I would love to see icuurd's work, as after reading the topic i have come to believe it is simply the best and most complete billiards simulation ever made in game maker.

 

Something this good should not be left to just disappear!!


  • 0

Proud user of GM 8.1


#30 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 03 April 2013 - 04:43 PM

I am also looking for these files. Are there any mirrors?

 

I would love to see icuurd's work, as after reading the topic i have come to believe it is simply the best and most complete billiards simulation ever made in game maker.

 

Something this good should not be left to just disappear!!

 

I re-uploaded the files I had on skydrive (dl links updated). the rest I will have to wait until the host-a people reset the bandwidth AGAIN and so I can transfer the rest. I think they lost me this time.


  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#31 van0014

van0014

    GMC Member

  • GMC Member
  • 301 posts
  • Version:GM8.1

Posted 04 April 2013 - 10:11 AM

Wow. Thankyou so much. This means a lot to me.

 

I really wanted this, because i was making a pool game, but was very unsatisfied with game maker's bounce code.

 

I found code for the physics, but i still was not happy with it. The physics is the most important part to a good game of pool.

 

You have done a brilliant job, making the best pool game in the history of game maker.


  • 0

Proud user of GM 8.1


#32 jhanley

jhanley

    GMC Member

  • GMC Member
  • 85 posts
  • Version:GM:Studio

Posted 29 January 2014 - 03:22 AM

@icuurd12b42,

 

I'm arriving late to the party, but I just wanted to say a big thank you for your amazing Pool Table tutorial.

 

I have spent the last week scouring the forums reading dozens of threads and experimenting with many examples relating to ball collisions, but all of them were either buggy, broken or WIPs.

 

My search is over! The ball behavior in your example is wonderfully realistic and efficiently coded. Simply marvelous. :-)

 

Warm regards,

John


  • 0
Be sure to check out my first game: Battle for Plangoria

#33 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 29 January 2014 - 03:37 AM

Thanks.

I must stress the fact hat Studio HAS physics now which should give much better result WITHOUT ANY CODE aside assigning a collision event with a single comment box and enabling physics in the room and objects (ball, bumper, etc)

So take what you learn from this and start fresh with Studio's physics
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#34 jhanley

jhanley

    GMC Member

  • GMC Member
  • 85 posts
  • Version:GM:Studio

Posted 30 January 2014 - 12:01 AM

Thanks.

I must stress the fact hat Studio HAS physics now which should give much better result WITHOUT ANY CODE aside assigning a collision event with a single comment box and enabling physics in the room and objects (ball, bumper, etc)

So take what you learn from this and start fresh with Studio's physics

 

Thanks for the reminder. You're right, the built-in physic functionality is definitely worth investigating. My only (albeit unsubstantiated) concern is the amount granular control it provides, but I definitely intend to take the time to experiment with it. Since my game is intended for HTML5, the less custom code needing interpreting the better.

 

Nevertheless, thanks again for all the hard work you previously spent on this. :-)


  • 0
Be sure to check out my first game: Battle for Plangoria

#35 jhanley

jhanley

    GMC Member

  • GMC Member
  • 85 posts
  • Version:GM:Studio

Posted 30 January 2014 - 02:05 AM

I just spent the last hour playing with the built-in physics and I have to say it's pretty awesome. I can reproduce all the custom code with just a handful of functions!

 

That said, I don't regret the time I spent experimenting with all the legacy examples. I learned some good fundamentals about ball physics, which is never a bad thing. :-)


  • 1
Be sure to check out my first game: Battle for Plangoria