Tuesday, May 5, 2009

Ambience

I like it when games come alive. I want to see characters going about their lives oblivious to me, proving there's more to the world than just my character. I like seeing NPCs go to work, grab a meal, and chat with each other. I like seeing them vary their activities from time to time.

I also like being able to make that happen. I've hashed together the beginnings of an ambient system that allows NPCs to be given hourly schedules rather than the day/night waypoint walking used by NWN. The waypoint system is just the beginning, though. It gets the NPCs where they need to go with great flexibility, and it allows the builders to attach scripts to waypoints that the NPCs can fire when they arrive. That's the skeleton, and now I'm putting meat on the bones by designing the scripts that will run on the waypoints.

What will it be able to do when it's done? Imagine a farmer rising just before dawn and heading to the barn to milk the cows before the sun rises. Next he heads to feed the chickens. Then to till the fields on the back forty. At midday, he returns to the farmhouse where his wife (who has her own schedule) pours him some lemonade as they sit in the shade. Then it's back to work, this time planting corn rows. Before sunset he heads to the local swimming hole to cool down, then it's back home for a meager dinner. Finally, bed so he can rest and do it all over again.

Now, that's almost certainly more complicated than most of our NPCs' schedules will be, but it's not beyond the realm of possibility. One thing is for sure, though. You won't just have NPCs standing on the street corner and staring dumbly at you.

Lore snippet: The Confederation of Adun was founded desperately forty years ago. Nerath, the eastern empire of old, swept across Emorlad, claiming the territory by divine right. The splintered Adunean states, weak from civil war, were no match for the might of Nerath individually. Forced by the Church of the Archons to put aside their differences, the states formed a defensive pact and successfully drove the invaders out. The pact later became the basis for the Confederation, but the tensions between the states remain strong.

3 comments:

Casa said...

w00t, The Witcher finally coming to NWN. Gimme! :D

Quillmaster said...

Sounds cool. I agree that ambience can add a lot, although it does require time and effort. Have you seen the ambient system developed by Ayath the Loafer and Nereng? I used it in my "Muddles in Milton" to reasonable effect. You can find the ambient system here -> http://nwvault.ign.com/View.php?view=Scripts.Detail&id=2433

Michael A. Sinclair said...

Yes, I saw that. It's an extension of the system that was unfinished in HotU. Quite interesting. I plan to attach similar scripts to waypoints, and the indepth descriptions of the functions that Nereng provides will go a long way toward helping me get this workable.

There's other ambient systems out there, I know, but I didn't find anything that I liked. NPC Activities seems to be a standard, but the scripting is so ponderous and intensive, running thousands of lines of code OnHeartbeat. One of my requirements in this system is that it be lightweight but still robust and flexible. I think it's worked out well thus far.

Will check out your module for inspiration. :)