Author Topic: I Wanna Be The Studio Engine YoYoYo Edition  (Read 49502 times)

YoYoYoDude1

  • Wannabe
  • Posts: 35
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 44.0.2403.157 Chrome 44.0.2403.157
    • View Profile
  • Playstyle: Keyboard
I Wanna Be The Studio Engine YoYoYo Edition
« on: August 23, 2015, 12:39:54 PM »
Hey everyone!
So while GameMaker 8.1 is no longer officially available and GM Studio is a nice newer, free option for making fangames, I felt like I should make an engine with most of the features contained within current GM 8.1 engines and share it with people that want to give GM Studio a shot.

If you're new to fangame development, check out this awesome tutorial made by Klazen! https://klazen.com/IWBTG/tutorial/dev_tutorial.html

About
  • This is an engine specifically made for GameMaker Studio with all of the weird physics bugs/changes Studio has fixed.
  • This engine assumes you have a reasonable amount of experience with GameMaker and requires basic GML knowledge for things like playing music.
  • The engine package includes the standard engine and a lite version which cuts out extra resources.

Features
  • Works the same as other standard engines, with cleaner code and annoying bugs like dying through platforms fixed
  • Includes a main menu system with options menu based off the KS engine
  • Includes gravity flipping, vines, jump refreshers, and other frequently used gimmicky objects
  • Includes slopes that support any shape
  • Includes native controller support
  • Built-in save verification system with MD5 hash checks to make saves harder to hack
  • Mute/unmute music with Ctrl+M
  • Stretchable window size (reset with F5)
  • Pause screen that shows deaths/time with volume controls
  • Includes toggleable debug keys ("Tab" to drag player to mouse, "Backspace" to toggle debug overlay, "Ins" to save, "Del" to toggle showing the hitbox, "Home" to toggle god mode, "End" to toggle infinite jump, "Page Up" to go to next room, "Page Down" to go to previous room)
  • Several options for many things you might want to change for your game (such as enabling/disabling death music) in the "scrSetGlobalOptions" script

Important notes
  • To set what music you want a room to play, change the "scrGetMusic" script. You can also place an objPlayMusic object in the room and set the variable "BGM" in its creation code. If you want something to stop music, use "scrStopMusic".
  • A template room that has all of the correct view settings is included which can be duplicated and modified.
  • If you're using slopes, it's possible that certain gimmicks such as ice blocks might not work properly with them because of how they're coded.
  • Because of how GM Studio saves files, all game saves are stored in "%localappdata%\<GameName>" instead of inside the folder where the game is located. Therefore, it is very important to change your game/project name to something unique before releasing your game to ensure there aren't save conflicts with other games.
  • Make sure to set the "global.debugMode" variable in the "scrSetGlobalOptions" script to "false" before releasing your game, otherwise debug keys will still work.
  • Make sure to set the "global.md5StrAdd" string in the "scrSetGlobalOptions" script to something unique to your game to make saves harder to modify. This can be set to anything you want it to be, but it should be pretty hard to predict as it's kind of similar to a password.
  • When creating new objects, the order of the objects in the Objects list matters for collision/event order. Therefore, when making new objects try to keep the type of object in the corresponding folder to prevent collision issues (ie put block objects in the blocks folder, player killers in the killers folder, etc).
  • Even though the engine supports it, if you are using the free version of GM Studio, the window caption is unable to be changed.
  • This version of the engine was made and tested in GM Studio v1.4.1763. If you are using a different version of GM Studio, there could be potential bugs as they sometimes tweak how things work in certain versions.

Download
I Wanna Be The Studio Engine YoYoYo Edition v1.51

GitHub repository (Main engine)
GitHub repository (Alternate lite version with only core features)

Changelog:
Code: [Select]
v1.51 (05/21/17):
-Changed ds_map_write/read back to json_encode/decode
-Changed lite version to be the same as the base engine except with less extra resources

v1.50 (01/04/17):
-Added global.playerAnimationFix option which fixes the weird player animation inconsistencies when moving around (disabled by default)
-Added debug mode indicator to the title screen when debug mode is active
-Changed default death music mode to no music
-Tweaked main menu cursor so that it stays in the same place after switching between different menus
-Added support for DirectInput gamepads
-Added separate debug variables for global.noDeath and global.infJump called global.debugNoDeath and global.debugInfJump
-Tweaked platform and slip block logic to fix some minor issues

