 The Second Hard Part |
Posted - 6/28/2006 9:59:18 AM | One of the biggest sticking points for me so far has been the user interface. I have a million ideas, and trying to narrow them down has been difficult. In particular, how will the player character interact with the game world?
A lot of this will be menu-driven; trading, talking, inventory, and the like. But the character must move through the world, and this action must be both intuitive and aesthetically pleasing. So what to do?
I do not have a lot of time to crunch scores of graphics, so I think an isometric game is out. Something top-down (a la Gauntlet) would be ideal, because I could have one sprite which I continually rotate. Flash 8 allows things like drop shadows to be dynamically generated, so the lighting could remain fairly realistic.
However, I have recently become aware of something called "Raycasting", which may allow me to have something like a first-person view for the world-travel part of the game, and possibly also for random encounters and combat. I found an example done in Flash 8 (the link to which I seem to have misplaced) which includes the source file, which I am in the proces of tearing down, prior to re-building it to suit my needs. One of the things I want to change about his engine is the fact that it doesn't really allow for variations in the terrain, other than simple color.
A few months ago I put together a Flash 8 height map (color-substitution version here), which I may cannibalize in order to add genuine terrain varation to the raycasting engine. Time will tell if this actually works.
So there it is: The two most technically challenging parts of the game - the other being the Miersenne Twister - are already well underway. In a couple of more weeks I may be able to post a screenshot, or maybe even a rough demo version.
| |
 On the Distribution and Availability of Goods |
Posted - 6/26/2006 9:42:46 AM | I have been working through how I am going to handle the relative availability, and therefore the relative value, of different trade goods in different parts of the gaming world.
The largest factor in the availability of goods is transportation. In the time and area in which my game takes place, it is kind of out in the sticks, population-wise. One empire is approaching its end, and another is on the rise. Various marauding tribes keep the pot stirred, so the infrastructure we take for granted -- roads, for instance -- are few and far between, and at best a well-packed trail through the forests and swamps.
All of the trade goods I am using have the possibility of being available at all of the different towns and villages in the game. However, they will not all be _definitely_ available at any given town, and where they are available, they will not necessarily be available at the same price or in the same quantities. In the south, by the sea, fish will be more easily available but e.g. iron will be a little harder to come by. Deer hides are common near the mountains to the west, and cotton easier to find as one approaches the plains to the east. Specialty items like amber and glass will be more common near trade routes, although relatively rare in any case.
But how to turn this into something the game can understand?
All of the goods in a game must come from somewhere. They can be spontaneously generated; there can be a set amount in a set location; they can be created as a result of player actions, e.g. killing a rabbit produces one unit of rabbit meat and one rabbit pelt. The farther a player is from the point of origin of a specific trade good, the rarer that thing will be.
Therefore I am giving every trade good one or more points of origin in the game world, and a set amount by which the availability decreases over a certain distance. These points of origin may be within the area available to the player, or substantially outside it.
Example: Assuming a game world which is 40 miles square, set up as a grid covering from [-20,-20] to [20,20]. The data for deer hide might look like this:
<item
name="deer hide"
base_value="5"
base_availability="7"
availability_dropoff=".2"
price_increase=".3"
lifespan="100"
origin="-18,0"
/>
This tells us that the point of origin of all deer hide in the game is near the western boundary of the "world", is fairly easy to aquire and is available even on the far side of the "world", although harder to find and more expensive.
The "lifespan" attribute allows the simulation of item perishability. Fish will have a lifespan of maybe a two weeks if packed in salt and ice. Caviar a little less, and various kinds of meat a little more. That means that they rapidly become more uncommon the farther one travels from the point of origin.
Here is another example:
<item
name="wheat"
base_value="1"
base_availability="10"
availability_dropoff=".05"
price_increase=".05"
lifespan="5000"
origin="0,0:-10,-10:10,-10:10,10:10,-10"
\>
Wheat is nearly ubiquitous -- available almost everywhere with only slight changes in price.
I think I can use this system for influencing the mix of tribal influences in the towns and hamlets of the game by giving the Romans, Turks, Franks and Bulgars origin points and dropoff values. Towns farther south will be more strongly Roman. Towns near the northeast will have more of a Bulgar flavor. This can also be used to modify random encounters in the travels between the towns.
| |
 What Need To Be Done: An Incomplete List |
Posted - 6/21/2006 2:56:12 PM |
- figure out specifics of gameplay
- blit/double buffer system for screen display
- data system for world objects/terrain creation
- scrolling terrain/tile engine
- user controls
- what view? iso? top-down? mix?
- stats for items
- weight
- volume
- materials
- value
- legality
- rarity
- stats for animals
- speed
- damage
- toughness
- morale
- materials
- rarity
- live_value
- stats for NPCs
- conversation trees
- name generator
- town/monastery/village/battlefield/ruins generation algorithms
- job/quest generation
- save/load game functionality
- combat routines
- trading routines
- haggling?
- set prices?
- begging?
- buy NorthCode
- player character “leveling”
- stats?
- health
- age
- reputation
- legal status
- values for world items
- graphics for everything
- sounds
- background music
- instructions
- documentation
| |
 Creating a Sensory Input-Based Monster AI |
Posted - 6/20/2006 4:03:31 PM | (copied over from my personal blog)
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.
| |
 Update: Research is Hard |
Posted - 6/19/2006 10:28:59 PM | I spent most of my free time this weekend researching the middle ages and Byzantium and the Black Sea area and the history of commerce and trade routes in the year 1000 and trade goods and relative values and economic equivalencies and Vikings and the Silk Road and Mongols and Franks and Vandals and units of currency and life expectancies and and and...
You would think that finding information on medieval trade and economics would be easier. This is what I ended up finding:
One $basic_unit_of_currency, which was the wage for a day of skilled labor, could buy:
1 loaf of bread, or
1 bottle of cheap wine, or
1 evening with a prostitute
...which makes me think that the Evening With a Prostitute is a great idea for a unit of currency, just because of the conversations which would arise:
"Father Yusef went to market and spent three evenings with a prostitute. He came home with a goat."
"Hey! How many evenings with a prostitute can I get for this horse?"
...you get the idea.
Actually, the standard units of currency in the Byzantine empire of the time was the gold solidus, the silver miliaresion, and the bronze nummi. I am having difficulty finding their relative values, and any real-world goods of the time to determine the purchasing power of those coins. Since a significant portion of the plot of my game is to earn a specific amount of money to pay back a debt, this is kind of important.
I have ordered Macromedia Flash Professional 8 Game Development, which should arrive Wednesday. I looked through it at the local bookstore and found some significant tutorials on the Flash 8 bitmapData class, which will go a long way toward optimizing the graphic output of this game so it doesn't eat up 90% or more of the processor during the more graphically intense moments. And the author, Glen Rhodes, wields a staggering amount of mojo in the field of Flash game development.
More as time progresses.
| |
 A New Home |
Posted - 6/15/2006 1:47:43 PM | Okay: The story will be taking place in Ukraine, a little north of the northern shore of the Black sea, and a little west of the Dnieper River. Google map of the location here. I like this position. Close to the trade routes of the time, but not so close that everything is easy to come by. And enough out in the sticks that it will not be too under the sway of the invaders/government du jour.
Next: Thinking about gameplay.
| |
 The Location of the Story |
Posted - 6/14/2006 10:31:32 AM | I have decided to place my game in early 11th century Georgia, on the shore of the Black Sea.
Next step: Study up on Georgian history, culture, flora, fauna, exports, crops and geography
[EDIT]
I have recently been informed that, for the purposes of the contest, Georgia is not part of Europe. Ah, well... it was worth a shot. So now I need to decide whether to place it in Turkey or Ukraine. And then find out what those places were like in the eleventh century. Or if they were even there... more when I make my next decision.
| |
 A First Stab at the Story |
Posted - 6/13/2006 11:11:34 AM | Here is a first go at the story behind Shank's Pony. I have tried to include all four elements without making it sem forced. Comments, as always, are welcome.
-----------------------------------------------------
It is 910AD. You are a young peasant in the villaeg of [VILLAGE], in the country of [COUNTRY] in eastern Europe, near the shore of [NAME OF LAKE OR SEA]. You and your younger brother have a small hut and a horse, and live adequately, if not comfortably, on the little money you make hiring out as transporters of goods around the area.
One rainy day you and your brother are heading out of town with a load of oats for the local Baron's prized horses when the Baron himself appears with his prized dogs, preparing to go hunting deer. You and your brother bow to him, and he dutifully ignores the gesture as he passes. Your brother, in a fit of pique, kicks a stone at one of the dogs. The dog yelps and attacks your horse, which kicks out, hitting another of the dogs. The heavy load of grain falls from your horses back as he rears and kills one of the dogs. The rest of the dogs join the fray, and in short order your horse and three of the dogs are dead. Your brother has a boot on his neck and you have a knife at yours.
The baron is enraged "You owe me for the dogs, and the grain, and the inconvenience. Until you have paid your debt, your brother will be a guest in the dungeon, where you will pay his rent and his meals. You may have him back when I am satisfied your debt is cleared."
You are taken to the blacksmith where the Baron has a chain welded tightly around your neck, from which dangles two tokens; One in the shape of a key, and one of a coin.
"Everyone in my town will know that you are in my debt, and that you are desperate. They will not treat you kindly. Remember to feed your brother or I will feed him to my dogs!"
The Baron and his men take their leave. The blacksmith is watching all of this with a sour look on his face. "I can't help you, boy, other than to give you this" - he hands you a tiny knife, the size of a finger, but sharp and of good metal - "and to offer some advice: People know you. They know you are a good boy, and a hard worker. You are smart, too. You have worked for a long time carrying goods. Now you must learn to buy and sell to keep you and your brother alive. Now go, before the Baron locks me next to your brother."
And so this is where you are. You have a tiny knife, a dead horse, a small hut, and the clothes on your back. Good luck to you.
| |
 The Genesis of the Game |
Posted - 6/12/2006 11:01:25 AM | Back in the mid-80s I spent hundreds of hours playing Elite. For those too young to remember it, Elite was a space trading simulation with elements of role-playing and flight-simulation. The game took place in a universe with hundreds of systems and thousands of planets and space stations.
And all of this on a Commodore-64 with around 30K of RAM, thanks to procedural generation of the galaxies.
I am, deep down, quite lazy. I have no interest in manually placing several hundred villages made up of dozens of buildings and scores of NPCS. I am, however, interested in having those things in my game. And as a developer I like having the possibility of something surprising, if not actually emergent, in my game. Thus the procedural generation.
In order to have a good random-seeming distribution of towns, caves, etc., I next needed a way of generating repeatable random-seeming numbers. The built-in random functions of most computer languages do not allow for the use of seeds, so the results are not repeatable - or at least, not repeatable in any useful way. Fortunately I am not the first person to have come up with this idea.
So: the first piece of code in Shank's Pony is the Mersenne Twister class, which I translated into Actionscript2.0 from a version written in C. All tests so far indicate that it is working exactly as I had hoped.
Next: Using modulus and seeds based on the Mersenne Twister to create procedural towns and dungeons.
| |
 Here We Go Again |
Posted - 6/11/2006 3:32:22 PM | Hello everyone.
I just signed up for this year's four elements game competition. I will use this journal to post my notes, thoughts, and progress reports as the year progresses.
Here is some info on the game I am building:
NAME: Shank's Pony
PLATFORM: PC/Mac, browser-based
TECHNOLOGIES: Adobe Flash 8, possibly some HTML/CSS as well.
TYPE: RPG/Trading simulation
GENRE: Historical fiction, with possibly very light fantasy elements
PLAY TIME: Open ended - following the story, perhaps 5 - 10 hours. Treating the world as a sandbox, potentially hundreds of hours.
More info as I continue to hash out exactly what I want to build.
| |
|
| S | M | T | W | T | F | S | | | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | | | | | | 16 | 17 | 18 | | | | 22 | 23 | 24 | 25 | | 27 | | 29 | 30 | |
OPTIONS
Track this Journal
ARCHIVES
November, 2009
March, 2009
January, 2009
November, 2008
October, 2008
September, 2008
August, 2008
July, 2008
February, 2008
December, 2007
November, 2007
October, 2007
September, 2007
July, 2007
June, 2007
March, 2007
February, 2007
January, 2007
December, 2006
August, 2006
July, 2006
June, 2006
|