AI in Game Development: Gamedev Tips, Tools, Techniques, and GPT / LLM Agent Integration

No problem! You’ve got some dedication for sure! :wink:

Quick one-shot prompt for ChatGPT Classic

You are an experienced browser-game developer and game designer. Build **SCRAPLINE: Road & Arena**, a single-player, 2D overhead vehicular-combat game contained entirely in **one index.php file**. **Tagline:** *Build for survival. Fight for salvage. Win for cash.* Capture the appeal of classic **Car Wars**: building a vehicle from a budget, choosing weapons and armor, then finding out whether that design survives combat. Use that vehicle-construction premise as inspiration, but create an original setting, presentation, equipment catalog, and simplified rules. Do not reproduce its rulebook, artwork, or branding. ([Steve Jackson Games][1]) The central design principle is: **this is a tactical car-combat board game brought to life, not an arcade racing game.** ### 1. Technical requirements Deliver one complete index.php containing all application HTML, custom CSS, JavaScript, game data, and any necessary PHP. Multiple screens must operate inside the same browser page without navigating to other PHP files. Use **Phaser 3.90.0** for the game world and **Bootstrap 5.3.8** for the surrounding interface, loaded from version-pinned CDNs. These versions have documented CDN distributions. ([Phaser][2]) Use vanilla JavaScript alongside those libraries. No database, Composer, npm, bundler, framework, server-side account system, or external asset pack. PHP may simply serve the page; campaign persistence should use localStorage. Generate cars, roads, buildings, obstacles, weapon effects, and interface illustrations with Phaser graphics, canvas textures, inline SVG, or CSS. The only required external downloads should be the two libraries. Prioritize desktop play, with a responsive layout and usable touch controls for tablets. Handle resizing without stretching the world or breaking pointer coordinates. ### 2. Setting and campaign loop The player is an independent autoduellist operating from a roadside garage in a battered industrial frontier. Roads belong to scavengers and raiders; arena promoters turn vehicular violence into entertainment. The complete gameplay loop is: **Garage → Build or repair → Choose road contract or arena event → Fight → Collect rewards → Return to garage → Improve the car.** The two combat modes must serve different economic purposes: **Road battles produce materials and recovered equipment.** The player takes risks to acquire parts, sometimes finding something better than they can currently afford. **Arena battles produce money and reputation.** The player earns a posted cash purse but does not get to strip the other contestants’ cars. Damage and ammunition consumption persist between fights. A victory can still be expensive. Support one active car and an inventory of spare parts. Do not build a fleet-management system. ### 3. Main screens Implement four complete in-page screens. **Garage / Shop:** A car schematic, installed equipment, spare inventory, shop catalog, armor allocation, repairs, ammunition purchases, and live build statistics. **Contracts / Events:** Separate Road and Arena tabs showing available encounters, opponent count, difficulty, entry requirements, and expected reward type. **Battle:** The Phaser battlefield, vehicle status, tactical controls, target information, round/impulse indicator, and readable combat log. **Results:** Victory, defeat, withdrawal, or draw; damage sustained; ammunition spent; cash awarded; recovered equipment; scrap gained; and a clear return-to-garage action. Keep a persistent header with the game name, cash, scrap, reputation, and access to help/settings. During combat, prevent shopping or changing equipment. ### 4. Garage and car construction Start a new campaign with **$12,000** and guide the player through buying their first car. Provide a **Buy Starter Build** button that purchases and assembles a legal, combat-ready vehicle for no more than **$8,000**, leaving a repair and ammunition reserve. Also allow manual construction. Offer three chassis types: a lightweight compact, a balanced coupe, and a heavy pickup. Give each distinct purchase cost, base mass, carrying capacity, internal space, chassis durability, and handling characteristics. A legal vehicle requires a chassis, engine, suspension, and tire set. It can carry directional weapons, armor, ammunition, and optional accessories. Use a small, meaningful catalog rather than dozens of nearly identical upgrades: | Category | Initial choices | | ---------------------- | ---------------------------------------------------------------- | | Engines | Economy, standard, performance | | Suspension | Stock, sport, reinforced | | Tires | Standard, heavy-duty, reinforced | | Direct-fire weapons | Machine gun, autocannon, shotgun, rocket launcher | | Rear-mounted equipment | Oil dropper, spike dropper | | Accessories | Ram bumper, targeting unit | | Armor | Separately purchased protection for front, rear, left, and right | Give every item a real gameplay purpose. Engine choice affects acceleration and top speed; suspension affects control; tires affect durability and grip; armor increases protection and weight. Weapons must occupy specific mounts: front, rear, left, or right. Limit each mount to one weapon or compatible device. A rear oil dropper therefore competes with a rear gun. Use both **weight limits and internal-space limits**. Heavier builds should accelerate more slowly, and overloaded builds must not enter combat. Show live totals for price, mass, capacity, occupied space, top speed, acceleration, handling, armor distribution, and weapon loadout. Explain invalid builds in plain language. Buying, installing, removing, selling, and repairing must be separate, understandable actions. Removed equipment returns to inventory. Installing or swapping a damaged part must not repair it for free. Give inventory items unique IDs and persistent condition values. Recovered equipment is not automatically brand new. ### 5. Tactical combat and board-game feel Use **turn-based combat with five movement impulses per round**. Nothing advances while the player is deciding. At the start of a round, let the player maintain speed, accelerate, or brake within the vehicle’s capabilities. Speed determines movement distance during the upcoming impulses. Before each impulse, the player chooses a maneuver and may queue a weapon action. Maneuvers should include straight movement and gentle, tight, or hard turns to either side. Show a ghost car and projected movement path before committing. Indicate maneuver risk and the selected weapon’s firing arc. Clearly distinguish a predicted result from a guaranteed one. When the player confirms, lock everyone’s orders, move all cars simultaneously, resolve collisions and hazards, then resolve valid weapon attacks. Animate the completed simulation and return control to the player. Each vehicle may perform **one weapon action per round**, choosing which impulse to use it in. Dropping oil or spikes consumes that same action. Show whether the action remains available. Cars cannot turn in place, strafe, or instantly reverse. Turning must happen through movement. Higher speed creates greater maneuvering risk. Use a compact handling system: difficult turns, impacts, damaged tires, and hazardous surfaces reduce control; steady driving restores it. Risky maneuvers trigger visible dice-based control checks. Failure can cause a skid, forced heading change, spin, speed loss, or collision. Use original, simplified formulas rather than reproducing published movement charts. Put all tuning values in a central configuration object. The important tactical questions should be: *Can I turn that sharply at this speed? Which armor facing will the enemy hit? Should I fire now or wait for a better angle? Is a ram worth the damage?* ### 6. Weapons, damage, and collisions Direct-fire weapons need a valid target within range, firing arc, and line of sight. Use vehicle-mounted arcs rather than freely rotating every weapon toward the mouse. Resolve attacks using **2d6 against a visible target number**, with modifiers for range, movement, handling, and equipment. Show the corresponding hit probability. Use dice-based weapon damage and explain outcomes in the combat log. Recheck targeting after simultaneous movement. A target that leaves the firing arc or passes behind cover should not be hit because it was valid during planning. An invalid firing solution should not consume ammunition. Track front, rear, left, and right armor separately. Determine the struck facing from the target’s orientation and incoming attack direction. Apply damage to that armor first, then carry overflow into chassis damage. Penetrating hits may damage the engine, tire set, or a mounted weapon. Keep the critical-hit system small and understandable. Do not add individual crew members or top/bottom armor for this version. A car is eliminated when its chassis is destroyed or it becomes permanently immobilized by component damage. Wrecks remain as obstacles. Collisions should consider closing speed and relative mass. Head-on impacts should be more dangerous than gentle rear-end contact. Ram bumpers should help without making the attacker immune. Oil should threaten control; spikes should damage tires. Hazards need visible boundaries and finite charges. Use a deterministic, fixed-step rules simulation. Phaser should render and animate the results, not decide combat through uncontrolled arcade physics. Prevent fast cars from tunneling through obstacles, and prevent overlapping cars from taking repeated collision damage every animation frame. ### 7. Road battles: salvage and scavenging Create a finite, scrolling overhead road map with lanes, shoulders, barriers, abandoned wrecks, and a few roadside obstacles. Provide three contract tiers using the same underlying road system. Vary enemy strength, enemy count, obstacle placement, and salvage quality. Limit encounters to **one player and at most three AI vehicles**. Include two basic objectives: defeat a raider group, or survive an ambush and reach an extraction zone. Clearly display the current objective. Road victories should award **scrap material plus one to three recoverable components**, subject to what survived the fight. Generate equipment from the actual defeated vehicles’ installed parts, not an unrelated generic loot table. A lightly damaged weapon may be repairable and valuable. A destroyed engine should mostly produce scrap. Make vehicle condition affect salvage quality. The results screen should show each recovered item’s type, condition, estimated sale value, and compatibility with the player’s car. Allow the player to keep it or dismantle it into scrap. Scrap is a repair resource, not simply another name for cash. Let the player choose a cash repair or an explicitly priced scrap-based repair where supported. Reaching extraction without controlling the battlefield counts as escape, not a full salvage victory. The player keeps their surviving car but forfeits unrecovered wreck loot. Do not award arena-style cash purses for road combat. The cash route is selling recovered equipment. ### 8. Arena battles: purses and reputation Create an enclosed overhead arena with walls, a few substantial obstacles, clear starting positions, and enough room for tactical driving. Use one functional arena layout with randomized obstacle variants rather than several unfinished maps. Offer three event divisions with provisional starting economics: | Division | Entry fee | Winner’s purse | | -------------- | --------: | -------------: | | Rookie Yard | $0 | $1,500 | | Iron Circuit | $300 | $3,500 | | Crown Division | $1,000 | $8,000 | Treat these as balancing values, not immutable numbers. Tune repair and ammunition costs so a reasonably played victory is usually profitable. Deduct the fee exactly once when an event begins. Display the purse before entry. Winning awards cash and reputation; arena wrecks never become player salvage. Start with one-on-one events and unlock multi-car events as reputation increases. Higher divisions should use stronger, legally constructed opponents. Support elimination victory and a finite round limit. At the limit, adjudicate using a clearly displayed score based on damage dealt and surviving condition. Define ties as draws and do not award a full winner’s purse for a draw. Allow withdrawal with forfeiture of the entry fee and purse. Preserve damage already sustained. ### 9. Opponent AI Create three behavior profiles: a gunner that seeks firing angles, a rammer that seeks favorable impacts, and a skirmisher that exploits speed and rear hazards. AI must obey the same movement, handling, ammunition, firing-arc, and attack-limit rules as the player. It may react to the public battlefield state but must not read the player’s uncommitted orders. A small candidate-action scoring system is sufficient. Evaluate legal maneuvers for collision risk, useful range, firing opportunity, exposed armor, and progress toward the encounter objective. Road enemies may concentrate on the player. Arena opponents should select targets sensibly rather than always teaming up against the player. Prioritize AI that reliably moves, attacks, avoids obvious obstacles, and finishes encounters over elaborate pathfinding. ### 10. Interface and presentation Use a gritty tabletop-autoduel aesthetic: dark asphalt, muted steel panels, amber warnings, stencil-like headings, and readable vehicle counters. Distinguish the front of every car clearly. Make the garage feel like an interactive vehicle record sheet. The player should be able to understand their build without opening multiple modal dialogs. During combat, give most of the screen to the battlefield. Keep a nearby status panel showing speed, handling, directional armor, chassis condition, ammunition, selected weapon, and remaining attack availability. Place maneuver controls, targeting controls, and a prominent **Resolve Impulse** button below the battlefield. Provide keyboard shortcuts as alternatives to clickable buttons. Use a collapsible combat log with concrete explanations, such as: “Front autocannon: rolled 9, needed 8. Hit left armor for 7. Armor absorbed 4; chassis took 3.” Show warning labels and numeric values rather than relying on color alone. Include a short first-run tutorial and a Help panel explaining turns, handling, weapon arcs, damage, and the road-versus-arena economy. Effects should be brief and readable: tracers, sparks, smoke, skid marks, and wreck markers. Provide a fast-animation setting. ### 11. Persistence, economy safeguards, and architecture Maintain one authoritative, serializable campaign state. Keep Phaser objects separate from saved data. Save cash, scrap, reputation, inventory, installed equipment, armor, component condition, ammunition, unlocks, and active encounter state. Autosave after garage transactions and at stable combat boundaries. A refresh during combat must restore a valid planning state without rerolling a completed attack, charging another entry fee, or duplicating rewards. Store encounter IDs, reward-settlement status, and random-generator state. Validate loaded saves and include a save-schema version. Handle unavailable or corrupted localStorage gracefully, with an explicit warning. Prevent negative currency, duplicate installs, selling installed equipment, illegal builds, duplicate rewards, and ammunition going below zero. Show the cost and consequence before a destructive action. Provide a recovery option so bankruptcy does not permanently block play: a sponsor can exchange the wreck and installed build for a basic loaner, at a reputation cost. Preserve the campaign rather than silently restoring the destroyed car. Organize the single file into clearly marked sections for configuration, catalogs, campaign state, vehicle calculations, shop transactions, combat simulation, AI, Phaser rendering, interface updates, and persistence. Share the same validation and combat functions between player and AI. Keep calculations testable without the renderer. ### 12. Scope and delivery standard Build a complete, modest game rather than a large collection of placeholders. The first version must support buying a car, modifying it, fighting on the road, recovering and installing a part, entering an arena, earning a purse, repairing damage, and continuing the campaign. Do not add multiplayer, accounts, pedestrians, an open-world travel map, crafting trees, online leaderboards, or monetization. Before delivery, verify the entire campaign loop, directional damage, firing restrictions, collision handling, inventory transfers, fee deductions, reward settlement, save/reload behavior, and recovery from defeat. Every visible button must work or be explicitly disabled with a reason. Avoid TODOs, dummy combat, decorative-only equipment, and screens that merely describe unimplemented features. **Deliver the complete index.php, followed by brief instructions for serving it locally and a compact explanation of the controls. Do not split the implementation into additional files.** [1]: Car Wars Classic “Car Wars Classic” [2]: Download Phaser v3.90.0 | Phaser “Download Phaser v3.90.0 | Phaser”

Cut and paste is wonky. Sorry!

The output…

random road battles in addition to arenas…

little clunky but not bad overall for 40 minutes! lol