v1.42 (11/29/16):
-Changed global.saveRoom to use room names instead of room indexes
-Reverted json_encode/decode back to ds_map_write/read (json_encode/decode causes some issues when saving booleans)
-Removed button text from the start screen
-Disabled precise collision checking for sprites that don't need it

v1.41 (10/13/16):
-Updated project to GM Studio v1.4.1763
-Added an option to fix the behavior when tapping left/right for less than 1 frame so that the player moves for 1 frame (by default he doesn't move when this happens)
-Changed save files to use json_encode/json_decode instead of ds_map_write/ds_map_read to prevent memory leaks
-Added a check to objWorld to make sure more than one never exists

v1.40 (09/07/16):
-Now includes a lighter version of the engine which simplifies the engine and cuts out extra resources/features
-Changed some menu arrays/variables to be more consistent
-Fixed more minor issues

v1.32 (08/23/16):
-Added an option to change the number of secret/boss items for the game to use (set to 8 by default)
-Added an option to autosave secret items when they're grabbed instead of having to save afterward (disabled by default)
-Changed some view_wview/view_hview to view_wport/view_hport to improve death text/pause screen behavior when changing the camera zoom
-Changed secret/boss item arrays to start at 0 instead of 1 (by default they go 0-7 instead of 1-8)
-Fixed a few minor issues

v1.31 (04/30/16):
-Added global option for whether to use ds_map_secure functions to save (disabled by default)

v1.30 (04/23/16):
-Added native controller support with automatic switching between keyboard/controller (Thanks chalenged for the help!)
-Added slopes (supports any shape)
-Added a warning prompt before overwriting a save on the difficulty select menu
-Added objOutsideRoomChanger which allows for smooth warp room transitions
-Added slight title screen text animation
-More minor tweaks/fixes

v1.22 (02/08/15):
-Rewrote save system to use maps instead of lists (they are now stored using ds_map_secure functions to improve save security and prevent transferring between PCs)
-Added moving platforms that don't bounce off of walls
-Added scrDrawTextOutline for outlined text on the debug info overlay (Thanks Archee for the suggestion!)
-Tweaked main menu layout
-Changed a bunch of 0/1 to false/true to improve code readability
-Removed/tweaked global.player_xscale, global.player_djump, global.savePlayerXScale, and global.debugOverlayColor to simplify code logic
-Other minor tweaks/fixes

v1.21 (11/20/15):
-Added vsync option
-Added stopping death sound when pressing "R"
-Some minor tweaks

v1.20 (11/9/15):
-Rewrote save system to use lists for saving instead of bytes
-Rewrote config system to use ini files
-Changed in-game timer to use delta_time for better accuracy
-Added scrStopMusic() to more easily stop current music
-Tweaked save system to not always load data from the file when pressing "R" to improve performance
-A bunch of minor tweaks/fixes

v1.15 (10/21/15):
-Fixed some buggy platform behavior when gravity is flipped

v1.14 (10/18/15):
-Tweaked vines to fix weird behavior when directly above/below a block with a vine on it
-Tweaked vines to fix getting stuck while on the ground
-Added saving the player's xscale to the save file
-Changed default jump refresher refresh time to 100
-Changed objKillerBlock to be visible
-Changed the way blood snaps to walls to look better (Thanks to patrickgh3!)
-Added "scrSetPlayerMask" which sets the player's mask_index according to the current gravity
-Tweaked scripts for better readability
-Other minor tweaks/fixes

v1.13 (10/4/15):
-Enabled being able to stretch the game window (Window size can be reset to the default by pressing F5)
-Changed screen smoothing from always changing when toggling fullscreen into an option to turn it off/on whenever (using the options menu or F3 to toggle)
-Tweaked the player draw to not round the player's position
-Renamed "scrInitializeVariables" to "scrInitializeGlobals"
-Renamed "scrConfigVariables" to "scrSetGlobalOptions"
-Organized scripts into folders
-Tweaked "scrPlayerJump" to give the player a djump if touching objWater3
-Added "refreshTime" variable to jump refreshers to customize how long until you can use them again
-Removed idle swaying movement for jump refreshers
-Changed save points to have a depth of 1
-Some other minor changes

v1.12 (9/29/15):
-Fixed a small saving exploit
-Added global.autosave variable for easily doing autosaves when the player is created
-Added objWarpAutosaveNext which goes to the next room and autosaves
-Added being able to use -2 in scrGetMusic in case you don't want it to affect a room's music at all (useful for bosses where you want other objects to control music)
-Changed player draw code to include image_xscale and image_yscale in case they're changed

v1.11 (9/22/15):
-Moved some pieces of code to scripts (scrFlipGrav, scrRestartGame, scrSetFullscreen, scrToggleMusic)
-Renamed scrGetControl to scrGetKeybind
-Disabled showing the splash screen by default
-Changed the bow so that it doesn't lag behind the player by a frame (there's a setting in scrConfigVariables to make it delay if you want it to)

