Friday, May 22, 2009
Frayed Knights - Not Giving You the Time of Day
Because you demanded it - well, okay, you didn't. But because someone somewhere might be remotely curious... Wait, that doesn't sound quite right either. Okay - because I said I would, in spite of the complaints and angry pitchfork-and-torch-wielding townspeople - here's another installment in the continuing saga of the development of Frayed Knights, the comedic indie role-playing game (RPG).
When Last We Left Our Intrepid Adventurers...
This week, I focused on "The next five minutes." Not minutes 6-10 of the game, because that's already been covered (if subject to some changes) in the pilot. No, I wanted to focus on what happens in the next five (to fifteen) minutes of the game after the pilot ends.
If you remember, the pilot ends with Benjamin leaving the Frayed Knights in shame (and under threat of bodily harm) after it was discovered that he'd revealed their quest information to the leader of a rival adventuring group - Florentine - while in bed with her a couple of nights earlier. As a result, her team - the Heroes of Bastionne - had beaten the Frayed Knights to the punch, taken the prize, and used it to get into the good graces of the local member of the Adventurer's Guild.
Loose lips sink ships. And sink chances of getting a coveted membership in the Adventurer's Guild.
The pilot episode (which is going to remain in the full game in pretty much the same piece - enhanced, updated, improved, but not fundamentally altered) is somewhat constrained and a little more linear than I'm generally trying to go for. The next morning things open up a bit more. Shops are open, more people are about, and opportunities open up for more exploration.
This means a lot of work for me.
(Not) Giving You the Time of Day
One thing which I wanted to experiment with was changing the time-of-day. Now, I'm using the Torque Game Engine, which has some pretty nice lighting, but it comes at a cost - it relies heavily upon "static lighting" which it can pre-calculate in a lighting pass in advance. This is time consuming, and it caches the results so that future lighting passes take less time.
I spent a bit of time this week working on a dynamic time-of-day system, which unfortunately has a lot of ugly side-effects. For one thing, it breaks the lighting cache, so that it means we always have to relight all the time to make sure we've got things lit properly for whatever time-of-day you are entering the world. And it is time-consuming. Annoyingly so. Especially as the scenes and towns get more complex (as Ardin is about to...) .
So I'm looking for an alternative. This probably means having duplicate versions of areas -- one for daytime, one for nighttime -- which is going to be quite problematic, especially for setting up triggers and events based on area geography and my existing flag / event record system. There may be other solutions as well that might not look as good. Or I may have to fall back on not having time-of-day - which would suck. Because I'd hate to lose this:
Ardin By Day
Ardin By NightKicking Ben Out of the Party
So Benjamin was kicked out of the party at the end of the pilot. I didn't actually boot him from the party roster at this point, because there were more important things to worry about at the time (like getting the save-game working).
However, because the party roster WILL change a little as the game progresses, and because the player could probably use the ability to change party order around as things change, I implemented that this week. So the next day begins with Sir Benjamin NOT appearing in this party - he shows up as an NPC (non-player character).Once again, I was impressed with how much flexibility I'd placed in my system to allow this, as well as by how much additional work I still had to do to make this happen properly. I had to create a "reserve party" to compliment the "active party," and a mechanism to switch between the two. The reserve party must also be saved with the save game - you don't want to lose a character's stats and updates in-between sessions, if they may be rejoining the party later, right?
This isn't to say that the Frayed Knights are going to have a revolving door policy on membership. Or that the world will be filled with recruitable NPCs. Since Frayed Knights has an emphasis on character and dialog, I have to keep pretty close tabs on the party. (This is part of why characters are "incapacitated" rather than killed or unconscious - I want them still able to talk! As a side benefit, it makes torture much more convenient...)
In addition, I added some other tweaks - like having speaker-less text in dialogs. And flagging it as an "aside" - an aspect of dialog that I have never used and I may never use outside of speaker-less text. The idea was that if party members are talking to each other without the other characters hearing what they were saying, this would be noted by a different color of background. In practice, I'm not sure it matters. But I like having expository text for the player.
The Big Event!
One major advantage of using Torque is the scripting system. While it can be amazingly frustrating to work with sometimes, it's also amazingly powerful. I mean, you can stick a script anywhere and execute it. I would go so far as to say it's moderately more powerful than the system in Neverwinter Nights. A lot more powerful, if you consider the ability for me to go into the source code and add even more functionality to the engine that can be accessed by scripts.
But - it's not all "hugs and puppies." There is a lot of framework in place for triggering recurring, non-saved-state events based on what is assumed to be a pretty static environment . TGE was optimized for first-person shooters, after all. Heavily conditional triggers based on sequences of other events firing don't have a lot of built-in support. Keeping track of humongously complex RPG states across saved games has virtually nothing built-in to help. So any support for this sort of thing is a do-it-yourself opportunity, which makes it a little harder to make some of the cool, complex behaviors and events like I used to do in Neverwinter Nights (which had it's own problems, as well).
Nevermind my willingness to kill for access to the amount of customizeable content I had in Neverwinter Nights, too...
Besides creating that level of support for myself (a bunch of "black triangle" work, some of which has been thankfully bearing fruit now), I've been going through a bunch of old RPG walkthroughs analyzing their quest and event structure for research. These games had fairly simple quest / event structures as well, and the designers managed some pretty cool things with very simple tools. They also managed to create some pretty amazing bugs, too, which is not anything I am immune to. But it has pretty helpful both to organize my thoughts and come up with some neat ideas, while avoiding absurd levels of complexity that I might otherwise saddle myself with.
Well, that's it for now. Time for me to hit the ol' dungeon again... meaning I have to build it. The Tower of Almost Certain Death is getting a new basement level, because it was just too small as a tower.
Later!
Labels: Frayed Knights, programming
Comments:
Links to this post:
<< Home
Another TGE owner! Great to know. I've been lurking & reading your progress, but never realized you were creating things in Torque. I can sympathize with your engine struggles, particularly if you're trying to integrate some of the community code out there. You're right, the scripting language is incredibly powerful and can hold a lot of game state complexity. But for RPGs I have a tough time deciding what belongs in script, mission files or what you're better off tucking into code.
I've recently switched from TGE to TGB with .dts files which is far more forgiving for my skill level. Hats off to you for keeping with it!
I've recently switched from TGE to TGB with .dts files which is far more forgiving for my skill level. Hats off to you for keeping with it!
Yup. I've had TGE for years and I've YET to have a full-fledged commercial release with the thing. And now it's all obsolete and stuff. Well, if Shamus Young is to be believed - that may not be a bad thing.
Rather than doing continuous relighting calculations, does Torque allow you to rebuild the lighting cache in incremental fashion over multiple frames? (i.e., keep using one set of lighting data while you build the new data, and then switch over after it's rebuilt.. rinse, repeat)
Relighting using the stock TGE lighting model is way too slow for real time. Have you considered Torque 3D for your project? Its a significant upgrade from TGE and would give you the option of more platforms for a Frayed Knights release. Sorry, not trying to be a salesman. Frayed Knights is looking awesome, and I'm always excited to see an indie working on an rpg!
If I understand correctly, lighting doesn't change in "real-time," but the game will calculate the correct time of day when you exit a structure (or otherwise enter an outdoor scene), right? That makes a lot of sense.
Re. the night scenes, dark dungeons, etc., please make the level of darkness player-configurable. Monitors vary in brightness (and my computer sits against a window, which can make daytime play difficult if the screen is too dark). In fact, I didn't buy Eschalon: Book 1, because the underground areas in the demo were just too dark on my computer. Realistic or not, stumbling around in the dark, peering intently at the screen to try to make out what was happening, was NOT fun. (Apparently, Book 2 will fix that problem. I hope so.)
Re. the night scenes, dark dungeons, etc., please make the level of darkness player-configurable. Monitors vary in brightness (and my computer sits against a window, which can make daytime play difficult if the screen is too dark). In fact, I didn't buy Eschalon: Book 1, because the underground areas in the demo were just too dark on my computer. Realistic or not, stumbling around in the dark, peering intently at the screen to try to make out what was happening, was NOT fun. (Apparently, Book 2 will fix that problem. I hope so.)
WCG - I will be doing that through a gamma correction slider. I hate it when games are too dark, too. I tend to simulate darkness with a lot of dark blue rather than black, for that reason.
Anyway - yeah, there is SOME dynamic lighting available in the game - I even add more by giving the player a simulated torch to add light to the immediate area. But the stuff that looks good is all pre-lit, and can take a while on lower-end machines with complicated scenes (which is why it only does it on start-up, and keeps a cache of it so that it only does the really time-consuming stuff once).
As far as Torque 3D - no, I'm not really considering it. If I decide to change engines (and every time I do, the feeling passes after I waste an evening checking on what's available), *everything* is negotiable. I'd be far more likely to simply go with Ogre 3D or Irrlicht or one of the other game engines out there which I can integrate with Python for scripting or something. Right now, Torque 3D is too rich for my blood, too, as well as being immature / unproven.
Anyway - yeah, there is SOME dynamic lighting available in the game - I even add more by giving the player a simulated torch to add light to the immediate area. But the stuff that looks good is all pre-lit, and can take a while on lower-end machines with complicated scenes (which is why it only does it on start-up, and keeps a cache of it so that it only does the really time-consuming stuff once).
As far as Torque 3D - no, I'm not really considering it. If I decide to change engines (and every time I do, the feeling passes after I waste an evening checking on what's available), *everything* is negotiable. I'd be far more likely to simply go with Ogre 3D or Irrlicht or one of the other game engines out there which I can integrate with Python for scripting or something. Right now, Torque 3D is too rich for my blood, too, as well as being immature / unproven.
@ Jay: Regarding a night-day cycle... For a real-time cycle in TGE, there are some resources on GG that appear to do a decent job blending sky boxes, weather, etc. But AFAIK, they still have to stick with vertex lighting (for terrain at least) since generating light maps in real-time is impossible.
But it looks to me like there are just 2-3 specific time periods...? If that's the case, then it shouldn't be too difficult to tweak it to use a specific lighting cache (file) per time period. This would make far more sense than rebuilding the entire mission just to change the time of day. The first step, I think, would be to change the lighting file naming convention. With a dynamic time of day system already in place, you should be able to take the current time and append that to the lighting file name. Then you'd be able to know exactly which file to load for a certain time of day. And of course it would make sense to save the names in each mission datablock. Anyway, something like that... =)
@ Mac: For FK's art style, T3D would pretty much be overkill -- expensive, wasted overkill. And TGE runs on the most relevant platforms already. So it makes little sense to port FK to T3D. (Now TGEA, that might be worth doing, but T3D...? Naw.)
Post a Comment
But it looks to me like there are just 2-3 specific time periods...? If that's the case, then it shouldn't be too difficult to tweak it to use a specific lighting cache (file) per time period. This would make far more sense than rebuilding the entire mission just to change the time of day. The first step, I think, would be to change the lighting file naming convention. With a dynamic time of day system already in place, you should be able to take the current time and append that to the lighting file name. Then you'd be able to know exactly which file to load for a certain time of day. And of course it would make sense to save the names in each mission datablock. Anyway, something like that... =)
@ Mac: For FK's art style, T3D would pretty much be overkill -- expensive, wasted overkill. And TGE runs on the most relevant platforms already. So it makes little sense to port FK to T3D. (Now TGEA, that might be worth doing, but T3D...? Naw.)
Links to this post:
<< Home


