Project X [RPG]

Project X
Title name is subject to change


Description:
Project X, As I’m calling it temporarily, Is a 2D RPG Game coded in Java. Maps/Levels are rendered using 16x16 tiles. Which have a fixed scale regardless of resolution, Though a larger resolution will offer the advantage of being able to view more of the map at once. For more information, Consider the paragraphs below for reading, or drop a comment(Preferably after you’ve read everything below).


Objective:
Basically it will be the same as Diablo II, Where you have Quests to complete. It will also offer the same unmediated pvp style. I do want to implement some kind of home base system though, Like Minecraft. Without the customization feature. So players will be able to have homes in the world, But can’t individually design them.


Features:
[x] Multiplayer [0%] - The game will offer multiplayer game play, Players will connect to a dedicated server using their accounts.
[x] Map/Levels [66%] - When it comes to the in game levels, They will be semi-static themselves. But, Objects on the maps will be placed dynamically. Hopefully not in hot Lava. Currently, Maps/Levels are loaded using XML files. But, Once the development of the multiplayer server begins. Maps/Levels will be loaded using the multiplayer server instead.
[x] Entities [1%] - I’m currently thinking, That entities will be rendered similarly as the tiles. Where each entity will extend an abstract class called entity. This may seem like common practice to some developers, But I’m rather new at this so forgive me if I elaborate too much.
[x] Collision [99%] - The system handling collisions, Is pre-coded into the tiles, Which uses a boolean field called PassThrough. So, if (!PassThrough) { move(0, 0); }. Seeing as everything rendered in game is tile based, Entities will also use this system of collision. Except perhaps Ghosts O.o


Planned Improvements:
[x] Implement Component Model Class for Tiles
[x] Assimilate Tile Classes into Class Members, Once individual Tile Classes are completed


GUI:
Currently, This is my GUI for the project. As you can see there are no in game menus currently, Though there are plans for a system which resembles that of Diablo II. You’ll notice the player sprite is loaded in the upper left hand corner in the image below, This is solely for testing purposes. Which has to be done during map development, Seeing as walking around on transparent void tiles isn’t possible with the collision system already in place.

http://imagizer.imageshack.us/v2/800x600q90/904/qZj7co.png


Inquiries:
If you have them, Please comment below. You may actually help me avoid problems down the line by asking questions as I’m pretty well learning as I go. I don’t have a story line yet, But, I’m thinking something like a Zelda/Diablo hybrid? Idk…

Downloads:
[spoiler]
Project X v1.0
Project X v1.1
[/spoiler]

Update:

So for todays progress I implemented a generic Launcher for the game. Which sounds easier than what it was. I had Launcher code from another project I thought I could simply copy/paste. But, I encountered JPanel duplications and, extended class errors. All in all, The problems are sorted out and, This is what the launcher looks like without decorations.

If you seen the image of the GUI above, You’ll notice the launcher in the image below appears smaller. That’s because I changed the height/width through the Configuration menu prior to screenshotting. So I wouldn’t have a bunch of desktop icons in the screenshot.

http://imagizer.imageshack.us/v2/640x480q90/538/lRkFNb.png

I’ll be bold and say you are over-reaching.

I have no idea how experienced you are but from what you described it sounds easier than it actually is.

Don’t mean to bring you down but most people that on here with plans like this usually end up in a corner crying lol.

Well, I definitely didn’t mean to imply that I’m trying to achieve the same user base, graphics or, game play as Diablo II or Zelda. But, Let’s just say that’s what I’m aiming for. It never hurts to set the bar high, As that usually inspires people. Any ways, I may be new to Java. But, From what I’ve learned already, It’s flowing pretty good. I do have coding knowledge other than Java and, Despite how little it may be it’s definitely a help. I have already coded a server/client in a previous project. So the multiplayer aspect of the game shouldn’t be very difficult. The worse part of the process right now seems to be hard coding my tile classes into the game. Especially with 12 variations of each corner tile.

[quote]It never hurts to set the bar high
[/quote]
Actually this is one of the most frequent problems we see. You might quickly lose motivation when not reaching it, but it’s up to you to know where your limit is. :slight_smile:

