Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Game Maker Sonic Engine Help


Recommended Posts

I REALLY dunno if i should post it here or in the showcase section (or somewhere else). Else mods, feel free to move this topic.

------------------------------------------------------------------------------------------------------------------------

So hm. I'm trying to do a Sonic Engine (which is actually based on the Sonic Revival Engine... An engine based on an engine, wierd) engine. I've just started doing it yesterday, so it has not much added for now. I want somehow (even though it will be hard, i know) to make the most Complete Sonic Engine possible, with both classic and modern characters and gimmicks. For now i'm working on the modern part however. Anyways here's some info about it!

 

I've currently added: Ramps, Dash Rings, and Rainbow Rings. That is all i added for now.

I modified a little bit sonic animation due to running being glitchy (Sonic goes walking then running then walking then running etc.). however now the whole animation system gliches. That's minor glitches but still.

 

Pics!

217s7r.png

2da0xux.png

2lapnpv.png

 

Download (Current Version): https://www.dropbox.com/s/zatmzdu3kxxtwks/SonicRE0.3.exe

 

Credits, Version log

The Sonic Revival Engine Modified



I made the engine MODIFICATIONS. I didn't make the original engine at all.

ENGINE CREDITS:
The Sonic Revival Engine Modified

I made the engine MODIFICATIONS. I didn't make the original engine at all.

ENGINE CREDITS:
TechnoSuperguy -For helping me fix many ringloss problems
Damizean -For engine base
Rougeyoshi -For Sonic 3 shields + sprites + HUD
Alex Z -For sprites
Kain -For checkpoints
Chaos Rush -For compiling this engine
Some people that i forgot and that i used their sprites/other things. (sorry for forgetting ;_ ;)

CONTROLS:
Right -Move right
Left -Move left
Down -Look down
Space -Jump
Down+Space-Spindash
Right/Left+Down -Rolling
Z -Lightdash
Fire Shield+Space+Space -Air Dash
Water Shield+Space+Space -Air Bounce
Electric Shield+Space+Space -Double Jump


VERSION LOG | + = addition | * = changes/bugfixes | - = removal | O: = other stuff (like comments etc) |
Day 1 - Version 0.1: First day, first release on Dropbox.
+ Added Jump Pads + sprites
+ Added Dash Rings + sprites. Not all of them are there yet.
* Modified Sonic Sprite order (minor)

Day 2 - Version 0.2
+Added Rainbow Rings + sprites
+Added a new test stage
+Added sounds for all new objects i said previously (including 1st day one)
* Fixed some stuff about Rainbow Rings and Dash Rings.
- Removed the old test stage
O: Trying to fix the sound glitch and collision glitch... fail.

Day 3 - Version 0.2.5 - This one is rather minor so yeah.
+Started to work on the classic part and i added a classic spring. Goes only upwards for now but i'll add more.
*Started to fix the Dash Ring and Rainbow Ring collision glitch.

Day 4 - Version 0.3
+Continued adding classic springs. Added yellows and reds + sprites + sounds.
*Dash Ring and Rainbow Ring glitch still not fixed.
*Modified the test stage so it features the classic spring test. And backgrounds.

 

Anyways, now i need help for two things for now

- When collision happens with Sonic and the dash/rainbow rings, it collides every frames into it. So as result, it does an ANNOYING sound effect spam.

- Sonic's animation is a bit messed up due to the modifications i made...

 

So yeah, if anyone could help... thanks in advance ^^

 

Oh also excuse me for any spelling and grammar errors, i'm french so yeah (my english is more then comphrensible however, dont worry). And plus, i'm rather tired right now, so yeah.

Edited by kyllian1212
Link to comment
Share on other sites

If the sound keeps starting you can use sound_is_playing to check if a sound is already playing. If it is then simply do not play the sound again. A better method might be to use a variable that changes values when you hit a wall.

 

collision event:

if collision == false {

     sound_play(sound);

     collision = true;

}

 

step event: // checks if 

if place_meeting(x, y, objWall) {

   collision = false;

}

 

