Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (511)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3 ... 9
1  Discussions / General Discussions / Re: Microsoft to buy Mojang for $2 billion? on: 2014-09-15 19:46:09
1 billion euro (taxes) is a lot of money, let's hope that they do something fun with it (especially Markus with his 71%) and that Microsoft doesn't ruin Minecraft Smiley

Notch won't be doing something fun with it (at least not for us), he doesn't want to make a next big hit: http://pastebin.com/n1qTeikM
Relevant tweets:
https://twitter.com/notch/status/511508079154696193
https://twitter.com/notch/status/511508557200498688
Hopefully in the long term he is getting over with it. He has enough money - even without the deal - to do whatever he likes to do.
Anyway, congratz on getting rid of some burden Smiley
2  Discussions / Miscellaneous Topics / Re: Inventory system in MySQL on: 2014-09-15 19:04:54
No, since this isn't a java game, It's a turn based RPG web game, coded mainly with php and javascript. I use PDO to connect to the database, and of course html, html5 and css.
Ah ok, that makes sense and the whole structure should apply more to a general approach. Still there can be a lot of things similar

I don't see how else I would make an item without item_stack without copying the whole item, which would be a waste of space, and would make the code much messier. How would I make it possible for a character to split stacks, or even have stacks in the first place?
Take a look at your own answer. The item does not need to know about the stack. Each slot/field/whatever of inventory can store exactly one item, but it will have assigned a specific amount of them. One row per stack Wink

I'm not sure about your idea with the slots_<number> in the inventory table, since I'm going to have furniture with a lot more inventory space, so I would need slot_1 to slot_50, which is way too much in my opinion. So I think it's better to have a size number instead.
Yea, for a browsergame it does not make that much sense. The classical way is pretty much easier to achieve.

What you said about the inventory table made me think, if I made it something like; inventory_id, item_id, amount_id, slot and then I stored the last created id inside whatever have the inventory. That way I could move around items much easier. Sure the item have no idea where they are, but the right bag/furniture/character/location would have a much easier time to locate them, and maybe I could have a inventory_layout table to have specific layouts and sizes.
Yea, to continue on this depending on your inventory layouts if any you could store the row and column informations with each item you store.
3  Discussions / Miscellaneous Topics / Re: What other programming languages do you use & why? on: 2014-09-15 16:59:52
Still growing ^^"

On a daily base:
PHP, SQL, Javascript, CSS, HTML, Bash/Shell

Rest on private use or used to do:
Java, C#, CFML, C/C++, TurboPascal/Delphi, R

Currently looking at: Python, HipHop


4  Discussions / Miscellaneous Topics / Re: Inventory system in MySQL on: 2014-09-15 16:53:31
Looks a bit weird to me. Do you intend to load everything on the start?

Basically I'd start with start with some minor optimizations like putting in Ids for character name and race. Created should be an unsigned integer to store the unix timestamp. Though it is not human readable you save the step to convert it.

itemTable:
Avoid NULL fields. Depending on your actual encoding you might waste some space. From my experience it is also to consider to store any character data somewhere else. Let it be some database table or a plain file that is deployed to the client. That way you can save up a lot of space on the network.
And I don't get the reason why you need the inventory_id inside of the item table.
The field untradable is pretty misleading. Why not naming it "is_tradeable" or shorten to "tradable"? Would make more sense.

inventory:
To store the info about which bag and so on in the inventory seem to be very weird. From my understanding someone would expect the actual inventory data there.
You might also think about how to organize everything. Most MMOs servers I've seen uses a fixed table size and append to the end when there is an expansion.

item_stack_table: I don't see any usage to it

Also try to put your fields that relates to other database at the beginning of the table. That way MySql or the database of your choice don't have read in the whole table row.

@Runes of Magic System: You may look up their private server data files ...


Here is an example how I would start the first approach according to your desired outcome of RoM.
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
-- account
create table if not exists `account` (
   id int(10) unsigned auto increment primary key,
   email varchar(128) not null,
   username varchar(16) not null,
   password varchar(40) not null,
   salt varchar(40) not null
) Engine InnoDb;

-- character
create table if not exists `character` (
   id int(10) unsigned auto increment primary key,
   account_id int(10) unsigned not null,
   name varchar(16) not null,  
   health smallint(5) unsigned not null,
   mana smallint(5) unsigned not null,
   -- other character stat fields  
   index(account_id)
) Engine InnoDb;

-- item
create table if not exists `item` (
   id int(10) unsigned auto increment primary key,
   icon_index smallint(5) not null,
   max_stack_size smallint(5) not null,
   tradeable tinyint(1) not null
   -- you might consider packing such flags into one field together with other flags  
) Engine InnoDb;

