Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (108)
games submitted by our members
Games in WIP (536)
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: So... state of the art 3D "engines" in Java on: 2014-07-30 13: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.
2  Games Center / Featured Games / Re: State of Fortune on: 2014-07-29 18:18:07
Anything you can state here or at the SoF board already? ^^
3  Games Center / Featured Games / Re: State of Fortune on: 2014-07-29 12: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
4  Game Development / Networking & Multiplayer / Re: [Kryonet] Any way to avoid instanceof check? on: 2014-07-02 18: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!
5  Game Development / Networking & Multiplayer / Re: [Kryonet] Any way to avoid instanceof check? on: 2014-07-02 17: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
6  Game Development / Networking & Multiplayer / Re: [Kryonet] Any way to avoid instanceof check? on: 2014-07-02 17: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.
7  Game Development / Networking & Multiplayer / [Kryonet] Any way to avoid instanceof check? on: 2014-07-02 15: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
8  Discussions / Miscellaneous Topics / Re: Statistics project: Please take a few seconds to answer! :) on: 2012-03-13 10: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
9  Games Center / Archived Projects / Re: Skyfall on: 2012-03-13 09:15:48
Uh, double post, remove this pls!
10  Games Center / Archived Projects / Re: Skyfall on: 2012-03-13 09: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
11  Games Center / Archived Projects / Re: Skyfall on: 2012-03-09 15:31:09
My (T-Mobile) HTC Desire HD is not compatible too Sad
12  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Universal Tween Engine -- Give life to your java projects (games, UIs...) on: 2012-01-25 14: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
13  Discussions / General Discussions / Re: What is good/bad about Skyrim? on: 2011-11-15 15: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.
14  Discussions / Miscellaneous Topics / Re: JavaScript is a scam on: 2011-11-14 15: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.
15  Discussions / General Discussions / Re: Hello Community (Introducing Myself) on: 2011-11-11 12:20:06
Welcome to this nice little place of helpfull resources.
16  Discussions / General Discussions / Re: New feature: serverside syntax highlighting on: 2011-11-11 12: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
17  Discussions / Miscellaneous Topics / Re: JavaScript is a scam on: 2011-11-11 10: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...
18  Discussions / Miscellaneous Topics / Re: JavaScript is a scam on: 2011-11-10 15: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
19  Discussions / Miscellaneous Topics / Re: JavaScript is a scam on: 2011-11-10 12: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?
20  Discussions / General Discussions / Re: New feature: serverside syntax highlighting on: 2011-11-10 12: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.
21  Discussions / Miscellaneous Topics / Re: JavaScript is a scam on: 2011-11-10 10:32:41
In Java (or Javascript) it would always be possible to change the state of an object.
As from my understanding it is possible to create an immutable Object in Javascript. So you can't modify any inner states without using accessors.
22  Discussions / Miscellaneous Topics / Re: JavaScript is a scam on: 2011-11-07 12:34:14
Yea, thats true, a point i missed out. Syntax tends to mislead on the path...

Though fun is neither language. For example I really miss closures in Java.

Maybe its easier for me as i have to write php applications at work and as all know, php does not have real inheritance. And the code get bloated all the way when start using it.
23  Discussions / Miscellaneous Topics / Re: JavaScript is a scam on: 2011-11-07 11:51:19
When you write to much javascript code, then you might have to overthink your idea or change the behavior. When i look back at some old javascript code i feel really awkward about is. Because today i know ways to make it smaller, faster and neater and without any use of inheritance needed.

The Prototype Object itself does work like inheritence. Any object that has been derived from another objects prototype will inherit its magic, but so far i haven't had much use for inheritence in javascript yet despice the small stuff provided by those js frameworks.
24  Game Development / Game Mechanics / Re: alternatives to per-frame functions? on: 2011-11-07 11:23:21
how does this global tick work?
It does work independently on your renderer. In the unreal engine for example the whole logic is determined by the Tick. So when a pawn enters a specific state, you could save that state and even subanimation info. I think you could even save the position of the animation or recalculate it on the current tick value. Lets say the walking state was entered on Tick 5.000 and now the player likes to save his game. Current Tick is 5.025 and the walking animation takes 7 ticks to be done. That would make up 3 full walking sequences and the fourth is at 3/7 in his animation.

Sounds plausible Wink
25  Discussions / Miscellaneous Topics / Re: JavaScript is a scam on: 2011-11-07 11:16:31
I wonder why so many people hate the lack of real inheritance with javascript. The language is not designed to work like any OOP language. Though the prototype way is somehow more powerfull for a language like javascript.

The most powerfull thing in JS is imho the fact to write any function and attach it to any literal you or the specs defined. Thats power Wink
26  Game Development / Game Mechanics / Re: alternatives to per-frame functions? on: 2011-11-04 10:33:43
I don't suggest to safe the actual situation. That could cause the player to run amok Wink Depending on your game the player should restart at the last possible checkpoint. Restarting directly in the action could be pretty annoying.

Thats just my point of view. For the question, yes i think this kind of per frame function is the only way, when you don't have something like a global tick that controls the whole gameflow. Then you could save the last tick state and start from there.
27  Java Game APIs & Engines / JOGL Development / Re: Search for a good jogl book on: 2011-10-13 09:51:46
For modern OpenGL 3.0+ I would take a look at the OpenGL Super Bible (5th Edition) or the updated Red Book which does have Shaders etc included too. Or start with the NeHe Tutorials. THey provide another great ressource for the pure learning purpose.
28  Games Center / Archived Projects / Re: Crabs! on: 2011-10-12 15:50:38
Background flashes x_X

New version now with 1300 craps @15fps
HTC Desire HD, Android 2.3.3
29  Java Game APIs & Engines / JOGL Development / Re: Search for a good jogl book on: 2011-10-12 09:00:37
Yes it is.
http://www.opengl.org/documentation/red_book/
30  Games Center / Archived Projects / Re: Crabs! on: 2011-10-11 17:05:06
Does that incremental GC in 2.3 do so much more than in 2.2?
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.

CogWheelz (18 views)
2014-07-30 21:08:39

Riven (23 views)
2014-07-29 18:09:19

Riven (15 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (33 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (43 views)
2014-07-24 01:59:36

Riven (43 views)
2014-07-23 21:16:32

Riven (30 views)
2014-07-23 21:07:15

Riven (31 views)
2014-07-23 20:56:16
List of Learning Resources
by SilverTiger
2014-07-31 18:29:50

List of Learning Resources
by SilverTiger
2014-07-31 18:26:06

List of Learning Resources
by SilverTiger
2014-07-31 13:54:12

HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54
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!