This will sort of work but the trouble is it will detect floors too, assuming they are the same objects. In which case you will want to look into bbox boundaries and check for collisions against those. But you will need the ID of the wall you are touching to do that. Do you know if your engine gives you the instance id for the current wall you are touching?

Link to comment
Share on other sites

Well i would like the sound to play once per object, since it also basically hits it every frames. Actually i don't think the sound is the problem. The collision is, rather.

But for now, i attempted something with the sound:

           

            if not sound_isplaying(sndDashRing)
            sound_play(sndDashRing)
            else
            ??

Except i dunno what to put to make it play the sound once per object.

But since it's a collision problem, i guess fixing the collision in priority (so it hits the object just once per collision) and will also fix the sound problem.

 

Also, i guess it gives me the instance id in the room menu, not directly in game.

 

Else i could PM you the GMK if that can help? I use Game Maker 8, however.

Edited by kyllian1212
Link to comment
Share on other sites

Basic pseudo code:

var collision;
var last_collision;

on begin step event:
last_collision = collision;
collision = false;

on collision event:
collision = true;
if collision and not last_collision
just collided; perform stuff

on end step event:
if not collision and last_collision
stopped colliding; perform stuff
Edited by VectorSatyr
Link to comment
Share on other sites

Dunno if what i did is correct, but i get this:

___________________________________________
ERROR in
action number 4
of Begin Step Event
for object objSonic:

Error in code at line 4:
   last_collision = collision;
                    ^
at position 19: Unknown variable collision

___________________________________________
ERROR in
action number 8
of End Step Event
for object objSonic:

Error in code at line 4:
   if not collision and last_collision;
          ^
at position 9: Unknown variable collision

 

Should i send the GMK or something?
 

Edited by kyllian1212
Link to comment
Share on other sites

Okay, started to fix it now, i'll probably continue tommorow.

Today progress:

 

Day 3 - Version 0.2.5 - This one is rather minor so yeah.
+Started to work on the classic part and i added a classic spring. Goes only upwards for now but i'll add more.
*Started to fix the Dash Ring and Rainbow Ring collision glitch.

 

EDIT: Also, once again:

 

Am i allowed to post a sort of preview version each time i do a new version? This could help people to know what happens if there a problem.

Edited by kyllian1212
Link to comment
Share on other sites

Progress!
Day 4 - Version 0.3
+Continued adding classic springs. Added yellows and reds + sprites + sounds.
*Dash Ring and Rainbow Ring glitch still not fixed.
*Modified the test stage so it features the classic spring test. And backgrounds.

 

Since i guess i'm allowed to post a download, here's an EXE: https://www.dropbox.com/s/zatmzdu3kxxtwks/SonicRE0.3.exe

Don't expect anything huge however. It just features a test stage.

Link to comment
Share on other sites

  • 2 months later...

What I'd do for the rainbow rings is have a variable that sets weather sonic triggers the sound effect or not. In this case, I'm going to call the variable "affected"

If you were to use GML for this, I'd put something like this in the collision with Sonic event of the Ring. It will replace the current sound playing script that you have, or else it will stay screwy.

 

if affected=0
{
audio_play_sound(ringsound, 10, false)
affected=1
alarm[0]=15
}
 
How this works:
If the affected variable is equal to 0 it will play a sound and set affected to 1. This way the sound will no longer play EVER
AGAIN (until the variable affected is set back to 0.)
 
This is where the alarm[0]=15 thing comes in. if your room is at the speed of 30, then 15 will be have a second in game time. Replace alarm 0 with any alarm you haven't used yet. You may have to fiddle a bit with your alarm time in order to get the sound glitchless. 
 
Create a event for the alarm that you put in (in my example, 0) and give it a single piece of code:
 
affected=0
 
This resets the variable, so you can play another sound when you come into contact but it will make no annoying overlap. 
If you meant that you wanted to set all rings to not play any sounds, replace all the times you put affected with ringobject.affected. This will set all ring objects affected variables to 0. I recommend trying both methods and seeing which one you prefer.
Kind of a dumb workaround but it works.
Edited by deathbob
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...