this is mostly about videogames, and is a small sample of the research i am doing for this novel. lots and lots of research.
There is some debate about how much work a gamemaster should put into an important NPC’s statistics; some players prefer to have every NPC completely defined with stats, skills, and gear, while others define only what is immediately necessary and fill in the rest as the game proceeds. There is also some discussion as to just how important fully fleshed-out NPCs are in any given RPG, but it is general consensus that the more “real” the NPCs feel, the more fun players will have interacting with them in character.
In some games and in some circumstances, a player who is without a player character of their own can temporarily take control of an NPC. Reasons for this vary, but often arise from the player not maintaining a PC within the group and playing the NPC for a session or from the player’s PC being unable to act for some time (for example, because they are injured or in another location). Although these characters are still designed and normally controlled by the gamemaster, when players are given the opportunity to temporarily control these non-player characters it gives them another perspective on the plot of the game. Some systems, such as Nobilis, encourage this in their rules.
In less traditional RPGs, narrative control is less strictly separated between gamemaster and players. In this case, the line between PC and NPC can be vague.
In some online games, such as MMORPGs, NPCs may be entirely unscripted, and are essentially regular character avatars controlled by employees of the game company. These “non-players” are often distinguished from player characters by avatar appearance or other visual designation, and often serve as in-game support for new players. In other cases, these “live” NPCs are virtual actors, playing regular characters which drive a continuing storyline (as in Myst Online: Uru Live).
More advanced RPGs feature interactive dialogue, or branching dialogue (dialogue trees). A good example are the games produced by Black Isle Studios and White Wolf, Inc.; every one of their games is multiple-choice roleplaying. When talking to an NPC, the player is presented with a list of dialogue options, and may choose between them. Each choice may result in a different response from the NPC. These choices may affect the course of the game, as well as the conversation. At the least, they provide a reference point to the player of his or her relationship with the game world. True dialogues with NPCs are usually very complex, however after you talk with an NPC and turn right back around to talk with them again, no matter how many times you do this, usually they will give you the same exact conversation.
Ultima is an example of a game series that has advanced from non-branching (Ultima III and earlier) to branching dialogue (from Ultima IV and on). Other role-playing games with branching dialogues include Cosmic Soldier, Megami Tensei, Fire Emblem, Metal Max, Langrisser, SaGa, Ogre Battle, Chrono, Star Ocean, Sakura Wars, Mass Effect, Dragon Age, Radiant Historia, and several Dragon Quest and Final Fantasy games.
Certain video game genres revolve almost entirely around interactions with non-player characters, including visual novels such as Ace Attorney and dating sims such as Tokimeki Memorial, usually featuring complex branching dialogues and often presenting the player’s possible responses word-for-word as the player character would say them. Games revolving around relationship-building, including visual novels, dating sims such as Tokimeki Memorial, and some role-playing games such as Shin Megami Tensei: Persona, often give choices that have a different number of associated “mood points” which influence a player character’s relationship and future conversations with a non-player character. These games often feature a day-night cycle with a time scheduling system that provides context and relevance to character interactions, allowing players to choose when and if to interact with certain characters, which in turn influences their responses during later conversations. Other examples of such games include Portopia Serial Murder Case, Sound Novels, J.B. Harold Murder Club, Snatcher, Policenauts, Tokimeki Memorial, To Heart, Kanon, Shenmue, Shadow of Memories, Ace Attorney, Fate/stay night, Clannad, Fahrenheit, and Heavy Rain.
Create a Flowchart for the entire game – Your game is going to be very complex and there will be many decisions that the player will have to make and each decision opens up a whole new path for the player to take. Creating a flowchart is the best way to keep track of all the possible paths through the game.
Create sub-quests and write a prose overview of each quest Sub quests can be simple or complex but each one is a story in itself and you must tell these stories.
Your game will probably involve interaction with non-player characters (NPC’s). You should write out the dialogue and flowchart the choices the game player can make. These interactions are often critical to the story and they can take the player on very different paths toward the conclusion of the game.
Write Cut scenes – Cut Scenes are short animations or movies that come before or after major plot points in your story. A cut scene should always be written to enhance or describe the story. A cut scene is also a reward given to the player for achieving a major milestone in game play.
Location : A dark cathedral with stained glass windows. An NPC is kneeling before a stone casket in the center of the main room
Music : background music of an organ playing introduces the scene but subsides
Characters : Main player, NPC named Thomas
Player Goal: Discover the location of the underground lair
Action: Player must initiate discussion with Thomas, upon first contact we activate cut scene (1) where Thomas morphs into a were-creature and summons his were-minions. Main character must battle the were-minions then re-initiate discussion with Thomas.
Flowchart: No decisions made at this point: If battle is completed Thomas reveals the entrance to the underground lair and player advances to that level. If player is defeated in battle revert to death cut scene (11) and move to try again screen.
Notes: Player is locked in the cathedral and there is no exit. The only viable way out is to initiate contact with Thomas. Random were-creatures can be activated if player explores cathedral before talking with NPC.
In addition to the economics of objects, you have to consider the economics of living in the world. In the physical world, mere existence of a person has a cost; in the virtual world, existence is cheap. Since a player may not be “logged on” all the time, it’s hard to come up with fair rules for the cost of existence without penalizing either players who play a lot (your core audience) or players who can’t log on much (who are likely to leave if penalized for not being there all the time). If you require someone to work for a living, the casual players may not be able to compete, and may leave.
Tuning generally comes down to whatever “feels right”. Isolate the most important number first – say, player jump height and move speed – then count on that as a pivot while tuning other values.
Values that “feel right” are often found by halving and doubling/splitting – programmers will recognize this idea as “binary search”, but the gist of it is that throughout the code, you’ll find many numbers for speeds, sizes, etc.
If something seems too fast, cut its speed in half. If something seemed too small, double its size. If one of those values was too far in the opposite direction, split down the middle on the next iteration, and so on, until it no longer seems to warrant finer changes.
By making dramatic changes in values, this also helps quickly ascertain whether the number in question is the right one to be futzing with.
Just like there are visual themes, the gameplay should also be broken into differentiated phases, when possible. Perhaps this part focuses on jump platforming, perhaps that part focuses on lock/key or torch/switch puzzles, perhaps this other area is pure combat. It’s entirely unnecessary (and often unwise) to cram every type of gameplay imaginable into every game, but what range is possible and worthwhile within the engine created should be explored in focused turns, rather than spread evenly into a murky gray from start to finish.
All that hard work gets burnt on trying to force what’s ultimately as artificial as a cartoon to look as photorealistic as live film. Would photorealism improve The Simpsons, South Park, or Futurama?
Simple isn’t worse. Complex isn’t better. Simple is substantially faster to make more levels, characters, animations, and special effects for. Complex requires a large team with a great deal of very specific and specialized talent coordinating efforts. Simple is conceptual. Complex is literal.
Frequently, someone comes into videogame development with an idea of a story they would like to tell. Is the particular story not, perhaps, better suited as a cartoon, as a short film, as a play, or even simply written in well-edited prose? Certainly, the audience coming into the story could be forced to unjam a virtual door with bobby pin before getting to the next scene, or required to fend off hordes of zombies (again), although videogame qualities are often adopted at the expense to the story concept as a prominent source of frustration or distraction, rather than as meaningful rhetorical elements.
illusion of simultaneity – Everything happens one thing at a time. The code in every function goes from top to bottom, one instruction at a time. Even though it looks like dozens or hundreds of things are happening and moving at once, they’re each getting a turn. They appear to be moving at the same time since the updates are happening very quickly. The game moves and draws all objects by calling a main or draw function 20-60 times per second, top to bottom, instruction by instruction.
Often, the last step in a given lap through the game’s movement, input, sound, and other code is to update the screen (technically also happening pixels at a time as the memory buffer gets copied to screen buffer). In some environments like Processing or ActionScript this step is handled automatically; in C++ or most other environments it must be done explicitly, but it’s the reason why things seem to all be drawn and moved at the same time – the effects of their having all been drawn and moved one at a time aren’t displayed until all increments for this past fraction of a second have been accounted for.
With rare exceptions, we don’t program the images or audio. We use programming to display images at certain coordinates, and to play sounds at certain times, but the images and sounds are usually created in outside programs. Images are often made in Photoshop / Gimp, and audio is often created or edited in Sound Forge / Audacity. The assets (images, audio, 3D models, etc.) are just plain image and audio files, in whichever formats your programming library and asset tools both support.
Level design should be done by dragging and dropping, filling, by lasso selecting, copy pasting, saving/loading, etc. Not by programming. Time that the programmer spends implementing level layouts is time that the programmer can’t spend fixing bugs and adding features – plus it’s time that the designer has to wait between iterating on ideas. Even if you’re the both the programmer and the designer (as is inevitably the case for a solo project, and common for a small project where it’s mostly art/audio coming from others), it still massively accelerates production effort, ensures systematic consistency, etc.
The easiest way to make a level building “tool” is to hijack the game’s existing code, burying the tool functionality within it. Upon pressing F1 or some other out of the way key, toggle to a mouse-control, toss a panel of buttons/objects on the screen, and switch keyboard to controlling some handy key shortcuts. This can be stripped from the finished game, hidden in the finished game as an unlockable reward, or simply released with a tiny bit of “the level editor is rough… good luck!” documentation/help
Get a single enemy working before expanding it into an array of them and/or supporting multiple enemy types. Build a very plain sort of particle effect first – white spinning squares that burst out might be a fine starting place. Then adjust or add functionality as needed to support different needs of particles (fading for smoke, glowing for flame, directionality for thrust…). Get 1 power-up working first, perhaps the simple 1-up, then introduce others as a variation on that.
This is sort of akin to the D&D concept of a mage’s life: low level mages can be killed by having someone sneeze on them, and they can cast one pathetically weak spell before they go back to cowering behind the fighters. The tradeoff in D&D is that your mage may eventually become a god on earth if he lives long enough. This is not a consideration in an MMORPG, since (a) you can’t really die anyway, and (b) eventually everyone will get to high level. Therefore, the MMORPG version of this is to make the mage weaker at every stage. This leads to players dropping their subscriptions, and more importantly, nobody being a mage. MMORPG, everyone wants to be a mage, and there’s no way under the current models to say they can’t be. Asheron’s Call made a go of it with their research system and spell economy, but ignored the axiom that all people suck, and so before beta was out formulae were everywhere, nobody cared about the economy anymore, and they were back in the same boat.
In the MMORPG, it’s hard to justify a rarity of mages to your players. They all pay the same subscription fee, don’t they? Say that magic is only available to a tiny number of people who “have the gift,” determined randomly. Now the guy with the account that doesn’t include someone “with the gift” is hosed. Either that or he just keeps rerolling and killing off characters until he winds up with a mage, and then you have the same situation as before, except now people are yelling at you on forums about your “stupid time-wasting system.”
All characters start out roughly the same, with no magic. No magic is ever available to them with the possible exception of minor shamanistic magic (healing, far sight, maybe watering the plants). In order to become a “mage,” a character has to undertake a very dngerous quest which he is expected to die on. If he manages to make it through the quest, he winds up at the place where you become a mage (secret mage academy, alternate dimension full of alien mages, underground genetics lab, radioactive meteorite, whatever). Assuming the character still wants to become a mage, he can… he loses a bunch of his other stats and such, maybe the ability to use certain kinds of gear, etc. etc., in effect trading in his moderately high-level character for a weak low-level mage.
Hand waving, gestures, rituals, etc. these are just delivery mechanic. Just as a warrior swings his sword, a mage has to wave his hands. The end result is a 1d8+1 for a warrior with the sword and 1d8+1 for a mage throwing magic missile. It makes the game richer to have a decent back story around how the mage’s magic missile comes about, but the ability to throw magic missiles is itself not magical if hundreds of other fellows can do the same thing.
The “solution above” is a quest that changes frequently to keep ahead of the wikis so that you have to discover it and complete it with little or no help from anyone else, and every character that becomes a mage is above as awe-inspiring as the dude who got the stupid Super Sword.
Only instead of raw power, it’s diverse abilities none of the hundreds of other sword-fighters in this low-magic setting can use. When you cast that Water-Walking spell now, people are actually wide eyed and going “Wow! He can walk on water!” Instead of it just being anothe buff they could’ve easily gotten if they practiced Alchemy or “rolled up a mage” at the start in that OTHER MMO.
The literary mage, unfortunately, is not a very good model for any but the most hard-core roleplayer to choose as an avatar. People have ever-shortening attention spans, and are not entranced by the idea of subscribing to a game so that their wizard can spend all his time in the library. Given the fact that most so-called computer RPG’s are almost entirely about killing things, they want to be out there killing things. They also don’t want to hang around with a party of fighters who do all the killing, providing motherly ethical advice all the time and firing off one spell every week. In order to cater to this class of mage player, computer RPG developers (and pen and paper RPG writers) have turned the mage from a bizarre mystical figure full of arcane wisdom to a lightning-lobbing siege engine.
It is always more rewarding to kill other players than to kill whatever the game sets up as a target.
A given player of level x can slay multiple creatures of level y. Therefore, killing a player of level x yields ny reward in purely in-game reward terms. Players will therefore always be more rewarding in game terms than monsters of comparable difficulty. However, there’s also the fact that players will be more challenging and exciting to fight than monsters no matter what you do.
A roleplay-mandated world is essentially going to have to be a fascist state. Whether or not this accords with your goals in making such a world is a decision you yourself will have to make.
The expectations are higher than of similar actions in the real world. For example: players will expect all labor to result in profit; they will expect life to be fair; they will expect to be protected from aggression before the fact, and not just to seek redress after the fact; they will expect problems to be resolved quickly; they will expect that their integrity will be assumed to be beyond reproach; in other words, they will expect too much, and you will not be able to supply it all. The trick is to manage the expectations.
A faucet->drain economy is one where you spawn new stuff, let it pool in the “sink” that is the game, and then have a concomitant drain. Players will hate having this drain, but if you do not enforce ongoing expenditures, you will have Monty Haul syndrome, infinite accumulation of wealth, overall rise in the “standard of living” and capabilities of the average player, and thus unbalance in the game design and poor game longevity.
You have to give players a sense of ownership in the game. This is what will make them stay–it is a “barrier to departure.” Social bonds are not enough, because good social bonds extend outside the game. Instead, it is context. If they can build their own buildings, build a character, own possessions, hold down a job, feel a sense of responsibility to something that cannot be removed from the game–then you have ownership.
- As a virtual world’s “realism” increases, the pool of possible character actions increase.
- The opportunities for exploitation and subversion are directly proportional to the pool size of possible character actions.
- A bored player is a potential and willing subversive.
- Players will eventually find the shortest path to the cheese.
Mike Sellers’ Hypothesis
“The more persistence a game tries to have; the longer it is set up to last; the greater number (and broader variety) of people it tries to attract; and in general the more immersive a game/world it set out to be–then the more breadth and depth of human experience it needs to support to be successful for more than say, 12-24 months. If you try to create a deeply immersive, broadly appealing, long-lasting world that does not adequately provide for human tendencies such as violence, acquisition, justice, family, community, exploration, etc (and I would contend we are nowhere close to doing this), you will see two results: first, individuals in the population will begin to display a wide range of fairly predictable socially pathological behaviors (including general malaise, complaining, excessive bullying and/or PKing, harassment, territoriality, inappropriate aggression, and open rebellion against those who run the game); and second, people will eventually vote with their feet–but only after having passionately cast ‘a pox on both your houses.’ In essence, if you set people up for an experience they deeply crave (and mostly cannot find in real life) and then don’t deliver, they will become like spurned lovers–somebecome sullen and aggressive or neurotic, and eventually almost all leave.”
You’re going to have violence done to people no matter what the facilities for it in the game are. It may be combat system, stealing, blocking entrances, trapping monsters,stealing kills to get experience, pestering, harassment, verbal violence, or just rudeness.
Trade skills and crafting (the subset of trade skills that directly involve creating goods from other components) are activities that do not involve combat directly and which are used to create items for or provide services to other players. Common examples include:
- tinkerer (device and tool making)
Other Trade Skills
Trade skills are often injected into an economy as substitutes for or adjuncts to NPC provided goods and services. Depending on the implementation, trade skills can function as item faucet; item sink; item converter; alternate career path; social glue; or some combination of the preceding.
The adventuring portion of a level treadmill consists of characters gearing up and heading out to a dungeon or some other monster heavy location. Upon arrival they set up camp and begin killing bad guys indiscriminately. As they kill stuff, they gain experience (used to advance skills and gain skill points) and money (through loot and coins dropped by the now dead monsters). At the end of a good day’s slaughter, they should be richer and more powerful. In the case of failure (dying) punishments range from negligible to moderate (loss of experience and/or items; inconvenience) to severe (permanent death).
Advancement Mechanics. Advancement is achieved by spending time in combat, gaining experience (for skills) and loot.
Cost for Attempts. Typically there is no “entry fee” to go adventuring — you simply head to a destination and start beating upon the local monster population to your heart’s content. Occasionally you run into a situation where you have to pay to reach your destination, but this is not the norm.
Unit of Cost per Attempt. Adventuring consumes time but only in rare cases does it present other active costs.
Unit of Reward per Attempt. Adventuring rewards are experience and loot.
Wealth Gain over Time. Adventuring normally yields a reasonably predictable amount of wealth over a given period of time, depending on the party’s level and type of monster being bashed.
Punishment for Failure. The punishment for failure (dying) with adventuring varies significantly in degree depending on the game. At one extreme death is permanent. At another extreme death has almost no repercussions — you simply wake up at a safe location, all gear and experience intact. Most games choose a middle ground, where the character suffers some kind of temporary statistical and experience penalties, and possibly must suffer a convenience penalty as well (recovering your corpse, etc.).
Real Risk. The real risk in adventuring is generally quite small. Ignoring external factors (other players), most adventurers almost never put themselves at risk — they attack monsters just powerful enough to give experience and loot, but not so powerful as to prove potentially fatal. Death only comes about through freak circumstances or the actions (direct or indirect) of other players (e.g “train to zone”).
Grouping Requirements. In most online games, adventuring with others is much safer (and more fun) than adventuring alone, although this depends largely on the individual player and the intent of the designers. On average, the adventuring path encourages grouping for safety and efficiency.
StarPeace worlds can be very large in MMPOG standards, covering thousands of square kilometers (note that a single World of Warcraft instance is about 500 square kilometers). A single world may have dozens of cities, each one hosting a few million virtual citizens. The image below shows a screen capture of a young city. The area covered by this image is 1/1000 of the world and it contains a few hundred facilities. Approximately two million virtual citizens live in this city.
Each virtual citizen is accounted for in the simulation. They need a place to live, the may work somewhere or have their own business, they consume goods that they pay for with the money they earn. While doing so, they alter their environment, they produce pollution, crime, or just wear down existing utilities. They require services like hospitals, police and education. They have a will of their own, usually moving from one place to another looking for better jobs, better commerce, or avoiding adverse conditions like pollution, crime, or even people from a different social class.
A voxel (volumetricpixel or Volumetric Picture Element) is a volume element, representing a value on a regular grid in three dimensional space. This is analogous to a pixel, which represents 2D image data in a bitmap (which is sometimes referred to as a pixmap). As with pixels in a bitmap, voxels themselves do not typically have their position (their coordinates) explicitly encoded along with their values. Instead, the position of a voxel is inferred based upon its position relative to other voxels (i.e., its position in the data structure that makes up a single volumetric image). In contrast to pixels and voxels, points and polygons are often explicitly represented by the coordinates of their vertices. A direct consequence of this difference is that polygons are able to efficiently represent simple 3D structures with lots of empty or homogeneously filled space, while voxels are good at representing regularly sampled spaces that are non-homogeneously filled.
A generalization of a voxel is the doxel, or dynamic voxel. This is used in the case of a 4D dataset, for example, an image sequence that represents 3D space together with another dimension such as time. In this way, an image could contain 100×100×100×100 doxels, which could be seen as a series of 100 frames of a 100×100×100 volume image (the equivalent for a 3D image would be showing a 2D cross section of the image in each frame). Although storage and manipulation of such data requires large amounts of memory, it allows the representation and analysis of spacetime systems.
To perform our calculation, we are borrowing concepts from the Boids algorithm and from Social Network Analysis. This technique makes possible new types of conflict, such as a Public Relations battle, and can make concrete the ‘battle for hearts and minds.’
People’s opinions are influenced by events, but also by what they perceive to be the opinions of the people around them — people tend to believe what the people around them believe. The central analogy of this paper is that just as birds, fish, and other animals move their bodies in groups, humans move their opinions in groups2. Animals flock with their bodies. People flock in their opinions.
This technique can be applied to large populations or small populations. A large population example could be an entire population of a country and their support of a particular armed militia group. (If the player can reduce public support for the militia, its resources will decrease.) A small population example could be the actors around a key decision maker. (If the player can locate and change the opinions of the people around the decision maker, it will be possible to influence the decision maker.)
Our forces will provide a propensity for the opinion of an individual to move in a particular direction. If there are people close to me that hold a particular opinion, then I will be likely to hold that same opinion. If I hold a different opinion, I will have to mentally justify it to myself in some way (such as thinking I have information that they don’t have.) The brain is a muscle, and mental justifications don’t come free. So the easy thing, and the typical thing, is to just give in and accept the ‘conventional wisdom’ and to fly with the rest of the flock.
Hexes: It may be important for some GMs using this article to know how much land is in a hexagonal area! To determine the area of a hex, multiply its width by 0.9306049, and square the result. Thus, if your game-map has hexes 30 miles across, each hex represents about 780 square miles (and it’s a convenient size for travel-times, since 30 miles is a good rule of thumb for a day’s road travel on foot or horseback).
Villages range from 20 to 1,000 people, with typical villages ranging from 50-300. Most kingdoms will have thousands of them. Villages are agrarian communities within the safe folds of civilization. They provide the basic source of food and land-stability in a feudal system. Usually, a village that supports orchards (instead of grainfields) is called a “hamlet.” Occasionally, game writers use the term to apply to a very small village, regardless of what food it produces.
- Towns range in population from 1,000-8,000 people, with typical values somewhere around 2,500. Culturally, these are the equivalent to the smaller American cities that line the interstates. Cities and towns tend to have walls only if they are frequently threatened.
- Cities tend to be from 8,000-12,000 people, with an average in the middle of that range. A typical large kingdom will have only a few cities in this population range. Centers of scholarly pursuits (the Universities) tend to be in cities of this size, with only the rare exception thriving in a Big City.
- Big Cities range from 12,000-100,000 people, with some exceptional cities exceeding this scale. Some historical examples include London (25,000-40,000), Paris (50,000-80,000), Genoa (75,000-100,000), and Venice (100,000+). Moscow in the 15th century had a population in excess of 200,000!
Large population centers of any scale are the result of traffic. Coastlines, navigable rivers and overland trade-routes form a criss-crossing pattern of trade-arteries, and the towns and cities grow along those lines. The larger the artery, the larger the town. And where several large arteries converge, you have a city. Villages are scattered densely through the country between the larger settlements.
First, determine the population of the largest city in the kingdom. This is equal to (P times M), where P is equal to the square root of the country’s population, and M is equal to a random roll of 2d4+10 (the average roll is 15).
- The second-ranking city will be from 20-80% the size of the largest city. To randomly determine this, roll 2d4 times 10% (the average result is 50%)
- Each remaining city will be from 10% to 40% smaller than the previous one (2d4 times 5% – the average result is 25%); continue listing cities for as long as the results maintain a city-scaled population (8,000 or more).
- To determine the number of towns, start with the number of cities, and multiply it by a roll of 2d8 (the average result is 9).
The remaining population live in villages, hamlets and smaller settlements; a small number will live in isolated dwellings or be itinerent workers and wanderers.
Adjusting the Number of Towns: The ratio of towns to cities given above presumes the existence of a notable and thriving mercantile community. Adjust the upward by 50% or more for a fantasy world on the verge of Renaissance, but adjust it sharply downward for a pre-Crusades type world
A square mile of settled land (including requisite roads, villages and towns, as well as crops and pastureland) will support 180 people. This takes into account normal blights, rats, drought, and theft, all of which are common in most worlds.
Once you’ve decided the ability of the land to support people, you can determine the amount of wilderness/unfarmable country in the kingdom by working backwards.
While the average distance between population centers can be derived from the total land area, the average walking distance from one village to the next is more realistically determined by considering only the settled land. Villages and towns tend to cluster tightly along the arteries of travel defined by the lines between the cities — leaving gaps of wilderness in the middle.
Livestock: The livestock population, on the whole, will equal 2.2 times the human population, but 68% percent of this will be fowl (chickens, geese and ducks). The rest will be dairy cows and “meat animals:” Pigs are superior as food animals, since they eat less individually, and are not picky eaters. Sheep will be extremely common if the region has a wool market (like medieval England, which was built on wool). Cattle for labor and milk will be found occasionally, but cattle raised specifically for meat are only found in very prosperous areas.
An attack works like this in D&D (and DDO):
You roll to see if you hit the enemy. This is done via a d20 (20-sided die), to which you add all your modifiers (strength/dex bonus, base attack bonus etc). This end result is compared with your enemy’s armor class. If your result is greater or equal to your opponent’s armor class you hit him. If not, you miss.
If you managed to hit your opponent, you get to roll for damage. The damage consists of your weapon’s base damage (e.g. 1d6 for rapiers, 1d8 for longswords) to which your modifiers are added (such as strength etc).
So AC negates damage by negating hits. If you don’t get hit, you don’t get damaged.