the cutting room mirror

Debug Content

This is a sub-page of Angry Birds.

There are many debugging leftovers in the game, ranging from togglable variables to a full-on level editor.

Build Settings#

To do:
Show the effects of these in-game.

  • releaseBuild: Retail, clean build, turning off makes the game act like debugging build, enabling debugging functions and some screens have debugging information like the credits, true is defaulted, disabling this setting allows the use of using all developer cheats on beta builds.
  • showEditor: Shows the level and particle editors at the main menu, false is defaulted.
  • cheatsEnabled: Allows use of built-in developer cheats, false is defaulted.
  • useDynamicAssets: Makes the game use assets from the dynamic script directory, true is defaulted.
  • isPremium: Makes the game acts like a "premium" version, ads are disabled, false is defaulted.
  • isKorea: Makes the game act like a Korean build, false is defaulted for non-Korean builds.
  • applyChinaRestictions: Makes the game act as a Chinese build, a timer is shown for game time left, false is defaulted for non-Chinese builds.
  • gameVersionNumber: Game version number shown in credits, changes after every update.
  • customerString: OEM based on how the game was acquired, commonly "googleplay".
  • svnRevisionNumber: Server revision number in last credits line, the number starting with RXXXXX.
  • isSeasonsAvailable: Makes the game advertise Angry Birds Seasons in menus? True is defaulted.
  • g_registrationEnabled: Toggles the game activation DRM setting, false is defaulted.
  • g_updateCheckEnabled: Toggles the game's autoupdater executable updater.exe setting, defaulted to false.
  • g_hasWebBrowser: Makes the game think you have a web browser to view ads (?), defaulted to true.
  • bingIsEnabled: Enables Bing search in the game over screen (used in old versions).
  • enableAssertions: Enables assertions?
  • disableShopButton: Hides the shop from the game, "false" is defaulted, try changing to "true"?
  • hasIaps: Allows IAPs to be made (?) off is defaulted.
  • g_is_free_version: Makes the game act like a free version, false is defaulted?
  • useScaling: Toggles scaling settings, defaulted to true.
  • timeMachineServer: What server is used (for time)? dev is defaulted.
  • gameId: Short identifier for the game when clicking ads that log it, defaulted to abc.
  • g_separate_powerup_highscore: Allows powerup based high scores separately to be kept along with plain gameplay scores in a highscores.lua, false is defaulted.
  • applyLocalisation: Applies a predetermined localisation.
  • isHDVersion: Makes the game act like an iOS HD build, maybe shows HD sprites and textures if on? False is defaulted.
  • g_use_mighty_league: Makes the game show Mighty League on the main menu, true is defaulted.
  • g_use_ingame_ads: Makes the game use in-game ads, defaulted to true.

Older Versions#

  • g_challengesEnabled: Enables the unused challenges mode.
  • g_hatcheryEnabled: A left over mode from Angry Birds Island. Due to missing files and code however, enabling this mode will cause the game to crash.

Debug Console#

A giant overlay for entering text, covering the entire screen, toggled by ⇧ Shift + D. It is possible to edit in-game flags and values for a session or directly call ingame/native functions by using it. It is also possible to display it by clicking on the bottom right corner three times, which is probably here so it would be possible to access it on mobile without an external keyboard.

All functions from gamelogic.lua and hardcoded in GameLua can be called and Lua table objects loaded can be accessed. The native GameLua class itself can be called using _G.gamelua or this._G.gamelua, the entire UI table can be called can be called with ui.

Using @ in your entry will close the debug console after it is entered while macros in the script can be used with $, also note that combos can be used while the debug console is open so be careful with how fast you type them.

Macros consist of full function/variable names and nested functions, They also interestingly leak official code as they are executed as unformatted raw strings. Note the comments added are not part of the original code.

