Author Topic: Is it possible to save the progress of a game with NWNX (bypass native save game mechanism)?  (Read 505 times)

Legacy_QlippothVI

  • Full Member
  • ***
  • Posts: 197
  • Karma: +0/-0


               I'm designing a sort of dynamic module where there are new and random events occuring with creature groups. The theory is to have a limited number for NPC/creature groups wandering the module at any given time, with new ones replacing the old in some random fashion when one group is destroyed or "leaves" the module.

Part of the initial design is a build an outpost theme. so you're protecting your factions creatures (guards, craftsmen, miners, etc) while building up your outpost/stronghold (or whatever, haven't decided the race of the PC faction yet).

I have a couple of interesting NWNX/DB modules I'm playing with, but I'd like to be able to shut down the server and replace the module (maybe adding creatures or areas), while retaining those creatures currently wandering the module. Obviously I'd like to be able to add creatures to the DB so I can just spawn them in, but Im starting small. I just want to save the state of the module at intervals so that progress is not lost if the module needs to be fixed. Which is not possible with a normal game save.

 - Qlippoth
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0


               The better question is, what are you trying to save progress for?

Because obviously if it's something simple like plot/etc then just use variables..

Other than that I'm not aware of anything that can perform a full save without going the save game route, e.g. if it's not broke, don't fix it...
               
               

               
            

Legacy_virusman

  • Sr. Member
  • ****
  • Posts: 448
  • Karma: +0/-0


               You can script your own persistency system, storing only the data you need: variables, creatures, etc.
We store items dropped by PCs on the ground, placeables marked as persistent by DMs, etc., and these changes are not affected by module updates because the system restores state from DB after module load.
               
               

               
            

Legacy_QlippothVI

  • Full Member
  • ***
  • Posts: 197
  • Karma: +0/-0


               Sorry if I wasn't clear (I ramble like that). Basically I want to save the state and location of all creatures in the module to keep them persistent. I would like to save all creature (and possibly placeable data) in the DB using NWNX. This means I also want to be able to load them back in when I start the server again.

I'm not a scripter, just getting started, but I would probably have each creature save themself every so often. I might also use something like (random idea, sorry if it makes no sense) Timestop to let this operation run through all of the creatures in the module so I can shut the server down.

This would allow me to (hopefully) replace the module when I wish to fix scripts or add/change areas.

The normal Save Game doesn't allow me to replace the module or make any changes, really. Some changes could be done using the DB depending on how the system is built. I'm starting with the idea of just keeping track of the creatures state (position, creatures data(hp), and current objective). Not sure if this is possible... Easiest idea (I think) would be to save the group to the DB so they can be created when the server is restarted.

I've been running the Universe of Arlandia module and TheRack does stuff like make quest creatures or objects persistent. But I"m not sure what all info for the creature is saved. I think just whther they are alive, then create them. They simply wander waypoints. I"ll be using NPC Activities 6.2 (ActingFenora) and vTags, so would want their HP, health (poison/disease), state (inventory/equipment), and vTag to be preserved so they keep doing what they are supposed to be doing. Maybe have the group leader run the group script to save the state of the group when they arrive at each NPC Activities waypoint...

EDIT: Virusman, just saw your reply. Thanks, just wondering how to keep the groups up to date and saved in the DB. The issue I'm thinking of is, if I save the groups seperately and at different times how will their positions be warped if the server crashes, or I don't do a full sync on server shutdown.

I guess I shoudl start looking at UoA's systems for persistence (like when I build my town in UoA with building placeables, that all gets saved) and such and figure out the issues as I go. It's just daunting for someone with no scripting experience. jst want some feedback about the possibility before I start getting to the frustrating bits. ':mellow:'

Hopefully this makes more sense to y'all,
- Qlippoth
               
               

               


                     Modifié par QlippothVI, 27 septembre 2011 - 07:22 .
                     
                  


            

Legacy_virusman

  • Sr. Member
  • ****
  • Posts: 448
  • Karma: +0/-0


               Yes, that's possible, but keep in mind that saving objects is a very CPU-intensive task, and saving ALL creatures as GFF in the DB will take a considerable amount of time. You should decide if you really need that kind of detail or you can just store the position and resref of every creature.
               
               

               


                     Modifié par virusman, 27 septembre 2011 - 07:42 .
                     
                  


            