-- character equipment
create table if not exists char_equipment (
   character_id int(10) unsigned not null unique,  
   slot_left_hand int(10) unsigned not null,
   slot_right_hand int(10) unsigned not null,
   slot_ring_1 int(10) unsigned not null,
   slot_ring_2 int(10) unsigned not null,
   slot_chest int(10) unsigned not null
   -- you can add all other fields here too, consider shorten the field names
) Engine InnoDb;

-- inventory
create table if not exists inventory (
   character_id int(10) unsigned not null unique,
   slot_size smallint(3) unsigned not null,
   slot_1 int(10) unsigned null,
   slot_2 int(10) unsigned null,
   slot_3 int(10) unsigned null,
   slot_4 int(10) unsigned null,
   slot_5 int(10) unsigned null
   -- more fields depending on the actual size
) Engine InnoDb;
5  Discussions / General Discussions / Re: Performance Test for the Voxel Thing on: 2014-09-14 16:53:13
~200fps, max. 246

System:
Win7 Sp1
Intel i5 760 @ 2.80GHz
12GB RAM
Sapphire Radeon R9 720x 4GB


However another game was running in the background... so maybe the result could have been higher
6  Games Center / Featured Games / Re: We Shall Wake demo (v6.0) on: 2014-09-10 12:11:50
Looked fine until I run out of options in the tutorial. I would advise you to display the current assigned key to the action that shall be executed. Because I had no clue which key to use to focus/target the npc. Furthermore the UI seem to lag a bit. Sometimes it required two clicks to react on a menu-item.
7  Games Center / Featured Games / Re: State of Fortune on: 2014-09-05 13:51:58
Here's a screenshot of the "Very far" render distance (6km) with one of the new trees in the foreground
Once again the tree are way to big Wink

Although the scenery looks nice
8  Games Center / WIP games, tools & toy projects / Re: Mortal Terminus on: 2014-08-07 14:10:56
video not available in germany, damn YT/Gema.
9  Discussions / Miscellaneous Topics / Re: Interesting Profile pictures on: 2014-08-06 12:09:09
Mine is something very old I own and wear from time to time ... used this avatar alot in the past.



10  Games Center / Featured Games / Re: State of Fortune on: 2014-08-01 09:06:28
Sounds promising. Looking forward for the update. Will you do a hard-reset or will we keep our accounts and gold? ^^
11  Discussions / General Discussions / Re: So... state of the art 3D "engines" in Java on: 2014-07-30 11:16:03
I guess most of the modern engines uses the approach of the old fashioned scene graph model as a supporting role for the spatial system approach. Thus they can combine it with nearly everything.
12  Games Center / Featured Games / Re: State of Fortune on: 2014-07-29 16:18:07
Anything you can state here or at the SoF board already? ^^
13  Games Center / Featured Games / Re: State of Fortune on: 2014-07-29 10:53:26
Anyone still logging in? Just bought ovens to increase my income. Though some nice features that mike have thought and I talked about of have never been added since Sad
14  Game Development / Networking & Multiplayer / Re: [Kryonet] Any way to avoid instanceof check? on: 2014-07-02 16:07:45
Thanks riven. That might be my rescue. That way I can define a common interface and still have small maintainable source Smiley
The overhead caused by the reflection on the serverside is probably not that big. But that would be another issue when it arise.

Thx Riven!
15  Game Development / Networking & Multiplayer / Re: [Kryonet] Any way to avoid instanceof check? on: 2014-07-02 15:46:46
It is not about the if-else chain. It is about the annoying instanceof checking.

I was hoping there is some kind of mechanism where I can just plugin my method and object. And as you said Kryonet will take core of it with its own lookup table.
If reasonable even with an delegate interface.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
public void updateLocation(Connection c, Location location) {
    // location might be serialized
    c.send(location)
}

public void updateInventory(Connection c, Item item) {
    // serialized object
    c.send(item);
}

public void sendChatMessage(Connection c, ChatMessage msg) {
    // serialized object
    c.send(msg);
}


Depending on the actual project I might end up with > 100 type of objects to check. Such a big conditional is not maintainable. Even when using a lookup table for just the conditional check o_O

