Thursday, July 28, 2011

GameLog 208 & 209

Back to School, along with the inevitable drain on my energy to produce these lists:
Grepolis (20h)
Battlefield: Bad Company 2 (10h)
Terraria (5h)
Magicka (4h)
Sanctum (2h)
Hoard (2h)
Team Fortress 2 (1h)

Wednesday, July 20, 2011

Exerting Control

One of the key facets of Notorious will be the ability to exert control over the various NPCs in the game. This could be mercenaries hired to guard your dungeon, or to dig it out, or even heroes attempting to raid someone else's dungeon. Here's the new section on how I plan to have the player influence their actions.

Exert control
- Mercenaries and heroes wearing focus amulets can be controlled, or grant vision, communication, etc. by applying your power through the linked focus gem.

- Gem size allows a maximum amount of power to be channeled through to it. Overloading the power level of a gem increases the chance of destroying the gem.

- Spell power modified by the distance to the home stone. Travelling through rock increases power cost, so that there is a risk / reward for exposing your home stone for greater power, or hiding it for greater security (especially from unlinking). Power investment set at time of change, so there is a benefit to bringing the mercenary close to your home stone before setting up their new default behaviour.

- Linked gem spells

Vision: grants vision from the gem’s location. Flat fee, relatively inexpensive so that it can work on heroes a long way away exploring other dungeons.

Communication: Talk directly to the mind of the person/monster holding it. Flat fee, relatively inexpensive so that primary minion and informants can use it to carry out most menu interactions (checking prices, buying selling, rumours, etc). Raises suspicion if used on heroes.

Control: Attempt to influence the bearer to take a certain action. Power required is variable and competes with the bearer’s own priorities. Needs linking into the AI system to give options of (go to location, attack, capture, flee, search, rest, dig, build, give, take, etc). Control is either sustained until the player removes the power investment (default), or placed as a once-off so that the power is immediately returned once the specified action is completed.

Cloaking: Attempt to hide the presence of a gem from attuned people / players. Variable power required and competes with the opponent’s detection power.
Mimic: Attempt to make it appear that someone else is linked to the gem.

- General spells

Link to gem: Create a link to a gem to allow powers to operate through it. Maintaining a link to a gem increases exponentially depending on how many other gems you have linked to. Should be possible for beginning players to have 2-4, medium players to have 6-8 and end game players to have up to 10.

Detection: Attempt to detect gems in your vicinity. Competes with cloaking (ground may also cloak gems). May choose a level to be used constantly which will add detection of other players attempting to scout / raid your dungeon.

Trace link: Attempt to find out who has a link to to a gem. Competes with Mimic power level to reveal all players / mimics currently linked.

Artificial Intelligence

Exerting control will be dependent on modifying the behaviour of the Mercenaries under your control, so it will be fairly important to design an AI system that is robust enough to allow independent emergent behaviour, but make sense enough that players can interact with the system in a meaningful way.

Actions and Needs
Each NPC will have a list of needs that change over time (the need for happiness, riches, sleep, food, chaos, etc). These needs will lead to actions fulfilling that need such as sleeping, fighting, etc. Each action that the AI can make is given a weighting depending on the expected need reduction that the action will take, then organised into a priority list of highest to lowest need reduction. The highest action is the one that is executed until the need is satisfied enough that the action is no longer the highest (plus an additional ‘resistance to change’ amount to keep them from always swapping from one task to the next and losing time on travelling).

Exerting Control
The player can interact with the Actions by placing more or less emphasis on that action by spending power points. This can be used to raise non-desirable actions (such as digging) into top priority, or to remove NPC actions that are not contributing to the player’s expectations (such as relaxing). Since the actions are given inputs from the need system there will be no way to completely stop a mandatory action (such as sleeping or eating) but they can be suppressed so that other action can take precedence for longer periods.

This is a list of needs and a brief description of how they will be expected to change over time.
Sleep - ramps up on an exponential scale
Eat - Ramps up on an exponential scale
Chaos - Slowly increases over time depending on their desire for chaos.
Safety - Usually 0. Increases when enemy is in sight, and ramps up depending on their assessment of a battle. Should be maxxed if they think the next round will kill them.
  • Owning space gives a set amount of happiness per hour depending on the mercenary’s desire for space.
  • Owning items gives a set amount of happiness per hour depending on the mercenary’s desire for that type of item. May be too complex an interface for little reward. Might simply make a ‘desirable item’ shortlist akin to dwarf fortress preferences and mainly include useable weapons.
  • Increasing Riches gives a one-time boost to happiness depending on the desire for riches. This may be triggered by getting %loot from kills, or by regular negotiated payments. Happiness gain indirectly proportional to their current wealth.
  • Doing Work drops happiness depending on their desire for the task done (Guarding, Digging, Building, Set traps, etc)
  • Faction likes/dislikes can influence happiness when they see mercenaries or heroes of an opposing faction. Can be used to introduce incompatible mercenary mixes such as dark dwarves and dark elves, Ors and goblins, etc, or encourage hiring similar types of mercenaries (or keep them VERY separated)

This is a list of actions and the needs that they fulfil
Eat - Attempts to go to home or designated dining hall and eats. Should drop hunger to 0 in a couple of turns.

Sleep - Returns home or to a designated barracks and sleeps. Should drop need for sleep AFTER waking (~5 turns?), so if they are sleeping they will still be unsatisfied if another action takes priority (an attack occurs threatening safety)

Guard location - Attempt to go to a location and remain alert. Generates unhappiness depending on desire for guarding. Player needs to exert control for this action to be considered. Elevates attack options once location is reached. Can also be used to suppress prisoners if guarding an prison area.

Patrol between locations - Attempt to walk between multiple locations and remain alert. Generates unhappiness depending on desire for guarding. Player needs to exert control for this action to be considered. Can also be used to suppress prisoners if guarding an prison area.

Defend Home - Return home and guard. Increases priority if enemy in home. Increases priority if personal safety is at risk. Increases priority depending on mercenary wealth. Decreases happiness depending on desire for guarding, but not as much as guarding location (1/4?)

Attack Character - Attacks the designated character. Can be elevated into priority by sighting someone when guarding, or to a lesser extent sighting an enemy when doing another task. Use aggression attribute? Decreases Chaos need. Increases safety need (indirectly proportionally to aggression?)
This action will be replaced by modes of attack such as:
  • Attack character with melee weapons
  • Attack character with ranged weapons
  • Attack character with ability X
Attack toward location - Move to location with very highly elevated attack character action pending. If any enemy is in sight, attack nearest. Player needs to exert control for this action to be considered.

Hide for Ambush at location - Move to location and wait for adjacent enemy before initiating an attack. Generates unhappiness depending on desire for guarding/ambush.

Flee - Generic flee action that will attempt to run away from the source of the damage. May lead to mercenary getting caught or corralled into a corner. Increases priority with Safety need and escalates so that it should be top priority if they perceive that they will die next turn. Reduces with reduction in safety concerns (no-one hitting them last turn, no-one in sight, health above 50%, etc.)

Flee to location - Uses flee mechanic, but has a specific location that they will attempt to get to rather than simply going away from the battle. Will usually be lower than Flee itself, but offers the player a way to exert control over where the mercenary should retreat to. A* to location needed as a weight against this action, especially if it takes them through the battle. I’d anticipate that building small hides and a fairly large sustained investment into this action will keep most mercenaries alive, even through wipes.

Go to location - Basic movement. Most actions will incorporate this action into their own, so this one is specifically designed for players to dictate a location change (say, going to the throne room for further instructions). Most likely used as a once-off power placement. Little to no interaction from needs. Possibly generate unhappiness at same rate as transporting goods.

Dig Nearest - Assign character to continually dig out designated areas. Decreases happiness depending on desire for mining. Player needs to exert control for this action to be considered. Digging skill increases digging speed.