ai = ingameCurrencySystem:addIGCItems
mm = menuManager --Macro for the external MenuManager UI class
em = eventManager
en = eventManager:notify
cr = menuManager:changeRoot -- Changes the current menu page. Enter like $cr(PageName:new(*))
hs = highscores --highscores.lua table
rk = notifyEventManager("EID_MATTEL_TOY_ACTIVATED") --Triggers the Golden King Pig/Apptivity effect
rr = notifyEventManager( events.EID_MATTEL_RANDOM_MODE, { popup = true } )
rt = menuManager:getRoot() --Gets the current menu table
sw = settingsWrapper --settings.lua table
cl = notificationsFrame:getChild("DebugConsole"):clear() --Clears the debug console frame, aside from this function usage.
xx = notificationsFrame:getChild("DebugConsole"):close() --Closes the debug console frame.
pl = previousLevel()
nl = nextLevel()
lc = initLevelComplete() --Starts the level complete sequence.
lf = initLevelFailed(1000) --Initializes the level fail timer for 1000 msec + current time.
dr = settingsWrapper:setLastRewardDate({year = 0, month = 0, day = 0, hour = 0, minutes = 0, seconds = 0}) --Resets the reward date.
ga = for _, page in _G.ipairs( g_episodes.G.pages ) do for _, level in _G.ipairs( page.levels ) do settingsWrapper:unlockGoldenEgg(level.name) end end --Unlocks all golden eggs and writes to your save data.
pu = bundleReward(100) --Grants 100 of each powerup.
ts = for _, v in _G.ipairs(g_episodeIds) do --Three stars all levels for the session.
                   local episode = g_episodes[v]
                   for _, page in _G.ipairs(episode.pages) do
                       for _, level in _G.ipairs(page.levels) do
                           if starTable[level.name] then
                               if not highscores[level.name] then
                                   highscores[level.name] = {}
                               end
                               highscores[level.name].score = 1000000
                               highscores[level.name].completed = true
                               if page.star_count_logic_override == "eggDefenderStarCountLogic" then
                                   highscores[level.name].stars = { egg = true, pig = true, bird = true }
                                   highscores[level.name].score = 0
                               end
                           end
                       end
                   end
               end
