ZMuohM_redux.rtf
This file can be downloaded and is part of the project.
18nov14 ndp
28nov14

Resurrecting  Zombies, Mutants, and Undead of MY!

ref: http://sourceforge.net/projects/reddwarf/
ref: www.gameactive.org

A place to put everything.
	"C:\Data\Software\JavaGameDevelopment\ZMUohM"
Then, we need NetBeans.."https://netbeans.org/"..8.0 already installed..ok..get all the updates..sheesh..
ok..up to 8.0.1..
Start with a fresh slate..File > Close All Projects..ok..
Let's see if there's enough instruction on GA to get the project..Go to www.gameactive.org
Down Load Client -> tells us to go to "https://java.net/projects/darkmud-redux" and the note at bottom of page 
has a link to DarkMud-Redux at "https://java.net/projects/darkmud-redux". So lets go there.
Ok. I need to put a note on the Download page to redirect back to the Subversion repository..treat as an IQ test for 
now.
Click "Get Source Code -> browse"..Source code  browse > svn > trunk > NetBeans > ZMUohMyNB
We'll need all three projects:
	ZMUcommon		These classes are built into a library to be shared by both the Game Server and 
				the Client.
	ZMUohMy		This is the Game Server.
	ZMUohMyClient	This is the Game Client.
NOTE: For the 3D client. Java3D is needed. I should change this the use the latest Java FX or what ever supports 3D.
hmm..best to use SVN to chechout the project. I should include zips. Could put them in the Douwloads.
The checkout URL is give as https://svn.java.net/svn/darkmud-redux~svn 
Guess I'll get the TortoiseSVN client for check out..go to "http://tortoisesvn.net/" and get TortoiseSVN 1.8.8 released.
Install 64bit..ok..open the "C:\Data\Software\JavaGameDevelopment\ZMUohM" folder and right click to checkout
repository "https://svn.java.net/svn/darkmud-redux~svn" it to Checkout directory
"C:\Data\Software\JavaGameDevelopment\ZMUohM\working"..notice I changed the location a bit from the default..
ok so far..checked out rev 240..but it got the whole effort..bah..all we want is the latest trunk..ok, delete and back 
up and try again..click jon the [...] to browse the repo.."https://svn.java.net/svn/darkmud-redux~svn" > trunk >
NetBeans > ZMUohMyNB shows the three projects..OK..check out to
"C:\Data\Software\JavaGameDevelopment\ZMUohM\ZMUohMyNB"..OK..ah, much better..now to see if NB 8 can
use them..
But we will still need the 0.10.2 DarkStar server release..So let's get that..go to
	"http://sourceforge.net/projects/reddwarf/"
Click download to get sgs-server-dist-0.10.2.1.zip and unzip..we'll only need a few things such as libs from it..
I'm going to try just bringing over libs as needed into a sgs-server directory in the ZMUohM directory..
Creating a C:\Data\Software\JavaGameDevelopment\ZMUohM\sgs-server folder...doh, wait a minute. I wrote
all this up way back when just for this event..back to the GA site..
  GAME DESIGN > Current Server Extention Effort > Moving to RDS 0.10.2 .. ah ha..steps..
hmm..go back and check for a client zip..0.10.2.1 has no client zip..check 0.10.2..ah..click to download 
sgs-client-dist-0.10.2.zip..extract client code..back to steps..
2) rename the sgs-server dir made earlier to sgs-dist and copy folders and file as directed..
The files in the conf folder can be deleted since they will be replaced with the game configs..
4) Copy the conf files from C:\Data\Software\JavaGameDevelopment\ZMUohM\ZMUohMyNB\ZMUohMy\conf
into the ../tutorial/conf, not the server/conf..hmm..should also make a sgs-client directory to put client stuff into..
Create a C:\Data\Software\JavaGameDevelopment\ZMUohM\sgs-client directory..
Before doing 5), copy the server jar files into the sgs-dist..naw, change this to sgs-server, and the client jar into
sgs-client..copy the -sources.jar file also..
../sgs-client
	sgs-client.jar
	sgs-client-0.10.2-sources.jar
Server jar files are in ../sgs-server/lib and ../sgs-server/src folders..need to bring over the src directory from the 
distrobution..
Client jar files are in ../sgs-client
ok, now to NetBeans..
5) Open C:\Data\Software\JavaGameDevelopment\ZMUohM\ZMUohMyNB\ZMUcommon. Project name should be
ZMUcommon. 
Open C:\Data\Software\JavaGameDevelopment\ZMUohM\ZMUohMyNB\ZMUohMy. Project name should be 
ZMUohMyNB. Resolve problems by adding the jar files to the projects libraries..
ZMUohMyNB > Libraries > Add Jar/Folder and use relative path..
	../lib/sgs-server-0.10.2.1.jar
	../lib/sgs-server-api-0.10.2.1.jar
	../src/sgs-server-0.10.2.1-sources.jar