Dig Location - Assign character to dig out a specific location rather than digging any designated area. Decreases happiness depending on desire for mining. Player needs to exert control for this action to be considered. Digging skill increases digging speed.

Mine nearest Gold - Phase 2 of digging that separates extracting gold from deposits rather than simply digging anything. Designated area produces a large quantity of gold before disappearing rather than being mined out quickly like any other rock. Digging skill increases quantity of gold mined.

Mine Gold at location - As above, but with a specific location designated.

Extract nearest Gems - Phase 2 of digging that separates extracting gems, rather than simply digging anything. Designated area will eventually produce a large gem capable of channeling power, along with potential minor gems for throwaway use (on heroes). Digging skill increases chance that gems retain their maximum size.

Extract Gems at location - As above, but with a specific location designated.

Build Wall - Construct a wall following the designated tiles. Need to also remove ownership of tile, or reduce their potential to provide happiness. Decreases happiness depending on desire for building. Player needs to exert control for this action to be considered.

Build Trap - Construct a trap at specified location. Need to reduce the potential of the tile to provide happiness to owner. Decreases happiness depending on desire for building. Player needs to exert control for this action to be considered. Trap skill increases the level of the trap set (to compare against hero detection / disarming skill)

Manufacture item X - Phase 2. Construct an item using materials. Priority increases with availability of resources and desire to construct. Decreases happiness depending on desire for manufacture. Some mercenary types (or captured blacksmiths) may spontaneously attempt this, but will be predominantly player driven.

Transport item to location - Move an item from its current position to another. Most likely triggered by heroes dropping loot. Can be used by player to reorganise gems and equipment use. Decreases happiness depending on desire for transporting.

Relax - Returns to home and slowly generates happiness. More or less a default action for unhappy mercenaries. More than likely this one will be reduced, or other actions that gain happiness increased for more efficient happiness management.

Raid village - Should have a number of options under this one for each type of raid (raid for items / money, Capture prisoners, Cause chaos). Priority changed by chaos, security, unhappiness. Successful raids reduce chaos and increase happiness.

Capture character - Make into prisoner. Can be used against raiding heroes, or against town.

Raid dungeon - Send them out against another player.

Pick a fight - Increases with Chaos and presence of opposing factions.

Revolt - Severe unhappiness for an extended duration. Usually means that space / money / items are not sufficient to keep the character under control. Will attempt to leave the dungeon. May also be used for prisoners who feel that potentially dying on their way to the front door is better than continuing on.

Get Payment - Go to vault and attempt to extract any outstanding payment. Priority increases with unhappiness. Successful payment increases happiness by an amount dependent on the character’s current wealth. Failure to retrieve payment decreases happiness further, but also dampens this type of happiness gathering for a moderate period so that they may try other avenues of gaining happiness (like relaxing)

Take ownership of location - Increases the space owned by the character. This may be available under severe unhappiness, but will be mainly used by the player to increase the happiness regeneration flowing from the character’s increased levels, or increased wealth.

Take ownership of item - Marks the item as now belonging to the character. Triggered by loot drops when %loot contracts are used. Can also be used to forcibly transfer someone else’s item to this creature, with appropriate anger from victim. Can be used by the player to give new weapons or gems from the vault.

Give ownership of location to character - Remove ownership of space and transfer it to another character. Creature competing the transfer will be angry on the loss of space, but not as angry as if it’s been taken from him. Very unlikely to be triggered naturally, but gives a way for the player to adjust their mercenary structure.

Give ownership of item to character - As above, but utilising item in the creature’s posession.

Sign new contract - Demand a new contract be signed. Priority increased through consistent unhappiness or multiple gains of levels. One step before revolting, and possibly linked to an email out to the player. Can also be triggered by the player to negotiate different payment methods (most likely with a once-off power payment)

(Mainly) Hero Specific:
  • Escort Prisoner - Attempt to move with the prisoner to the entrance. If they make it they are credited with rescuing that prisoner.
  • Disarm Trap - Apply disarming skill to any detected trap. Priority increases significantly when a trap is near and known. Ramps up with expectation of successful disarming.
  • Search for secret doors / traps - Apply searching skill rather than moving on quickly. Priority increased with searching skill and hero aggressiveness.

