Need some opinions/suggestions on my project

So I was bored (typical) and decided to start a new project, the first time I’ve ever tried something like this. It’s a Java MORPG (calling it massive would be cliché :P), but I really can’t judge my own work, as I’ve shown in the past, so I wanted some ‘Veteran’ opinions on how I’m doing so far.

I’m working on it with a friend, so far he’s done a little bit (his work is in the playersaving package in the server, everything else I’ve re-done) so don’t be surprised if you look at the contributors page and see his name. We have not written any content yet, so it’s just an empty frame for now.

Server
Client

The client is still in a mock-upped form to test pathfinding and map drawing, so if you see those don’t worry about it.

One thing I really think I did wrong was how I draw the map offset (I’m just using x and y variables in the local player class…) so I’d really like some help with that.

Oh, and it’s all obviously still in progress, nothing is finalized, so all thoughts are welcome :slight_smile:

EDIT - We’ll probably need some graphics designers for default components and interfaces, neither of us are very artsy :stuck_out_tongue:

I recommend documentation (that way you could generate a javadoc for others to build upon your project).

EDIT: http://code.google.com/p/unnamed-rpg/source/browse/trunk/RPG/src/server/net/Server.java
should be implementing Runnable, not extending Thread?

Yea… that’s one thing I know I should always do but I’ve never been privy to the details of good commenting for javadocs, and a lot of the guides I look at either don’t give in depth information or contradict others… :frowning:

PS - Am I allowed to share the information you guys give me with my partner on this?

[quote=“Davidi2, post:3, topic:401073”]Yea… that’s one thing I know I should always do but I’ve never been privy to the details of good commenting, and a lot of the guides I look at either don’t give in depth information or contradict others… :frowning:

PS - Am I allowed to share the information you guys give me with my partner on this?[/quote]
I don’t see how that would be an issue, especially since you have your src on a public SVN…?

I mean like quote what you guys say, because I’m not sure what is considered ‘leaking’ here

Giving out releases that are made to stay in this board?

[quote=“T4_, post:6, topic:401073”][quote author=Davidi2 link=topic=498130.msg3642703#msg3642703 date=1309131454]
I mean like quote what you guys say, because I’m not sure what is considered ‘leaking’ here
[/quote]
Giving out releases that are made to stay in this board?[/quote]I’m not talking about the code, the code is public, like you said. I just know some people don’t like people without access to the board to be able to know what they said, so I’m asking if you guys care if I share your opinions with my partner about this project.

[quote=“Davidi2, post:7, topic:401073”][quote author=T4_ link=topic=498130.msg3642726#msg3642726 date=1309133499]

Giving out releases that are made to stay in this board?
[/quote]I’m not talking about the code, the code is public, like you said. I just know some people don’t like people without access to the board to be able to know what they said, so I’m asking if you guys care if I share your opinions with my partner about this project.[/quote]
I doubt anyone cares.

[quote=“T4_, post:2, topic:401073”]EDIT: http://code.google.com/p/unnamed-rpg/source/browse/trunk/RPG/src/server/net/Server.java
should be implementing Runnable, not extending Thread?[/quote]

Why? I’ve seen people recommend implementing Runnable over extending Thread, but never a valid reason on why one should do so. Certainly there are times when you are forced to do one or the other, but, in general, why should you go with one over the other?

[quote=“Moparisthebest, post:9, topic:401073”][quote author=T4_ link=topic=498130.msg3642698#msg3642698 date=1309130941]
EDIT: http://code.google.com/p/unnamed-rpg/source/browse/trunk/RPG/src/server/net/Server.java
should be implementing Runnable, not extending Thread?
[/quote]

Why? I’ve seen people recommend implementing Runnable over extending Thread, but never a valid reason on why one should do so. Certainly there are times when you are forced to do one or the other, but, in general, why should you go with one over the other?[/quote]

It’s a bit pedantic in this case, since extending Thread and implementing Runnable have pretty much the same end result.

The accepted convention in object-oriented programming [citation needed] is to extend a class only if you plan to augment the functionality or interface exposed by that class. On the other hand, implementing an interface is done to show that your class conforms to the functionality that the interface guarantees.

/most/ people creating threads don’t actually want to extend Java’s threading functionality, they just want to run code on a separate thread concurrently. So, implementing the interface makes more sense.

[quote=“Davidi2, post:11, topic:393487”]I never understood why people would do implements Runnable instead of extends Thread, and then to call it do new Thread(runnable).start()

I would understand if you planned on using it for something else as well, and I do it myself just by force of habit, but I just don’t get it :([/quote]
Crap… I usually do implement runnable, I don’t even know why I didn’t this time…

Well that’ll be fixed in the next commit. Right now working on upgrading a map editor I made a month or two ago to work with the new map format we’ll be using.

There are many reasons to prefer implementing Runnable over extending Thread. I can name a few of them here aswell.

  1. Separation of concerns. An operation and the one performing this operation are both distinct concepts.

  2. You can only run a Thread once; its life-cycle ends and it cannot be run again. But you can run a Runnable more than once, if you implemented it that way.

  3. The java.util.concurrent API uses Runnable and Callable. Although, Thread is itself a Runnable, it (conceptually) makes no sense to use it as a Runnable in an ExecutorService.

  4. As you already know, implementing an interface is more flexible than extending a class.

  5. To extend a class means that an instance of your class actually is an instance of your parent class. To benefit from using your class, it should contain more functionality than your parent class. It should also not change the existing functionality of your parent class, because then there’s no guarantee it will work in all situations your parent class already works. So, instead, implement Runnable in pretty much all cases. Thread after all has an aggregation alternative, which is much more flexible. It delegates its own Runnable operation to the aggregated Runnable.

A stupid analogy: We could say a Thread is an engine while a Runnable is the fuel for that engine. If you buy a new engine, you may get some fuel just because the owners of the store are nice, but I suspect this usually won’t happen. But if, on the other hand, you buy some new fuel at the local fueling station, you def. won’t get a new engine (it would be wicked awesome though). :slight_smile:

Yup, basically saw all that in the other thread about this. I just made an honest brain-fart :stuck_out_tongue:

Any other things people see?

EDIT - This project is on hold, I started up my old RSPS again. But I am contributing some of the source to the team making the zombie game here