1998Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev]  World Persistence, flat files v/s DB v/s ?? -->
<!--X-From-R13: [ngg Qunggreyrl <znggNzcp.qla.zy.bet> -->
<!--X-Date: Sun, 22 Mar 1998 12:44:11 +0000 -->
<!--X-Message-Id: Pine.LNX.3.96.980322122912.390B&#45;100000#mpc,dyn.ml.org -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: Pine.LNX.3.96.980321223049.1095A&#45;100000#shamen,cyberhighway.net -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:matt#mpc,dyn.ml.org">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00811.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00813.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00827.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00814.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00812">Author</A>
&nbsp;|&nbsp;<A HREF="#00812">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00812">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: mud-dev &lt;<A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A>&gt;</LI>
<LI><em>Subject</em>: Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</LI>
<LI><em>From</em>: Matt Chatterley &lt;<A HREF="mailto:matt#mpc,dyn.ml.org">matt#mpc,dyn.ml.org</A>&gt;</LI>
<LI><em>Date</em>: Sun, 22 Mar 1998 12:43:49 +0000 (GMT)</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:neddy#itl,net">neddy#itl,net</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
On Sat, 21 Mar 1998, Ben Greear wrote:

&gt; I'm contemplating a space based game, where once started, it will
&gt; never again resemble it's starting state (unless the starting world
&gt; image is saved of course.)  It will be written in Java.

Well, this sounds intruiging. I've also been wanting to write a server in
Java to see how well its object-orientated model maps to the purpose (very
well I should imagine, particularly if any 'on-line' coding can also be
done in Java - although it sounds like you will not have anything of
this sort). Actually this project sounds like one of the popular
'strategy' or 'warfare' type games, and very interesting indeed.
 
&gt; 
&gt; The game will need to update it's persistant storage very often
&gt; to make this feasible. 

Yeah, I can imagine. This is going to be your main problem, I think. :)
 
&gt; In my current game, I use ascii based flat files.  I don't think
&gt; this will work so well for the space game.

I doubt it. You could end up with very large files, plus, I find that
ASCII is awkward to work with when loading in data on a large scale. An
advantage is that if the file layout is predictable and constant, you can
update bits easily in java (RandomAccessFile).
 
&gt; The two things I'm pondering now are binary flat files (one per object,
&gt; a collection of objects?? I dunno) or a database.

The former depends on the design structure of the server - if you can
sanely order it into a series of binary files and it won't be too
inconvenient to work with them, maybe, otherwise a database might be a
good move. I think your own binary files or ASCII files would be the best
bet (perhaps ASCII if it were kept compressed, since the amount of data
should be large).

&gt; I'm a little concerned about the performance hit on a DB, as I expect
&gt; this game server to bring a machine to it's knees anyway...
&gt;
&gt; I'd be interested to hear any suggestions you might have.. 

A point to remember: Have the game *constantly* saving *small* amounts of
data. Don't attempt to do what bases like PennMUSH do and dump a large
amount of data at a regular interval - this causes quite a few problems
(or rather, will if you are saving more than a few megabytes).
 
&gt; Also, as a java server, I don't think I can do a select on incomming
&gt; data.  I think a thread for every player is a bit much...any suggestions
&gt; here?

You're going to need one ServerSocket per player, aren't you?

If I am correct in this assumption, there is no problem - you can use one
thread to read from them, identifying connections by the socket they are
connected to.

If not, you can either use one thread/socket, and require a custom client,
which attaches an identifier to data sent (possibly using something like
DataGramPacket, where one part of the packet is the identifier), or just
use one thread per player - this doesn't seem overly excessive to me. :)

-- 
Regards,
	-Matt Chatterley
Spod: <A  HREF="http://user.super.net.uk/~neddy/spod/spod.html">http://user.super.net.uk/~neddy/spod/spod.html</A>


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="00889" HREF="msg00889.html">Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</A></strong>
<ul compact><li><em>From:</em> Adam Wiggins &lt;nightfall#user2,inficad.com&gt;</li></ul>
<li><strong><A NAME="00856" HREF="msg00856.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></strong>
<ul compact><li><em>From:</em> J C Lawrence &lt;claw#under,engr.sgi.com&gt;</li></ul>
<li><strong><A NAME="00826" HREF="msg00826.html">Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</A></strong>
<ul compact><li><em>From:</em> Ben Greear &lt;greear#cyberhighway,net&gt;</li></ul>
<li><strong><A NAME="00814" HREF="msg00814.html">Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</A></strong>
<ul compact><li><em>From:</em> Joel Dillon &lt;emily#cornholio,new.ox.ac.uk&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00810" HREF="msg00810.html">World Persistence, flat files v/s DB v/s ??</A></STRONG>
<UL><LI><EM>From:</EM> Ben Greear &lt;greear#cyberhighway,net&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00811.html">Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00813.html">Re: [MUD-Dev] Parlez vous NPC?</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00827.html">Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00814.html">Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00812"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00812"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<ul compact>
<LI><strong><A NAME="00893" HREF="msg00893.html">Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</A></strong>, 
Matt Chatterley <a href="mailto:matt#mpc,dyn.ml.org">matt#mpc,dyn.ml.org</a>, Wed 25 Mar 1998, 08:40 GMT
</LI>
</ul>
<LI><strong><A NAME="00881" HREF="msg00881.html">Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</A></strong>, 
Vadim Tkachenko <a href="mailto:vt#freehold,crocodile.org">vt#freehold,crocodile.org</a>, Wed 25 Mar 1998, 04:53 GMT
<UL>
<LI><strong><A NAME="00924" HREF="msg00924.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Wed 01 Apr 1998, 00:49 GMT
</LI>
</UL>
</LI>
</ul>
</ul>
<LI><strong><A NAME="00827" HREF="msg00827.html">Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</A></strong>, 
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Sun 22 Mar 1998, 20:05 GMT
</LI>
</ul>
<LI><strong><A NAME="00812" HREF="msg00812.html">Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</A></strong>, 
Matt Chatterley <a href="mailto:matt#mpc,dyn.ml.org">matt#mpc,dyn.ml.org</a>, Sun 22 Mar 1998, 12:44 GMT
<UL>
<LI><strong><A NAME="00814" HREF="msg00814.html">Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</A></strong>, 
Joel Dillon <a href="mailto:emily#cornholio,new.ox.ac.uk">emily#cornholio,new.ox.ac.uk</a>, Sun 22 Mar 1998, 12:50 GMT
<UL>
<LI><strong><A NAME="00815" HREF="msg00815.html">Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</A></strong>, 
Matt Chatterley <a href="mailto:matt#mpc,dyn.ml.org">matt#mpc,dyn.ml.org</a>, Sun 22 Mar 1998, 13:40 GMT
<UL>
<LI><strong><A NAME="00816" HREF="msg00816.html">Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</A></strong>, 
Joel Dillon <a href="mailto:emily#cornholio,new.ox.ac.uk">emily#cornholio,new.ox.ac.uk</a>, Sun 22 Mar 1998, 13:55 GMT
</LI>
<LI><strong><A NAME="00817" HREF="msg00817.html">Another recruit for the list?</A></strong>, 
Joel Dillon <a href="mailto:emily#cornholio,new.ox.ac.uk">emily#cornholio,new.ox.ac.uk</a>, Sun 22 Mar 1998, 15:29 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</ul>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>