And it is not clean code Wink
16  Game Development / Networking & Multiplayer / Re: [Kryonet] Any way to avoid instanceof check? on: 2014-07-02 15:26:07
The tutorials don't state that it is doing something like that. I've seen the serialize stuff and so on. But no real example. Every example, even those shipped with kryonet have a long list of conditionals with instance of checks
1  
2  
3  
4  
5  
6  
7  
8  
9  
[...]
public void received (Connection c, Object object) {
    if (object instanceof MyObjectA) { ... }
    if (object instanceof MyObjectB) { ... }
    if (object instanceof MyObjectC) { ... }
    if (object instanceof MyObjectD) { ... }
    [...]    
}
[...]


That is why I'm asking. Maybe I just haven't found the right source of documentation/tutorial.
17  Game Development / Networking & Multiplayer / [Kryonet] Any way to avoid instanceof check? on: 2014-07-02 13:03:30
Hi guys,

while thinking about how to use Kryonet for sending many different objects between the client and server I wondered how to avoid the instanceof check.

Is this even possible at all?

From my current thoughts I came up with the idea of having a simple packat class that encapsulate an op-code and some arbitrary data. In that case I would end up with some kind of lookup table to create my corresponding object.

However I really hope there is some more easier/fluent way of handling many different data objects.

Greetz
Evil-Devil
18  Discussions / Miscellaneous Topics / Re: Statistics project: Please take a few seconds to answer! :) on: 2012-03-13 09:00:58
Age? Race? Gender?What is your favorite genre of music?
29, Caucasian, MaleHardstyle, Trance, Classic/Orchestral Music, and allmost everything I like at the first hearing
19  Games Center / Archived Projects / Re: Skyfall on: 2012-03-13 08:15:48
Uh, double post, remove this pls!
20  Games Center / Archived Projects / Re: Skyfall on: 2012-03-13 08:12:52
I was able to play now due to an ad that redirected me to the marketplace download...

Its pretty nice to play, when there is a WiFi or HSDPA/Edge connection available - throttled speed due to excessive traffic use may occur after a while...


Well, the game mechanics so far i played - Slay the dragon - were pretty easy and intuitive. Leveling Up could show the attribute effects or did I missed that info? And maybe add some kind of loading/connection animation. I used to tap and tap and tap when nothing happend when there seemed to be some background loading.

Overall pretty nice so far. I really like the graphic style Smiley
21  Games Center / Archived Projects / Re: Skyfall on: 2012-03-09 14:31:09
My (T-Mobile) HTC Desire HD is not compatible too Sad
22  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Universal Tween Engine -- Give life to your java projects (games, UIs...) on: 2012-01-25 13:36:32
This is pretty impressive. Is there any example on how to use it with opengl (ie. lwjgl)? Haven't found one in the wiki
23  Discussions / General Discussions / Re: What is good/bad about Skyrim? on: 2011-11-15 14:57:58
The scaling works fine. Way better than in oblivion. Only dragons and some quests scale with the actual player level. Though dragons were still easy to beat.

What is bad? Those glitches in animation and positioning actors. How comes a npc can sleep in their furniture? Or some imprisoned npc is out of it when you walk around the corner and he is trying to get back into it while looking weirdly at you...

What pretty good is, is this "just this one more item, one more dungeon" feeling you have while playing it. I constantly overslept the last few days due to excessive skyrim playing what caused missing sleep hours.
24  Discussions / Miscellaneous Topics / Re: JavaScript is a scam on: 2011-11-14 14:57:01
Oh, that Box-Sizing article is new to me. Haven't knew there is a switch like that.

Actually I tried allways to go with: size = width | height + padding + border. Except for rare cases like mixing relativ/absolut block/inline elements together that worked pretty fine.
25  Discussions / General Discussions / Re: Hello Community (Introducing Myself) on: 2011-11-11 11:20:06
Welcome to this nice little place of helpfull resources.
26  Discussions / General Discussions / Re: New feature: serverside syntax highlighting on: 2011-11-11 11:19:13
Derailing my own thread...

1  
2  
3  
4  
5  
6  
      // fill fourCC with whitespaces if length is shorter than 4
      if (fourCC.length() < 4) {
         for (int i=0; i<(4-fourCC.length()); i++) { // <--------------- this is a bug!
            /* fourCC = */ fourCC.concat(" "); // <--------------- this is a bug!
         }
      }

1. fourCC will not be modified (strings are immutable), you're basically doing nothing.
2. if they were, it still wouldn't work, so adding the assignment wouldn't help (much)
You can see that if you pass an empty string, it will stop once it reaches a length of 2, instead of 4.



Trivial fix:
1  
2  
3  
4  
      // fill fourCC with whitespaces if length is shorter than 4
      while (fourCC.length() < 4) {
         fourCC = fourCC.concat(" ");
      }


