<commit_before><!DOCTYPE html>
<html lang="en-GB" xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width,user-scalable=yes,initial-scale=1,maximum-scale=1">
		<title>Needs AI - Utility Artificial Intelligence Demo With Utility-Driven Agents</title>
		<meta name="author" content="<NAME>">
		<meta name="description" content="This utility based artificial intelligence game drives autonomous agents using utility-theory based logic.">
		<meta name="keywords" content="artificial intelligence, AI, utility, utility theory, needs-based, needs AI, IAUS, utility systems">
		<meta name="subject" content="Utility Based AI">
		<meta name="robots" content="index, follow">
		<link rel="canonical" href="https://www.samcodes.co.uk/project/needs-ai/" />
		<meta property="og:title" content="Needs AI - Utility Based AI Demo">
		<meta property="og:description" content="Demo that animates autonomous agents using utility-theory based AI">
		<meta property="og:site_name" content="Samcodes">
		<meta name="twitter:title" content="Needs AI - Utility Based AI Demo">
		<meta name="twitter:description" content="Demo that animates autonomous agents using utility-theory based AI">
		<link rel="icon" type="image/x-icon" href="icon/favicon.png">
		<link rel="apple-touch-icon-precomposed" type="image/x-icon" href="icon/apple-touch-icon-precomposed.png">
		<!--[if IE]><link rel="shortcut icon" type="image/x-icon" href="icon/favicon.ico"><![endif]-->
		<link rel="stylesheet" type="text/css" href="css/style.min.css">
	</head>
	
	<body>
		<section id="header">
			<div class="inner">
				<h1>Needs AI</h1>
				<h2>Utility-based artificial intelligence</h2>
				
				<a href="https://github.com/Tw1ddle/needs-ai" target="_blank">
					<img class="logo" src="https://github.com/Tw1ddle/needs-ai/blob/master/screenshots/logo.png?raw=true" alt="utility-based needs AI icon, artificial intelligence game and library logo">
				</a>
				
				<p><a href="https://github.com/Tw1ddle/needs-ai" target="_blank">Needs AI</a> drives autonomous agents with <a href="https://en.wikipedia.org/wiki/Utility_system" target="_blank">utility-based</a> artificial intelligence. An <a href="https://github.com/Tw1ddle/needs-ai" target="_blank">open source</a> demo written by <a href="https://twitter.com/Sam_Twidale" target="_blank"><NAME></a>.</p>
				
				<div id="game" class="container stitched" oncontextmenu="return false;"></div>
				
			</div>
		</section>
		
		<!-- Options and filters -->
		<section id="accordion">
			<div>
				<input type="checkbox" id="check-1">
				<h2><label for="check-1">Settings</label></h2>
				
				<div class="settings">
					
				</div>
			</div>
		</section>
		
		<br>
		
		<div class="container stitched">
			<h2 id="storysofar">The Story</h2>
			<h2>TODO</h2>
		</div>
		<div class="container stitched">
			<h2 id="agents">Human States</h2>
			<h2>TODO</h2>
		</div>
		<div class="container stitched">
			<h2 id="agents">Zombie States</h2>
			<h2>TODO</h2>
		</div>
		
		<br>
		
		<br>
		
		<div class="container stitched">
			<h2>How It Works</h2>
			<p>This page uses a <a href="https://en.wikipedia.org/wiki/Utility_system" target="_blank">utility AI</a> to control autonomous agents, in this case humans and zombies in the game world. Use the mouse to interact with the humans and zombies and watch the chaos unfold.</p>
			<p>AI where NPCs consider their own needs leads to convincing awareness of their environments and autonomous behaviours without the need for brittle scripting. Utility-based AI works for many types of game.</p>
			<p>The basic hierarchy is as follows: AI agents have Brains. Brains contain Reasoners. Reasoners contain ActionSets. ActionSets contain Considerations. Considerations (also known as Axes) hold Inputs, measurable aspects of the game world, and a way for an agent to consider (evaluate) the Inputs.</p>
			<p>When it is time for an agent to think using their Brains, the available Actions are scored by evaluating their associated Considerations, and the best scoring actions are chosen through a strategy encapsulated by the ActionSets and Reasoners.</p>
			<p>The challenging part of using a utility-based AI is the amount of design work and balancing needed to produce the behaviour you want. For example, an Input such as the distance from zombies must factor into human Considerations, but it may depend on the person.</p>
			<p>Another challenging area is making Inputs available in a performant way, like how to represent generalized distances between objects, influence maps, elapsed times and other attributes.</p>
			<p>This AI demo was written using <a href="https://haxe.org/" target="_blank">Haxe</a>. If you have any suggestions, requests or comments then <a href="https://twitter.com/Sam_Twidale" target="_blank">contact me</a> or open an <a href="https://github.com/Tw1ddle/needs-ai" target="_blank">issue</a>.</p>
		</div>
				
		<script type="text/javascript" src="js/three.min.js"></script>
		<script type="text/javascript" src="js/orbitcontrols.js"></script>
		<script type="text/javascript" src="js/game.js"></script>
	</body>
