[REQUEST] AI personality selection

Discussion in 'Mod Discussions' started by Quitch, July 24, 2015.

  1. Quitch

    Quitch Post Master General

    Messages:
    5,885
    Likes Received:
    6,045
    In the lobby is a drop down for the AI by which you select a personality. This is drawn from the \ui\main\game\new_game\js\ai.js file which contains a number of blocks which look like the following (PTE):

    Code:
            'Absurd': {
                percent_vehicle: 0.45,
                percent_bot: 0.25,
                percent_air: 0.2,
                percent_naval: 0.05,
                percent_orbital: 0.05,
                personality_tags:
                [
                    "PreventsWaste"
                ],
                metal_drain_check: 0.55,
                energy_drain_check: 0.65,
                metal_demand_check: 0.72,
                energy_demand_check: 0.8,
                micro_type: 2,
                go_for_the_kill: true,
                priority_scout_metal_spots: true,
                enable_commander_danger_responses: true,
                neural_data_mod: 1.0,
                adv_eco_mod: 1.3,
                adv_eco_mod_alone: 0.85
            },
    personality_tags is a new field allowing the assignment of multiple tags to affect the AI's behaviour. For example, Queller uses the older personality_tag field (one tag only) to allow each difficulty level to utilise unique behaviour.

    With the ability to add multiple personality_tags I want to expand this so that behaviours are selectable separate from the difficulty. However, with the current implementation this gets unwieldy pretty fast.
    1. Imagine five difficulty levels: bronze, silver, gold, platinum and uber. That's five personalities in the drop down.
    2. Now you want to add unit variations: bots, tanks, air, random. That's now twenty personalities in the drop down.
    3. Further to that you want to add strategic variations: turtle, tech, adaptive. Now you have sixty personalities in the drop down. Clearly unmanageable.
    What I want is for something that parses the ai.js, and any additions (ala wondible's AI Personalities mod), and then presents each item in its own dropdown. To clarify, let's imagine the final ai.js looks like this:

    Code:
            'Relentless': {
                percent_vehicle: 0.45,
                percent_bot: 0.25,
                percent_air: 0.2,
                percent_naval: 0.05,
                percent_orbital: 0.05,
                personality_tags:
                [
                    "PreventsWaste"
                ],
                metal_drain_check: 0.75,
                energy_drain_check: 0.85,
                metal_demand_check: 0.92,
                energy_demand_check: 1.0,
                micro_type: 2,
                go_for_the_kill: true,
                priority_scout_metal_spots: true,
                enable_commander_danger_responses: true,
                neural_data_mod: 1.0,
                adv_eco_mod: 1.3,
                adv_eco_mod_alone: 0.85
            },
            'Absurd_BotTechRush': {
                percent_vehicle: 0.45,
                percent_bot: 0.25,
                percent_air: 0.2,
                percent_naval: 0.05,
                percent_orbital: 0.05,
                personality_tags:
                [
                    "Bots"
                    "TechRush"
                ],
                metal_drain_check: 0.55,
                energy_drain_check: 0.65,
                metal_demand_check: 0.72,
                energy_demand_check: 0.8,
                micro_type: 2,
                go_for_the_kill: true,
                priority_scout_metal_spots: true,
                enable_commander_danger_responses: true,
                neural_data_mod: 1.0,
                adv_eco_mod: 1.3,
                adv_eco_mod_alone: 0.85
            },
            'Absurd_Tank': {
                percent_vehicle: 0.45,
                percent_bot: 0.25,
                percent_air: 0.2,
                percent_naval: 0.05,
                percent_orbital: 0.05,
                personality_tags:
                [
                    "Tank"
                ],
                metal_drain_check: 0.55,
                energy_drain_check: 0.65,
                metal_demand_check: 0.72,
                energy_demand_check: 0.8,
                micro_type: 2,
                go_for_the_kill: true,
                priority_scout_metal_spots: true,
                enable_commander_danger_responses: true,
                neural_data_mod: 1.0,
                adv_eco_mod: 1.3,
                adv_eco_mod_alone: 0.85
            },
    You're presented with a single drop down which offers you the following:
    • Relentless
    • Absurd (the script knows to ignore everything after an underscore and so these two options become one)
    You choose Absurd. Now a new drop down appears which offers you:
    • Bot
    • Tank
    PreventsWaste isn't presented because no Absurd AI has it. The first option in the list is the default choice. You pick Tank. If you changed Absurd to Relentless then Tank would immediately change to PreventWaste.

    The script has narrowed your selection down to a single AI personality and so no further boxes are presented. When the game is launched the AI Absurd_Tank is the assigned personality for that slot.

    This would allow for meaningful customisation of AI behaviour by the player, while keeping the UI element manageable.
    Last edited: July 24, 2015

Share This Page