Page 1 of 2

A working Sonic Engine?

PostPosted: Sat Oct 02, 2010 8:38 am
by CrimsonTheDarkBat
Hey all, just wondering has ANYONE made a fully working Sonic Engine for GE? I've been searching for one FOREVER, and my own attempts at coding one myself have epically failed. So, if theres a Sonic base with physics as close to the original as possible, please let me know, thanks! :D

Re: A working Sonic Engine?

PostPosted: Sat Oct 02, 2010 9:42 am
by savvy
there isnt currently, but it could be done. the hardest bit is the angles, thats the problem :S

Re: A working Sonic Engine?

PostPosted: Sat Oct 02, 2010 2:13 pm
by SuperSonic
"Sonic? *gasp* Did somebody say Sonic *double gasp* LOL :lol: :lol: :lol:

Re: A working Sonic Engine?

PostPosted: Fri Nov 26, 2010 4:14 pm
by Waluigiftw
Well, it might not have been made with GE, but its still fun, just run GENS+ (not the other ones, theyre really slow and glitchy) and click file -> open rom -> look in the roms file included, and i gave you a bunch of sonic games and some of my other favorites too :mrgreen: :mrgreen: Go nuts!

*HINT*- Uhhhhhh, you could always rip some sprites from this.... CHeers
Oh and by the way, this is in a .tar format (best compression) 7zip should be able to handle it :mrgreen:
http://www.multiupload.com/QR5UUYB2RT

Re: A working Sonic Engine?

PostPosted: Fri Nov 26, 2010 6:14 pm
by lcl

Re: A working Sonic Engine?

PostPosted: Wed Dec 01, 2010 12:31 am
by BloodRedDragon
The loops would also be very hard to do(that is, if you're thinking of doing loops). You would either need very clever physics, or a path that activates when the player goes through the loop. :)

Re: A working Sonic Engine?

PostPosted: Thu Dec 02, 2010 10:31 pm
by Waluigiftw
Yeah, loops would be dificult, because if your going through a loop and you stop, you fall out of it.
I also think that it has the potential to run slow if improperly assembled or if you overdo it with the graphics.
I guess that SEGA had a leg up on us :roll: :mrgreen:

Re: A working Sonic Engine?

PostPosted: Sat Jan 01, 2011 5:36 pm
by CrimsonTheDarkBat
Thanks guys.

Yeah, I'm gonna stick with paths for loops since it seems the easiest way around the matter.

Re: A working Sonic Engine?

PostPosted: Sun Jan 30, 2011 4:56 am
by 247wkman
edit post too long: making piont shorter . paths are fixed from actor start point so they will be inflexible and unnatural unless they are used to put sonic throught those tunnels etc.
to run sonic through a loop (the loop itself will be made up of several peices with collision to just one side to allow running into and out of but not streight though and may requre additional trigger features to prevent sonic switching in and out of the loop segments just by bumping into them)

imaginge you loop path- now place markers along it at say every 45 degrees. when sonic runs into the loop, each time he hits a marker, his gravity dirction will change for a brief instant- all the control directions will change to mach his orientation so if he hits half way up he is facing up- the forward movements will change to move upward, backward would be down and up/down would change to left/right. these changes would take place over 45 degree intervals so he should be able to propergate his forward motion through the loop but only if he is moving fast enough. if he is moving too slow the angle change will revert to standard and he will fall to the ground. it would require sonic to meet a speed condition so the markers won't trigger unless he is running into them.

another approach is not to use multiple markers but to say "when sonic collides with the loop a formula of his speed and angle will begin so that the angle would change over time in relation to his speed. the formula would have to be different if the loops are different in size.

Re: A working Sonic Engine?

PostPosted: Sun Jan 30, 2011 5:24 am
by Waluigiftw
^^^247wkman i think i now love you (as a brother of course)
but i think that that would actually work, i looked some shiz up and essentially, that IS how SEGA did it,
when you mentioned gravity i had a thought, why not put a bunch of if-then statements in the draw actor event of sonic that checks if those "markers" are being collided with using variables, then set directionalVelocity and angle to whatever you need!!
+point for 247wkman
i never would have thought of that

-> example of what draw actor event of sonic would look like
if(marker==1)
{
directional_velocity+=.5;
angle=360;
}
^^ i dont even know if that would work but there really isnt anything to say that it wouldnt

Re: A working Sonic Engine?

PostPosted: Sun Jan 30, 2011 4:44 pm
by 247wkman
Waluigiftw: wow, thanks- didn't notice your post when i decided to re-edit my first one- so if it looked like i re wrote what you said (refurning to my non programmer's conceptualisation of code speak, on animation switching)- i was actually just ironing out the kinks of my original draft. like i said- its kinda obsesive to need to know how to portray every dynamic concept- i would be very upset if it could not be done! (also wondering how to climb a rope that maybe swinging and changing angles, fire an arrow with range control, swim etc. essentially i wish to make an adventure game that more or less exploits every dynamical concept i can think of! i know story and concept comes first but i'm obsessive on details- i made my original post at 4am...god help me.

Re: A working Sonic Engine?

PostPosted: Mon Jan 31, 2011 12:19 am
by Waluigiftw
Its cool, and if your maing an adventure game, then check out my game viewtopic.php?f=4&t=9829 the first post has the source files, and yes my code looks like crap...but it all works! I have implemented arrows and aiming them and tons of other stuff, im going to work out swimming using a single variable and a filled region, so ill keep you updated, and you could always just ask me for help if you dont understand something :)

