(Game Maker 8 Pro) Polishing Speedway Interactions

Discussion in 'Programming' started by Build Man, Jan 10, 2019.

  1. Build Man

    Build Man Member

    Joined:
    Jul 23, 2017
    Posts:
    135
    I have just recalled a fragment of my memory dump from a video about Sonic game physics engine. Among else, there was stated that physics engine uses Advance layer and Backside layer(al least that is what I remember them named), and player character shifts between these by touching specialized beacons - and the beacon part is where I considered total rework of Speedway Interactions.

    Now speedways will be solid for the Protagonist, but only when he runs through the specialized beacon with Sandals on(The Protagonist is not supposed to jump onto speedways, or land on them anyways). This saves some troubles, but the new system is not perfect still.



    Here, you can see that the Protagonist just runs off speedway instead of snapping onto straight tile and assuming new angle. I will try to figure out how to make the Protagonist snap nicely onto the straight tile. I will let you know if I am succesful or not, but you can give your suggestions anyway.

    By the way, here is the new experimental version with mentioned rework - https://www.mediafire.com/file/uuyywg5vyylkckf/Legend_of_Mako_Experimental_12.gmk/file

    If you are concerned about how this all is coded, the code related to speedways is in spoiler below:
    Collision Event with speedway_parent
    Code:
    if sprite_index = Mako_SandalSpeed && speedways = true && other.angle = 0
     {
     speedways = true
     alarm[9] = 10
     image_angle = 0
     if hspeed > 0
     motion_set(image_angle,speed)
     if hspeed < 0
     motion_set(image_angle,-speed)
     }
    if sprite_index = Mako_SandalSpeed && speedways = true && other.angle = 45
     {
     speedways = true
     alarm[9] = 10
     image_angle = 45
     if hspeed > 0
     motion_set(image_angle,speed)
     if hspeed < 0
     motion_set(image_angle,-speed)
     }
    if sprite_index = Mako_SandalSpeed && speedways = true && image_angle = 45 && other.angle = 90
     {
     speedways = true
     alarm[9] = 10
     image_angle = 90
     if vspeed > 0
     motion_set(image_angle,speed)
     if vspeed < 0
     motion_set(image_angle,-speed)
     }
    Collision event with beacon_speedway
    Code:
    if sprite_index = Mako_SandalSpeed
     {
     speedways = true
     alarm[9] = 10
     }
    Alarm 9
    Code:
    speedways = false
    if image_angle != 0
     {
     image_angle = 0
     }
    End Step
    Code:
    if place_meeting(x,y,speedway1)
     {
     if image_angle = 45
      {
      move_outside_solid(225,1)
      }
     }
    The code is incomplete, but first, some issues must be solved before I continue it. The last code is so the Protagonist would not get stuck in a speedway.
     
    Last edited: Jan 12, 2019
  2. Build Man

    Build Man Member

    Joined:
    Jul 23, 2017
    Posts:
    135
    By the way, I just decided I will revert to previous terrain collision system. That means player object and enemy objects would rely on tiles being Solid once more. That only makes sense, since subject TheouAegis would not be able to support me anymore. If you want to playtest my project to be able to provide me help, I will gladly provide an up-to-date version for you to try, in the separate conversation.
     
  3. Meve

    Meve Member

    Joined:
    Jan 21, 2018
    Posts:
    47
    Hey! I know this is a bit unusual, but you seem like a good programmer and I'm eager to learn, so I was wondering: Why aren't you using gravity, are there benefits? Also, how did you make your character come down after jumping if you aren't using any gravity?
     
  4. Build Man

    Build Man Member

    Joined:
    Jul 23, 2017
    Posts:
    135
    There is gravity. It is just that for certain instances it is turned off.

    Sorry to disappoint you, but I am not that good at programming. While I can try and figure this for myself, it may take too many time and attempts. And it all may end up messy, unprofessional, and take up tons of text. And while it would work, at times it may just not work properly. That is why I ask YoYoGames community for the right directions.
     
  5. Build Man

    Build Man Member

    Joined:
    Jul 23, 2017
    Posts:
    135
    Speedway Interactions just got total rework. Original Post is updated.
     
  6. Build Man

    Build Man Member

    Joined:
    Jul 23, 2017
    Posts:
    135
    I tried to come up with my own solutions(which obviously did not work properly, or at all). Then I have tried to find help in legacy forums, by searching specifically for posts that mention angles and slopes. I found a handful of results and got confused. While I try to figure out how to translate answers from legacy forums into code, especially code that would work nicely with one I currently have, the idea that I might need someone with good experience in recreating Sonic physics sinks deeper into my processor. The fact that Speed Sandal movement is limited to 8 angles(as opposed to any MegaDrive game's 16 angles) does not help that matter either.

    I need to think hard about all those results I have found in legacy forums so far, but not too hard as to not fry my circuits down. Either that, or I need to find someone as good at that Sonic physics thing as GameGoblin or Chrscool8 to help me out with that matter.
     
  7. Build Man

    Build Man Member

    Joined:
    Jul 23, 2017
    Posts:
    135
    The Summary: I tried to incorporate almost everything from the Legacy forums, and even something from other sources, into my code. None worked. Either I have incorporated them all poorly, or my particular system requires a unique code to make it work properly. And I am not that good at programming, sadly.

    Facts such as 8 directions limit and top speed being "hspeed = 20" makes this task even harder. I need to find someone who is good at Sonic physics, or at least, good at programming. While I may consider to directly ask someone who is stated to be good at programming to help, I do not like the idea of bothering a single person with some kind of task.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice