Saturday, May 5, 2012

Crimmor: Hidden Pocket Armor

Hidden Pocket armor allows you to hide weaponry (or potentially other items) on yourself in case you face a search by someone. If you remember my Hidden Weapons (http://kamalpoe.blogspot.com/2011/03/crimmor-hidden-weaponry.html), Hidden Weapon class weapons are accounted for (they hide themselves, and so do not count against the hiding capacity of the armors).

Picture one: Wearing Hidden Pocket leather armor, the guard doesn't see the short sword in my inventory. You can see in the message window the hiding capacity and capacity used of the hidden pocket items I am wearing. Hidden Pocket armor by itself can hide one small, and two tiny, weapons.


In picture 2, the fact I'm wearing hidden pocket armor doesn't help, because he can plainly see the weapon since it's in my hands
Picture 3, a dagger is hidden. You can see how the dagger falls into the Tiny category, as opposed to the small category the shortsword is in. Size categories are from http://nwn2.wikia.com/wiki/Weapon_size with a few adjustments (my Hidden Weaponry has hidden by default categories for some weapons, and I made slings tiny category because they can be folded up)
Picture 4, I've added Hidden Pocket boots to my Hidden Pocket armor, increasing my hiding capacity. Hidden Pocket armor has capacity 1 small, 2 tiny. Boots, Belt, and Bracers have capacity 1 tiny. This is defined in the script, so it could be changed.
Picture 5: Examine description of Hidden Pocket item, the armor in this case.
Picture 6: I'm wearing Hidden Pocket armor, but a longsword is too large to hide.

Monday, April 30, 2012

Map markers in Crimmor

Crimmor the city is laid out in a haphazard manner, much like an actual medieval city. There's no modern grid pattern, its mostly just a jumble of streets that go every which way and are rarely straight. I still get lost, and I built the place!

To ease things I've color coded the extensive set of map points visible on the minimap.

Red: marks safehouses, the guildhall, and the players house, these are friendly locations where resting is allowed (no resting on the streets or in some random merchants store!). Red also marks active quest locations, so your minimap will highlight where you need to go for quests. The red quest markers are only active while the quest for that location is open. For locations that have multiple notes, such as a store that becomes involved in a quest, the quest note takes precedence so there are not two notes at the same point. (I'm not recoloring a single note, I use multiple notes and display/hide as appropriate.

Green: these notes indicate a location name, Wight Alley, The Drae, Firesteep Square, Carn Market, etc. These are both for flavor as well as a potential marker to guide players on quests involving locating things ("He hangs out at Carn Market in Purse Ward").

Default color: generic points of interest such as stores.

Blue (may change, the shade I picked looks close to the green) : Dead drops, which function as quest givers. These are only located in the wards of the city you work as a fixer for.

Yellow (may change, looks close to default ingame): area transitions between the sections of the city.


Monday, April 9, 2012

A new feature for my commoner ai

As I was testing various activities for my commoner ai I realized that my "sleeping" commoners would get up and pick another activity at the time period change, meaning they wouldn't be asleep for a normal amount of time. I also realized there was no way for them to go home for the night (only sleep in the same area was allowed). So I've added a new activity and some new functionality that I'm currently working out bugs in. You can now give a "go home and sleep" activity and commoners will find and move to a random door in the area, play the "use" animation, and go script hidden for 9 hours (8+1 for breakfast). At their wake up time they unhide themselves and pick a new activity based on the time. Once that is working, I will add the code to force the activity for a sleep period to all the sleep activity functions, and add a sleep until morning and a sleep until evening function.

The go home and sleep functions will allow builders to have their streets empty out at night (or day if you want vampire commoners :) ). Since these are command to essentially "leave the area", I could see them being used to empty out a tavern at closing time or give a shop hours, with the timely player being able to see these transitions.

Another use case for the commoner ai would be for something like a tavern, have the patrons sit and eat during the day, and get up and dance or play instruments at night, automatically.

edit: it looks like I've solved my problem with npc's sometimes getting stuck at their old waypoint when they pick a new activity. Pesky bug solved! And now my npc's also are "sleeping" properly in their go home and sleep activity, so I can add the sleep period code to the other sleep activities.

Friday, April 6, 2012

What do you want in the commoner ai?

There are still some bugs, mostly in making sure the npcs to play their animation once they reach their waypoints and nailing down some time randomness. But at this point the ai's reached a state where I can start thinking about adding features people think need to be in an initial release. Some ideas I had:

Integration of Apep's dynamic commoners (Apep granting permission required): this allows commoners to automatically dress, get voicesets, names etc. I wouldn't expect permission problems from Apep. I view this as the "neat"-est thing that can be added.

Duplicate waypoint user detection: [edit: added this 7 April, and it worked on the first try! It also fixed the remaining animation bugs, npcs that elected the same wp would result in one getting bumped, and it would be too far from it's wp, so the animation would not play. Added feature and bugfix all in one!]
ensures an npc doesn't try to occupy the same waypoint that another one already is. Not so important for "cheering crowd", but the sitting and bed activities would benefit. Perhaps the most useful add, even if the benefit isn't highly visible except for specific actions.

Kemo sitting/bed support: for those halfling and dwarf commoners. Benefits the sitting/bed activities. I havnt looked at all at Kemo's system, this may turn out to not be doable. I think it should be doable, maybe not in a 1.0 release.

More detection of "appropriateness": npcs already equip their hands appropriately for activities. They could also dress appropriately, for instance making woodcutters wear leather armor.

Also in "appropriate"-ness: there are animations for female and male dance and seperate activity chances for each, but commoners don't currently only adopt the appropriate one (female npcs can currently choose the male dance animation and vice versa). Would people like commoners forced to adopt the "appropriate" animation for their gender? Would they want males being forced into the male dance animation even if the builder assigned 0% to male dance animation, or would re-selection of activity be preferable (that would mean a 50% chance of female dance would result in no males and 50% of females dancing) Or just leave it as is with no gender checks (females can play male dance animation and vice versa).

Holiday detection: allow a builder to use an area heartbeat to have a "holiday" setting, giving builders the ability to use a different set of ipoints for holiday action control (maybe the commoners all dance in the town square) This would be mostly on a builder to define when they wanted one, but a local int such as nIsHolidayToday could be set on an area to support that, and an alternate set of "holiday ipoints" could be included, with a small change to default scripting to look at that for that area variable and change the control ipoints appropriately.

Other, better ideas go below, or do you want to see a beta release first to play around with to see what you want?

Sunday, April 1, 2012

More on the commoner ai project

My wintertime funk has pretty much lifted, and so I'm spending much more time in the toolset. While I'm not working on Crimmor per se, I am working on functionality that I view as critical for it, my commoner ai system. It's at the stage of fixing bugs. Here's a link to my original blog post http://kamalpoe.blogspot.com/2011/07/commoner-ai-project.html

How to build with it:
There are premade ipoint placeables for each time period of the day, there are 6 periods, that can be set via script for whatever hours you want. These ipoints are placed in the area, and contain the local variables for the actions, the percentage chance an npc will adopt a given action. The builder sets the chance.

There are premade waypoints for each action. To be placed where the builder wants an action to take place. If you place multiple of the same type, the npc will randomly choose which one to go to.

A heartbeat script: any npc using this system needs to run this heartbeat, but does not need any other customization. No local variables need to be assigned (scripts auto set local variables), no creature tags required.

That's it.

How it works:
The npc heartbeat sets it's initial activity by determining the time, and checking against the ipoint for that time period, selecting an activity based on the percent chance as stored on the ipoint. It also determines a slight offset to the time period that shifts the time period for that npc, so not all npcs will change activity at the same time. The npc then selects a random waypoint tagged for the chosen activity.

The npc moves to the waypoint, and carries out the activity it chose until the heartbeat determines a new time period has been entered. It then selects a new activity based on the ipoint for the new time period and the process starts over.

Activities have predefined scripts to determine them, so a builder does not have to. These are pulled from Uncle FB and Lugaid of the Red Stripes systems. There are approximately 70 activities defined (and more can be added by a builder), covering things like farming, sweeping, working a forge, sitting and drinking, playing the lute, etc.

Scripts automatically ensure the npc is appropriately equipped (and eventually appropriately dressed). An npc that goes from walking around to playing the lute automatically has one generated and equipped, the npc does not need to be pre-equipped. If the npc then decided to be a woodsman, the lute is unequipped and destroyed, and a handaxe is equipped.

Nifty notes:
If you use Apep's dynamic commoner (http://nwvault.ign.com/View.php?view=NWN2PrefabPlaceables.Detail&id=162), like I am, you can have your commoners also automatically randomize their appearance, soundset, name, hair etc. on spawn. Use his included npcs, set the variables you want for his system on the blueprints, and change the blueprints to use my heartbeat. Viola, a town full of customized commoners carrying out randomized actions. Apep's system works, so it's just a matter of getting my ai working. Ideally, town ambiance has never been so easy.

I've also done some preliminary work on random pickpocket results (including failure and being caught) for generic npcs, similar to how Baldur's Gate had it, as a separate script for the OnInventoryDisturbed. That's a separate but related project. Status for that is built but not working. It's on my "would be nice to have" list. When I get that working at some point in the future, I will post a blog on that.

Saturday, March 24, 2012

Icewind Dale and The Wizard's Apprentice 2

Not feeling particularly inspired on the building front recently, I turned my time over to playing the two big recent releases, the Icewind Dale remake and The Wizard's Apprentice chapter 2. They are both excellent and worthy of play, but for different reasons.

Icewind Dale remake is exactly that, a remake of the original game using the nwn2 engine and ruleset. It's not aiming for innovation, it's aiming for faithful recreation. And it succeeds. Everything you remember from the first game is in there (except the use of one substitute creature model). Yes, the frozen aquarium is in there, it's a custom metatile in all it's 3d glory. There is a lot of new custom content in terms of tiles and placeables. And the area design captures the feel of the original areas. The voiceovers, the book style cutscenes, all there. So is the difficulty of the original. Slowdive fan has already released a post 1.0 update to address bugs found post release. I played the 1.0 version and found it generally bug free.

The Wizards Apprentice 2 continues the story from the first. TWA is a wizard adventure, so I eagerly played it to look at how others are approaching single class focused adventures. TWA1 was pretty humor oriented. TWA2 changes that focus to a more traditional adventure, though there's some significant early bits of humor in TWA1's style. TWA2 benefits from the transition, at least for me. The area design is top notch, there are well done cutscenes, and the scripting work is similarly excellent, and plentiful (for example as the player can knock icicles from the ceiling at one point and they actually fall, not just a fade to black and apply the effect of the fallen icicles). Similarly there is regular use of wizard spells to do things like optionally casting stone to flesh on a petrified dwarf to gain information. There's a lot for the wizard that doesn't launch fireballs all day, using spells in the environment or to aid quests.

Saturday, March 10, 2012

Neverwinter Nexus

The Vault recently underwent a long quiet period with no content being posted. This led to concern in the community about the future of the Vault. To avoid repeating the whole story, you can read more in this Bioware Social thread.
http://social.bioware.com/forum/1/topic/172/index/9196246

The point I'd make here is the poster DarkOne is the owner of the Nexus group of websites, and has been willing to work with the community, both in that thread and via the NWN irc channel. Funnily enough, it's almost one year exactly since the gmod.com debacle, where that site simply took people's content without asking permission.

So DarkOne and the Nexus are providing the community with a Neverwinter Nexus site.
http://www.neverwinter.nexusmods.com/index.php

If you play the Elder Scrolls games, or the Fallout series, you are probably aware of the Nexus. The Nexus has been probably the primary community place for mods for those games.


You can see my content on the Nexus. I put it there. The Nexus has some good things, like no 25 meg file limit. You can post any size files you want without having to wait for approval. I'm hoping the Neverwinter Nexus draws in new players, people who like the other Nexus games and are made aware of all the content  NWN has when they see a NWN Nexus. I'm also hoping we see some cross pollination of modders, with people that mod those other games getting interested in modding, or porting their existing mods, to the NWN series. My content will still go on the Vault as well, I will just be posting it in both places.