v1.10 (9/20/15):
-Updated collision code to work better with the new version of GM Studio (v1.4.1657)
-Added showing current binds in controls menu
-Fixed another possible case of saving in a wall
-Changed key rebinding so that if you bind to a shift key, it still works for both shift keys
-Changed platform objects to have a depth of 1
-Added more comments to scripts

v1.03 (9/12/15):
-Fixed part of the difficulty select not using global.menuSound
-Fixed another rare bug involving music variables not getting initialized properly

v1.02 (9/8/15):
-Enlarged the save point hitbox so touch saves work on edges of blocks
-Fixed a very rare bug involving music variables not getting initialized properly

v1.01 (9/6/15):
-Fixed warp room mode for file difficulty select not working properly
-Tweaked game muting/unmuting using Ctrl+M to work properly when using objPlayMusic

v1.0 (9/4/15):
-Added debug overlay (toggle with backspace)
-Updated objSign to display text instead of using show_message
-Added configurable variable for which sound to use for navigating the menu
-Added volume control to the options menu
-Added randomize() when the game is started to start with a random seed for RNG (Studio starts with the same initial seed every time you run the game)
-Added scrPlayMusic script to make it easier to change songs
-Added objPlayMusic for people who don't want to use the scrGetMusic method of playing music
-Added example Miku avoidance (Thanks to Stinkycheeseone890 for designing it!)
-Some other minor changes/fixes

v0.9 (9/1/15):
-Added main menu system based off the KS engine that has options and rebindable controls
-Added saving fullscreen mode in the config file

v0.8 (8/31/15):
-Fixed the player sometimes getting stuck on the sides of objSlideBlocks
-Fixed game not restarting properly when pressing R and F2 on the same frame
-Fixed texture interpolation setting bugging out when pressing F2+F4 on the same frame
-Changed it so that you can't switch between fullscreen on/off when the game is paused (this caused the pause surface to be lost)
-Added a variable to customize the speed of objSmoothCamera
-Changed default case for scrGetMusic to play nothing instead of musGuyRock
-Changed font naming
-Fixed the player occasionally drawing abnormally
-Set debug mode off by default
-Added a variable for whether or not to show the debug player visual changes when inf jump/god mode are toggled
-Some other minor changes/fixes

v0.7 (8/29/15):
-Implemented save verification system with MD5 hash checks to make saves harder to hack

v0.65 (8/27/15):
-Fixed a bug where right vines wouldn't always work properly

v0.6 (8/26/15):
-Implemented pause screen that shows deaths/time
-Implemented volume control in the pause menu (Updated config file to save the volume level)
-Made objGameClear autosave when touched
-Optimized objMovingPlatform performance
-Merged objMusicFade into objWorld
-Fixed the player moving when standing still for a long time on objSlipBlock
-Fixed a case where the player could save inside of a wall

v0.5 (8/23/15):
-Initial release
« Last Edit: May 21, 2017, 06:34:10 AM by YoYoYoDude1 »

lawatson

  • The Kid
  • Posts: 331
  • I do things and I make things.
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 44.0.2403.155 Chrome 44.0.2403.155
    • View Profile
  • Playstyle: Keyboard
Re: I Wanna Be The Studio Engine YoYoYo Edition
« Reply #1 on: August 23, 2015, 01:24:44 PM »
based codegod appears with yet another treat

Thanks for taking time to make this engine, I'll totally use it when I end up finally defecting to studio.
(click to show/hide)

smoke weed everyday

BaronBlade

  • Spike Dodger
  • Posts: 140
  • bees?
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Chrome 43.0.2357.134 Chrome 43.0.2357.134
    • View Profile
  • Playstyle: Keyboard
Re: I Wanna Be The Studio Engine YoYoYo Edition
« Reply #2 on: August 23, 2015, 11:16:56 PM »
Of course this happens the day after I start using the KS engine :BibleThump:
I'm definitely going to use this for most of my games, though!
bean!

Wolsk

  • The Kid
  • Posts: 332
  • Wolsky McKitty :3
  • OS:
  • Linux Linux
  • Browser:
  • Chrome 44.0.2403.133 Chrome 44.0.2403.133
    • View Profile
  • Playstyle: Keyboard