[quote]I have already coded a server/client in a previous project. So the multiplayer aspect of the game shouldn’t be very difficult.
[/quote]
Well, we will see…

However, good luck.

Update:

Sorry if this update is a disappointment, But it is significant in regards to the Launcher. I made the buttons and fonts all dynamic. Along with squishing a duplication bug, Which caused buttons to appear in the Configuration screen from the Launcher screen. Even though there was already a code implementation in place to stop this, It still happened. So, I had to further code a fix for that bug. Which appears to have completely eliminated the bug. I also added screen resizing based on resolution, This can be done through the Configuration menu. By default it’s 800 x 600 and, Only offers resizing based on the 4:3 aspect. There is a little delay when changing screen sizing, This is due to Thread.Sleep which had to be implemented to negate the save delay. Anyways, This is the Launcher as is:

http://imagizer.imageshack.us/v2/800x600q90/907/Zl71Ns.png

The next update should be more game play related, I just decided to work on the Launcher this time. As hardcoding Tile classes got boring after doing three dozen. I think I have another four dozen to go, Including drawing the tiles.

How come so many? :persecutioncomplex:

Many dozens of tile classes sounds like the perfect place to use a component model.

Well, I think the best way I can explain it is like this. Take the grass tile for example, It’s 16 x 16 and, For that tile I have variations with water an lava. So there is North Grass, East Grass, South Grass and, West Grass. For North Grass, The grass is at the top of the tile and the water increments per tile from the bottom and, So on for the other ones. Then there’s North West Corner Grass and, North East Corner Grass.

Those tiles each consist of Grass on one of four sides or, In the case of the corner tiles, On two out of four sides. With water or, lava on the other sides. Every tile has a higher incrementation of water or, grass depending on how you look at it. Until the grass/water gets close to the tile boundary.

The reason I did this was so that I could customize the size of things like ponds, lakes and, rivers. Most of these tiles the player can’t walk on. If I would have chosen to do this on a per level basis, I would have had to do 8 grass tiles with one water tile in the middle. Which eats up a lot of screen real estate, With my method I can do 1 directional grass corner tile and, I’ll end up with four tiles which show grass on all sides of water. As shown in the two tables below.

[tr]
[td]
http://imagizer.imageshack.us/v2/100x100q90/912/QzZvEv.png
[/td]
[td]
http://imagizer.imageshack.us/v2/100x100q90/912/QzZvEv.png
[/td]
[td]
http://imagizer.imageshack.us/v2/100x100q90/912/QzZvEv.png
[/td]
[/tr]
[tr]
[td]
http://imagizer.imageshack.us/v2/100x100q90/912/QzZvEv.png
[/td]
[td]
http://imagizer.imageshack.us/v2/100x100q90/538/2sONnm.png
[/td]
[td]
http://imagizer.imageshack.us/v2/100x100q90/912/QzZvEv.png
[/td]
[/tr]
[tr]
[td]
http://imagizer.imageshack.us/v2/150x100q90/912/QzZvEv.png
[/td]
[td]
http://imagizer.imageshack.us/v2/100x100q90/912/QzZvEv.png
[/td]
[td]
http://imagizer.imageshack.us/v2/100x100q90/912/QzZvEv.png
[/td]
[/tr]

The brown/tan pixels in the tiles below is suppose to represent a dirt/sand transition to the water. In the previous layout, You’ll notice there is no dirt or, sand. That’s because I would have to add yet another two rows and two columns in the grid to permit dirt/sand transitional tiles in a already limited area.

[tr][td]
http://imagizer.imageshack.us/v2/100x100q90/743/bIAOE8.png
[/td]
[td]
http://imagizer.imageshack.us/v2/100x100q90/746/c009c4.png
[/td][/tr]
[tr][td]
http://imagizer.imageshack.us/v2/100x100q90/661/Ic0JlD.png
[/td]
[td]
http://imagizer.imageshack.us/v2/100x100q90/540/gvRPxP.png
[/td][/tr]

The grid above shows four corner tiles of the same grass/water increment. If the reason why I have so many tiles is confusing, I hope its clarified now.

