04 Jan, 2011, quixadhal wrote in the 21st comment:
Votes: 0
What you *might* want to consider is going in the opposite direction. :)

Instead of writing a bazillion bits of load/save code to push everything into and out of a database, you might want to just use a serialization library and put ALL your game data into a single top-level structure that you can serialize as a single action. Then you can just capture the entire world state and dump it to wherever you like.

You'd need to write a small amount of sanity code to restore, so that (for example), if you're doing a cold boot, you probably want all the players to be logged out and all the npc's to not be in combat.

The plus side of doing it this way is, no more rewriting loading/saving code. Keep an "empty" world state file as a place to restart from, and that's about it. The minus side, of course, is that you'll need to edit things in game, or use a format like JSON that you can hand-edit if you're willing to plough through the giant data structure.
04 Jan, 2011, plamzi wrote in the 22nd comment:
Votes: 0
RoFAdmin said:
I actually had previously downloaded the MySql source, and attempted to install it as per this article
http://www.drk.com.ar/docs/windows/mysql...
however when i attempt to ./configure –without-server it says "./configure: no such file or directory"
Im assuming im going about something wrong. More then likely the article is outdated since its for version 4.something and im using version 5.5.8


Googled this out for you:

http://bugs.mysql.com/bug.php?id=45399

The thread seems to cover the exact error you got and someone has reported success getting past it.

If you're only going to read stuff at boot time, then one remaining question is how much you trust the remote database to be always up. And if you're talking about a web host providing MySQL db access as part of a package, I'd also make sure that it's possible to connect from the location where you run the server. (A lot of providers only allow sql db connections from the server where your site/shell is located.)

