13 Oct, 2006, ThomasB wrote in the 21st comment:
Votes: 0
Justice said:
I wouldn't worry too much about finding a server and hosting… unless you want it public. For a school project, all that matters is that you are able to prove it works, in this case, you may want to use whatever OS is handy in that class.


First, thanks for the reply and advice! :biggrin:

Second, I want to actually have it hosted so that I can put databases up at home and access them at school. And so that I can see how it works when I have more than one user up, i.e. will it successfully update Room A for User A is User B does something to Room A?

I'll more than likely continue to use Windows, I've already made my first databse using mySQL, and I just have to figure out how to host it and access it without going to the saved file. And I'm sure I can figure out a way to get everything else up, worst case scenario I'll use CYGWIN :lol:

I'd also like to develop this into a bit more of a hobby than just a school assignment. This is something that actually interests me, so I'm sure I'm going above and beyond what's required for an A.

Thanks again,
Thomas
14 Oct, 2006, Brinson wrote in the 22nd comment:
Votes: 0
Cygwin is evil. :alien:

Best linux for beginners: Ubuntu. Its free. Its forum has thousands of logged members most of the time who are fricking geniuses…and they'll even MAIL you a cd for free if you want. A very easy to use GUI, all the necessary workspace applications. Its often called Noobuntu because its so easy, but nothing's wrong with that.
14 Oct, 2006, ThomasB wrote in the 23rd comment:
Votes: 0
I'd really like to avoid a second OS, I suppose. The option became less viable when I realized that OSes are configured for laptops, and that if you just install Linux or reinstall XP etc. you lose some of the functionality.
14 Oct, 2006, Mabus wrote in the 24th comment:
Votes: 0
ThomasB said:
I'd really like to avoid a second OS, I suppose.


Another great reason to use Java, as you have stated. Platform independence.

I can code on a windows machine, compile and start it up to check for bugs, ftp the changes to a host running SuSe, log into the shell, type "ant compile" and then start the game up. The same code works on both systems.
16 Oct, 2006, Justice wrote in the 25th comment:
Votes: 0
Mabus said:
Java can be used to make MUD engines. Because of its high resource usage it used to be more prohibitive, but with todays CPU's and memory it is much less so.


I disagree that java has a "high resource usage". Java is primarily used for microdevices that don't have alot of resources. A modern JIT JVM converts java bytecode into machine instructions and after initial loadtime has extremely good performance. The primary slowdown relates to object churn, which is a major problem in any GC based language. It even effects C/C++ when a GC based memory management system is used. The other slowdown java has relates to it's use of reflection… each member of an object must be looked up. This is a minor slowdown but can have dramatic results when poor programming practices are used.
16 Oct, 2006, Justice wrote in the 26th comment:
Votes: 0
ThomasB said:
First, thanks for the reply and advice! :biggrin:

Second, I want to actually have it hosted so that I can put databases up at home and access them at school. And so that I can see how it works when I have more than one user up, i.e. will it successfully update Room A for User A is User B does something to Room A?


Not too difficult. All you need to connect to MySQL remotely is… a public IP address. And the port available from outside (ie… firewall). Just beware of potential security issues this may cause. You'll definitely want to change the admin username for MySQL.
17 Oct, 2006, Mabus wrote in the 27th comment:
Votes: 0
Justice said:
Mabus said:
Java can be used to make MUD engines. Because of its high resource usage it used to be more prohibitive, but with todays CPU's and memory it is much less so.


I disagree that java has a "high resource usage". Java is primarily used for microdevices that don't have alot of resources. A modern JIT JVM converts java bytecode into machine instructions and after initial loadtime has extremely good performance. The primary slowdown relates to object churn, which is a major problem in any GC based language. It even effects C/C++ when a GC based memory management system is used. The other slowdown java has relates to it's use of reflection… each member of an object must be looked up. This is a minor slowdown but can have dramatic results when poor programming practices are used.


I was speaking specifically about using Java in MUD engines. It is not unusual to use 256MB of RAM and from 1-35% CPU (or more) to run a Java-based MUD. Compared to most C-based engines this would be "high resource usage", but as I said in today's computers it is not as problematic.
17 Oct, 2006, Justice wrote in the 28th comment:
Votes: 0
Mabus said:
I was speaking specifically about using Java in MUD engines. It is not unusual to use 256MB of RAM and from 1-35% CPU (or more) to run a Java-based MUD. Compared to most C-based engines this would be "high resource usage", but as I said in today's computers it is not as problematic.


IMHO, that reflects poor programming practices more than limitations of Java. My java mud engine used less than 20mb ram (10 for JVM) and didn't register over 1% CPU. That included using the Mozilla Rhino engine for scripting purposes.


I've also seen many C codebases spike to over 100% cpu and have similar memory requirements. Due to the same reason.
17 Oct, 2006, Mabus wrote in the 29th comment:
Votes: 0
Justice said:
My java mud engine used less than 20mb ram (10 for JVM) and didn't register over 1% CPU. That included using the Mozilla Rhino engine for scripting purposes.


That would be impressive for a full-featured non-buggy Java-based MUD.

Care to share the code?
18 Oct, 2006, Justice wrote in the 30th comment:
Votes: 0
I wouldn't call it "impressive". And I guess it depends on what you'd call "full featured"… it was a ranged combat pk mud based on GroundZero. I haven't taken a look at either java codebase you describe, so I can't comment on them.

I didn't do anything really special to get that kind of performance. Basically, all I did was intern strings that weren't going anywhere so the JVM didn't have alot of duplicate strings. This increased the load time of the game, but greatly decreases memory usage. Next, avoid temporary strings, instead I used a StringBuffer or char array. This required a decent StrUtil class with static methods, but was worth it. What this does is prevent object churn due to hundreds or thousands of temporary objects. The last thing is to make methods and classes final when you know they won't be overridden. This allows the JVM to avoid looking for over-ridden variables.

Finally, java can "leak" memory. If you don't clear all references to an object, it will not be GC'd. This will cause your memory usage to bloat.

FYI, the worst case of object churn I've dealt with is the Apache FOP project. When creating large reports you can watch it jump between 150mb and 2gb of ram, and using <5% CPU to 100%CPU. I'd say FOP probably spends 70% of it's runtime in GC.
20.0/30