Monday, July 11, 2011

A Notorious Holiday (Pt 2)

After fleshing out the design document with all the new ideas, it was time to start looking into coding. My first port of call was the ToME engine as it had a promising glimpse of a realtime roguelike example module. Unfortunately the module didn't work out of the box, but finally a forum post cleared up the issue.

Spent a couple of hours setting up the dev environment and compiling the ToME source code, only to find out that the vast majority (if not all) of the module can be handled exclusively by the LUA module documents. First impressions of the system are great as it was pretty easy plugging in a bit of code from the ToME module and getting it working. I did have some issues trying to debug certain errors, but once I realised all output was going to the log file and not to the console, it made it a lot more straightforward to see what needed to be imported to get a certain piece of code working.

The development path is pretty much set for either the full game or along way into the prototyping phase with the wealth of extras that T-engine4 gives me.

Projected development:
- Recompile T-engine - Done, although not needed
- Set up a new module based off the realtime example - Done. 30 mins
- Bring in new entities that are on the player's side - Done. 4h. Pinched the summoning code. Bit messy as it used the party system that was non-existent in the example module. Lots of new code brought in that may or may not help.
- Bring in the party system - Done. 2h. After revisiting the ToME module it seems like the party system might work well for flipping control between the mercs on your side. I'm not sure whether I'll need the party display though.
- Have vision from all minions. 3h. 80%. Worked in the first 1/2 hr, but now it seems inconsistent. Hopefully it's only an incorrect assumption about the caching, but I've seen enough to know that it's definitely possible.

- Spawn in a hero and move it toward the player. Hopefully the minions are able to react and fend off the hero. Will need to open up state-based AI transitions.
- AI code to move hero toward arbitrary location.
- AI code to make hero explore.
- Build governor AI to swap between AI states depending on priorities.
- AI code to make hero retreat.
- Allow minions to retreat to arbitrary point
- Create a digging AI task for minions.
- Allow player to influence minion priorities.
- Build power system for player
- Tidy up minion influence interface to make it viable for realtime play. Goto X, stop, Fight, Flee, dig, transport.

- Create standard dungeon layout with initial home stone placement and initial Gemkeeper minion.
- Limit movement and appearance of player to home stone.

- Build Gem Detection spell
- Build Gem Linking spell
- Build Vision spell
- Build Communication spell
- Build Exert control spell (interface onto merc AI priorities?)
- Create 10-20 mercs and test.
- Build Merc selection interface
- Integrate merc happiness system into AI priorities
- Designation of ownership
- Designation of rooms (vault / prison / throneroom / retreats)
- Collect hourly payments from vault

- Design village raids
- Design rumour system
- Design village (?). allow swapping of interfaces to see village raids
- Design notoriety boards
- Design merchant
- Design Black market

- Link notoriety to power gain.
- Create more heroes / Mercs and play-balance notoriety.
- Release version 0.1

GameLog 206 & 207

Steam summer sales to the rescue. Lots of bargain bin play and additional achievements to chase.

Civ V (22h) - Rome Rising scenario. Almost a total conversion, and the changes have made the game feel very much like you're playing Rome in its infancy. Map, Tech and AI gives rise to a typical Roman expansion path. Reminds me somewhat of Philip of Macedon in that it makes me want to know more about the actual history of the Roman rise to power.

Grepolis (15h) - 12 cities. 105th. Back into a groove of morning, midday and night time farming runs, plus a little bit of occupation with the freedom that the holidays allows me.

Terraria (12h) - Digging with Cam.

Solar 2 (9h) - Exceptional little Indie title I picked up just before the steam sales. Feel a long time ago now though.

Magicka (8h) - Fun little game. Controls take a bit to get used to, but should be great at LAN.

Mount & Blade: Warband (7h) - New female campaign to chase a ticket.

Shogun: Total war 2 (6h) - New Date' and Tokugawa campaigns to chase tickets.

