Skip to content

Ecce Signum

Immanentize the Empathy

  • Home
  • About Me
  • Published Works and Literary Matters
  • Indexes
  • Laboratory
  • Notebooks
  • RSS Feed

Tag: game development

Creating a Sensory Input-Based Monster AI, Part I

2006-05-30 John Winkelman

As a thought experiment I am putting together a generic artificial intelligence which I can use for bad guys/NPCs in a variety of different games. There are myriad paths I could follow in creating AI, so for right now I am going to concentrate on two inter-related tasks: awareness and morale. In other words, when does X become aware of another entity, and what does X do in response to that awareness?

For the purposes of this essay there will be two entities: a deer and a wolf. I will discuss the reactions of the deer.

The first step is to create a triggering event. In this case, proximity. Using whatever senses are available to it, somehow, at some point as the wolf approaches, the deer becomes aware of it. This could be something like a twig snapping, or movement in shadows, or wolf-smell on the wind. In any case, the first level of this system is Awareness.

Once the deer is aware that Something is out there, the next step is to determine what that thing is. It could be another deer, or a faun, or a human, or the wolf. Without making that determination the deer cannot react appropriately. It might run in terror from the faun, or stand still while the wolf attacks. So the second level of the system is Recognition.

Once the approaching entity is recognized, the deer can take the appropriate action; in this case, run in terror from the wolf. Or if the deer is protecting a faun, move to attack/distract the wolf while the faun flees. This level of the system is Reaction.

So: Awareness to Recognition to Reaction. Think of them as concentric rings centered on the deer. As the wolf enters these rings its proximity triggers different responses. These distances can be displayed as a sequence of numbers; for instance [20/10/5]. [Awareness/Recognition/Reaction].

Awareness will always be the largest number. Without being aware of something, the deer cannot either recognize or react to it.

Either recognition or reaction may be the next largest number, or they may be equal. In any case, neither of them may be larger than the Awareness number, although they may be equal to it.

So: [10/5/10] would be a “legal” description, but [5/10/5] would not.

Using this system a wide variety of behaviors may be put into place with little effort. The following are some examples:

[10/5/2] — Long-range awareness, medium-range recognition, short-range reaction. A semi-tame, slow-moving, not-too-bright animal. A farm cow, for instance. Knows you are there, knows who you are, doesn’t much care.

[10/5/10] — Long-range awareness and reaction, medium-range recognition. Guards at a gate. Something is out there, so immediately set out after it. Once they are close, it may be recognized and perhaps another action performed.

[10/5/1] — Long-range awareness, medium-range recognition, extremely short-range reaction. A bored, disaffected clerk at a store. Knows you are there, knows who/what you are, doesn’t do anything until you actually poke him in the shoulder.

[10/1/10] — Long-range awareness and reaction threshold, contact-range recognition. A rhinoceros during mating season, which charges anything it detects, and only stops when it recognizes “Ooh! That’s a train!”, or something of the like at extremely short range. Basically this is an unthinking reaction to the presence of another entity.

It occurs to me that this could be made less “broad” and more “deep” by changing to a two-level “awareness/reaction” and “recognition/reaction” system. For the purpose of simple- to medium-complexity games I like the three-level approach. In particular playing around with the distance between “recognition” and “reaction”, allowing for simulating different levels of intelligence or bravery, and startle-reactions, such as an enemy suddenly appearing well within the “reaction” threshold, causing a panic reaction; or a particularly slow-witted (think “drunk”) critter standing around gob-smacked while being charged by a bull.

Note that this AI system is for an “initial contact” situation, where another entity is first entering into awareness range, or has been outside of awareness range long enough that the “deer” has forgotten the entity was there. Reactions when actually interacting with another entity will be discussed in an upcoming essay.

Posted in ProgrammingTagged artificial intelligence, game development comment on Creating a Sensory Input-Based Monster AI, Part I

Flash 8: Height Map With Color

2006-03-17 John Winkelman

Minor change to the previous experiment. This one, obviously, performs color substitution as it is rendering the 3d-ish version of the bitmap. Click to launch the Height Map.

