Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: nitacku on February 12, 2009, 10:40:34 pm

Title: Bowling: Re-optimzed.
Post by: nitacku on February 12, 2009, 10:40:34 pm
Ok, so this is my take on re-optimizing Bowling.
I've scanned the entire code (all 1646 lines) and optimized the whole thing, especially the recognized bottlenecks. I've also tweaked the graphics a bit and introduced a new scrolling background method to create animated scrolling backgrounds. Yep, animated scrolling backgrounds. Now, I'm ready for grayscale :P

I'm finished with the optimization part, so now all I need to do is re-code the physics simulator. I've been procrastinating on this part for a while now. It's the most complicated part of the entire game, and I just don't know where to begin. I have to integrate multiple variables into the simulator and have it return an acceptable result. The variables include: Spin vector (magnitude & direction), velocity (gloves and throw meter control this), entry angle (result of some calculus), Accuracy (shoes control this), mass (not actually used currently), direction, and initial position. Combining these with actual lane & pin dimensions has proven to be a difficult task.

Here is a screenshot of everything so far:
(I had to hurry since imageshack only allows files less than 1.53mb)
(http://img15.imageshack.us/img15/575/screenshotnx3.gif)
Title: Re: Bowling: Re-optimzed.
Post by: noahbaby94 on February 12, 2009, 10:44:33 pm
Are you gonna get rid of the strike glitch?
Title: Re: Bowling: Re-optimzed.
Post by: nitacku on February 12, 2009, 10:48:00 pm
Yes, I am actually :D
In fact, the strike glitch is what motivated me to re-code bowling.
I'm putting of studying for this game. It just goes to show how much the glitch is irritating me :P
Title: Re: Bowling: Re-optimzed.
Post by: trevmeister66 on February 12, 2009, 11:14:49 pm
Wow I really like the new title screen. That's awesome. Very nice work.
Title: Re: Bowling: Re-optimzed.
Post by: DJ Omnimaga on February 13, 2009, 12:27:32 am
this is nice, I am happy a new version is coming out. Will it still fit in one flash app page (assuming you still use BasicBuilder?)
Title: Re: Bowling: Re-optimzed.
Post by: nitacku on February 13, 2009, 12:54:59 am
It will easily fit on one flash app page. After all this optimizing, it will be even smaller than before (it had better be :P)

btw, since I have room in the app, I am considering adding some stuff
If you have any suggestions let me know
Title: Re: Bowling: Re-optimzed.
Post by: TIfanx1999 on February 13, 2009, 02:25:36 pm
Very nice! This was an awesome game and I'll be happy to see an update. Glad to see you back!
Title: Re: Bowling: Re-optimzed.
Post by: metagross111 on February 13, 2009, 03:03:54 pm
bowling? yep, looks awesome :)

EDIT: I need to forge my own seal of approval for times like these :P
Title: Re: Bowling: Re-optimzed.
Post by: Galandros on February 14, 2009, 07:09:11 am
Great graphics and the physics seem cool.
Hey, make animated and realistic collision of ball and bowls instead of just disappear them. xD j/k

But how do you do that strike glitch? I have heard of it in a review in ticalc.
And more, what caused it?
Title: Re: Bowling: Re-optimzed.
Post by: nitacku on February 14, 2009, 11:05:14 am
It's not really a glitch. My current simulator makes getting strikes too easy.
As of a few hours ago, I've already made some improvements over the old engine. Hopefully there won't be any easy strikes from now on.

I've also added in animation speed, so the ball motion will actually reflect the velocity at which it is traveling.
It was always present before, but now it is graphically rendered.

Also, I've re-coded the trajectory curve equation. It forces the user to make much better use of the items now. For example: Without a glove, the ball travels very slowly and has little momentum. With a glove, the ball travels faster, but it becomes more difficult to apply spin. If you pack only spin modifiers, the ball will spin too much and end up in the gutter before it hits the pins. By combining both gloves and spin modifiers, both spin and velocity will balance each other out, allowing the player to throw the ball fast and with enough spin to get a strike. The accuracy is now affected much more by the shoes packed. Without good shoes, the ball has potential to veer off considerably from the designated path.

Hopefully these modifications in addition to the re-coded engine, will make the game much more challenging and interesting.
Title: Re: Bowling: Re-optimzed.
Post by: DJ Omnimaga on February 14, 2009, 09:19:31 pm
this is nice, it will be even more realistic now :)
Title: Re: Bowling: Re-optimzed.
Post by: TIfanx1999 on February 14, 2009, 10:39:59 pm
Pretty impressive stuff! I look foward to playing around with the updated version when it's completed.
Title: Re: Bowling: Re-optimzed.
Post by: Galandros on February 17, 2009, 04:09:26 pm
Woah, really nice. And I think the recoding was a great decision nitacku!
Title: Re: Bowling: Re-optimzed.
Post by: kalan_vod on February 18, 2009, 11:39:04 pm
Yeah, great that you were able to advance even more than before!
Title: Re: Bowling: Re-optimzed.
Post by: Silver Shadow on February 20, 2009, 11:32:33 am
Just a question about BasicBuilder: can you put multiple programs into it? Because I read somewhere that it didn't work... (I might use that for my Fangh RPG).
By the way, how does xLIB work with BasicBuilder apps?
Title: Re: Bowling: Re-optimzed.
Post by: DJ Omnimaga on February 20, 2009, 08:18:21 pm
you can, but it's  only practical if your entire game is in RAM, not archive
Title: Re: Bowling: Re-optimzed.
Post by: Galandros on February 21, 2009, 05:01:32 am
I guess xlib usage is exactly the same. Or has some little issues?
Title: Re: Bowling: Re-optimzed.
Post by: DJ Omnimaga on February 21, 2009, 09:58:01 am
You can use xlIB for basicbuilder, but I think you need to do special stuff with your game when you use pictures, such as Bowling
Title: Re: Bowling: Re-optimzed.
Post by: trevmeister66 on February 21, 2009, 12:07:01 pm
You can use xlIB for basicbuilder, but I think you need to do special stuff with your game when you use pictures, such as Bowling
Yeah I never quite figured out how to use Basic builder with xLIB.. I think i tried once and failed miserably, so I never tried again.
Title: Re: Bowling: Re-optimzed.
Post by: Silver Shadow on February 21, 2009, 01:04:41 pm
You can use xlIB for basicbuilder, but I think you need to do special stuff with your game when you use pictures, such as Bowling
How does BasicBuilder handle the pics? Does it put them in the app or do you have to leave them as normal pics?
Title: Re: Bowling: Re-optimzed.
Post by: JonimusPrime on February 21, 2009, 03:24:13 pm
You Most likely have to do some sort of install/uninstall sequence like bowling does. This way you can get around any weird basicbuilder =+ xlib quirks that there may be.
Title: Re: Bowling: Re-optimzed.
Post by: nitacku on February 22, 2009, 01:09:22 am
How does BasicBuilder handle the pics? Does it put them in the app or do you have to leave them as normal pics?

BasicBuilder packages the pics into the app just like it does with the programs. However, having the pics as random data in the app is useless if you plan on using Celtic or xLIB with the pics. In order to use the pics, you have to "extract" them from the app first. Basically you have to recall the pics from the app and store the image to pic files.

Bowling stores the images to "hacked" variables and archives them when it is first run. That's what is going on in the background when you see the images flash on the screen.

Just a question about BasicBuilder: can you put multiple programs into it? Because I read somewhere that it didn't work... (I might use that for my Fangh RPG).
By the way, how does xLIB work with BasicBuilder apps?

Yes you can put multiple programs into it, but I find that the application runs extremely slow when there is more than one program packaged into it. To avoid this issue, I compile all the subprograms into the main program. There is a method to call the subprograms from the main code without destroying the flow of execution. If you induce a memory leak using a Goto inside a Repeat/While loop, you can return back into the loop by passing an extraneous End to the interpreter. The interpreter will see the End as part of the exited loop and will resume execution after the loop. In effect, the subprogram code can be called just like it would be if it were a separate program. There a few varieties of methods to induce the memory leak. The method I use allows arguments to pass in Ans which I find useful at times.