I’m already using an abstract tile class, Which isn’t quite as efficient as a component model. But, Is somewhat easier to understand amidst the rest of the code. Though, I can see the payoff.

Hmm… you’re not using a separate class for each grass tile variant are you?? If you are, it’s much easier to make a single grass tile class, and store its variant as a member.

I’m actually not using members right now, But would peg it as a future efficiency upgrade. Once I have all the individual classes coded, I could transition them to class members. It’s a lot easier to copy/paste classes and, comment 12 of them out of the tile initializer right now as opposed to commenting out twelve class members. I’ll add this to the “todo” list.

you could do it roughly like this:


public class Tile{
    public int type;
    public int variant;
}

use type to record what sort of tile it is: GRASS, WATER, LAVA, etc.
and variant to record what variant it is: NORTH, WEST, etc.

then your game logic can just check these values as it needs them, and your rendering can use them to decide which tile graphics to use.

There’s plenty of different ways to do this of course, but using a separate class for each one is probably really over complicating things for yourself.

Precisely. I’ve been posting this often as of late, but here’s some ideas on how to automate tile map joining in the manner than you describe: http://www.angryfishstudios.com/2011/04/adventures-in-bitmasking/

I was thinking of something along the same lines as a Component Model, Like what BurntPizza suggested.

As I’m currently coding the classes independently and, debugging them. The complication isn’t much of a bother. Other than redundantly adding three lines per tile class. But, I will definitely implement this once I know the classes are bug typo free.

I actually looked at that link, Which you posted in a previous post. But, I think it’s a little over complicated for this project. Though I can see how it would eliminate the need for tile variations. Seeing as you could simply apply a mask over the map at the specified coordinates and, essentially achieve the same outcome with less graphic work. In many cases where project authors don’t produce their own tiles, I can see how this would be a great concept. Correct me if I’m mistaken.

So, I’ve been slowly stepping through all my tiles and, I can finally see the end in sight. I only have the south corners left to make. But I decided to refresh the map file to reflect some progress. I work a lot and, have a daughter. So any progress is a landmark in my books. I’m sure any parents here can atest to that. Anyways, Enough excuses, This is what I have so far;

http://imagizer.imageshack.us/v2/800x600q90/904/qZj7co.png

I also realized, That I may need to make inverted tiles. For instances like the one above, Where the grass is bordered by water. Also, I’m aware of bit masking, But opt’d to do things this way for a simpler integration with a multiplayer server.

Which gives me a couple options;

  • On Demand tile system, Where the game retrieves tiles from a web server. This cuts down on the overall installation size.
  • Increased tile modding by players (Wink, Wink)
  • Simpler client communications with multiplayer server, Map packets end up being shorter when you don’t have to declare bit masking. Probably not that significant of a difference though.

Anyways, Now that the weekend is here, I’m going to try to polish off the list of grass tiles I have left.

Don’t do this, you will make people very angry when suddenly their internet gets throttled. Best way to have, and this is no argument, client handles the graphics side and is dumb; server handles logic.

This means client should always have the assets, the server should be telling the client what to do with them.

In cases where the player could edit the assets in order to gain an advantage (like MC X-Ray RP’s) then you will have to implement some way for the server to check file to see if it matches with the instance of a client on the server side.

Sorry, I meant to clarify that. I recognize the matter regarding network instability and, Also don’t want a “online only” game. So, The game would download the Tiles whilst the Launcher is onscreen. Unless, The player configures the game not to.

Editing the assets in this project, Won’t give an advantage to the player. Think of Zelda for instance, Making the grass on the map transparent doesn’t really offer any benefit. I think where you’re concerned about “X-Ray like” hacks only applies to 3D games.

Could always have buried treasure under those tiles! :stuck_out_tongue:

yup rpg games takes lots off time and coding if its gona be good

Yep, I took yet another break from completing my Grass Tiles. This time I’ve added a Mouse class to handle mouse clicks an such. There was a minor hiccup as some JGO members may have witnessed. But, The matter has been resolved and, A updated zip of the project can be found in the original post. There’s not much you can do right now, Other than just walk around. From here, I plan on finishing the Grass Tiles and, Further developing the entity classes.