[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Game Logic



Dennis Payne wrote:

> > I ran a "size libperl.a" and took the total of the text, data and bss:
> > 466425 bytes.
> 
> I meant over time.  When using mod_perl it is advocated that you have a
> seperate pool of apache servers without mod_perl for serving images and
> static pages because of its size.  I'm wondering if this is because
> perl consumes a large amount of memory over time, at startup, or what.

Yeah, well, compiled code is stuff in read/write data, so this is
subject to COW after forking and new scripts loaded after fork will not
be shared by other processes (even if they use the same script). Note
that if you load scripts before forking, this will be easier (compiled
scripts aren't written to most of the time, so they should get COWed too
much).

The memory usage is big, but it's not that bad. The problem with Apache
is that on big mod_perl sites (like IMDB or Slashdot), you have a lot of
traffic for images (for example), which induces server forking to handle
the load. This can get ugly real quick, with hundreds of httpd processes
with non-shared script data fluffing around, unused...

> For Troll Bridge, I use shared libraries to implement much of the game
> logic.  There are a couple of problems with this setup.  Tweaking the
> monster AIs takes more knowledge and time than doing the same with an
> interpreter.  Non-programmers can't add easily add new creatures.  For
> example an artist who designs some cool new creature that has frames
> that differ from existing creatures can't see it until a programmer
> codes something up.
> 
> I'd still use shared libraries if I started from scratch though.
> Implementing shared libraries is easy.  Not to mention a scripting
> language can now be implemented in a shared library.

I am trying to get both working. As you mention, a scripting engine can
be stuffed into a shared library...

<shameless plug>
XPLC has no scripting support yet, but in the Near Future it will:
http://xplc.sourceforge.net/!
</shameless plug>

:-)

-- 
"As usual, this being a 1.3.x release, I haven't even compiled this
kernel yet.  So if it works, you should be doubly impressed."
 -- Linus Torvalds

---------------------------------------------------------------------
To unsubscribe, e-mail: linuxgames-unsubscribe@sunsite.auc.dk
For additional commands, e-mail: linuxgames-help@sunsite.auc.dk