lts = for _, v in _G.ipairs(g_episodeIds) do
                   local episode = g_episodes[v]
                   for j = 1, #episode.pages do
                       local page = episode.pages[j]
                       for i = 1, #page.levels do
                           local level = page.levels[i]
                           if (i ~= #page.levels or j ~= #episode.pages) and starTable[level.name] then
                               if not highscores[level.name] then
                                   highscores[level.name] = {}
                               end

                               highscores[level.name].completed = true
                               highscores[level.name].score = 1000000
                               if page.star_count_logic_override == "eggDefenderStarCountLogic" then
                                   highscores[level.name].stars = { egg = true, pig = true, bird = true }
                                   highscores[level.name].score = 0
                               end
                           end
                       end
                   end
               end
lpts = for _, v in _G.ipairs(g_episodeIds) do
                   local episode = g_episodes[v]
                   for j = 1, #episode.pages do
                       local page = episode.pages[j]
                       for i = 1, #page.levels do
                           local level = page.levels[i]
                           if i ~= #page.levels and starTable[level.name] then
                               if not highscores[level.name] then
                                   highscores[level.name] = {}
                               end

                               highscores[level.name].completed = true
                               highscores[level.name].score = 1000000
                               if page.star_count_logic_override == "eggDefenderStarCountLogic" then
                                   highscores[level.name].stars = { egg = true, pig = true, bird = true }
                                   highscores[level.name].score = 0
                               end
                           end
                       end
                   end
               end
sync = notifyEventManager(events.EID_START_CLOUD_SYNC)
aw = DebugConsole.addDebugVariable --Macro to add a variable watcher on the screen, use like $aw("*"), this doesn't work on boolean variables as they simply return NIL.
cw = DebugConsole.clearWatcherFrame() --Macro to clear the watcher frames
pr = local prnt = function(...) notificationsFrame:getChild("DebugConsole"):printValues("print", true, true, _G.unpack(arg)) end prnt
ge = local ge = function(level) goldenEggAchieved(g_episodes.G.level_list[level]) end ge
fal = for k,v in allLevels() do
tdd = debugDrawSubsystem:toggleDrawing() and "debug drawing on" or "debug drawing off",

Camera Visualizer#

In the main game logic script, the initialize function has a check for a showCameraDebugData flag which isn't set outside modification or the debug console, when enabled it sets visualizeScreen to {x = 0, y = 0} and visualizes level cameras for the device model. The white box is the current camera view while the red is the camera range. Note you must set the visualizeScreen value if the flag wasn't defined before loading the function.

Radio Dial Visualizer#

RadioButton.draw(x, y) in menus/radio.lua features a visualizer for the radio dial for the said Golden Egg, simply under a local variable named debug_draw which is always set to false, setting it to true makes the game implement a draw function for the class that draws two circles draw overtop the radio dial, yellow being the area where interaction is detected and red is the dead spot of the middle of it.

Invisible UI Button Draw#

InvisibleButton:draw(x, y, scaleX, scaleY, angle) in ui_components/InvisibleButton.lua has a local variable simply titled debug, which is always set to false. Setting it to true makes invisible buttons draw black squares overtop them.

Local Text Draw#

ui_components/Text.lua has a local variable simply titled debug_draw, which is always set to false. Setting it to true makes the game use a local function to draw text that draws light blue lines over text, rather than the native engine function. Note it does break the debug console since it relies off the C++ engine's function to draw its text.

Text Button Draw#

TextButton:draw(x, y, scaleX, scaleY, angle) in ui_components/TextButton.lua has a call for an unreferenced local variable simply titled debugDraw. Setting it to true makes the game draw grey rectangles over text buttons.

Commented Debug Code#

In compiled scripts, commented code is completely removed, thankfully via certain releases of the games and Angry Birds Trilogy on Wii and U using uncompiled likely source scripts, it's possible to restore it.

Image Boxes#

A debug draw for boxes of UI images, present in Image:drawSelf(x, y, scaleX, scaleY, angle, hoverScale) of ui_components/Image.lua. It draws a grey rectangle and yellow lines over images. Add this under the line with HPIVOT and VPIVOT for it to work.

--uncomment for debug draw:
--local px, py = _G.res.getSpritePivot(self.image) local x1 = x + self.x - px local y1 = y + self.y - py local x2 = x1 + self.w local y2 = y1 + self.h gamelua.setRenderState(0, 0, 1, 1, 0, 0, 0) gamelua.drawLine2D(x1, y1, x2, y1, 1, 255, 255, 0, 255) gamelua.drawLine2D(x2, y1, x2, y2, 1, 255, 255, 0, 255) gamelua.drawLine2D(x2, y2, x1, y2, 1, 255, 255, 0, 255) gamelua.drawLine2D(x1, y2, x1, y1, 1, 255, 255, 0, 255)--

Level Editor#

Controls#

Blocks#

  • Space: Opens the block selection window.
  • 1 / 2: Cycles through the stone blocks listed in the rockBlocks table in blocks.lua.
  • 3 / 4: Cycles through the birds listed in the birds table in blocks.lua.
  • 5 / 6: Cycles through the miscellaneous blocks listed in the extras table in blocks.lua.
  • Q / W: Cycles through the wood blocks listed in the woodBlocks table in blocks.lua.
  • E / R: Cycles through the pigs listed in the piglettes table in blocks.lua.
  • T / Y: Cycles through the platform blocks listed in the platforms table in blocks.lua.
  • U / I: Cycles through the vehicle blocks listed in the badPiggiesVehicles table in blocks.lua.
  • O / P: Cycles through blocks listed in the opobjects table in blocks.lua.
  • A / S: Cycles through the glass blocks listed in the lightBlocks table in blocks.lua.
  • H / J: Cycles through the unused cloud blocks listed in the clouds table in blocks.lua.
  • Z / X: Cycles through the static blocks listed in the staticBlocks table in blocks.lua.
  • C / V: Cycles through the decorative blocks listed in the decorations table in blocks.lua.
  • N / M: Cycles through the fragile static blocks listed in the staticFragile table in blocks.lua.
  • Ctrl+R: Rotates the currently selected block(s) clockwise. (Hotkey was ⇧ Shift + R in older versions.)
  • ⇧ Shift + Ctrl + R: Rotates the currently selected block(s) counterclockwise.
  • ← Backspace / Delete: Deletes the currently selected block(s) and/or joints.

Joints#

When two blocks are currently selected, you can do the following:

  • Ctrl+J: Brings up the joints menu. (Hotkey was ⇧ Shift+J in older versions.)
  • Ctrl+F1: Creates a distance joint. (Hotkey was F1 in older versions.)
  • Ctrl+F2: Creates a weld joint. (Hotkey was F2 in older versions.)
  • Ctrl+F3: Creates a revolute joint. (Hotkey was F3 in older versions.)
  • Ctrl+F4: Creates a prismatic joint. (Hotkey was F4 in older versions.)
  • Ctrl+F5: Creates a "destroy attached" joint. (Hotkey was F5 in older versions.)

Camera#

  • Mouse Wheel: Zooms in/out.
  • ⇧ Shift+B: Sets the camera position for the birds' side of the level.
  • ⇧ Shift+C: Sets the camera position for the pigs' side of the level.
  • Ctrl+⇧ Shift+B: Snaps to camera position of the birds' side of the level.
  • Ctrl+⇧ Shift+C: Snaps to camera position of the pigs' side of the level.

Other#

  • Tab ↹: Toggles physics.
  • Ctrl+Z / ⇧ Shift+Ctrl+Z: Undo/redo last change made to the current level.
  • ⇧ Shift+T / ⇧ Shift+Ctrl+T: Cycles through the level backgrounds listed in the themes table in themes.lua (blocks.lua in older versions). It's also worth noting that ⇧ Shift+Ctrl+T did not exist in older versions of the game, so you would only be able to go through the backgrounds in ascending order.
  • S: Saves the current level or vehicle. (Hotkey was Ctrl+S in older versions.)
  • P: Playtests the current level. (Hotkey was ⇧ Shift+P in older versions.)
  • Esc: Opens with a prompt asking if you want to leave the editor. (Exits out of the editor entirely in older versions.)