Re: I Wanna Be The Studio Engine YoYoYo Edition
« Reply #3 on: August 24, 2015, 12:16:53 AM »
meow :3

Why are you complaining about being a meme? this is a positive thing

Archee

  • Wannabe
  • Posts: 11
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 40.0 Firefox 40.0
    • View Profile
  • Playstyle: Keyboard
Re: I Wanna Be The Studio Engine YoYoYo Edition
« Reply #4 on: August 24, 2015, 02:15:39 PM »
Hey, you've made a massive work. That's really awesome.
Do you need any help, by the way, to create the engine faster? I've made a simple pause, it works pretty well, I think. If you like it, I can post a diff with version 0.5 here. :)

Edit: found a bug, when you can't complete the game on impossible mode, because objGameEnd doesn't save you and there's no savepoints in the end room.
« Last Edit: August 24, 2015, 04:45:22 PM by Archee »

YoYoYoDude1

  • Wannabe
  • Posts: 35
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 44.0.2403.157 Chrome 44.0.2403.157
    • View Profile
  • Playstyle: Keyboard
Re: I Wanna Be The Studio Engine YoYoYo Edition
« Reply #5 on: August 25, 2015, 03:31:15 PM »
Hey, you've made a massive work. That's really awesome.
Do you need any help, by the way, to create the engine faster? I've made a simple pause, it works pretty well, I think. If you like it, I can post a diff with version 0.5 here. :)

Edit: found a bug, when you can't complete the game on impossible mode, because objGameEnd doesn't save you and there's no savepoints in the end room.
Oh yeah sure, I'd like to see how you implemented the pausing. I tried a couple different methods but nothing worked as well as I wanted it to.
And thanks for letting me know about the objGameEnd thing. I'll just make it so that it autosaves you when you touch it.

Archee

  • Wannabe
  • Posts: 11
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 40.0 Firefox 40.0
    • View Profile
  • Playstyle: Keyboard
Re: I Wanna Be The Studio Engine YoYoYo Edition
« Reply #6 on: August 25, 2015, 06:22:30 PM »
Well, there's too many shitty changes I've made, so I'm just going to explain how I've made it insteat of posting it here.

Changed code is this:
Code: [Select]
if (keyboard_check_pressed(global.pausebutton) && !global.noPause) {
    global.pause = !global.pause;
    if( global.pause ) {
        instance_deactivate_all(true);
        surface_copy(global.pause_surf,0,0,application_surface);
    } else {
        instance_activate_all();
    }
}

So, I'm making a pause surface at the start of the game in variable initialization script and added a clear memory script to delete it if you press F2, but it'd be much better to not restart the game and ust move to the title again, because it does the same work all over again if you restart game. It'd be harder to make, I think, I didn't look into the whole code. Also, you need to add a check for a pause to not to increment time while paused. Oh, and I almost forgot to post draw GUI code of objWorld:
Code: [Select]
var str, off, th, tm, ts;

if(global.pause) {
    draw_clear(c_black);
    draw_surface_ext(global.pause_surf,0,0,1,1,0,c_white,0.5);
    draw_set_color(c_white); //Font color
    th = floor(global.time/(60*60));
    tm = floor((global.time/60) mod 60);
    ts = floor(global.time mod 60);
    str = "Time: "+string(th)+":"+string(tm)+":"+string(ts);
    off = view_hview - string_height(str)-8;
    draw_text(8+string_width(str)/2,off,str);
    str = "Deaths: " + string(global.death);
    off = off - string_height(str)-8;
    draw_text(8+string_width(str)/2,off,str);
   
    str = "PAUSE";
    draw_text(view_wview/2,view_hview/2,str);
}

Offsets maybe broken a bit, I've expected it to be drawn from a top-left corner and not from a center.

YoYoYoDude1

  • Wannabe
  • Posts: 35
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 44.0.2403.157 Chrome 44.0.2403.157
    • View Profile
  • Playstyle: Keyboard
Re: I Wanna Be The Studio Engine YoYoYo Edition
« Reply #7 on: August 27, 2015, 12:10:19 AM »
Well, there's too many shitty changes I've made, so I'm just going to explain how I've made it insteat of posting it here.

Changed code is this:
Code: [Select]
if (keyboard_check_pressed(global.pausebutton) && !global.noPause) {
    global.pause = !global.pause;
    if( global.pause ) {
        instance_deactivate_all(true);
        surface_copy(global.pause_surf,0,0,application_surface);
    } else {
        instance_activate_all();
    }
}
Oh awesome, thanks! I didn't realize you could copy the application surface like that. That's a pretty good way of doing the pausing.
Anyway, I just updated the original post with version 0.6 of the engine that has the pause screen implemented and a very other misc fixes/changes.

