Author Topic: platform collision question.  (Read 17474 times)

0 Members and 1 Guest are viewing this topic.

Offline jsj795

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1105
  • Rating: +84/-3
    • View Profile
Re: platform collision question.
« Reply #15 on: June 10, 2010, 10:52:43 pm »
Also, just a side note, since Axe is pretty fast and everything is either monochrome or grayscale you could possibly just let him fall through. Since there aren't multiple colors it might go unnoticed. Just a thought. What ever you do that I'm sure it'll look and feel good game wise :)

The problem of just letting him fall is that in that case I have to update the tilemap every frame, which I don't want to do... It's a lot easier to just use pt-change( to erase the sprite and redraw another sprite.
So if I don't redraw the whole tilemap, when the sprite goes through the block, the block won't get redrawn which will erase the block so it won't look like it's not there anymore.

If somehow I can't do this, then I'll just stick with the sprite being able to stand on the edge :P


Spoiler For funny life mathematics:
1. ROMANCE MATHEMATICS
Smart man + smart woman = romance
Smart man + dumb woman = affair
Dumb man + smart woman = marriage
Dumb man + dumb woman = pregnancy
2. OFFICE ARITHMETIC
Smart boss + smart employee = profit
Smart boss + dumb employee = production
Dumb boss + smart employee = promotion
Dumb boss + dumb employee = overtime
3. SHOPPING MATH
A man will pay $2 for a $1 item he needs.
A woman will pay $1 for a $2 item that she doesn't need.
4. GENERAL EQUATIONS & STATISTICS
A woman worries about the future until she gets a husband.
A man never worries about the future until he gets a wife.
A successful man is one who makes more money than his wife can spend.
A successful woman is one who can find such a man.
5. HAPPINESS
To be happy with a man, you must understand him a lot and love him a little.
To be happy with a woman, you must love her a lot and not try to understand her at all.
6. LONGEVITY
Married men live longer than single men do, but married men are a lot more willing to die.
7. PROPENSITY TO CHANGE
A woman marries a man expecting he will change, but he doesn't.
A man marries a woman expecting that she won't change, and she does.
8. DISCUSSION TECHNIQUE
A woman has the last word in any argument.
Anything a man says after that is the beginning of a new argument.

Girls = Time * Money (Girls are a combination of time and money)
Time = Money (Time is money)
Girls = Money squared (So, girls are money squared)
Money = sqrt(Evil) (Money is also the root of all evil)
Girls = sqrt(Evil) squared (So, girls are the root of all evil squared)
Girls = Evil (Thus, girls are evil)
*Girls=Evil credit goes to Compynerd255*

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: platform collision question.
« Reply #16 on: June 11, 2010, 04:35:49 pm »
If you're using xor logic in Pt-Change() the blocks won't get erased.  That's the beauty of using xor.  It does however cause the pixels of the intersection to get inverted while the sprite passes through it.  Another way to avoid redrawing the screen is to just use a backbuffer.  Its just as fast recalling the backbuffer as it is to do a ClrDraw.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline jsj795

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1105
  • Rating: +84/-3
    • View Profile
Re: platform collision question.
« Reply #17 on: June 11, 2010, 06:33:38 pm »
Oh, I haven't thought of using the backbuffer :) That makes my life a lot easier than trying to redraw the tiles that got erased :D
Thanks for the tip


Spoiler For funny life mathematics:
1. ROMANCE MATHEMATICS
Smart man + smart woman = romance
Smart man + dumb woman = affair
Dumb man + smart woman = marriage
Dumb man + dumb woman = pregnancy
2. OFFICE ARITHMETIC
Smart boss + smart employee = profit
Smart boss + dumb employee = production
Dumb boss + smart employee = promotion
Dumb boss + dumb employee = overtime
3. SHOPPING MATH
A man will pay $2 for a $1 item he needs.
A woman will pay $1 for a $2 item that she doesn't need.
4. GENERAL EQUATIONS & STATISTICS
A woman worries about the future until she gets a husband.
A man never worries about the future until he gets a wife.
A successful man is one who makes more money than his wife can spend.
A successful woman is one who can find such a man.
5. HAPPINESS
To be happy with a man, you must understand him a lot and love him a little.
To be happy with a woman, you must love her a lot and not try to understand her at all.
6. LONGEVITY
Married men live longer than single men do, but married men are a lot more willing to die.
7. PROPENSITY TO CHANGE
A woman marries a man expecting he will change, but he doesn't.
A man marries a woman expecting that she won't change, and she does.
8. DISCUSSION TECHNIQUE
A woman has the last word in any argument.
Anything a man says after that is the beginning of a new argument.

Girls = Time * Money (Girls are a combination of time and money)
Time = Money (Time is money)
Girls = Money squared (So, girls are money squared)
Money = sqrt(Evil) (Money is also the root of all evil)
Girls = sqrt(Evil) squared (So, girls are the root of all evil squared)
Girls = Evil (Thus, girls are evil)
*Girls=Evil credit goes to Compynerd255*

SirCmpwn

  • Guest
Re: platform collision question.
« Reply #18 on: June 11, 2010, 07:10:58 pm »
HL2 updates the tilemap every frame (to accommodate for smooth scrolling later), and every sprite is updated each frame, and I haven't noticed slowdown.  Also, I made the decision to allow the player to stand on the edge, because I would hate to be playing and find myself forced off of an edge.  It is harder to implement, but I think it is worth it.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: platform collision question.
« Reply #19 on: June 11, 2010, 07:38:20 pm »
Harder to implement?  It sounds like it would be easier to implement it since you wouldnt have to have any extra code, and all the hard coding would go into the sliding off an edge?

SirCmpwn

  • Guest
Re: platform collision question.
« Reply #20 on: June 11, 2010, 07:43:32 pm »
No, users can position themselves anywhere on the screen and interact with the environment in a realistic way.  This is harder to implement because users will fall through the blocks on one side if you are not careful, and usually it will require about twice the collision code.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: platform collision question.
« Reply #21 on: June 11, 2010, 07:46:55 pm »
Mmm i thought he was just talking about the decision to have a character balance on an edge or be pushed off?  I think the former is supported with simple collision, where the latter needs some sort of counter and other forces involved.

SirCmpwn

  • Guest
Re: platform collision question.
« Reply #22 on: June 11, 2010, 07:49:44 pm »
Well, the former is actually more complicated than it sounds, as I found out.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: platform collision question.
« Reply #23 on: June 11, 2010, 07:52:05 pm »
Hmmm maybe so, but wouldn't adding some sort of edge sliding make it more complicated, not less?

SirCmpwn

  • Guest
Re: platform collision question.
« Reply #24 on: June 11, 2010, 07:52:35 pm »
Nope, I can think of several ways to sort of fake the sliding.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: platform collision question.
« Reply #25 on: June 11, 2010, 07:53:59 pm »
really? I cant think of any way that would make it easier o.O What kind of method would you use?

SirCmpwn

  • Guest
Re: platform collision question.
« Reply #26 on: June 11, 2010, 07:56:55 pm »
If I saw a collision, I would stop the physics engine from updating, take manual control of the character, animate it sliding off the edge, and give the physics engine control again.  I would probably play around with it to find a suitable method.  That is, assuming that I was willing to do that to the player in the first place.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: platform collision question.
« Reply #27 on: June 11, 2010, 07:57:09 pm »
HL2 updates the tilemap every frame (to accommodate for smooth scrolling later), and every sprite is updated each frame, and I haven't noticed slowdown.  Also, I made the decision to allow the player to stand on the edge, because I would hate to be playing and find myself forced off of an edge.  It is harder to implement, but I think it is worth it.
I wonder if it would be possible with half byte tiles to actually just update the row/col of tiles the screen is scrolling from? Would it require insane coding? Updating the entire tilemap is usually fast, but my worry was about games like Sonic, that requires extreme amounts of speed. That said, IMHO it's best if the screen framerate is not too high either, though (I prefer a maximum of 15 FPS when I have scrolling), otherwise it's hard to see anything due to the crappy LCD and it's even worse on a TI-Nspire.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: platform collision question.
« Reply #28 on: June 11, 2010, 07:59:42 pm »
If I saw a collision, I would stop the physics engine from updating, take manual control of the character, animate it sliding off the edge, and give the physics engine control again.  I would probably play around with it to find a suitable method.  That is, assuming that I was willing to do that to the player in the first place.

Ah that would be an interesting solution.  It might cause some weird complications but im sure they could be ironed out ^^

SirCmpwn

  • Guest
Re: platform collision question.
« Reply #29 on: June 11, 2010, 08:00:07 pm »
Well, I do something similar to the row/column updates in Advance Wars TI, but it usually runs super fast anyway.  I have it optimized pretty heavily.

On a side note, Axe Sonic sounds like a good idea...