Legacy_QlippothVI

  • Full Member
  • ***
  • Posts: 197
  • Karma: +0/-0


               Hmmm, ok. I might be running it on an i7-2600 running ESXi, with the DB and Windows VMs on separate spindles by the time I'm doing much with it as a PW (the plan anyway). Hopefully that will be enough to overcome performance issues. Otherwise I might have some ideas for cludgy solutions if the hardware isn't enough.

I'll be starting with a prototype that just uses a save game, but I have plans for a PW with an overarching story line and a bunch of battles to occur between quests and story arcs and the freedom to add areas and change scripted behavior between server restarts is an attractive goal ATM. ':?'

So, saving creatures as GFF, what data does this include?

Thanks for the info, by the way! I love this community... ':wizard:'
 - Qlippoth
               
               

               


                     Modifié par QlippothVI, 27 septembre 2011 - 07:48 .
                     
                  


            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0


               Neverwinter nights is a Single Core CPU Game, meaning it's best to have a CPU that can produce the best performance in single Core Performance, the i7-2600 is a great quad core with hyper threading, for neverwinter nights though a Core 2 Duo E7500 that is overclocked properly will produce stellar performance.  The i7-2600K (Unlocked) if overclocked is pretty much untouchable by anything on the market, till Bulldozer Comes out, then I would say buy a Dual or Quad core version of that, as it shattered the world record at 8 GHz, and can do 6 GHz on air, with ease...

AMD's new Bulldozer / FX series of CPUs are going to be real game changers in the future. (I think it's suppose to be released in October, maybe middle or end of October.  Just something to take note of..

Nevertheless, Virus man is correct, it's best not to put a server through that much of a strain, it's going to make game play rather laggy to say the least.
               
               

               


                     Modifié par _Guile, 27 septembre 2011 - 09:51 .
                     
                  


            

Legacy_virusman

  • Sr. Member
  • ****
  • Posts: 448
  • Karma: +0/-0


               Guile, on single-core loads i7 can overclock higher, boosting single-core performance. It certainly won't be any slower than previous generation dual-core CPUs. It was the case with Core 2 Quad vs. Core 2 Duo, but not with Core i7 2600 vs. Core 2 Duo <whatever>. Also, CPU clock rate isn't a reliable parameter to compare CPUs.
               
               

               
            

Legacy_QlippothVI

  • Full Member
  • ***
  • Posts: 197
  • Karma: +0/-0


               I have an old HP Pavilion X2 5600+ at 2.8 Ghz, I think it's time for an upgrade to run an NWN server. ':crying:'

Yeah, the good ol' days when you could just look at the Mhz speed and pick the higher number... I was looking at an AMD X6 machine for $380, and that's at least twice as fast as my old machine, plus 4 more cores. ':devil:' I'm leaning towards the i7 because that is about 40% faster than the X6. I may simply wait until this machine dies, as it is already getting finicky even after replacing the PSU.

I'm thinking about the server machine and keeping resources seperate for each use. NWN1 is all single threaded, though I have both the NWNX TMI and a "improved" server executable to help with the number of instruction limit. NWN1 still has it's limits, of course, but I'm glad to hear about any hurdles I might face with my design.

Obviously my main hurdle is my lack of scripting knowledge. I have some ideas (hacks) for dealing with staggering the DB commits, but they are still just ideas from someone wokring from ignorance. <>< things="" like="" using="" timestop="" to="" run="" all="" the="" db="" scripts="" while="" everyone="" is="" frozen?="" have="" a="" group="" run="" their="" script="" once="" every="" x="" time="" or="" when="" they="" enter="" a="" new="" area?="" any="" other="" ideas?="" thoughts="" on="" these="">

