[MUD-Dev] Material state transformations

Chris Chris
Tue Jul 1 17:44:36 CEST 2003


From: "Yuri Bazhukov" <ybazhukov at ktl.ru>

> I am very interested, in material transformations from solid to
> liquid, from liquid to gaseous form. I think it will be very good
> to implement it, because it adds some variety to game. I found
> some difficulties in implementing it, and want to ask community
> about ways to implement it.  The main problem is determine
> characteristics of transformed object.

I can tell you from a coding prospective it will require alot of
time. Much like a physics engine (Havoc) is wrote, numerous
equations and outcomes have to be programmed and constantly
checked. This does two things: (1) Requires a programmer to hard
code (more on hardcoding) all of the information into the server and
(2) uses processor cycle time just like the Havoc engine uses cycle
time.

Take the example of water from liquid to solid state; let's say a
lake.  First, you have to code what each state does: ie liquid is
swimmable, and solid u can stand on. Each state has it's own set of
physics that would have to effect the player. IE: you would have to
code in how to swim, what swiming does (ie: possiblity of
drowning). Then take the instance of what happens if the player (or
anything else) is swimming when the state changes (frozen in the
ice?) or vice versa. Equations based on size of the water and it's
temperature would have to be drawn up to check if it is solid or
liquid. The server would have to preform many 'checks' on these
equations to see if the lake should change states.

COST:

  If you don't have state changes, then for a programmer to code a
  lake, it would take 1 unit of time to program a lake. However, if
  this lake is able to turn into solid then it would take 2 units of
  time to program (for the 2 different states). Finally, if this
  lake can dry up and evaporate, it would take 3 units of time to
  program (for the 3 different states). Concurrently, the server
  would take 0 CPU power for the lake (0 because there is no need to
  check for a different state). It would take 1 unit of CPU
  processor time on the server to check between the 2 or 3 different
  states (1 equation can give you the correct state). However, your
  world is given to have N number of lakes; each must be
  checked. Therefore, your server cost with a lake of only1 state
  costs 0 CPU processor time, and O (N) *reads as big-O of N* CPU
  processor time for more than 1 state.

Some short cuts would be to have the state change at a given time;
much like how night and day is calculated from the server clock; a
state change could be calculated based on season. This would reduce
your server CPU load to O (1) *reads as big-O of 1*, which, for
those that don't know, esentially nothing. However, the programmer
would still have to code in the behaviour of the 3 different states.

Finally if you want to have other object interact with each state
change it would be look as thusly: Take the interaction of potassium
(element K) and liquid water. When touched the potassium
ignights. However, potassium does nothing to vapor and ice. So a
programmer would have to program the interaction between potassium
and liquid water; but do nothing for the other states. Take now that
you have water again, and some other substance that has 3 states as
well. If each state produced a different outcome then the programmer
would have to code 3^3 = 27 state intereaction outcomes.

In short, it's a waste of time a programmers time; he should be
fixing bugs.

     Chris "Diamonds" Stewart
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev



More information about the mud-dev-archive mailing list