Core Gameplay Loop & Progression
Relevant source files
The following files were used as context for generating this wiki page:Skid-Inc is an idle game with a hacking theme where the player interacts with a terminal interface. The core gameplay loop revolves around executing commands to run "scripts," which generate the primary resources: Money and Experience (EXP). These resources are then used to purchase upgrades, unlock more powerful scripts, and automate tasks, allowing for exponential growth.
The progression system is centered on leveling up by gaining EXP, which in turn unlocks new purchasable items. A prestige mechanic, involving "botnets," allows players to reset their progress in exchange for permanent boosts to their resource generation, forming the long-term progression loop. All player interactions and game state updates are managed through a central game object, skidinc, which is updated on a fixed interval.
Game Initialization and Main Loop
The game's lifecycle begins with the skidinc.init() function. This function sets up a main game loop using setInterval that calls skidinc.core() at a fixed rate defined by skidinc.fps. The init function also handles the display of a loading screen and initializes all major game modules like scripts, purchasing, achievements, and saving.
Sources: app/js/core.js:89-110
Main Update Cycle
The skidinc.core() function calculates the time elapsed since the last update and calls skidinc.update() a corresponding number of times to ensure consistent progression, even if the browser tab is inactive. The update function serves as the central dispatcher, calling the loop method for each core game module.
This diagram illustrates the main game loop initiated by skidinc.init().
Sources: app/js/core.js:10-20, app/js/core.js:78-87
Player and Progression
The player's state is managed within the skidinc.player object. Progression is measured through several key attributes.
Player Data Structure
The core attributes defining the player's progress are stored in the game state. The structure below is a simplified representation of the player's data model.
This diagram shows the main properties of the player object.
Sources: src/renderer/save-manager.js:372-385
Leveling Up
Players level up by accumulating EXP. The skidinc.player.checkLevel() function is called whenever the player gains EXP. If player.exp meets or exceeds player.expReq, the player's level increases, exp is reset, and the expReq for the next level is recalculated.
This sequence diagram shows the process of gaining EXP and leveling up.
Sources: app/js/player.js:17-30
Core Player Actions
The player interacts with the game primarily by typing commands into the terminal. The skidinc.console object is responsible for parsing and executing these commands.
Command System
When a player enters a command, skidinc.console.parse() is triggered. It validates the input, checks if the command exists, and verifies the arguments before executing the associated function.
| Command | Description | Effect Function | Source File |
|---|---|---|---|
help | Shows a list of available commands. | skidinc.console.help() | app/js/console.js |
clear | Removes all logs from the terminal. | skidinc.console.clear() | app/js/console.js |
username | Sets the player's username during the tutorial. | skidinc.player.setUsername | app/js/console.js |
script | Executes a script to earn money and EXP. | skidinc.script.execute | app/js/console.js |
buy | Buys items like scripts, autoscripts, and servers. | skidinc.buy.execute | app/js/console.js |
achievements | Displays the player's achievements. | skidinc.achievements.list() | app/js/console.js |
Sources: app/js/console.js:16-80, app/js/console.js:125-189
Tutorial and Onboarding
The game starts with a tutorial that guides the player through the basic commands. The skidinc.tutorial object manages a step-by-step process where the player learns to set their username, use the help command, and execute their first script. This sequence introduces the fundamental gameplay loop.
The tutorial progresses through the following steps:
- Step 0: Introduction and prompting the user to set a username with the
username [name]command. - Step 1: Prompting the user to use the
helpcommand. - Step 2: Explaining the
scriptcommand and how to list and execute scripts. - Step 3: Concluding the tutorial and transitioning to the main game.
Sources: app/js/tutorial.js:1-79
Resource Management
The core loop involves earning and spending resources to enhance earning potential.
Earning Money and EXP
The primary method for earning resources is by executing scripts via the script [name] command. Each script takes a certain amount of time to complete, after which it rewards the player with money and EXP. The amounts are modified by the player's current multipliers.
Spending Money: The buy Command
The buy command is the main sink for money. It allows players to purchase upgrades that are essential for progression. The skidinc.buy.items array defines all purchasable items.
| Item Type | Description | Impact on Progression |
|---|---|---|
script | Unlocks new, more profitable scripts for execution. | Provides access to higher tiers of income and EXP gain. |
autoscript | Automatically executes a specific script, automating resource generation. | A key feature of the idle game mechanic. |
web | A server upgrade that increases both money and EXP multipliers. | Directly boosts resource generation from all sources. |
telnet | A server upgrade that increases the time multiplier (reduces script times). | Speeds up the core loop of executing scripts. |
This flow chart shows the cycle of earning and spending resources.
Sources: app/js/buy.js:6-66, index.html:125-156
Prestige System
Once a player reaches a certain level of progress, they can "prestige." This resets most of their progress (level, money, scripts) but grants them Botnets.
- Earning Botnets: The number of botnets earned on reset is calculated based on the player's progress.
- Botnet Effect: Each botnet permanently increases the money and EXP multipliers by 2%. This boost is applied after all other multipliers.
- Prestige Multiplier: The total multiplier from all botnets is displayed as the "Prestige mult." in the UI.
This system encourages long-term replayability by allowing players to accelerate their progress on subsequent runs.
Sources: index.html:167-177, index.html:221-226