What is a GFF and what data does it preserve? Eevrything for the creature object? I want to clarify, there will be a limit of about 60 creatures, and Deva Winblood did some things for Harvest of Souls that would consolidate creature groups when noone else was around (seems to work fine, though I haven't evaluated it carefully yet). Also, these creatures will tend to roam in groups, so the number of areas with roaming creatures should be fairly low (groups of 1-10), rarely one creature alone wandering around.

 - Qlippoth
               
               

               


                     Modifié par QlippothVI, 27 septembre 2011 - 04:30 .
                     
                  


            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0


               <roosters (censorship much?) an ear...>

You *do* realize I'm eavesdropping shamelessly, right :-)
Good thread.

<...and takes notes>
               
               

               


                     Modifié par Rolo Kipp, 27 septembre 2011 - 04:33 .
                     
                  


            

Legacy_QlippothVI

  • Full Member
  • ***
  • Posts: 197
  • Karma: +0/-0


               Heck, I'm praying for it. '<img'>

I am looking to learn scripting, I need it for my professional growth. Right now I'm sticking with prototyping the easy stuff for game/play balance, and trying to figure out things as I go.

I've been in and out of the gaming industry (video, not gambling) and I've yet to find a game that was enjoyable that wasn't a targetted story to one user (or limited coop in that story). Most MP games are nothing but grinding (MMOs). The grind doesn't appeal to me, and the gameplay in MMOs I just don't find compelling. There's something very visceral about playing in NWN1 I don't find anywhere else (probably the dance of death during melee helps).

I don't expect to solve these problems on my own, but I'd like to explore and take a crack at an expanded story arc, with feelings engendered by the content that capture the imaginations of the player. All while providing a more intricate, i"ll use the term though I dislike it, "grind" that is more involved and interesting. It should also allow players to control some measure of power that isn't just personal (how many HP, BAB, spells you have).

These are all simplified examples:

In the first case I'm thinking more personally directed requests, where there are reputation enhancements for achiving results for your faction. Say, destroy the main gate so we can launch an offensive, or capture the ballista at some choke point. In any case, there needs to be some kind of emotional appeal to the player to accompish all of these various tasks that will make the effort more emotionally rewarding.

Obviously we're talking warfare, here, but this all started with the idea for a system to simulate gangs or underworld guilds competing for territory in a big city, with housing requirements as well as needing to control money making interests, recruitment, and these various factions would fight over each building type (in a sort of game of Life) and hope to not make enough of a mess that brings in the Marines (had a setup for a Navy base/ship building facility which basically controls the towns production) and get your crew wiped out or hauled off to the labor camps.

I also want to ensure the player always knows there is something to do. If they want a fight, they can simply go on patrol, but there will be more intricate missions with objectives that will be helpful for your faction. Hit and Fade, raids for reducing the enemy position, or for supplies or equipment. Maybe you just want to go on a mission to contented territory where you can mine iron ore or other metals while guards watch for the approach of hostile forces (or be those guards). Or lumber, or whatever to support the buliding or repair of your defenses.

These missions will change with the success or failure of each faction. I don't want cookie cutter missions, no instances! Each missions success can earn the player reputation, which is basically cache with each faction for more perks, whether greater powers of command or equipment (magical or otherwise). you might even require a certain amount of earned Rep for training... Depends on what you want to spend your reputation or favor on.

There might be opposing factions on the same side, vying for the political (or other) favor from the leaders or my Queen figure pulling all the strings (using my faction list). "We need to do this BEFORE the other guy, and show how much better our faction is!" Or even have certain factions with less scruples sabotage another on the same side. Sure, in the code it all comes down to points, but this might engender those feelings from personal and group pride to worry over self preservation.

Good equipment is more rare, it's not like I can just walk up to a guy and ask him to give me a gun. Swords were prohibited for a reason in strict lawed societies. And it was EXPENSIVE...

And learning spells will be trickier, either through some kind of "study" or craft-like mechanic (for casters only, obviously). Originally I was thinking magic items could be built, but they'd be one or two use items. Magic may seem weak, but anything that can help kill another creature is powerful. Especially when death is permanent to NPCs in most cases (PCs not so much, probably penalties in time to heal wounds which reduce stats until healed). Imagine what people would pay for a way to kill a dozen men without putting their own in danger? It's not like they can just be replaced, sure you might be able to grab some children once their old enough to hold a spear, but then you have to wait and hope over the next 15 or more whiile you wait for babies to be old enough to be pressed into war (think about propoganda of the _womb_ as a means of troop production during World War 1). The "Sleep" spell in E6 is much more powerful in E6 (with level 3 and 4 being average)... I'll have to balance for HP at lower levels, that'll be tricky.

Failure could also have an impact, but I haven't gotten around to thinking about it too in depth. This could lower your rep, and you could be demoted, might even lower your innate "base Rep" until you can repair your image. Innate Rep might be a multiplyer for your earned rep. when spedning it on perks, whether commiting forces ("I stake my name on it!") or asking for permission to acquire better arms (chainmail and up is expensive to craft and maintain).

In the second case, personal power is great, but temporal power can be more useful in the low magic low level setting like I'm planning (E6-ish setup). The Leadership type feats/skills could also affect things, and now there's a
reason to skimp on certain stats to help with the political or leadership effects on other creatures. Sure, I'm a weak shmoe in melee, but I can command 20 troops to squash an objective on occassion using some Rep points. Say, current personal Rep based on skill and stats, and spend a few point on making Command commit to your action against the enemy. This might also open the door for Spycraft, but that's getting even more involved.

I'm thinking of replacing any animal companios with weaker versions. I might also replace familiars with either weaker versions, or convert them to what will basically end up being a scrying orb with some kind of invisibility that might be detected somehow and no combat ability. You can't go through doors, but you can scout the area! Not sure about time limits on this.

I mention interest in using an external event engine to offload such things out of NWN because there are other things that could happen this way. You can only spawn groups when either the PC is in the area based on this data, you could also spawn them in from a trasition when they "move" to that area in the external engine, or creatures need to interact in the engine for some reason, such as combining forces or combat.
Of course, I've been talking about this for about 3 years now (game design issues for longer), I better get to it. ':whistle:'

- Qlippoth
               
               

               


                     Modifié par QlippothVI, 27 septembre 2011 - 11:15 .
                     
                  


            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0


               <opening the door...>

QlippothVI wrote...
I am looking to learn scripting, I need it for my professional growth. Right now I'm sticking with prototyping the easy stuff for game/play balance, and trying to figure out things as I go.

Not a bad way to do it :-) And learning while doing something you really enjoy is the absolute best way short of do-or-die, IMO ;-)

