Page 7 of 10

Posted: Thu 05 Jan, 2006 11:36 pm
by DigiTan
I'd maybe contact CoBB and Joe Permberton for the hard-hitting questions on discrete physics. The Sonic team and myself can also lend some support, but a lot of this stuff is new territory for us as well. That's the real ball-breaker: the physics.

Posted: Thu 05 Jan, 2006 11:54 pm
by threefingeredguy
You don't have to stop using the ion libraries. If you intend to use a shell, then save the space. Unless you need a sprite routine that isn't XOR. Then use sigma's or movax's. I heard those were faster, though I have never checked.

Posted: Fri 06 Jan, 2006 3:25 am
by CompWiz
calcul831415 wrote:@katmaster and CompWiz: Do you guys want to use ION libraries to put sprites for now and then build our own sprite routine later?
Until I know more about asm programming(I have started to learn it) or until katmaster responds, you are the best able to make those types of decisions. Forum members with more asm experience will probably be most able to answer your questions.(thanks tfg) Feel free to do what you think is best. :)

And we all have time restraints. If you don't get a whole lot of time, I'm sure we can all relate. Anything you have time for is great. :)

Posted: Fri 06 Jan, 2006 3:28 am
by Liazon
I, myself have not started, mainly because I have no clue where to start when it comes to physics (not an available course until next year).

Posted: Fri 06 Jan, 2006 3:35 am
by CompWiz
I am actually taking physics right now. I can answer physics questions. In fact, here is the physics reference tables packet that we use in school. It has a bunch of great formulas at the end, and good constants(like acceleration due to gravity) on the first page. I'd be happy to answer any physics questions you may have, as I have a good amount of experience using these forumulas. As to the coding of physics, DigiTan is working on that for sonic, and no doubt knows all about it.

Just thinking about it, here are a few things to get you started: gravity pulls down with an acceleration of 9.81m/(s^2). (m/(s^2) is the unit). However, when the person jumps, they go higher if you hold down the button longer. Therefore, this would not work alone to determine jump height. If it did, you could just do 0=(initial velocity)^2 +2(9.81)d. Solve for d, then put the initial velocity in.

Hmm, I'm guessing a lot of this wouldn't make a whole lot of sense to someone who hasn't taken physics yet. Well, like I've said, ask me about any physics stuff, I can give you the formulas you need to program in, and how to use them.

Posted: Fri 06 Jan, 2006 4:11 am
by threefingeredguy
Subsitute 10 for 9.81 to get slightly less exact results but easier calculations. Or, if you like bcalls, theres a htimes9 or hltimes9 that you can use if you subsitute 9. Or you can use feet, that gives you a nice 16 (or 32 depending on how you look at it) which can be calculated quickly and easily with bit shifting or add hl,hl a bunch of times.
But why do real physics. I suggest trying that equation with varying values to find was is easiest to translate into your graphics. For example, you can do 16, but then have to scale down the size of the movements so it stays within a reasonable range, or you could do 4, making up your own gravity, use smaller numbers for acceleration, and generally have an easier time of it.

Posted: Fri 06 Jan, 2006 4:36 am
by Patori
threefingeredguy wrote: But why do real physics.
Amen to that. I don't think a game would be much fun if a sprite fell too fast to control, or too slow for that matter either.

Posted: Fri 06 Jan, 2006 5:09 am
by CompWiz
That's true. Fun to play is way more important than having realistic physics.

Posted: Fri 06 Jan, 2006 5:24 am
by katmaster
calcu831415 wrote:It's good to hear katmaster's done a lot of ASM programming already
Who said that?!?! I've probably done about as much as you have.

As for learning ASM, I'm on about day 12/13. I'm getting dsl soon, so I'll be tied up with that for a bit. Otherwise, it's going well.

As for sprites, I think ION will be fine. Does anyone have a ION learning guide, cuz I only know a little bit about using ION....

As for physics, I wonder if we can get the source code for N-game itself. Does flash use source code? I've never tried using it......

Posted: Fri 06 Jan, 2006 5:27 am
by kalan_vod
This may help with understanding about sprites down the road.

Posted: Fri 06 Jan, 2006 4:25 pm
by threefingeredguy
Flash has actionscript and you can decompile an swf, sometimes. Email the author and I can convert it to pseudo code for you. Actionscript is remarkably like java, so if you guys know java you could convert it yourself.

As to learning ION, andy's asm pack on ticalc.org contains a file called ionguru (actually it's called ig) which contains a very vague example of how to use the ion functions. It provides input, which is all you need, I guess.

Posted: Fri 06 Jan, 2006 7:06 pm
by CompWiz
threefingeredguy wrote:Email the author and I can convert it to pseudo code for you.
about what? The flash file is freely downloadable. What do you want?

Posted: Fri 06 Jan, 2006 11:22 pm
by Liazon
CompWiz wrote:I am actually taking physics right now. I can answer physics questions. In fact, here is the physics reference tables packet that we use in school. It has a bunch of great formulas at the end, and good constants(like acceleration due to gravity) on the first page. I'd be happy to answer any physics questions you may have, as I have a good amount of experience using these forumulas. As to the coding of physics, DigiTan is working on that for sonic, and no doubt knows all about it.

Just thinking about it, here are a few things to get you started: gravity pulls down with an acceleration of 9.81m/(s^2). (m/(s^2) is the unit). However, when the person jumps, they go higher if you hold down the button longer. Therefore, this would not work alone to determine jump height. If it did, you could just do 0=(initial velocity)^2 +2(9.81)d. Solve for d, then put the initial velocity in.

Hmm, I'm guessing a lot of this wouldn't make a whole lot of sense to someone who hasn't taken physics yet. Well, like I've said, ask me about any physics stuff, I can give you the formulas you need to program in, and how to use them.
The jumping engine I have right now (really bad and pathetic, but at least have to start somewhere) in the Santa Game uses a constant fall down of 1 pixel per loop cycle. (it cuts one pixel from the y position of the sprite at the end of the giant game loop) Going up means storing the maximum height in the y position of the sprite (I originally only had my elf sprite jump about 6 pixels) It doesn't really look like jumping. Perhaps I can add some code to modify how long it takes to fall down.

I assume exponential acceleration would involve at least two counters (one for the # adn it's current power?) In N-Game, we need to achieve loftiness at the peak of the jumps. Ah, just store the last pixel increase into a variable and then do add hl,hl or sra a to double the position change.

Posted: Sat 07 Jan, 2006 1:06 am
by threefingeredguy
CompWiz wrote:
threefingeredguy wrote:Email the author and I can convert it to pseudo code for you.
about what? The flash file is freely downloadable. What do you want?
The swf file is freely downloadable, but I need the FLA file. Unless you wanna find a compatible decompiler.

Posted: Sat 07 Jan, 2006 3:01 am
by CompWiz
@TFG: e-mail sent. I'll let you know when I get a responce.

@calcul831415: working on physics when I get a chance. Feel free to look at the formulas from the pdf file I posted a link to .