TheExDeus
 Joined: Apr 2008
Posts: 1,860
|
 |
Reply #15 Posted on: September 29, 2014, 09:18:33 AM |
|
|
|
Making it yourself is often the smart option, as it will be much easier for yourself to understand it later on.
|
|
|
edsquare
 Joined: Apr 2014
Posts: 402
|
 |
Reply #16 Posted on: September 29, 2014, 04:24:03 PM |
|
|
Quote from: HitCoder on September 29, 2014, 07:01:43 AM Guys, thanks for the help so far, but I have decided to make my own engine using my own knowledge, but using it properly. I'm not bad with game maker and enigma, I'm just a little lazy, but I know what I'm doing 90% of the time. I may make a topic on my engine later on, so people can download it here, and use it as they please.
That's great and much apreciated! 
|
|
|
|
|
Goombert
 Joined: Jan 2013
Posts: 2,991
|
 |
Reply #18 Posted on: October 02, 2014, 10:17:22 PM |
|
|
HitCoder, that's an interesting idea, you could actually combine the behavior of speed and hspeed/vspeed I've always wanted to learn how to do Sonic the Hedgehog style physics but never learned. One thing is important though, do not make your physics come out like Sonic the Hedgehog 2006 https://www.youtube.com/watch?v=5dd2g4C19Og
|
|
|
|
|
|
|
HitCoder
 Joined: Aug 2014
Posts: 157
|
 |
Reply #21 Posted on: October 19, 2014, 02:41:43 PM |
|
|
Ok, thanks Robert, they work, but I'd like an engine that has slopes, and rotates in 360 degree rotations. I'm not bothered whether or not it's legacy rotations, but I can't make what I'm intending to make without it. Sorry for any extra work, I've been trying my best with making my own engine, but they all mess up where I make a single error, leave it until the next day, and forget what I did to cause the error. It's been a long gruelling process with little success. Thanks for all the help so far. ~~HitCoder~~ EDIT: The following engine works on Enigma if you rename the object "floor" to anything else, due to a conflict to the floor constant. I also had to go through the code of the player. http://sandbox.yoyogames.com/games/29959-dr-spazzs-movement-engineHere's my edit: https://www.dropbox.com/s/p5fk34s3ll0airb/movement_engine.gmk?dl=0
|
|
|
Goombert
 Joined: Jan 2013
Posts: 2,991
|
 |
Reply #22 Posted on: October 20, 2014, 07:10:00 AM |
|
|
You're welcome, and yeah that one does work pretty well.  The first level seemed a little glitchy to me though, it wasn't animating properly and was running on the outside of the circle. But once I restarted it was fine and so was every other level, so I am guessing that was a wild fluke.
|
|
|
polygone
 Joined: Mar 2009
Posts: 794
|
 |
Reply #23 Posted on: October 21, 2014, 01:23:18 PM |
|
|
I have no idea why my sonic engine isn't on the EDC; it was working fine in ENIGMA perhaps an incompatibility was introduced in it so I took it down but I don't remember doing so? Anyway here is the engine: https://app.box.com/s/nc7smht5lqh90kyi7byvI do not know if it works properly in ENIGMA or not any more but it shouldn't be hard to make it work if it doesn't. EDIT: Just tested it and it runs fine; with 2 apparent bugs that have been introduced in ENIGMA. 1) The score text at the top is moving all the time (possibly something to do with rounding) 2) The collision detection for the boxes and rings has been bugged somehow. They all use the script collision_onset: // Checks if there is going to be a collision with the object giving in argument0 given the Player's current speed // To be accurate it does this using a place_meeting check at the position the Player will be at given it's hspeed / vspeed // And also using two collision lines either side of the player mask from the Player's current position to the position it // will be at given it's hspeed / vspeed
var x1, y1, x2, y2;
x1 = x + cos(full_direction+pi/2)*mask_radius; y1 = y - sin(full_direction+pi/2)*mask_radius; x2 = x + cos(full_direction-pi/2)*mask_radius; y2 = y - sin(full_direction-pi/2)*mask_radius;
return (place_meeting(x + full_hspeed, y + full_vspeed, other.id) || collision_line(x1, y1, x1 + full_hspeed, y1 + full_vspeed, argument0, false, true) != noone || collision_line(x2, y2, x2 + full_hspeed, y2 + full_vspeed, argument0, false, true) != noone)So my guess is that collision_line has become bugged.
|
|
|
HitCoder
 Joined: Aug 2014
Posts: 157
|
 |