To resolve issue of old 0.10.2 jars, go to project Properties:Libraries and remove broken 0.10.2 refs from list.
hmm..three souce errors. Will have to resolve those also, but let's get the Client project loaded first..
Open C:\Data\Software\JavaGameDevelopment\ZMUohM\ZMUohMyNB\ZMUohMyClient. Project name should be
ZMUohMyClient. hmm..no lib issues, but source AND think missing the 3D lib stuff..

Ok, since ZMUcommon isn't complaining, try to build it (I recall that the Server and Client are dependent on it's jar).
Builds no problems..reveiw Slipstream Notes page..
"Download and install Java 3D 1.5.1 from http://www.oracle.com/technetwork/java/javase/tech/index-jsp-138252.html."
Go there..d/l Java 3d 1.5.1 "java3d-1_5_1-windows-i586.exe" and install..ok..
Time to start looking at the source code..going to reload NB first, may not have detected the 3D install..
Try simple 3D example..can't find java 3d..try system reset to see it detects 3D install..
hmm..there are 3d jar files in the ZMUcommon, but I don't know how thety got there..
Referencing the ZMUcommon/lib/Java3d fixed the errors..builds..
run.."no j3dcore-ogl in java.library.path"..
Reinstall from C: drive..thinks I have an AMD64..try that "java3d-1_5_1-windows-amd64.exe" d/l..hmm, no errors..
Removed 3d from ZMUcommon lib..no problems..can delete Java3D from ZMUcommon..all ok..and Client RUNS!
So, the i586 is a 32bit and the amd64 is a 64bit..all working now.
Do a TortoiseSVN delete..Ah, all the ZMUohMyNB error are gone also..Jave3D example "HelloUniverse" runs also..
Well, since everything compiles, back to the steps..
Copy C:\Data\Software\JavaGameDevelopment\ZMUohM\ZMUohMyNB\ZMUohMy\dist\ZMUohMyNB.jar into
C:\Data\Software\JavaGameDevelopment\ZMUohM\sgs-server and delete the ../tutorial/data folder if it exists.
CD to C:\Data\Software\JavaGameDevelopment\ZMUohM\sgs-server and run
	java -jar bin/sgs-boot.jar tutorial/conf/ZMUohMyNB.boot
hmm..3d loader issue. Old problem..Since I'm going to redo the 3D anyway, going to disable it where is causes
a problem. I want to get to where the server runs with the client..
MOD: Room.java, PositionMessage.java, Door.java
build server..test..TA DA..server is UP!..application is ready..try client..hmm..not logged in..check host settings..
ah ha..change MudClient.java to use "localhost"..WOOT..we're in..
Commit and add the report..

19nov14
ADD: In ZMUcommon project, add com.altruistech.mat package to add a Vect3d Class to replace the Java3D 
one I disabled in the Server. As I put 3d back in, add needed methods to Vect3d class..
MOD: Room.java
ADD: import com.altruistech.math.Vect3d;
ADD: Room()
    private Vect3d position;
    private Vect3d dimensions;
MOD: Room::Room()
        position = new Vect3d(0f,0f,0f);
        dimensions = new Vect3d(0.1f,0.1f,0.1f);
and add constructor to Vect3d class..
MOD: Room::getDimensions()
    public Vect3d getDimensions() {
        return dimensions;
    }
MOD: Room:getPosition()
    public Vect3d getPosition() {
        return position;
    }
MOD: Room::setDimensions()
            dimensions.set(Float.valueOf(dim[0]), Float.valueOf(dim[1]), Float.valueOf(dim[2]));
and add set() method to Vect3d class..
MOD: Room::setPosition()
        if(pos.length == 3)
            position.set(Float.valueOf(pos[0]), Float.valueOf(pos[1]), Float.valueOf(pos[2]));
MOD: Door::commitCommand()
            String DDP = dest.getDescription()+
                    "@"+dest.getPosition().toString()+
                    "@"+dest.getDimensions().toString();
MOD: Door:run()
            PositionMessage msg = new PositionMessage(invoker.hashCode(),
                    invoker.getType(), where.getPosition());
ADD: PositionMessage.java
import com.altruistech.math.Vect3d;
    private Vect3d objectPosition;