Besides that, shoving arbitrary bytes in a byte[4] into a String(...) is extremely dangerous, as you get a conversation to a char[] using the default system dependent charset which is not at all guaranteed to result into a char[4], and even when it's a char[4] within the String, that doesn't mean each char holds the value each original byte had.

Spooky nicely colored code Smiley
Erm, well...i only knew the code worked like intented back in 2005/2006 and using the systems default charset was out of scope as the FourCC was part of the fileheader. Which was IIRC lower endian ...though concat returns a new string object
27  Discussions / Miscellaneous Topics / Re: JavaScript is a scam on: 2011-11-11 09:44:30
CSS3....when it is fully supported in IE11+ the web could look much better.
Many CSS 3 selectors were implemented in IE 8 and even IE 7. IE 9 supports pretty much all of the selectors that other browsers supports, and the ones which are missing are typically also missing or very buggy in other browsers.

For visuals, all the main stuff is already supported by IE 9. This includes border radius, box shadows and CSS transitions (through the -ms- prefix). CSS gradients are missing, but you can use SVG as a background (and of course the old DirectX filters, which even IE 6 supports, but they don't play nicely with properties such as border-radius). The only noticeable property which is missing is text shadow, for which there is no pure CSS alternative (you'd have to include a piece of text twice in your HTML and use one of them as the shadow). Gradients and text shadow are supported in IE 10.
Yes, the support is growing, but to slow! And even thus features implemented were buggy. Attribute Selectors, pseudo-classes and a lot more. I agree that the IE Dev Team has done a great job improving the render engine since IE6 but there is still a lot of work to be done. For example the border-radius, why haven't they implemented in IE8? Instead they kicked out the interface and done another horrible to use interface. At least they fixed the Box-Modell Issues.

Well and at the other site of their products they stripped of Outlooks HTML caps back to the '90s!

Maybe all this will end some day.

//edit: Another thing i missed out. IE9 hardware acceleration is pretty neat when you hear about it. But when you have to disable it to see any website its pretty lame. Not to mention that the initial 64bit release did not worked either.

I'm looking forward for IE10, but they could have done so much more...
28  Discussions / Miscellaneous Topics / Re: JavaScript is a scam on: 2011-11-10 14:38:58
You have WebGL with HTML 5. Though its horrible slow compared to Java JNI bindings it is still possible to use and its growing.

//edit, damn work ^^" two posts in the meantime
29  Discussions / Miscellaneous Topics / Re: JavaScript is a scam on: 2011-11-10 11:52:12
CSS3....when it is fully supported in IE11+ the web could look much better.
HTML6? I thought HTML5 will be the last draft and anything after will just be seen as an addon to html5. Is that idea allready dumped?
30  Discussions / General Discussions / Re: New feature: serverside syntax highlighting on: 2011-11-10 11:13:59
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
public class Util {
   
   public static final String fourCC(int fourCC) {
      byte[] fourCCString = new byte[4];
      fourCCString[0] = (byte)fourCC;
      fourCCString[1] = (byte)(fourCC >> 8);
      fourCCString[2] = (byte)(fourCC >> 16);
      fourCCString[3] = (byte)(fourCC >> 24);
      return new String(fourCCString);
   }
   
   public static final int fourCC(String fourCC) {
      if (fourCC.length() > 4)
         throw new IllegalArgumentException("FourCC String must have 4 or less characters.");
     
      // fill fourCC with whitespaces if length is shorter than 4
      if (fourCC.length() < 4) {
         for (int i=0; i<(4-fourCC.length()); i++) {
            fourCC.concat(" ");
         }
      }
     
      int fourCCInt = 0;      
      fourCCInt = (((byte)fourCC.charAt(0) & 0xFFFFFFFF) |
                  ((byte)fourCC.charAt(1) & 0xFFFFFFFF) << 8 |
                  ((byte)fourCC.charAt(2) & 0xFFFFFFFF) << 16 |
                  ((byte)fourCC.charAt(3) & 0xFFFFFFFF) << 24);
      return fourCCInt;
   }
}


Looks good except for the byte array in line 4.
Pages: [1] 2 3 ... 9
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (50 views)
2014-10-17 03:59:02

Norakomi (40 views)
2014-10-16 15:22:06

Norakomi (31 views)
2014-10-16 15:20:20

lcass (36 views)
2014-10-15 16:18:58

TehJavaDev (67 views)
2014-10-14 00:39:48

TehJavaDev (65 views)
2014-10-14 00:35:47

TehJavaDev (57 views)
2014-10-14 00:32:37

BurntPizza (72 views)
2014-10-11 23:24:42

BurntPizza (44 views)
2014-10-11 23:10:45

BurntPizza (84 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!