• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

(Game Maker 8 Pro) Polishing Speedway Interactions

Build Man

Member
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:

Build Man

Member
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.
 
M

Meve

Guest
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?
 

Build Man

Member
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?
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.
 

Build Man

Member
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.
 

Build Man

Member
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.
 
Top