Gravlab II

A forum where you can announce your awesome project(s).

Moderator: MaxCoderz Staff

leofox
Calc Master
Posts: 1064
Joined: Fri 17 Dec, 2004 3:22 pm
Location: Probably playing DDR
Contact:

Gravlab II

Post by leofox »

Gravlab was a little test program i made in TI-basic, a demo of a falling and bouncing ball. For my senior assignment (or w/e you call that in English), i decided to remake it in ASM/Basic.
In essence, it's now a physically accurate simulation of a ball falling in vacuum. Features i plan to add are multiple objects, friction, realistic collision , shooting the ball (giving it a certain start velocity) and maybe even wind.
I don't plan to use it in a game, it's main purpose is demonstration in physics class, clarifying gravity. Similar programs are already used in physics class, but usually the teacher does the settings and the students only watch. Gravlab II would allow every student to figure it out by themself.

Basic/ASM means that the main menu and user input is written in TI Basic, but the actual graphical simulation (where accuracy and speed are so very much needed) is 100% Assembly without any rom calls in the main loop.

Sorry if it sounds vague atm, more will follow later including screenies. It WILL be finished before january 2007, with extensive documentation. It's a school project after all ;)
My first calc project i post on MC before UTI.. *sigh*
Image
Image
DarkAuron
Maxcoderz Staff
Posts: 1349
Joined: Sat 18 Dec, 2004 6:53 pm

Post by DarkAuron »

Sounds great! Maybe you should allow addition of wall objects or what not that it could bounce off, or even roll down?
[Gridwars Score] - E: 1860037 M: 716641 H: 261194
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

yes sounds great, are you going to add spinning and spinning-friction aswell?
the last one might be little hard though, but very cool.
leofox
Calc Master
Posts: 1064
Joined: Fri 17 Dec, 2004 3:22 pm
Location: Probably playing DDR
Contact:

Post by leofox »

DarkAuron wrote:Sounds great! Maybe you should allow addition of wall objects or what not that it could bounce off, or even roll down?
Walls would be easy, slopes are not planned currently.
Image
Image
CoBB
MCF Legend
Posts: 1601
Joined: Mon 20 Dec, 2004 8:45 am
Location: Budapest, Absurdistan
Contact:

Post by CoBB »

Implementing proper collision can be a major pain.
leofox
Calc Master
Posts: 1064
Joined: Fri 17 Dec, 2004 3:22 pm
Location: Probably playing DDR
Contact:

Post by leofox »

Yeah, that would be the hardest part probably. Luckily i have the help of a computer science and physics teacher.
Image
Image
leofox
Calc Master
Posts: 1064
Joined: Fri 17 Dec, 2004 3:22 pm
Location: Probably playing DDR
Contact:

Post by leofox »

a screenie for the masses!
Image
Values here are acceleration of $00,$00,$01 and frameskip of $80.
In human, that means the acceleration is 1/65536th of a pixel, but it only draws one in 128 frames (so it runs at a decent speed). It's kinda jumpy now, but that's because most of the speed is spent on calculating. Higher acceleration is recommended, so you can lower the frameskip for a smoother picture. You lose a bit of accuracy though, but that shouldn't matter because the speed barely goes above 1pixel anyway (the problem with these is that if your speed is too high, objects will fall through each other).
Image
Image
CoBB
MCF Legend
Posts: 1601
Joined: Mon 20 Dec, 2004 8:45 am
Location: Budapest, Absurdistan
Contact:

Post by CoBB »

leofox wrote:(the problem with these is that if your speed is too high, objects will fall through each other).
That's exactly the kind of problem I was thinking about. ;)
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

Yeah I've had that problem, its really annoying.
Image
leofox
Calc Master
Posts: 1064
Joined: Fri 17 Dec, 2004 3:22 pm
Location: Probably playing DDR
Contact:

Post by leofox »

CoBB wrote:
leofox wrote:(the problem with these is that if your speed is too high, objects will fall through each other).
That's exactly the kind of problem I was thinking about. ;)
The floor is now only pixel high ( i just check cp 60 -_-') but i'm not running into problems yet. That's where frameskip is for :)
Image
Image
leofox
Calc Master
Posts: 1064
Joined: Fri 17 Dec, 2004 3:22 pm
Location: Probably playing DDR
Contact:

Post by leofox »

I am now adding friction (gaah... it needs division and multiplication, which is a bitch to do with 3 byte numbers :S ) and a way to control the ball with the keypad in real time. It'd be pretty cool, the first step to maybe implementation in a game.
Image
Image
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

The API has a 16 bit multiplication routine under Mathematics, perhaps it can help you get inspiration..?
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
leofox
Calc Master
Posts: 1064
Joined: Fri 17 Dec, 2004 3:22 pm
Location: Probably playing DDR
Contact:

Post by leofox »

Thanks, i'll look at that.
Image
Image
User avatar
anykey
Extreme Poster
Posts: 420
Joined: Mon 31 Jan, 2005 3:36 am
Location: In the matrix
Contact:

Post by anykey »

ooooh...me gusta gravity.
I think, therefore iMac
Image
User avatar
nepmarauder
Regular Member
Posts: 119
Joined: Thu 14 Apr, 2005 7:02 pm
Location: Ann Arbor, MI
Contact:

Post by nepmarauder »

I was thinking about making a program like this. But, I never have much time to program. I'd like to see this when its finished. Good luck.
Image
IT'S GREAT TO BE A MICHIGAN WOLVERINE!
Post Reply