Posted in ProgrammingTagged Flash, game development comment on Flash 8: Height Map With Color

Practicing What I Preach

2006-02-01 John Winkelman

In line with my stated goals for the the Year of the Dog, I have given myself a couple of personal projects.

Every day this year, I will think up an idea for a game. Computer game, board game, card game, logic puzzle… all are fair game. Heh.

And every day this year, I will write a poem. Haiku, sonnet, blank verse, random gibberish…good or not, it will help me get my head back into the space it was many years ago, before I began spending so much time staring at computers.

If I come up with anything particularly interesting or good, I will post it here. And if one of my ideas turns into an actual game, I will also post it here.

Here is an example computer game which I came up with today:

You are stationed on an asteroid in space, in the middle of an ion cloud. Enemies are approaching! Your only defense is a (bottomless) crate of capacitors and a, uh, capacitor launcher. When the capacitor reaches a predetermined location, it discharges and electricity arcs between your base and the capacitor, frying anything which gets in the way.

Gameplay is as follows:
Your base is in the center of the screen.
Enemies drift around out in space, and occasionally spiral in to ram you.
Click the screen to launch a capacitor from your base to the area you just clicked.
When the capacitor reaches that point, electricity discharges in a straight line between the base and the capacitor.
Any Enemy touched by the electricity is destroyed.
Powerups are occasionally released by dead enemies, and drift toward your base.
If you shoot the powerup it is destroyed

Powerups include extra lives, shields, a faster-flying capacitor, improved rate of fire, multiple arcs, and possibly a smart-bomb type weapon.

I don’t think this game would be too difficult to program. I just need to sit down and program it.

Posted in LifeTagged game development, poetry comment on Practicing What I Preach

Kingdom, Complete

2005-10-19 John Winkelman

Weeellllll here it is. A total of about ten hours of development, and perhaps not the cleanest code in the whole wide world, but it is done. And already I have several ideas for a sequel.

Click here to play Kingdom.

Posted in ProgrammingTagged Flash, game development comment on Kingdom, Complete

Kingdom

2005-10-04 John Winkelman

This is the first draft of my version of one of the first video games I ever played. Variously called Kingdom or Hammurabi, it is a simple economic game. I first played it in the Impressions 5 Science Center in Lansing, Michigan. I must have been about eleven years old.

You are the ruler of a kingdom. Your duty is to acquire land and peasants. You do this by planting crops, feeding your peasants, and indulging in simple land speculation (buy low, sell high). Chaos enters the system in the form of rats eating your grain, peasants dying of plague, and variation in the price and fertility of your land. The “bushel of grain” is the standard unit of currency.

Right now the balance of values is as follows:

-Each peasant eats 20 bushels of grain a year
-It takes 2 bushels of grain to plant an acre of land
-Each acre of planted land will grow between 2 and 5 bushels of grain
-If you under-feed your peasants, they will starve to death.

If you try to spend more grain than you have, the game will simply do nothing when you click the button. And this leads me into the “to do” list for the game

-alerts which tell you when you are spending too much.
-adding logic so that each peasant can farm no more than 10 acres of land
-allowing a set number of years so the game does not continue forever
-if too many peasants die, the survivors revolt and cast you from power

I like this kind of game. It packs a nice amount of complexity into a very small package. I imagine that the idea for Warcraft grew out of something very like this.

Click here to play my version of The Kingdom of Hamurabi.

Posted in ProgrammingTagged Flash, game development comment on Kingdom

New Week, New Books

2005-06-29 John Winkelman

Well, once again I was distracted from Dark Age Ahead by another book. Several, in fact.

The first is Made in Detroit by Paul Clemmens, which has not yet been published but I got my hands on an uncorrected galley. When it is finally released I highly recommend grabbing a copy.

Next, the latest edition of McSweeney’s Quarterly Concern arrived on Monday. This one came packaged with a comb.

And today I picked up Olympos by Dan Simmons, a book for which I have been waiting for about a year. I will post more after I read it, which should hopefully be sometime this weekend.

At work my first game project is beginning to ramp up, so I have been learning/brushing up on, in no particular order, Actionscript 2.0, UML, Use Case Scenarios, and software engineering. This should keep me happily busy until Oh, about February.