Reply #24 Posted on: October 21, 2014, 08:29:52 PM |
|
|
Quote from: polygone on October 21, 2014, 01:23:18 PM I have no idea why my sonic engine isn't on the EDC; it was working fine in ENIGMA perhaps an incompatibility was introduced in it so I took it down but I don't remember doing so?
Anyway here is the engine: https://app.box.com/s/nc7smht5lqh90kyi7byv
I do not know if it works properly in ENIGMA or not any more but it shouldn't be hard to make it work if it doesn't.
EDIT: Just tested it and it runs fine; with 2 apparent bugs that have been introduced in ENIGMA.
1) The score text at the top is moving all the time (possibly something to do with rounding) 2) The collision detection for the boxes and rings has been bugged somehow. They all use the script collision_onset:
// Checks if there is going to be a collision with the object giving in argument0 given the Player's current speed // To be accurate it does this using a place_meeting check at the position the Player will be at given it's hspeed / vspeed // And also using two collision lines either side of the player mask from the Player's current position to the position it // will be at given it's hspeed / vspeed
var x1, y1, x2, y2;
x1 = x + cos(full_direction+pi/2)*mask_radius; y1 = y - sin(full_direction+pi/2)*mask_radius; x2 = x + cos(full_direction-pi/2)*mask_radius; y2 = y - sin(full_direction-pi/2)*mask_radius;
return (place_meeting(x + full_hspeed, y + full_vspeed, other.id) || collision_line(x1, y1, x1 + full_hspeed, y1 + full_vspeed, argument0, false, true) != noone || collision_line(x2, y2, x2 + full_hspeed, y2 + full_vspeed, argument0, false, true) != noone)
So my guess is that collision_line has become bugged.
Oh, thank you. I think I will give that a try. Although, I was planning on making a sonic engine specifically designed for enigma - not that I had any hope though. I was going to name it "Sonigma" haha. EDIT: What was wrong with just using place_meeting, mind you? EDIT2 : how can I fix collisions with springs? They seem to activate at a way to far away distance. Also, why does sonic go into a roll if you don't make it up a slope?
|
|
|
polygone
 Joined: Mar 2009
Posts: 794
|
 |
Reply #25 Posted on: October 22, 2014, 02:37:21 PM |
|
|
Quote from: HitCoder on October 21, 2014, 08:29:52 PM Although, I was planning on making a sonic engine specifically designed for enigma - not that I had any hope though. I was going to name it "Sonigma" haha.
Well I did the opposite thing and helped develop ENIGMA to make sure everything in ENIGMA was compatible with my Sonic engine  As I said it was working perfectly before. Quote from: HitCoder on October 21, 2014, 08:29:52 PM What was wrong with just using place_meeting, mind you?
collision_line is more accurate as sonic is not just a single point. Quote from: HitCoder on October 21, 2014, 08:29:52 PM how can I fix collisions with springs? They seem to activate at a way to far away distance.
Again as I said in my post that is a bug that has been introduced into enigma (it never happened before) so one of the ENIGMA devs (who isn't me) needs to look at it and fix the problem. Quote from: HitCoder on October 21, 2014, 08:29:52 PM Also, why does sonic go into a roll if you don't make it up a slope?
That was a choice that I made to do it like that. In the Sega games when Sonic doesn't make it up a slope he is rotated until in a vertical position then falls, my engine did original do this to mimic that behaviour but then I decided to change it so Sonic goes into a ball because in my opinion (which was heavily influenced by Josh lol) it looks better and is a more realistic way of handling the situation. However yes this behaviour is different to how it was classically done. If you look in Sonic's step event 'Game Motion' code you will see this: // Or if the player is too slow and we're on the roof or on a wall, fall if (angle>70 && angle<290 && abs(hsp)<5.5) { vsp = -dsin*hsp; hsp = dcos*hsp; ground = 0; angle = 0; dcos = 1; dsin = 0;
if (action != act_roll) // go into roll when falling off a wall { action = act_roll; sound_play(SndSpin); } }That is the code piece for the falling, you can see there where the action is set to rolling. If you comment out (or just delete) the part where it makes Sonic roll, ie: /* if (action != act_roll) // go into roll when falling off a wall { action = act_roll; sound_play(SndSpin); } */Sonic will then rotate when falling instead of rolling.
|
|
|
|
|
polygone
 Joined: Mar 2009
Posts: 794
|
 |
Reply #27 Posted on: October 22, 2014, 04:05:44 PM |
|
|
|
I haven't really got time to be programming any more :/ so unfortunately...
|
|
|
|
|
|
|
|