I've been in and out of the gaming industry (video, not gambling) and I've yet to find a game that was enjoyable that wasn't a targetted story to one user (or limited coop in that story). Most MP games are nothing but grinding (MMOs). The grind doesn't appeal to me, and the gameplay in MMOs I just don't find compelling. There's something very visceral about playing in NWN1 I don't find anywhere else (probably the dance of death during melee helps).

There is much more potential for "the personal touch" in NwN. One of the greatest draws to both my PnP games and my forum- & chat-based games was that I engage players by making them part of the world. They are not some alien stranger stomping about. At the minimum, my "native" players have a home, job, family, friends, rivals/enemies, a reputation to protect and a lot to lose. This is one (of many) reasons I went smaller (with NwN) and don't worry (as much) about griefers and other online annoyances. They simply can't compete with my players on their home turf.

That sort of *investment* in the world and story is a very personal thing. Way back when, both Rob Bartel & I wrote (unknown to each other) very convergent essays about this. The eerie thing was we both started with Robert Frost's poem "The road less travelled". Rob's essay was titled "Tracking Giants" I believe. Can't remember what I called mine.

Melee can be done better than NwN. But immersion, investment, engagement in NwN is hard to beat. Sorry. rambling.

I don't expect to solve these problems on my own, but I'd like to explore and take a crack at an expanded story arc, with feelings engendered by the content that capture the imaginations of the player. All while providing a more intricate, i"ll use the term though I dislike it, "grind" that is more involved and interesting. It should also allow players to control some measure of power that isn't just personal (how many HP, BAB, spells you have).

These are all simplified examples:

In the first case I'm thinking more personally directed requests, where there are reputation enhancements for achiving results for your faction.
...
In the second case, personal power is great, but temporal power can be more useful in the low magic low level setting like I'm planning (E6-ish setup). The Leadership type feats/skills could also affect things, and now there's a reason to skimp on certain stats to help with the political or leadership effects on other creatures. Sure, I'm a weak shmoe in melee, but I can command 20 troops to squash an objective on occassion using some Rep points. Say, current personal Rep based on skill and stats, and spend a few point on making Command commit to your action against the enemy. This might also open the door for Spycraft, but that's getting even more involved.

It sounds like a lot of what you want hinges on a relationship system a bit deeper and more developed than the standard faction system.  Just happens, I'm working on that ;-) We'll talk.

I'm thinking of replacing any animal companios with weaker versions. I might also replace familiars with either weaker versions, or convert them to what will basically end up being a scrying orb with some kind of invisibility that might be detected somehow and no combat ability. You can't go through doors, but you can scout the area! Not sure about time limits on this.

Personal opinion, I don't like this :-/ You might offer your scrying orb as a *choice* instead of familiars, but if you force MUs to a new, and stricter, rule I think you will be turning more than a few away. Again, personally, I've played a great many characters in the last 32 years <ouch!> and my very oldest and most beloved <beloved? Wrong word, boss> is Rolo Kipp <oh, self-love... got it :-P> hush, Bother.