</html><commit_msg>More fiddling with page<commit_after><!DOCTYPE html>
<html lang="en-GB" xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width,user-scalable=yes,initial-scale=1,maximum-scale=1">
		<title>Needs AI - Utility Artificial Intelligence Demo With Utility-Driven Agents</title>
		<meta name="author" content="<NAME>">
		<meta name="description" content="This utility based artificial intelligence game drives autonomous agents using utility-theory based logic.">
		<meta name="keywords" content="artificial intelligence, AI, utility, utility theory, needs-based, needs AI, IAUS, utility systems">
		<meta name="subject" content="Utility Based AI">
		<meta name="robots" content="index, follow">
		<link rel="canonical" href="https://www.samcodes.co.uk/project/needs-ai/" />
		<meta property="og:title" content="Needs AI - Utility Based AI Demo">
		<meta property="og:description" content="Demo that animates autonomous agents using utility-theory based AI">
		<meta property="og:site_name" content="Samcodes">
		<meta name="twitter:title" content="Needs AI - Utility Based AI Demo">
		<meta name="twitter:description" content="Demo that animates autonomous agents using utility-theory based AI">
		<link rel="icon" type="image/x-icon" href="icon/favicon.png">
		<link rel="apple-touch-icon-precomposed" type="image/x-icon" href="icon/apple-touch-icon-precomposed.png">
		<!--[if IE]><link rel="shortcut icon" type="image/x-icon" href="icon/favicon.ico"><![endif]-->
		<link rel="stylesheet" type="text/css" href="css/style.min.css">
	</head>
	
	<body>
		<section id="header">
			<div class="inner">
				<h1>Needs AI</h1>
				<h2>Utility based artificial intelligence</h2>
				
				<a href="https://github.com/Tw1ddle/needs-ai" target="_blank">
					<img class="logo" src="https://github.com/Tw1ddle/needs-ai/blob/master/screenshots/logo.png?raw=true" alt="utility-based needs AI icon, artificial intelligence game and library logo">
				</a>
				
				<p><a href="https://github.com/Tw1ddle/needs-ai" target="_blank">Needs AI</a> drives autonomous agents with <a href="https://en.wikipedia.org/wiki/Utility_system" target="_blank">utility based</a> artificial intelligence. An <a href="https://github.com/Tw1ddle/needs-ai" target="_blank">open source</a> demo written by <a href="https://twitter.com/Sam_Twidale" target="_blank"><NAME></a>.</p>
				
				<div id="game" class="container stitched" oncontextmenu="return false;"></div>
				
			</div>
		</section>
		
		<br>
		
		<div class="container stitched">
			<h2 id="storysofar">The Story</h2>
			<h2>TODO</h2>
		</div>
		<div class="container stitched">
			<h2 id="agents">Human States</h2>
			<h2>TODO</h2>
		</div>
		<div class="container stitched">
			<h2 id="agents">Zombie States</h2>
			<h2>TODO</h2>
		</div>
		
		<br>
		
		<br>
		
		<div class="container stitched">
			<h2>How It Works</h2>
			<p>This page uses a <a href="https://en.wikipedia.org/wiki/Utility_system" target="_blank">utility AI</a> to control autonomous agents in the game world. In this demo we have humans and zombies - humans have a problem with zombies, and zombies enjoy nothing more than eating brains. Use the mouse to interact and watch the chaos unfold.</p>
			<p>AI where NPCs consider their own needs leads to convincing awareness of their environments and emergent autonomous behaviour without the need for brittle scripting. Utility based AI works for many types of game. Implementations tend to be modular, extensible and reusable, and are used in various commercial games, such as Iron Man or Red Dead Redemption.</p>
			<p>This implementation has the following structure: AI agents have Brains, top level decision makers that direct an agent. Brains contain Reasoners, decision makers that assess the suitability of sets of actions. Reasoners contain ActionSets, groups of potential actions. ActionSets contain Actions, identifiers for actions that an agent can engage in. Actions (also known as Options) contain Considerations, aspects that an agent must assess to determine the suitability of an action. Finally, each Consideration (also known as an Axis) holds an Input, a measurable aspect of the game world, and a technique an agent uses to consider (evaluate) the Input.</p>
			<p>When it is time for an agent to think using their Brain(s), the Actions are scored by evaluating their associated Considerations, and the best scoring actions are chosen through a strategy encapsulated by the ActionSets and Reasoners.</p>
			<p>A single agent may have more than one Brain for handling separate sets of Actions that may be performed in parallel, such as one Brain for chattering with your fellow survivors, and others for core behaviours such as handling weapons or running from zombies.</p>
			<p>The most challenging part of using a utility based AI is the amount of design work and balancing needed to produce the behaviour you want. For example, an Input such as the distance from zombies must factor into human Considerations, but it may depend on the person.</p>
			<p>Another challenging area is making Inputs, views of interesting data about your world, available in an efficient way. Such as, how to represent generalized distances between objects, influence maps, elapsed times and other attributes. Scalability is simple though - you can perform triggered updates, have agents only use their Brains every so often, or even disallow Actions that take a lot of processing power to consider when necessary.</p>
			<p>This AI demo was written using <a href="https://haxe.org/" target="_blank">Haxe</a>. If you have any suggestions, requests or comments then <a href="https://twitter.com/Sam_Twidale" target="_blank">contact me</a> or open an <a href="https://github.com/Tw1ddle/needs-ai" target="_blank">issue</a>.</p>
		</div>
				
		<script type="text/javascript" src="js/three.min.js"></script>
		<script type="text/javascript" src="js/orbitcontrols.js"></script>
		<script type="text/javascript" src="js/game.js"></script>
	</body>
</html>
{'fraction_non_alphanumeric': 0.13167165756561564, 'fraction_numerical': 0.005812929364100757, 'mean_word_length': 4.686029043565348, 'pattern_counts': {'":': 0, '<': 231, '<?xml version=': 0, '>': 231, 'https://': 22, 'lorem ipsum': 0, 'www.': 4, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2703391', 'n_tokens_mistral': 3711, 'n_tokens_neox': 3299, 'n_words': 1156}