MOD: PositionMessage::PositionMessage() 
    public PositionMessage( int id, MudObject.MudType type, Vect3d pos ) {
MOD: PositionMessage::getObjectPosition()
    public Vect3d getObjectPosition() {
MOD: PositionMessage::encodeImpl()
        dout.writeFloat(objectPosition.x);
        dout.writeFloat(objectPosition.y);
        dout.writeFloat(objectPosition.z);
and make x,y,z public access..Look into this later..
MOD: PositionMessage::decodeImpl()
        objectPosition = new Vect3d(x, y, z);    }
hmm..not finding new package at run time..tortoiseSNV add new altruistech dir to progect..
hmm..noticed that ZMUcommon is using Libraries::sgs-server-api-0.10.1.jar and not -0.10.2.1..
fix..remove 10.1 and add the 10.2.1 in the sgs-server dir..build..
ok, ZMUohMyNB::Libraries::ZMUcommon.jar>META-INF>MANIFEST.MF is correct now..
try adding path to ZMUcommon.jar in Proj Properties::Libraries::Run..
try Refactor Vect3d into sgs.darkmud.core..clean & build common and server..hmm. still can't find class..
try renaming to Vect3z..nope..hmm..in the ZMUcommon.jar, the other class files have two entries.
One has a $ plus extra name.class. The Vect3z.class has only one entry..
Remove and readd ZMUcommon.jar..hmm...restart NB..bah..refactor name to Vec3dz..bah..
Undo 3d refs and use int as before..blah, use float instead of int..yeah.."INFO: ZMUohMyNB: application is ready"
Copy C:\Data\Software\JavaGameDevelopment\ZMUohM\ZMUohMyNB\ZMUohMy\dist\ZMUohMyNB.jar to
C:\Data\Software\JavaGameDevelopment\ZMUohM\sgs-server\tutorial and delete data folder...
run server
cd C:\Data\Software\JavaGameDevelopment\ZMUohM\sgs-server and run 
	java -jar bin/sgs-boot.jar tutorial/conf/ZMUohMyNB.boot
should get .."INFO: ZMUohMyNB: application is ready"..now run client from NB and logon..
type "look" to get some info..logout..oh well..
Try copy Vec3dz.java to server source .darkmud.core and do a trivial use in Room.java..hmm, worked..
ok..try to use it..
MOD: Room.java, PositionMessage.java, Door.java again..server comes up..logon ok..hmm, still can't move and
starting at 0,0,0..BLAH, from old mods, com.sun.sgs.darkmud.core and .messages are duplicated in ZMUcommon
AND in ZMUohMyNB..DOH..this may have been the problem all along because the PositionMessage in ZMUcommon
is still using the Java 3D javax.vecmath.Vector3f class without complaining..may be this weekend..
25nov14
Fix duplicate files issue in Common, Server, and Client.
Ok. Client is fine. No duplicates.
Server: Delete .core file duplicates
	DataBase.jave
	IdManager.java
	ListPair.java
ok..hmm.. .follow::Zombie.java shows error now..old method. Comment out for now..
build..run server
   Copy C:\Data\Software\JavaGameDevelopment\ZMUohM\ZMUohMyNB\ZMUohMy\dist\ZMUohMyNB.jar to
   C:\Data\Software\JavaGameDevelopment\ZMUohM\sgs-server\tutorial and delete data folder...
   cd C:\Data\Software\JavaGameDevelopment\ZMUohM\sgs-server and run 
	java -jar bin/sgs-boot.jar tutorial/conf/ZMUohMyNB.boot
run Client from NB..didn't logon..no class DataBase..hmm..try copy ZMUcommon.jar to \tutorial as well..YES!!
So, need to have build insert ZMUcommon.jar into ZMUohMyNB.jar..hmm..oops, forgot to delete
duplicate .messages package... .core::Door.java error..MudObject has MudType enum. There is also MudType class..
not good..
DEL: ZMUcommon MudType.java and use MudObject.MudType.xxx for enum...
MOD: ZMUClient::Avatar.java to use MudObject.MudType..
MOV: MubObject.java to ZMUcommon..blah..change Avatar to not use MudObject..MudObject is a core class
used by the Server to manage ingame objects. The Client does not need this heavy weight class.
NEW: MinMudObject.java and put in ZMUcommon. Eventually move core Object elements into it and share
with Server after removing those elements from the original MudObject.java file..
MOD: Avatar.java..ok..NOTE: Need to put ZMUcommon.jar into dist jar for Client..
MOD: PositionMessage.java
import com.sun.sgs.darkmud.core.MinMudObject.MudType;
hmm..not seeing it..use int for now..
    private int objectType;
    public PositionMessage( int id, int type, Vector3f pos ) {
    public int getObjectType() {
        dout.writeUTF(((Integer)objectType).toString());
        objectType = (int)Integer.valueOf(din.readUTF());
//import javax.vecmath.Vector3f;
import com.sun.sgs.darkmud.core.Vec3dz;
MOD: Door.java
                    invoker.getType().ordinal(),
MOV: Vec3dz.java back to ZMUcommon to handle simple 3d vector points..
MOD: Door.java
import com.sun.sgs.darkmud.core.Vec3dz;
MOD: PositionMessage.java
//    private Vector3f objectPosition;
    private Vec3dz objectPosition;
//    public PositionMessage( int id, int type, Vector3f pos ) {
    public PositionMessage( int id, int type, Vec3dz pos ) {
//    public Vector3f getObjectPosition() {
    public Vec3dz getObjectPosition() {
//        objectPosition = new Vector3f(x, y, z);
        objectPosition = new Vec3dz(x, y, z);
Door error gone..ok..MudClient error still...
MOD: MudClient.java
import com.sun.sgs.darkmud.core.Vec3dz;
                MudType ca[] = MudType.values();            // make an array
                MudType match = ca[msg.getObjectType()];    // equate to enum index
//                switch(msg.getObjectType()) {
                switch(match) {
    private void serviceUser(PositionMessage msg) {
        Integer id = msg.getObjectId();
        Vec3dz inm = msg.getObjectPosition();
        Vector3f mt = new Vector3f(inm.getX(), inm.getY(), inm.getZ() );
        if(avatarList.containsKey(id)) {
            // update positon
//            avatarList.get(id).moveTo(msg.getObjectPosition());
            avatarList.get(id).moveTo(mt);
        } else {
            //  Make a new Avatar
            MinMudObject.MudType na[] = MinMudObject.MudType.values();            // make an array
            MinMudObject.MudType nao = na[msg.getObjectType()];    // equate to enum index
            Avatar avatar = new Avatar(msg.getObjectId(),
//                    msg.getObjectType(),
                    nao,
//                    msg.getObjectPosition());
                    mt);
    private void servicePlayers(PositionMessage msg) {
        Integer id = msg.getObjectId();
        Vec3dz inm = msg.getObjectPosition();
        Vector3f mt = new Vector3f(inm.getX(), inm.getY(), inm.getZ() );
        if(avatarList.containsKey(id)) {
            // update positon
//            avatarList.get(id).moveTo(msg.getObjectPosition());
            avatarList.get(id).moveTo(mt);
        } else {
            //  Make a new Avatar
            MinMudObject.MudType na[] = MinMudObject.MudType.values();            // make an array
            MinMudObject.MudType nao = na[msg.getObjectType()];    // equate to enum index
            Avatar avatar = new Avatar(msg.getObjectId(),
//                    msg.getObjectType(),
                    nao,
//                    msg.getObjectPosition());
                    mt);
    private void serviceMobs(PositionMessage msg) {
        Integer id = msg.getObjectId();
        Vec3dz inm = msg.getObjectPosition();
        Vector3f mt = new Vector3f(inm.getX(), inm.getY(), inm.getZ() );
        if(avatarList.containsKey(id)) {
            // update positon
//            avatarList.get(id).moveTo(msg.getObjectPosition());
            avatarList.get(id).moveTo(mt);
        } else {
            //  Make a new Avatar
            MinMudObject.MudType na[] = MinMudObject.MudType.values();            // make an array
            MinMudObject.MudType nao = na[msg.getObjectType()];    // equate to enum index
            Avatar avatar = new Avatar(msg.getObjectId(),
//                    msg.getObjectType(),
                    nao,
//                    msg.getObjectPosition());
                    mt);
MOD: Vec3dz.java..add get x,y,z methods to construct a Vector3f object..
ok..Clean and Build all 3..
Copy both ZMUohMyNB and ZMUcommon jars to tutorial, delete data, run..logon..woo hoo..back up..
hmm, still at 0,0,0 and can't move, BUT zombies show up on map..SVN Add Files then commit..
28nov14
Still tweaking the MudType enum..
ADD: MudType.java
public enum MudType {
    OBJECT, ITEM, ROOM, CHARACTER, USER, PLAYER
}
Now, delete MinMudObject.java and replace MudType enum in MudObject and everywhere used..
Cleaner..commit..245