If you deny me the Raven Wings-of-Shadow-Under-the-Vanguard-of-Storms (and that *is* Bother's short version name), you take away a lot of dynamic and a lot of history.  I made it all the way through the OC->HotU with a raven familiar. I honestly don't think she needs to be *weaker*. <Hey! What's that mean?!>

I mention interest in using an external event engine to offload such things out of NWN because there are other things that could happen this way. You can only spawn groups when either the PC is in the area based on this data, you could also spawn them in from a trasition when they "move" to that area in the external engine, or creatures need to interact in the engine for some reason, such as combining forces or combat.

I am *very* interested in this. I believe that, in a lot of respects, many functions of the engine could be moved outside and take advantage of faster (& more) cores and much greater memory. When you consider that nearly everything the engine does (*not* the client) is a variation on database management... the mind boggles!

Of course, I've been talking about this for about 3 years now (game design issues for longer), I better get to it. ':whistle:'

At least you didn't take a ten year sabbatical :-P

<...and sweeping out some desert sand>
               
               

               


                     Modifié par Rolo Kipp, 28 septembre 2011 - 09:06 .
                     
                  


            

Legacy_QlippothVI

  • Full Member
  • ***
  • Posts: 197
  • Karma: +0/-0


               I'm swamped with work and family obligations at the moment, but as far as changing familiars my first inclination is to swap just one of them and making sure the player knows this. This makes them a kind of scout/scryer for their faction and other players. And hope no one cries that I've taken away their favorite.

I can see how having a familiar lends to interesting role playing, like the annoying familiar who won't say anything until they get a treat, or some massaging of ego is performed (my halfling PC Lily Glittermoss had her stubborn and lazy dire boar "Piggy"). Since this is a low level game I'm concerned mainly about damage reduction and such causing even low hp Imps to be a balance killer. No magic weapons? No magic in your group (since mainly PCs will be magic users, NPC magic users may be rare), oh well, there goes that squad of NPCs...

- Qlippoth
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0


               

QlippothVI wrote...
 What is a GFF and what data does it preserve? Eevrything for the creature object? I want to clarify, there will be a limit of about 60 creatures, and Deva Winblood did some things for Harvest of Souls that would consolidate creature groups when noone else was around (seems to work fine, though I haven't evaluated it carefully yet). Also, these creatures will tend to roam in groups, so the number of areas with roaming creatures should be fairly low (groups of 1-10), rarely one creature alone wandering around.

 - Qlippoth


GFF stands for Generic File Format.   It is a file format that......   Hmm. Let me just quote bioware here. 

The Generic File Format (GFF) is an all-purpose generic format used to store data in BioWare games. It
is designed to make it easy to add or remove fields and data structures while still maintaining backward
and forward compatibility in reading old or new versions of a file format.
The backward and forward compatibility of GFF was important to the development of BioWare's games
because file formats changed rapidly. For example, if a designer needed creatures in the game to have a
new property to store their Last Name, it was easy to add that field to the creature file format. New
versions of the game and tools would write out the new field, and old versions would just ignore it.
In Neverwinter Nights, a BioWare game, most of the non-plain-text data contained in a module is in
GFF, although the compiled scripts are a notable exception.
The following file types within a module are all in GFF:

· Module info file (ifo)
· Area-related files: area file (are), game object instances and dynamic area properties (git),
game instance comments (gic)
· Object Blueprints: creature (utc), door (utd), encounter (ute), item (uti), placeable (utp), sound
(uts), store (utm), trigger (utt), waypoint (utw)
· Conversation files (dlg)
· Journal file (jrl)
· Faction file (fac)
· Palette file (itp)
· Plot Wizard files: plot instance/plot manager file (ptm), plot wizard blueprint (ptt)
The following files created by the game are also GFF:
· Character/Creature File (bic)



Hmm  I was going to suggest that you could download  all the file formats from the vault:
  Aurora Engine Documentation

and read up on the GFF format.  It appears however that the GFF format was left out of the download.   I will see if I can get ahold of  Pstemarie and have hil add the GFF format to the download.   If not I can always send you a copy if you need or want it.
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0


               <perks up his ears...>

I do! I do!

But I'd like to see it on the Vault, so I'll just wait ;-P
Not like I'm not doing anything else...

<...and settles back down>