MultiGame

From RocketLauncher Wiki
Revision as of 18:41, 23 January 2017 by Djvj (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

HOW TO SETUP MULTIGAME SUPPORT:

What this is:
A long awaited feature requested by many over the years and has used up most of my free time over the past month to create. This gives you the ability to swap a game disc/disk/tape while playing an emulator, using a friendly and highly customizable GUI.

Why do I need this?:
Have you ever played a game and it asks you to insert Disc 2 and you say to yourself "well this sucks, I have to unmount this game or select File->Open, find the new game, then load/mount it" just to continue playing? Many systems from old cartridge and tape based ones to the latest DVD ones require some sort of disc swap to occur at some point in the game. This does all the work for you by popping up a GUI and automagically finding the games and only showing you ones that match what you already have running!

Features:

  • Customizable Image artwork - (use the default ones provided for you or create your own. It will space your images across the screen evenly for you!)
  • Use your HS Artwork (Disc/Disk/Tape Scans) - (Instead of the provided defaults, you can optionally use these images, You only have to turn this feature on and set the Artwork folder your files are in. MG will load your artwork directly from your Artwork folder.)
  • Customizable Default or Per-rom Background Image support - (will load a default.png in your Media\MultiGame\systemName\ or a romname.png one if it exists)
  • Customizable Background Color - (this is default when an image does not exist, you can change it to any color and set it's opacity if you prefer to see what's going on underneath)
  • Customizable Text - (Don't like the default greeting? Have it say what you want! You can change many aspects of the text including size, font, color, bold/italic/underline/etc, quality, and more)
  • Automatically downloads default Image artwork from rlauncher.com and puts it in your image folder
  • Automatically downloads gdip library into a "Modules\Module Extensions\" Folder
  • Resize Images - (Stretch or shrink your images upto 3x it's size. They are anti-aliased to help mitigate jaggies)
  • All ini keys needed for MultiGame support are automatically created in your Global Settings and System inis for you
  • Use your arrow keys to navigate the GUI
  • Customizable keys to show the GUI, exit the GUI, and select a game - (limited to what ahk supports)
  • Feedback Sound - (Play a sound beep as you move your cursor from one game to the next. Pitch of the sound can be changed to anything you want)
  • Customizable Exit Effect - (When you choose a game, you have the choice to pixelate or grow the selected image. More may be added later.)
  • 7z support - (Let's say you launch a game from HS, then switch discs. If both games were extracted with 7z, and you like to keep your temp dir clean, HL2 will delete all the games launched from your current session)



How roms MUST BE NAMED:
HS2 will contain MultiGame support from the menu so you will no longer need multiple wheels to show one game that has multiple discs or carts. To use this functionality, some naming standards had to be put in place so when parsing your xml, it recognizes these games. Basically a tag gets put on the end of your romname, in parenthesis, saying what type of media and what number it is, example:

Final Fantasy VII (USA) (Disc 1).iso
Final Fantasy VII (USA) (Disc 2).iso
Final Fantasy VII (USA) (Disc 3).iso


A space MUST EXIST between the media type and the number.

Four media names are supported at the moment: Cart, Disc, Disk, and Tape. Where Tapes can have Sides:

Crystals Of Kings (Europe) (Tape 1 Side A).tzx
Crystals Of Kings (Europe) (Tape 1 Side B).tzx


The above media tags must be the last thing in parenthesis in your rom name.


How do I use this in my modules?:

  • Simply download a module that has already been updated with MG support and set your ini keys to get the look you want, or update your own module with the following info:
  • It is injected into the module if you have MG enabled. Just make sure you are running at least this version, and you will have it. Modules need a custom label, much like CloseProcess, called MultiGame. If you attempt to enable MultiGame support and do not have this section in your module, you will get an error about not being able to find MultiGame.
  • The MultiGame section needs to contain code on what to do after you select your game from the MultiGame GUI. It is fed some variables that you use to pass to the emu or your virtual drive application to mount your new game. If you want to use the feature and create your own method to change discs, here are the variables you need to know about:
    • selectedRom = The full path, name and extension of the game you selected as it exists in your romPath
    • currentButton = The number of the image you selected to load
    • mgRomPath = The path to the game (If 7z is enabled, this will be updated to reflect the path after extracting has occured)
    • mgRomName = The name of the game w/o an extension
    • mgRomExt = The extension of the game (If 7z is enabled, this will be updated to reflect the extension after extracting has occured)
    • mgCancel = Set when you exit the GUI and did not choose a game. You will need this on some emus where script is required to restore the emu if it lost focus or was minimized by bringing up the GUI

[*]Each module also needs to contain a PreMultiGame label. This is where you can put code if you need to put the emu in a state for the MG GUI to work properly. For example you may need to take the emu out of fullscreen or minimize it before bringing up the GUI. Then put code in the MultiGame label to put the emu back after changing disks.
NOTE: EVERY MODULE YOU WANT THIS TO WORK IN WILL NEED CODE TO TELL THE EMU AND/OR VIRTUAL DRIVE HOW TO CHANGE DISCS

Limitations: Due to the nature of how true fullscreen works in windows, some emus might not play well with this feature when in true fullscreen mode. The GUI may take your emu out of fullscreen so it can do it's thing to swap games. Code needs to exist to put your emu back in fullscreen if this occurs. Utilize the PreMultiGame section of the module! Some emus might not like a rom to be swapped while it is running. There is not much you can do about these so pick an emulator that allows this. If you store your games on a network drive or a very slow HDD, you may notice some small lag after hitting your key to till the GUI comes up. This is because it has to query the drive quite a few times and find the roms that match the current one. Good thing is it only has to do this once per session. So subsequent presses of the MG key will be instant because the table of games has already been created. If you use 7z to extract very large games, you probably already have lag from when you launch the game from HS until it starts. You will have the same lag from the GUI. If you don't like this, keep your roms extracted. Space is cheap.

Explanation of the new INI keys:
Global Settings.ini will be injected with all the new keys the first time you launch any game on any wheel.
Your system ini will be injected with the new keys first time you launch a game from that system's wheel.

Settings.ini Default Key Values:
[RocketLauncher]
MultiGame_Key = NumpadSub

Global Default Key Values:
[RocketLauncher]
MultiGame_Background_Color = FF000000
MultiGame_Side_Padding = .2
MultiGame_Y_Offset = 500
MultiGame_Image_Adjust = 1
MultiGame_Font = Arial
MultiGame_Text_1_Options = x10p y30p w80p Centre c80FFFF00 r4 s100 Bold Italic
MultiGame_Text_1_Text = Please select a game
MultiGame_Text_2_Options = w96p cffffffff r4 s50 Center Bold Italic
MultiGame_Text_2_Offset = 70
MultiGame_Use_Sound = True
MultiGame_Sound_Frequency:=300
MultiGame_Exit_Effect = none
MultiGame_Selected_Effect = rotate
MultiGame_Use_Game_Art = false
MultiGame_Art_Folder = Artwork1


System Ini Only Default Key Value:
[exe info]
MultiGame_Enabled = true


Definitions:

  • MultiGame_Enabled:Set this to true to turn on MG support and enable the MG key
  • MultiGame_Key:This is your key to bring up the MG Gui
  • MultiGame_Background_Color:Background color in ARGB format, first to characters denote the opacity, see text formatting options below for further info
  • MultiGame_Side_Padding:Percentage of padding (empty space), in decimal (eg 0.2 = 20 percent of unused space will be used on the sides), we allocate for left and right screen edges to keep images from touching the screen edge
  • MultiGame_Y_Offset:Adjust this to offset your images from the bottom of the screen. A positive number moves the images up, a negative moves it down
  • MultiGame_Image_Adjust:Multiplier to adjust the size of the images. Use this if you want to shrink or grow the images
  • MultiGame_Font:Specify the Font to use. Default is Arial as most systems should have this installed
  • MultiGame_Text_1_Options:Set the text options for the middle of the screen
  • MultiGame_Text_1_Text:Set the text for the middle of the screen
  • MultiGame_Text_2_Options:Set the text options for above the images
  • MultiGame_Text_2_Offset:How much to offset the text above the images from the image itself. A positive number moves the text up, a negative moves it down
  • MultiGame_Use_Sound:If true, will play a SoundBeep when an arrow key is pressed
  • MultiGame_Sound_Frequency:The frequency of the SoundBeep
  • MultiGame_Exit_Effect:Choices are pixelate, grow, or none. This animates the image when you press your Select Key
  • MultiGame_Selected_Effect:Choices are grow or rotate. This animates the selected image when moving around with the arrow keys. I suggest rotate only for discs as you probably don't want to rotate a cart.
  • MultiGame_Use_Game_Art:If true, uses artwork from the game as images on GUI instead of the default ones. Set the Artwork folder your art is stored in on the MultiGame_Artwork_Folder key
  • MultiGame_Art_Folder:This if the folder the image artwork you want to use is stored in 9eg Artwork1, Artwork2, Artwork3, or Artwork4)



Text Formatting Options:

  • w (width):Area you force the text to stay constrained to. If p is used after the value, it denotes the percentage of the image width So w90p, means to allow the text to use 90% of the image width. If p is not used, the value represents pixels
  • c (color):In ARGB, preceded with the opacity. So DD000000 would be partial black, and FF000000 would be solid black. Preceed the color with a c to denote it is a color (cFF000000) - For more info see: {http://en.wikipedia.org/wiki/RGBA_color_space]
  • r (quality):The following chart explains the different effects you can apply
SystemDefault = 0
SingleBitPerPixelGridFit = 1
SingleBitPerPixel = 2
AntiAliasGridFit = 3
AntiAlias = 4
  • s (size):Size of the Font
  • Formatting Options:Top, Up, Bottom, Down, vCenter, vCentre, Centre, Center, Regular, Bold, Italic, BoldItalic, Underline, Strikeout, NoWrap (you can use as many as you like, but careful with the positioning options as you may cover up the image art)



At a minimum, your module MUST CONTAIN THESE LABELS OR ELSE YOU WILL ERROR ON LAUNCH WITH MULTIGAME ENABLED:

PreMultiGame:
Return
MultiGame:
Return


Like to thank Kodiak for the initial CD images and stupus for taking them a big step further and creating all the default images to date. Also like to thank brolly for taking the time testing all this stuff.