Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  


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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Leslie

Pages: [1]
General Anim8or Forum / 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 :).

Pages: [1]