Posted in Literary MattersTagged game development, work comment on New Week, New Books

Playing With(in) the Rules

2005-06-03 John Winkelman

In Twisty Little Passages, Montfort distinguishes between three types of story or narrative: Diegetic, Hypodiegetic, and Extradiegetic (from diegesis). The 1001 Arabian Nights is useful for describing the differences: The framework story is diegetic, each of the individual stories is hypodiegetic, and the physical book itself, the paper and ink, is extradiegetic.

In the world of Interactive Fiction, Diegetic commands are those which control the “player character”. Extradiegetic (e.g. meta-) commands are those which control the game itself. Hypodiegetic commands are those which are made through the player character, and which influence other characters in the game.

Moving from Interactive Fiction out to User Interaction, we find some parallels. Using the navigation links in a website is diegetic. Using the web browser controls is extradiegetic. Perhaps using in-system tools (e.g. a price calculator or a store locator) could be considered hypodiegetic.

Someone pointed out a few years ago that web developers and usability experts, nominally working in a “new” field, could take many lessons from the video game industry, which has been working on many of these same problems for more than 30 years.

Posted in ProgrammingTagged game development, games, reading comment on Playing With(in) the Rules

Gaming and Surfing

2005-04-19 John Winkelman

As I dive deeper into the theory and structure of the training courses, I realize that a lot of basic usability features of web pages and applications map closely to the features of adventure games which we consider vital and part of “good gameplay”.

Consider personal inventory. You are in a small room. You are wearing a backpack which contains a coil of rope and some food . Compare this to any of the numerous checkout screens at Amazon.com. Your shopping cart is used in the same way: You put something in it, and while you move from page to page (room to room) the things you put in the cart stay in the cart. They are available for you to use whenever you need them.

Consider navigation. In an adventure game it is considered poor form to put the player in a room from which there is no escape. By “no escape” I mean that the player character is alive and well, but cannot backtrack and cannot go forward. The only way out is to restore a saved game or manually restart the game (play with the game rather than within the game). This is analogous to hitting a page in a website where there are no navigation elements and the only way to move to a different part of the site is to hit the web browser’s “back” button (restore a saved game) or type a new URL in the address bar (restart the game).

I am sure there are many more parallels, but these seemed to be the obvious ones.

Posted in ProgrammingTagged game development, work comment on Gaming and Surfing

Back to Work

2005-03-16 John Winkelman

Well, it looks like my days as a Gentleman of Leisure are coming to an end. Starting Monday I am back to somewhat regular work hours, albeit this time as a contractor rather than a full-time employee. No more soap operas. No more sleeping in until noon. No more spending the entire day in my pajamas.

So it is appropriate that I hereby announce the release of Whirling Vector Shapes of Doom v1.0 . This is the first game I have completed in eighteen years. The last one was a dungeon crawl written in BASIC on a Commodore-64.

Having reached every milestone I set myself for this release I already see room for a dozen improvements, and I have ideas for the creation of another dozen games.

Stay tuned!

Posted in LifeTagged Flash, game development comment on Back to Work

Almost A Game

2005-03-06 John Winkelman

I took a few days off of this thing, then returned with a vengeance. The arrow keys [UP,DOWN,LEFT,RIGHT] control the direction you move. [Z] fires your gun.

Click to play the game.

Posted in ProgrammingTagged Flash, game development comment on Almost A Game

Posts navigation

Older posts
Newer posts

Personal website of
John Winkelman

John Winkelman in closeup

Archives

Categories

Posts By Month

May 2025
S M T W T F S
 123
45678910
11121314151617
18192021222324
25262728293031
« Apr    

Links of Note

Reading, Writing
Tor.com
Locus Online
The Believer
File 770
IWSG

Watching, Listening
Writing Excuses Podcast
Our Opinions Are Correct
The Naropa Poetics Audio Archive

News, Politics, Economics
Naked Capitalism
Crooked Timber

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

© 2025 Ecce Signum

Proudly powered by WordPress | Theme: x-blog by wpthemespace.com