don't click here

General Project Screenshots/Video Thread

Discussion in 'Fangaming Discussion' started by Sparks, Jun 28, 2008.

  1. BlazeHedgehog

    BlazeHedgehog

    A "Community Enigma"? Oldbie
    1,472
    18
    18
    [​IMG]

    I expected coding this to be a lot harder than it actually was, though I guess my implementation is a bit hacky. (One could argue, however, that making games in MMF is a hacky process)
     
  2. MarkeyJester

    MarkeyJester

    Original, No substitute Resident Jester
    2,250
    510
    93
    Japan
    Looks very nice, though I'm concerned about the small missing curvy piece on the far left.
     
  3. Namo

    Namo

    take a screenshot of your heart Member
    2,912
    0
    0
    Haha, you can say that again. I'm curious as to how you implemented that. Perhaps the animation frame for Sonic changes as he collides with specific track parts?
     
  4. jman2050

    jman2050

    Teh Sonik Haker Tech Member
    634
    4
    18
    It'd be a thousand times easier to just check Sonic's height in relation to the loop and determine the animation frame from there.

    Easier still to just sync the animation speed with the speed of running through the loop, though obviously that would involve some trial-and-error.
     
  5. Namo

    Namo

    take a screenshot of your heart Member
    2,912
    0
    0
    Yeah, there's so many ways to do it. I'm still rather new in MMF2 so I wouldn't have guessed the first one. ...or the second one.
     
  6. jman2050

    jman2050

    Teh Sonik Haker Tech Member
    634
    4
    18
    I certainly haven't used MMF2 extensively as well, but I figure if you can't do those two at least for whatever reason then maybe one should rethink their choice of MMF2 for a project of this nature :P
     
  7. BlazeHedgehog

    BlazeHedgehog

    A "Community Enigma"? Oldbie
    1,472
    18
    18
    I actually use a method somebody at SFGHQ suggested (Nitemare, I think).

    This is my template object:

    [​IMG]

    It's an active object that gets turned invisible at runtime. This is what checks to see if Sonic is "in" the corkscrew. Also at runtime, several objects are created relative to the position of this template object:

    [​IMG]

    These two are separate; one is under Sonic and the other is over Sonic. These should be obvious. The one that makes it work, though, is this object:

    [​IMG]

    Turned invisible at runtime, this is what Sonic "stands on". Whether or not it's solid depends on a number of factors: If Sonic's X speed is below 2, it becomes non-solid. If Sonic is not touching any floors, it becomes non-solid.

    When Sonic is completely overlaying the corkscrew template object, his animation is changed to the corkscrew animation, which is 13 frames long. The frame of the animation is forced based on his X position in the corkscrew:

    To break it down,

    This handy little thing basically means that if the result of the calculation exceeds the number listed, it'll start counting from zero again. So "(0) mod 13" is still 0, but "(14) mod 13" is 1, "(15) mod 13" is 2, etc. At least, I think that's how it works - I'm awful at anything more than simple math, but this is how it was used in Sonic Worlds, and that's how it has continued to work for me.

    This produces the distance between Sonic's X position and the left edge of the corkscrew template. Since this is going to be a big number and our animation is only 13 frames long, we're going to need to divide it by something, so we divide it by 26 - which is 13 * 2.

    I'm still playing with it, but yeah, that's the implementation I'm currently using and it works.

    Edit:

    And if you need to know what it looks like when the invisible objects are visible:

    [​IMG]
     
  8. Namo

    Namo

    take a screenshot of your heart Member
    2,912
    0
    0
    I'm saving that post in case I ever feel like creating a Sonic Fan-game. Nice explanation. It's broken down even for noobs like myself.
     
  9. jman2050

    jman2050

    Teh Sonik Haker Tech Member
    634
    4
    18
    ah, the invisible solid object is certainly a good way of forming the path of the corkscrew.

    Also, as far as mod goes, just go alllll the way back to your elementary school math class when you use to do long division with the quotient and the remainder. mod performs a standard division between two numbers and returns the remainder rather than the quotient. And yeah, its primary utility is for dealing with counters that cycle within a given range.
     
  10. Liliam

    Liliam

    Oldbie
    1,563
    117
    43
    Doesn't that mean that way Sonic gets drag from the invisible slope object?

    Personally I'd have a mode where Sonic isn't affected by gravity and just have his Y position be a function of his X position relative to the control object's X position. If that makes any sense. No need for multiple objects or invisible collsion masks or anything of the sort. I'd probably implement the animation in a similar if not identical fashion, though.
     
  11. Namo

    Namo

    take a screenshot of your heart Member
    2,912
    0
    0
    Of course, another way to do the corkscrew thing would be to use the path movement object. But that's extremely newb-tier, and would probably take more trial and error than it's worth. + - AKA, what I would have done and struggled with incessantly.  
     
  12. BlazeHedgehog

    BlazeHedgehog

    A "Community Enigma"? Oldbie
    1,472
    18
    18
    Shouldn't he, though? It looks correct enough to me:

    http://i36.tinypic.com/8ze1b9.gif

    If he doesn't, it's probably not very difficult to simply turn off the momentum/drag stuff when he's overlapping the corkscrew object.
     
  13. Zenor

    Zenor

    flip the chessboard over Member
    302
    23
    18
    Wouldn't it be better to just set Sonic's Y coordinate according to the distance from the corkscrew's left X coordinate, using a cosine wave?
    That way you won't be restricted to many objects.
     
  14. BlazeHedgehog

    BlazeHedgehog

    A "Community Enigma"? Oldbie
    1,472
    18
    18
    Math is hard. :specialed:
     
  15. Liliam

    Liliam

    Oldbie
    1,563
    117
    43
    Heh. That actually seems physically correct, since when he's coming back down gravity should be lending a hand and speeding him up a bit. I'm pretty sure Sonic 2 doesn't do it, but this might actually work BETTER than it.
     
  16. Zenor

    Zenor

    flip the chessboard over Member
    302
    23
    18
    Code (Text):
    1. Y= base + amplitude*cos(freq.* X)
    2.  
    3. base - in this case, the corkscrew's Y(should be aligned at the center).
    4. Amplitude - Distance from Y to Y top. Corkscrew's height/2 (Not exactly accurate, though).
    5. freq. - Needless to say. The bigger the corkscrew is, the smaller this is.
    6. X - Distance.
    :eng101:

    I just don't like how Sonic gains speed when he's going down the corkscrew. It looks a bit unnatural to me.
     
  17. Namo

    Namo

    take a screenshot of your heart Member
    2,912
    0
    0
    Nice. Looks good here.
     
  18. Polygon Jim

    Polygon Jim

    Eternal Tech Member
    0
    3
    0
    across town from Hinchy
    All the bitches.


    I love how that works actually. Sonic gaining speed when going down is awesome, and makes more sense than him staying the same speed the whole time.
     
  19. Sparks

    Sparks

    Member
    3,166
    190
    43
    Sondro Gomez / Kyle & Lucy

    Why does my computer like to lag

    Why can't I have a nice video editor

    :psyduck:
     
  20. Azu

    Azu

    I must be stupid. Member