Excellent! Glad you like it. Thinking technically is key when resources are tight.
Here’s a potential technology stack, focusing on speed, ease of use, and leveraging existing skills:
Technology Stack Proposal: "Kopalnie Czasu"
Core Philosophy: Leverage existing tools and practices to minimize learning curve and maximize programmer efficiency. Prioritize data-driven design so content can be added/modified without touching core code.
1. Game Engine: Unity
- Why: It's the industry standard for indie and mobile development. Our programmer is likely familiar with it. It handles cross-platform builds (PC, Android, iOS) out-of-the-box, has a vast asset store for potential needs (though we'll keep asset costs minimal), and excellent documentation/community support. Its component-based architecture fits perfectly with our modular approach.
2. Programming Language: C#
- Why: The native language for Unity development. It's powerful, versatile, and relatively easy to learn compared to some alternatives.
3. Art & UI: Unity UI (UGUI) & Scriptable Objects
- UGUI: For standard UI elements like buttons, text displays, and simple panels. It's efficient for 2D interfaces and integrates seamlessly with Unity. Less overhead than UI Toolkit for this scope.
- Scriptable Objects: This is crucial for designer control. We'll use ScriptableObjects to define all game data:
UpgradeData: Cost, effect (e.g., +coal/sec), name, required level.
CreatureData: Name, description, passive bonus (e.g., x1.1 multiplier), special ability trigger.
EraData: Name, duration, potential rewards.
DialogueData: Text lines, speaker.
- This allows me (or another non-programmer) to create new upgrades, creatures, or eras simply by creating new ScriptableObject assets, tweaking values, and assigning new art/text. The programmer only needs to build the framework to read and apply this data.
4. Data Management: CSV & JSON
- CSV: Excellent for tabular data like creature stats, upgrade costs, and progression curves. Easy to manage in spreadsheets (Google Sheets, Excel) and import into Unity via simple parsers or custom editors.
- JSON: Ideal for structured data like dialogue trees or complex configurations. Unity has built-in JSON serialization support.
5. Version Control: Git (e.g., GitHub, GitLab, Bitbucket)
- Why: Absolutely essential, even for a solo programmer. Tracks changes, allows rollbacks, facilitates collaboration if needed later, and provides a backup.
6. Monetization Integration: Unity Ads / AdMob
- Why: Standard SDKs for mobile ads (rewarded video, interstitials). Unity Ads is often simplest to integrate within the engine. We'll use a simple mediation layer if needed, but start with just one provider.
7. Localisation: Simple JSON/CSV files
- Why: As mentioned, text data will be externalized. We can load language-specific JSON or CSV files based on player settings. Given the scope, only English and Polish initially.
Basic Code Snippet (Illustrative)
This is a highly simplified example focusing on the core resource generation and upgrade loop, demonstrating ScriptableObjects and a basic timer.
1. UpgradeData.cs (ScriptableObject)
using UnityEngine;
[CreateAssetMenu(fileName = "NewUpgrade", menuName = "GameData/Upgrade")]
public class UpgradeData : ScriptableObject
{
public string upgradeName = "New Upgrade";
public string description = "Effect description";
public int baseCost = 10;
public float costIncreaseMultiplier = 1.15f; // Each purchase gets more expensive
public float coalPerSecondBoost = 1.0f; // How much this upgrade adds to coal/sec
public int requiredLevel = 1; // Simple progression gate
// public int creatureUnlockID; // Optional: could unlock a creature
}
- How to use: Create new assets via
Assets > Create > GameData > Upgrade. Fill in the details.
2. MineManager.cs (MonoBehaviour - attached to a GameObject)
using UnityEngine;
using UnityEngine.UI; // Needed for UI Text elements
using System.Collections.Generic;
using System.Linq; // For Linq queries
public class MineManager : MonoBehaviour
{
[Header("Resources")]
public float currentCoal = 0f;
public float coalPerSecond = 1f; // Base rate
[Header("Upgrades")]
public List<UpgradeData> availableUpgrades; // Assign all UpgradeData assets here
private int currentUpgradeLevel = 1; // Tracks player's current progression level
[Header("UI References")]
public Text coalDisplay;
public Text coalPerSecondDisplay;
// Add references for upgrade buttons, etc.
private float timer = 0f;
// --- Initialization ---
void Start()
{
// Load saved progress if available (implement Save/Load later)
LoadProgress();
// Apply any creature buffs (implement CreatureManager later)
// Example: ApplyCreatureBuffs();
UpdateUI();
}
// --- Game Loop ---
void Update()
{
// 1. Idle Resource Generation Tick
timer += Time.deltaTime;
if (timer >= 1.0f)
{
// Calculate coal earned in the elapsed time
float earnedCoal = coalPerSecond * Mathf.Floor(timer);
currentCoal += earnedCoal;
// Reset timer, keeping any fractional part for accuracy
timer = timer % 1.0f;
UpdateUI();
}
// 2. Player Tap/Click Input (for active play)
if (Input.GetMouseButtonDown(0)) // Or a dedicated tap button press
{
// Simple tap adds 1 coal
currentCoal += 1f;
UpdateUI();
}
}
// --- Player Actions ---
// Call this when an upgrade button is clicked
public void AttemptPurchaseUpgrade(int upgradeIndex)
{
if (upgradeIndex < 0 || upgradeIndex >= availableUpgrades.Count)
{
Debug.LogError("Invalid upgrade index!");
return;
}
UpgradeData upgrade = availableUpgrades[upgradeIndex];
// Check if player meets requirements (level, currency)
if (currentUpgradeLevel >= upgrade.requiredLevel)
{
// Calculate the actual cost for this purchase
// In a real game, cost calculation might be more complex (stored per-upgrade)
int purchaseCost = Mathf.RoundToInt(upgrade.baseCost * Mathf.Pow(upgrade.costIncreaseMultiplier, GetUpgradePurchaseCount(upgradeIndex)));
if (currentCoal >= purchaseCost)
{
currentCoal -= purchaseCost;
coalPerSecond += upgrade.coalPerSecondBoost;
// Increment level or purchase count for this upgrade
// (Need a way to track how many times each upgrade was bought)
// IncrementCurrentUpgradeLevel(); // Example logic
Debug.Log($"Purchased {upgrade.upgradeName}. New coal/sec: {coalPerSecond}");
UpdateUI();
// Potentially update available upgrades if this unlocks new ones
}
else
{
Debug.Log("Not enough coal!");
// Optionally show a visual cue to the player
}
}
else
{
Debug.Log("Upgrade not available yet!");
// Optionally show a visual cue
}
}
// --- UI Update ---
void UpdateUI()
{
if (coalDisplay != null)
{
coalDisplay.text = $"Coal: {Mathf.FloorToInt(currentCoal)}";
}
if (coalPerSecondDisplay != null)
{
coalPerSecondDisplay.text = $"Coal/Sec: {coalPerSecond.ToString("F1")}"; // Format to 1 decimal place
}
// Update button states (enabled/disabled based on currency)
// Update display for next upgrade cost etc.
}
// --- Saving & Loading (Placeholder) ---
void LoadProgress()
{
// Implement PlayerPrefs or a more robust save system here
// Example:
// currentCoal = PlayerPrefs.GetFloat("PlayerCoal", 0f);
// coalPerSecond = PlayerPrefs.GetFloat("PlayerCoalPerSecond", 1f);
// currentUpgradeLevel = PlayerPrefs.GetInt("PlayerUpgradeLevel", 1);
}
void SaveProgress()
{
// PlayerPrefs.SetFloat("PlayerCoal", currentCoal);
// PlayerPrefs.SetFloat("PlayerCoalPerSecond", coalPerSecond);
// PlayerPrefs.SetInt("PlayerUpgradeLevel", currentUpgradeLevel);
// PlayerPrefs.Save();
}
// Helper to get how many times a specific upgrade was purchased (needed for cost scaling)
int GetUpgradePurchaseCount(UpgradeData upgrade) {
// In a real implementation, you'd store purchase counts per upgrade ID
// For this example, we'll simulate it based on the current level for simplicity,
// but this needs a proper data structure.
// Let's assume a simple linear progression for now, where 'currentUpgradeLevel' represents
// the next upgrade to buy. This is crude but shows the cost scaling concept.
if (upgrade == availableUpgrades[currentUpgradeLevel - 1]) { // If this is the next upgrade we'd buy
return 0; // First time buying this tier/level
}
// A better approach: Use a Dictionary<UpgradeData, int> or similar.
return 0; // Placeholder
}
// Example: A very simple way to manage level progression
void IncrementCurrentUpgradeLevel() {
currentUpgradeLevel++;
// Check if new upgrades are unlocked by this level
}
}
Explanation:
UpgradeData ScriptableObject: Holds the blueprint for each upgrade. This is where I can define new upgrades easily.
MineManager MonoBehaviour: This script manages the core game state.
currentCoal & coalPerSecond: The player's resources and income rate.
availableUpgrades: A list where we drag-and-drop our UpgradeData assets.
Update(): Handles both the passive income generation (timer) and player input (Input.GetMouseButtonDown).
AttemptPurchaseUpgrade(): Contains the logic for checking currency, applying the upgrade's effect (coalPerSecondBoost), and scaling the cost.
UpdateUI(): A dedicated function to refresh all text displays. Crucial for immediate feedback.
LoadProgress/SaveProgress: Placeholders for persistence. PlayerPrefs is the simplest starting point for Unity.
This setup ensures that the programmer writes the core systems once (resource management, upgrade logic, saving), and the content (specific upgrades, creatures, dialogue) can be created and balanced by others using ScriptableObjects and simple data files, requiring minimal coding intervention.