Re: A working Sonic Engine?

PostPosted: Mon Jan 31, 2011 5:21 pm
by 247wkman
the sonic loop thing another problem i thought of was that the loop would have to be made in two pieces. otherwise it would just be a box with a circly hole in it! you would have the first piece consisting of the entry ramp moving up, round the top and half way down- your second piece would continue the loop which would sit behind it in zdepth (of couse it will look like one piece) and to make it work you need a collider sitting at the end of the first piece so you can trigger sonics z depth to change so he is in the same depth as the second piece in order to collide/run on it and maybe a last maker to trigger him back into standard z when leaving that half (it seems quite precarious- it would have to work both ways as would the gravity triggers and i fear you could eaily be triggered into z depth oblivian! ever got stuck in a wall playing sonic? i did and that is why it sucks if you can't save!) edit: (i got this wrong ignore it)

Re: A working Sonic Engine?

PostPosted: Mon Jan 31, 2011 10:39 pm
by Waluigiftw
Well,another problem that might arise is whenever sonic is going around a loop, say to the right, if you just hold right he'll go all the way around as long as you hold down right, however in GE making the KEY_DOWN event simply alter his xvelocity would not work, so you would have to have a TON of if-then statements that check that same variable that controls his "gravity" in game, this way, it would change the "run right" from a right, to an up, to a backwards, then down, then right again

i dont think it would be hard to do, it would just take a dedicated person who has nothing better to do, but right now i have a project of my own, and i really want to finish it officially, sooooooo someone else make this sonic coding marvel

Re: A working Sonic Engine?

PostPosted: Tue Feb 01, 2011 3:12 pm
by 247wkman
yet again i get this wrong! 7 pieces it consisted of in the end, at least by how i played through it in my head (i modeled it in blender and broke it down, so i can rework them as needed) i list the conponants in order of contact as you would run through the loop from the left side.

sonic loop dynamic & construction
topZ is entry half of visible loop
bottomZ is exit half of visible loop
piece #1 is bottom right (with little bit of floor) entry collider
piece #2 is top right of enty collider (trigers collide with #1 to on and #4 to off- for running the opossit way).
piece #3 is top left of exit collider (trigers #4 to on and #1 to off).
piece #4 is bottom half of exit.
piece #5 is top collision platform, give space for trigers (rub out just above to top curve).

these conditions apply to indivual actors- a 'create' and 'destroy' approach to the colliders will work for one player but for two would be like two people trying to switch of a light at using two switchs at the same time! also a condision of being eiter side of the platform is needed incase sonic backtracks over the top.

Did an animation of the collision actors- the top ones light up to indicate they are the trigers, the bottom ones disapear to show they have been removed as collision actors (not destroyed). you will see the top right light up as the player passes over it but nothing happens because the player has entered from the left side so the result would have already set (just play vid in reverse) i can re shape these as needed if anyone would like to use the templates.

It would be better to turn of the triggers too after contact with the lower loop forms (so sonic wont bump into them if he jumps under them) but i only just thought of that. end