Archee

  • Wannabe
  • Posts: 11
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 40.0 Firefox 40.0
    • View Profile
  • Playstyle: Keyboard
Re: I Wanna Be The Studio Engine YoYoYo Edition
« Reply #8 on: August 27, 2015, 04:33:23 AM »
Sometimes vines are not working (the right one), I wasn't able to reproduce it again. I guess if this is a mistake that causes the bug:
Code: [Select]
if (distance_to_object(objWalljumpL) < 2 && place_free(x,y+(global.grav)))
...
if (distance_to_object(objWalljumpR) == 1 && place_free(x,y+(global.grav)))

Edit: I got it, it's because of slip blocks which make player coordinates being changed to something like N + 0.5 exactly, works with everything else. Changing == 1 to < 2 seems fixing it.
« Last Edit: August 27, 2015, 07:25:33 AM by Archee »

YoYoYoDude1

  • Wannabe
  • Posts: 35
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 44.0.2403.157 Chrome 44.0.2403.157
    • View Profile
  • Playstyle: Keyboard
Re: I Wanna Be The Studio Engine YoYoYo Edition
« Reply #9 on: August 27, 2015, 07:51:36 PM »
Sometimes vines are not working (the right one), I wasn't able to reproduce it again. I guess if this is a mistake that causes the bug:
Code: [Select]
if (distance_to_object(objWalljumpL) < 2 && place_free(x,y+(global.grav)))
...
if (distance_to_object(objWalljumpR) == 1 && place_free(x,y+(global.grav)))

Edit: I got it, it's because of slip blocks which make player coordinates being changed to something like N + 0.5 exactly, works with everything else. Changing == 1 to < 2 seems fixing it.
Based sub-pixels causing another bug. Thanks for letting me know, just uploaded a fix.

Anon70000

  • Cherry Eater
  • Posts: 50
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Firefox 39.0 Firefox 39.0
    • View Profile
  • Playstyle: Keyboard
Re: I Wanna Be The Studio Engine YoYoYo Edition
« Reply #10 on: August 28, 2015, 06:21:45 AM »
  • Muting sound effects on reset
if (keyboard_check_pressed(vk_f2))
{   
    audio_stop_all();
    game_restart();
}

?

pieceofcheese87

  • Global Moderator
  • The Kid
  • Posts: 346
  • Personal Text
  • OS:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 44.0.2403.157 Chrome 44.0.2403.157
    • View Profile
    • Twitch Tv Channel
  • Playstyle: Keyboard
Re: I Wanna Be The Studio Engine YoYoYo Edition
« Reply #11 on: August 28, 2015, 07:19:19 AM »
Pretty sure he means when you press R, not F2.
Signature

YoYoYoDude1

  • Wannabe
  • Posts: 35
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 44.0.2403.157 Chrome 44.0.2403.157
    • View Profile
  • Playstyle: Keyboard
Re: I Wanna Be The Studio Engine YoYoYo Edition
« Reply #12 on: August 28, 2015, 03:01:29 PM »
Yeah I meant restarting when pressing R.
The issue is that there's no simple way to stop all of the sound effects without also stopping the music and having it restart. There's a feature in Studio that could probably help with this (audio groups), but this feature is only available in the Professional Version so I don't want to use it in this engine.

YoYoYoDude1

  • Wannabe
  • Posts: 35
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 44.0.2403.157 Chrome 44.0.2403.157
    • View Profile
  • Playstyle: Keyboard
Re: I Wanna Be The Studio Engine YoYoYo Edition
« Reply #13 on: August 29, 2015, 08:08:24 PM »
Okay, I just uploaded v0.7 of the engine with a new feature I've been wanting to implement.
There's now a built-in save verification system that uses MD5 hashes to make sure the save being loaded hasn't been tampered or modified outside of the game. This should make save hacking in games made with this engine reasonably more difficult.
« Last Edit: August 29, 2015, 08:31:00 PM by YoYoYoDude1 »

lawatson

  • The Kid
  • Posts: 331
  • I do things and I make things.
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 44.0.2403.157 Chrome 44.0.2403.157
    • View Profile
  • Playstyle: Keyboard
Re: I Wanna Be The Studio Engine YoYoYo Edition
« Reply #14 on: August 30, 2015, 03:27:50 AM »
damn that's sick.
(click to show/hide)

smoke weed everyday