|
edsquare
|
|
Reply #16 Posted on: September 29, 2014, 11:24:03 am |
|
|
Location: The throne of ringworld Joined: Apr 2014
Posts: 402
|
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!
|
|
|
Logged
|
A child of five would understand this. Send someone to fetch a child of five. Groucho Marx
|
|
|
HitCoder
|
|
Reply #17 Posted on: October 02, 2014, 12:07:48 pm |
|
|
Location: Oxford, England Joined: Aug 2014
Posts: 157
|
just looking for advice, but would using a variable that moves you based on direction be a good idea, for while you're on ground? then when you go up slopes, when you hit a slope, the slope rotates you, and your speed vars don't need to be modified other than making gravity pull you down.
|
|
|
Logged
|
Computer Scientist, Programmer in C#, C/C++, Java, Python, GML, EDL, and more. Hobbyist musician. DISCORD: HitCoder#4530
|
|
|
Goombert
|
|
Reply #18 Posted on: October 02, 2014, 05:17:22 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
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
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|
HitCoder
|
|
Reply #20 Posted on: October 13, 2014, 05:16:20 am |
|
|
Location: Oxford, England Joined: Aug 2014
Posts: 157
|
Just an update HitCoder, I managed to partially get the following example working. http://sandbox.yoyogames.com/games/163325-sonic-battle-engine-v1gmk-included
Here is my GMK with changes. I mainly had to set the game info frame to have a border so you could close it because I haven't finished implementing the game info window fully. I also had to fix some parsing errors in the drag and drop by enclosing them with start and end brackets. I also had to replace action_save and action_load_game with a comment in obj_storymode because we haven't implemented saving and loading yet. There were also two objects with the same name which we do not support. https://www.dropbox.com/s/3bllq4gjkgn2yh2/sbev1.gmk?dl=0
The sonic Red Ring tutorial also works if you change the name of the room and run it. http://sandbox.yoyogames.com/games/188858-sonic-red-ring-tutorial-transform
This one also works but it appears the developer didn't quite finish it too much. You will have to rename the "double" variable though to get it to build, because double is a C++ type which ENIGMA supports. http://sandbox.yoyogames.com/games/191988-sonic-engine
Sonic Boost tutorial works by just changing the room name. http://sandbox.yoyogames.com/games/182835-sonic-boost-tutorial
Thank you, I will check these out as soon as I get home (at school at the moment)
|
|
|
Logged
|
Computer Scientist, Programmer in C#, C/C++, Java, Python, GML, EDL, and more. Hobbyist musician. DISCORD: HitCoder#4530
|
|
|
HitCoder
|
|
Reply #21 Posted on: October 19, 2014, 09:41:43 am |
|
|
Location: Oxford, England Joined: Aug 2014
Posts: 157
|
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
|
|
« Last Edit: October 19, 2014, 10:01:05 am by HitCoder »
|
Logged
|
Computer Scientist, Programmer in C#, C/C++, Java, Python, GML, EDL, and more. Hobbyist musician. DISCORD: HitCoder#4530
|
|
|
Goombert
|
|
Reply #22 Posted on: October 20, 2014, 02:10:00 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
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.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
polygone
|
|
Reply #23 Posted on: October 21, 2014, 08:23:18 am |
|
|
Location: England Joined: Mar 2009
Posts: 794
|
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.
|
|
« Last Edit: October 21, 2014, 09:01:46 am by polygone »
|
Logged
|
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
|
|
|
HitCoder
|
|
Reply #24 Posted on: October 21, 2014, 03:29:52 pm |
|
|
Location: Oxford, England Joined: Aug 2014
Posts: 157
|
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?
|
|
« Last Edit: October 21, 2014, 04:20:11 pm by HitCoder »
|
Logged
|
Computer Scientist, Programmer in C#, C/C++, Java, Python, GML, EDL, and more. Hobbyist musician. DISCORD: HitCoder#4530
|
|
|
polygone
|
|
Reply #25 Posted on: October 22, 2014, 09:37:21 am |
|
|
Location: England Joined: Mar 2009
Posts: 794
|
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. What was wrong with just using place_meeting, mind you?
collision_line is more accurate as sonic is not just a single point. 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. 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.
|
|
« Last Edit: October 22, 2014, 09:51:27 am by polygone »
|
Logged
|
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
|
|
|
Goombert
|
|
Reply #26 Posted on: October 22, 2014, 09:59:42 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
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. I just want to uhm touch base with you on this polygone, we fixed the base instance type to fix that memory leak in collision detection. I did it with the help of Josh but the testing was not exactly comprehensive, just a running through some games and making sure they still worked. This was the commit, it is probably a good idea to run through and revert the changes to each changed file and then see if this caused the new bugs. https://github.com/enigma-dev/enigma-dev/pull/835Additionally here is a list of each file with a link to the git revision directly before my pulls changes. To test just copy the raw file into your local enigma fork and see if the bugs persist. enigma-dev / ENIGMAsystem / SHELL / Universal_System / instance_system_base.h https://github.com/RobertBColton/enigma-dev/blob/5c6eb12f7962ce9a42f4eaffef55dbcef536f273/ENIGMAsystem/SHELL/Universal_System/instance_system_base.henigma-dev / ENIGMAsystem / SHELL / Universal_System / instance_system.h https://github.com/RobertBColton/enigma-dev/blob/883c176b228ed0d6af45fb25517a5d8c9afc4fd4/ENIGMAsystem/SHELL/Universal_System/instance_system.henigma-dev / ENIGMAsystem / SHELL / Universal_System / instance_system.cpp https://github.com/RobertBColton/enigma-dev/blob/8aa5a1eeb26bd0ddb4f9fb516e653d06cba8807a/ENIGMAsystem/SHELL/Universal_System/instance_system.cppenigma-dev / ENIGMAsystem / SHELL / Universal_System / instance_iterator.h https://github.com/RobertBColton/enigma-dev/blob/5c6eb12f7962ce9a42f4eaffef55dbcef536f273/ENIGMAsystem/SHELL/Universal_System/instance_iterator.h(I only updated the copyright header in this one, so you don't really have to revert it) enigma-dev / ENIGMAsystem / SHELL / Universal_System / instance_create.h https://github.com/RobertBColton/enigma-dev/blob/1f8b84fead2ea09539eff46a3e9cd71dbdc6d533/ENIGMAsystem/SHELL/Universal_System/instance_create.henigma-dev / ENIGMAsystem / SHELL / Universal_System / instance.h https://github.com/RobertBColton/enigma-dev/blob/da1e4fbd310501c7b04feec49701b87448d4387d/ENIGMAsystem/SHELL/Universal_System/instance.h
|
|
« Last Edit: October 22, 2014, 10:01:15 am by Robert B Colton »
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
polygone
|
|
Reply #27 Posted on: October 22, 2014, 11:05:44 am |
|
|
Location: England Joined: Mar 2009
Posts: 794
|
I haven't really got time to be programming any more :/ so unfortunately...
|
|
|
Logged
|
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
|
|
|
HitCoder
|
|
Reply #28 Posted on: October 22, 2014, 11:15:50 am |
|
|
Location: Oxford, England Joined: Aug 2014
Posts: 157
|
I tried those, but the collisions are still massively off. It's exactly the same as before. What I am struggling to understand mind you, is how collisions with walls and floors and slopes work perfectly, yet misc items collide with you at odd distances :/
I've still got an older version of Enigma installed on my computer, so I'll try using that.
Edit: Nope, no luck
|
|
« Last Edit: October 22, 2014, 12:31:42 pm by HitCoder »
|
Logged
|
Computer Scientist, Programmer in C#, C/C++, Java, Python, GML, EDL, and more. Hobbyist musician. DISCORD: HitCoder#4530
|
|
|
HitCoder
|
|
Reply #29 Posted on: October 23, 2014, 07:55:56 am |
|
|
Location: Oxford, England Joined: Aug 2014
Posts: 157
|
Ok, so I have found that it is not anything to do with collision_line It is to do with the script being executed, for some reason ENIGMA does not like how the script is being executed for a specific object through another object or something.
|
|
|
Logged
|
Computer Scientist, Programmer in C#, C/C++, Java, Python, GML, EDL, and more. Hobbyist musician. DISCORD: HitCoder#4530
|
|
|
|