Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

Author Topic: LazyPool game loading from .an8 file  (Read 1681 times)

Leslie

  • Newbie
  • *
  • Posts: 17
    • View Profile
LazyPool game loading from .an8 file
« on: January 22, 2013, 01:44:00 am »

A couple of years ago I tried to convince my daughter (12 then) to learn the basics of programming. What could be better for that purpose than making a game? So I showed her how to design and program a 2D game. We made a new level each day for a week, until we both got bored. She wasnít too impressed, you can imagine, with all those 3D games one can get for free from the webÖ I told her we can do better than 2D, so I promised her a 3D game with lights and textures.
It was just a programming demonstration, so I wanted it done in minimum time. I borrowed the .an8 file loader and the OpenGL renderer from Terranim8or. The very basic modeling was done in Anim8or, of course. The game is an 8 ball pool with strait-forward logic, but not at all trivial due to issues involving simultaneous collisions and optimizations. Finally it came out as multithreaded server-client architecture, playable over the net by two players, or standalone.

Iíve decided to tell you about it only for one funny reason: as I was progressing with the game design, I had to solve a detail regarding the pocketed balls. One way of showing the balls stuck into the pockets was to render them static somewhere in the game window (which I think is the classical approach). Itís the easiest way, but it takes away from the realism Ė we have a dynamic 3D environment, but there is a floating array of balls kept in the same place in the corner of the window. Pathetic!
I was heading for the challenging way, of having the balls enter the pockets and landing in a net. Now that proved to be too challenging to make it look real, besides the visibility of those balls couldnít be too great :).
Change of plan: the ball enters a certain pocket then continues in some kind of carved corridor under the table surface till it hits the wall, or a previous ball. Now we have a natural array of pocketed balls, visible from the outside, but itís too difficult to program it compared to how little spectacular it could be. Not a good time investment.
At this point came the revelation, well deserved by any lazy individual like me! Why bother with pocketing the balls when we can leave them to fall off the table, just like that? Itís a simple pool, so simple that there are no nets under the pockets (no need the model them)! I checked the web and rechecked several times: no such design. Seemed that my laziness provided me with an original idea that Iím copyrighting right here in our Anim8or Forum :)!

When playing the game for the firs time, I had quite a shocking surprise: the balls that landed on the floor continued to behave correctly, obeying the laws of physics regarding decelerated rolling and collisions with each other. I didnít intend to program them like that, but the balls continued to do exactly what they were supposed to do on the table :).
Logged

SpeedLow

  • Newbie
  • *
  • Posts: 11
  • Beginner
    • View Profile
    • SpeedLow
Re: LazyPool game loading from .an8 file
« Reply #1 on: January 22, 2013, 02:45:05 pm »

Very Nice For Game You  :o
Logged
?

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1450
    • View Profile
Re: LazyPool game loading from .an8 file
« Reply #2 on: January 22, 2013, 11:12:11 pm »

Nice to see you didn't completely disappear Leslie ;) It looks good, got a vid or demo of it in action?
Logged

headwax

  • Sr. Member
  • ****
  • Posts: 600
    • View Profile
    • Headwax's Website
Re: LazyPool game loading from .an8 file
« Reply #3 on: January 23, 2013, 08:03:42 am »

Good on you Leslie! Welcome back :) And thank you for sharing! I hope your pocketless pool table you just copywrited here takes off like a Saturn Two rocket :) PS thanks for all the help you gave me when I first started.!
Logged

Leslie

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: LazyPool game loading from .an8 file
« Reply #4 on: January 24, 2013, 02:21:20 pm »

Thanks for not forgeting me :)! I'll try to make some video of the game in action.
Logged