P. S.
Given your requirements (unique id's, ability to modify individual records), I would advise against a flat file (JSON or not). A SQL db is wonderful in many ways, and some of those ways include exactly what you're looking for.
04 Jan, 2011, RoFAdmin wrote in the 23rd comment:
Votes: 0
@quix:

I had considered that, but there are some objects/npcs that i dont want to be persistent.. Plus as you mentioned then i have to code in all sorts of sanity checks, which doesn't sound fun either. Id much rather just save the NPCs and object that i need to save because realistically i would say only 10-15% of the NPCs and Objects occupying space in the world that isnt on a character need to actually be persistent. I have NPCs and MOBs, functionally they are the same for the most part, but NPCs need to persist, MOBs don't. Also the only items i want to save on the ground/in objects are ones that are specifically either marked persist or are "registered" by the game to a player this way if they dropped something, and the game goes down, or i hotboot, the item is still there. All the "junk" in the game i could care less if it poofs ya know?

@plamzi:
Thanks for the link, but my problem is actually coming in sooner. ./configure no longer works. It appears they are using CMAKE, so i need to go and figure out how to go about configuring and installing via CMAKE now.

As far as how much i trust the remote DB to be up, i trust it to be up enough during my development. After that i plan on actually hosting the game and the SQL server on the same machine. As for why i just don't run a copy of MySql locally, the answer is simple. I do all my development from my laptop, and while its a power house, i stress this thing 24 hours a day already. At any given time i have Adobe Fireworks, Adobe Flash, NetBeans, Eclipse, Cygwin, and Visual Studio open, not to mention my two virus scanners, an ungodly amount of tabs in Firefox, Couple copies of my favorite mud client, and anything else misc that i may need at the moment. So i just dont really feel like beating up on my poor laptop any more by deciding to install SQL on top of everything else i run. Especially when the only reason i would need a local copy running is for this MUD im working on. and before you ask, yes most of the time is is required that i have most of these programs open.
04 Jan, 2011, plamzi wrote in the 24th comment:
Votes: 0
@RoFAdmin

You must really have a powerhouse of a laptop if you can open Adobe Flash and Eclipse at the same time :P.

Well, if you can't get the MySQL API to compile under cygwin, I suppose you could just grab a lightweight Linux image for VMWare. A lot larger footprint, but as a dev environment it might work ok: it can be paused quickly to regain resources, and it's easy to delete when done.
05 Jan, 2011, quixadhal wrote in the 25th comment:
Votes: 0
Ok, it was an idea. I've worked with fully persistent games before, and to be honest, they are more the norm than the exception these days. For a couple of examples in the MUD world, check out the Gurba mudlib for DGD, or any of the TinyMUCK/MUSH family. The amount of special case coding you have to do is pretty small, but you do need to have an object manager so you can find/update/destroy objects of any kind, since if you lose track of anything, it lingers around forever.
05 Jan, 2011, Tyche wrote in the 26th comment:
Votes: 0
Scandum said:
Tyche said:
Scandum said:
I think software runs about 3 times slower under Cygwin than natively, which is somewhat of an advantage development wise as bottlenecks are more apparent.

I think it don't.
Of course profiling and benchmarking is far more useful than thought experiments.

My own codebase takes 6 seconds to boot using Cygwin and 1.5 seconds using Slackware. CPU load is roughly 3 times higher.


That's not at all what I mean by native. For instance if you think I/O is a bottleneck…
My cygwin include folder contains 8,262 Files in 618 Folders; 77 MB of header files.
Not only will grep open all those files and search them, it'll pipe the hits back into the calling program.

MSys user system total real
grep -r int C:\cygwin\usr\include 0.485000 0.047000 0.532000 ( 5.190430)

Borland Grep user system total real
grep -d int C:\cygwin\usr\include 0.422000 0.219000 0.641000 ( 4.463867)

Cygwin user system total real
grep -r int /c/cygwin/usr/include 0.860000 0.640000 1.500000 ( 4.375000)

Cygwin apparently runs faster in this case. Maybe because MSys uses a slightly older grep and was built with the gcc 3.x compiler. Borland Turbo Grep uses a runtime ten years old. In any case, the overhead Cygwin introduces maintaining it's unix-like environment (in this case mapping Windows files and pipes to descriptors) is pretty negligible.

I don't measure boot times because they don't have anything to do with the mud's runtime performance.
Do you measure the second or third boot as Windows agressively caches files.
The above grep commands will take maybe 5 times longer on the very first run.
05 Jan, 2011, David Haley wrote in the 27th comment:
Votes: 0
There's also SQLite if you don't want a whole DBMS running.

TBH, though, I think that using a database is a little unnecessary. This is not something that will be queried or written to often. You don't really need any indexing or complex lookups or the ability to join across stables. All you want is a pile of storage units, and the file system really isn't so bad for this. If you actually do have too many files (are you cleaning up dead entities? how many entities are created and destroyed during an average session?) you can split them into subdirectories by type, vnum, vnum range, or whatever.

By the way, even if you're just writing remotely, you want the connection to be fast unless you have non-blocking I/O.

And FWIW, I agree with Tyche w.r.t. the performance issues. Cygwin's not an emulator, after all. It is possible that a few of its POSIX routines are a little slower, but datadatadata is necessary.
05 Jan, 2011, Scandum wrote in the 28th comment:
Votes: 0
Tyche said:
That's not at all what I mean by native. For instance if you think I/O is a bottleneck…

Reading from disk creates hardware lag, as such it's difficult to determine the software lag. It's like using Cygwin to open and close your dvd drive 500 times, then using DOS to do the same thing, and report that Cygwin takes a total of 1000.3 seconds and DOS 1000.1 seconds, next claiming speed differences are negligible.

Anyways, from running various software on both Cygwin and Linux it is rather obvious to me that Cygwin is slower, and as my codebase reports out of bound heartbeats, and they're much more frequent on Cygwin, it is a known issue, and in my opinion the most likely cause. Why Cygwin is slower I do not know, and it may be faster on different windows releases.

Even though you're mistaken, you may still get a democratic win, and if other people besides Crat are going to jump in and proclaim me a moron you'll definitely win the popularity vote! It's almost like politics. ;)
06 Jan, 2011, David Haley wrote in the 29th comment:
Votes: 0
No, it's not difficult at all to separate time spent waiting for I/O and time spent in the CPU, or at least if you know how to measure things properly instead of waving around silly numbers like only the total time.

Scandum, you might want to reconsider your popularity vote joke if you've got Tyche and me agreeing. :smile:
07 Jan, 2011, Cratylus wrote in the 30th comment:
Votes: 0
David Haley said:
No, it's not difficult at all to separate time spent waiting for I/O and time spent in the CPU, or at least if you know how to measure things properly instead of waving around silly numbers like only the total time.

Scandum, you might want to reconsider your popularity vote joke if you've got Tyche and me agreeing. :smile:


I'm pretty sure the I/O is tied up by the same mechanisms that has kept socialists boggled for centuries, that some are far better calls than others, and that this isn't fair.

-Crat
http://lpmuds.net
07 Jan, 2011, Runter wrote in the 31st comment:
Votes: 0
Putting aside the boot up time for your game…I thought the issue was that while the game is actually running it's skipping heartbeats or whatever you called it. That would seem to suggest it's substantially worse if I understand what that means on your game. Why don't you profile it and find out what actually is the problem rather than guessing?
07 Jan, 2011, Scandum wrote in the 32nd comment:
Votes: 0
Maybe you people should go back to insisting that MCCP stream errors cannot, I repeat, can not, be recovered from. I remember a clear democratic victory and a massive win of the popular vote.

Is there some kind of special school where I can master this social behavior? Or is it one of those things that have to come naturally?
07 Jan, 2011, David Haley wrote in the 33rd comment:
Votes: 0
It would be interesting to see unambiguous empirical measurement, yes… after all, we are fortunate to have a question here that would have a fairly clear-cut answer one way or the other.
20.0/33