Guardians of Graxia (6h) - Was meaning to pick this up and give it a go earlier, but never got around to it. Plays somewhat like a tabletop game mixed with Magic: the gathering. Seems a little limited to keep me entertained with all the other stuff I've just picked up.

ToME (5h) - New work starting on Notorious using the ToME engine. Started another play through to see how the new party system works.

League of Legends (5h) - A couple of games a night up in Mackay with brothers.

Hoard (2h) - More fun chasing tickets.

TF2 (2h) - Even more fun. With TF2 going free 2 play, it's going to get a bit more of an airing.

AI war (1h) - Bit too complex to get into during alll the mayhem of the sales and the Mackay trip. Might need to revisit it once things settle down.

Dawn of War 2 (1h) - Last Stand fun at LAN.

Moonbase Alpha (1h) - Limited LAN airing. Pretty fun pinching the dune buggy, but the interface is pretty bad for serious play.

Thursday, July 07, 2011

A Notorious Holiday

The semester break has been great, especially after finding out I had 3 weeks off instead of 2. I know I'll need about a week to get things organised for next semester, and we'd already organised a week up in Mackay, so the additional week has meant extra time for Notorious design and possibly programming. I've already spent about 3 days going over the design with anyone that will listen, and have discovered a couple of critical pieces to smooth out the concept into a logical, cohesive environment. I've also moved the majority of the documentation into a google document for easier layout control, but will attempt to log the design progress here too.

Focus gems
I'd been flitting around with the idea of using some sort of amulets or the like to utilize the powers of the player, or possibly direct spells, but it was all a bit up in the air. Making the decision to move to exclusively gem-based spells have tidied up a lot of loose ends. Now the players are effectively ethereal beings (more work on that yet) that use gems to focus their power. They have a 'home stone' (a large gem located somewhere in the dungeon) that they primarily link to, and then can manipulate other gems in their immediate vicinity. Base spells are available to discover gems and link to them, then linked gems can have vision, communication or control over the bearer. Limiting the amount of focus gems allows players to make interesting choices in terms of utilising them for scouting, more minions, infiltration, etc.

Having the home stone instead of the actual player allows a logical way of keeping the player safe through dungeon wipes, but also allows high level play to include unlinking the player from their dungeon effectively starting them again (depending on their latent power).

The Gemkeepers are a Hidden Society that knows somewhat of the player's ability to link to gems. They believe that by helping these beings, they too may be able to claim power over the world. Gemkeepers actively seek out gems large enough to be linked to and attempt to prepare the gem to be linked. Contrary to the Gemkeeper’s beliefs, the gems do not need any special preparation for linking, but the existence of the Gemkeepers does make it easier to get started in your notorious career.

Acolyte Gemkeepers have no master, and scour the countryside looking for a suitable gem. Once located (using Gem Detection spell at power level similar to their level), they dig out a corridor to the gem and, while they are waiting for a presence to appear, they keep digging out more and more of a throne room around the gem as well as a place for themselves to live. They also make themselves known to the local town or village using a secret identity to hide their real aim of being here. Acolytes spend as much of their time as possible in the throne room, hoping to be the first one that the presence links to. For this to occur, Acolytes carry a quite precious gem (or possibly several) with them to make the linking process easier.

The number of Acolytes are significantly higher than the number of Linked Ones (full members of the Gemkeeper Society who have successfully been linked to an Ethereal Being) and it may take a lifetime for an Acolyte to become linked, if ever. Acolytes learn from the Linked Ones about what generally goes on once linked in somewhat vague terms. It is common knowledge within the society that a gem of a certain size and quality is needed to host a presence, that they will then use the main gem (home stone) to link with other gems, and that the presence can then communicate to and influence creatures holding those gems.

If an Ethereal Being links to an uncovered gem (new players automatically find uncovered gems), they will often see the Acolyte Gemkeeper in the throne room, calling out ‘Link to me master!’, ‘Speak to me!’, ‘Let me be your right hand man!’.