Hi !
Featured games (88)
games approved by the League of Dukes
Games in Showcase (681)
Games in Android Showcase (196)
games submitted by our members
Games in WIP (746)
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 ... 70
1  Game Development / Newbie & Debugging Questions / Re: Movement interpolation - alpha ruins floating point and makes jerky moves on: 2016-06-20 22:28:38
I believe re-arranging the expression so only the delta is multiplied by alpha will (in this situation) avoid the issue.

drawX = prevX + (currentX-prevX)*alpha;
2  Discussions / General Discussions / Re: Question: Bit-exact floats on different computers? on: 2016-06-17 20:26:46
Why not just use StrictMath everywhere?

Do some of the Math methods with exactly defined results (e.g. Math.sqrt) get intrinsified?
3  Discussions / General Discussions / Re: Question: Bit-exact floats on different computers? on: 2016-06-15 22:13:48
Even on ARM and for both floats and doubles? Can I be 100% sure that if I run the exact same deterministic program on both the result will be bitwise exactly the same?

Short of a VM bug, hardware bug, or error in your own code, yes.

Java requires & utilizes only IEEE 754 floating point.
( )
FP-strict forces all intermediate values to be constrained to the same precision as the operands.
( )
4  Game Development / Game Mechanics / Re: [LibGDX] Rotate around a shape in a non-circular motion on: 2016-06-14 00:46:47
Linearly interpolate between the vertices.
5  Game Development / Newbie & Debugging Questions / Re: Notifying another class, in another thread, of a variable change? on: 2016-05-02 22:00:15
Stick the input in a queue*, and poll the queue in your game thread.

*(obviously making sure reads & writes to the queue are properly synchronized)
6  Game Development / Game Mechanics / Re: Hardware-like software cursor. on: 2016-05-01 16:06:46
Wasn't that the technique used in Molyneux's Black & White?
I seem to remember the cursor & game framerates being disconnected from one-another as being a major selling point of that game.
7  Discussions / General Discussions / Re: Interesting proposals: Java 9 and beyond on: 2016-03-16 11:58:04
      String s = Cast_Me(aaa, String.class);
   static public<T> T Cast_Me(Object Obj, Class<T> cl){  
         return (T)Obj;
      return null;

I hope you realize how & why that is really really nasty.

To the other suggestions, I favor if instanceof; it's the one closest to 'fixing' the instanceof operator (it should have never been a binary operator).
8  Games Center / WIP games, tools & toy projects / Re: War of Conquest on: 2016-02-26 00:00:56
Instructions needed  Clueless
9  Games Center / Android Showcase / Re: FiveMinuteGame on: 2016-01-25 20:42:59
Interesting game.
Can't say I've worked out very much of a strategy; best I've managed so far over the 5 rounds is 2524.

Is there a good strategy to it?
The only vague rules I've come up with so far are:
- trace out the results of the 1st few rotations, ensuring that it spreads to at least 4 simultaneous node activations.
- Try to start near the middle of the board
- Avoid starting near areas containing many aligned nodes

I can imagine there must be board states that will lead to an endless cycle?
10  Game Development / Game Play & Game Design / Re: Risk design on: 2016-01-25 16:41:24
If world map of Risk is a problem, we can call it World Domination game, inspired by risk and change countries names and I think we are okay, no ?

Hasbro don't own the copyright for planet Earth's political map.........

You can do what the f**k you want.
11  Discussions / Miscellaneous Topics / Re: Looking for a old wipeout-like game on: 2015-12-26 16:48:41
CyberSpeed? PSX & PC.
Looks pretty grey to me.
12  Game Development / Networking & Multiplayer / Re: Titanfall - some math on server bandwidth requirements. on: 2015-12-16 23:42:11
It doesn't mention or address the lack of continuity, coherence & community endemic with matchmaking systems.

While this isn't something that's been a major part of console gaming, PC has (until fairly recently) enjoyed the benefits of the traditional server browser + private servers model.
While such a system doesn't scale as neatly or efficiently as the cloud-based system described for Titanfall, the community benefits of static named servers cannot be understated.
Being able to visit the same server, and encounter the same 'locals' is an invaluable foundation upon which friendships & a community grows.

That's something Blizzard have really missed with games like Hearthstone.
The degree of anonymity given to players means it's essentially a glorified Turing test; A community will never develop in such a sterile environment.
This is IMO a missed opportunity, as social investment can be a huge draw to keep players coming back long after they've exhausted the content of the game itself.

I think that's why Twitch streams are so successful; however chaotic they can be, they permit the social interaction that isn't provided by most modern games.
13  Game Development / Networking & Multiplayer / Re: what would be the basic structure for UDP multiplayer server/client on: 2015-12-15 23:58:13
Adding reliability to UDP will incur the same penalty.

That's simply not true; as implied in my previous post, there are other ways of implementing reliability without incurring the massive latency spikes inherent with TCP's strategy.

The simplest approach being to append all unack'ed packets each time you broadcast data, so when a packet goes missing, you simply wait for the next.
Of course this redundancy approach increases packet size significantly, but that's a perfectly valid compromise if latency is your priority.

The point is, even on modern reliable connections, TCP is not the universal answer.
14  Game Development / Networking & Multiplayer / Re: what would be the basic structure for UDP multiplayer server/client on: 2015-12-15 18:40:16

You shouldn't use UDP to build games, at least not without a lot of extra complexity,
for the simple reason that UDP is not guaranteed to be reliable.   UDP messages
can arrive out of order, or not at all.  You can use UDP for non-critical messages
such as the instantaneous mouse position, but anything that affects the flow of
the game has to be sent reliably.

This leaves you with two choices.  Either use TCP for "important" messages, and
somehow integrate the non-synchronized TCP and UDP streams, or add a layer
of complexity to your UDP messages to add TCP-like reliability guarantees to
the important messages.

True enough, reliability is the crux of the issue.
Though there are many ways to achieve reliability, and while TCP's implementation is a good general purpose solution, for games where latency is a concern & packet loss is probable, its behaviour is pretty horrible.

So I'd never say "You shouldn't use UDP to build games".
You should use UDP when you know that the performance characteristics of TCP are unacceptable.

Though the OP's question sounds like he's trying to run before he can walk.
Write your RPG 1st; don't even think about how to make it multiplayer until you've finished making it work for 1 player.
15  Game Development / Networking & Multiplayer / Re: Cannot host a game without port forwarding on: 2015-12-14 13:24:42
The best solution is to use

This free service allows you to open a tunnel through a randomly generated URL they provide you. Locally on the machine you run an application that connects to their servers and forwards packets to and from a local port and their service.

What does ngrok do? it isn't particularly clear from their website.
Does it relay all traffic between clients? or does it simply act as negotiator for nat hole punching?
Relaying obviously has major performance implications.

If UPnP isn't a sufficiently encompassing solution, the OP should look at Hole punching.
Excellent explanation here:

The complete solution for nat traversal is:

1st) Test if UPnP is supported by the nat router. If not......
2nd) Attempt to hole punch a direct connection. If not......
3rd) Fall back to relaying traffic via a 3rd party server. (and inform the client that their performance will be degraded until they manually forward the ports required by your application.)
16  Game Development / Networking & Multiplayer / Re: Cannot host a game without port forwarding on: 2015-12-14 02:29:19
Yes, almost all routers support UPnP for opening ports.
Though a large proportion of these have it disabled by default.

There are several Java libraries that implement UPnP, though the only one I have experience using is Cling.

In their user manual they have a rudimentary example of how to request a port mapping on a network's NAT gateway.
17  Game Development / Networking & Multiplayer / Re: what would be the basic structure for UDP multiplayer server/client on: 2015-12-12 21:52:32
thanks, but its not for hobby i want to learn the good way, today im learning but i think to make it profesional in near future,
by the way, i want to accomplish multiplayer online, not masive, but several connections to server y i'd like to be non blocking,

what kind of connections have, games like, ragnarok online, tibia or Mass Effect 3 in multiplayer, those are TPC or UDP?

The link ra4king gave you is basically 'the word of god' when it comes to networking games.
The articles there cover the theory behind practically every networking concept.

There's also an excellent video from GDC2015:
18  Game Development / Networking & Multiplayer / Re: what would be the basic structure for UDP multiplayer server/client on: 2015-12-12 19:33:09
For a lobby, you should use TCP not UDP, as latency isn't a concern.

As for threading; you need to look into blocking & non-blocking I/O.
19  Discussions / General Discussions / Re: key events & capturing special keys on: 2015-12-10 11:58:31
VK_ALT should work just fine.

A code fragment (and the OS you're using) might help identify the problem.
20  Game Development / Newbie & Debugging Questions / Re: Obfuscation of serializable class. on: 2015-12-08 21:01:43
Thanks for link it will be very useful.
I want to obfuscate code.
The problem is that I can't obfuscate class which Serializable.
In that case Player.class on client after obfuscation will be called asd.class with x,y,z variables and on server Player.class after obfuscation will be called hds.class with y,z,a variables.
It breaks whole serialization process.

Obfuscate the Client & Server as a single unit.
21  Game Development / Networking & Multiplayer / Re: UDP Server listens only to localhost and not over Internet on: 2015-12-02 12:15:01
I think i need to use an automatic port forwarding methode  so any player behind a NAT can host a server easily and won't open his router configuration everytime he needs to open a certain port so id use UPnP (Universal Plug And Play) there is a plenty UPnP librarys in java for that including weupnp and cling and i have no idea how to use them sadly  Clueless Huh
i saw this topic with some code example but all the links are dead ...  Undecided

The most rudimentary usage for cling is covered in their FAQ:

As for users who have upnp disabled, that's their problem.
Code to support it, and document the necessary port forwardings for those who have it disabled.
22  Game Development / Networking & Multiplayer / Re: Introduction to Network multiplayer game in Java on: 2015-10-22 11:31:06
Write a latency port forwarder! That's what I did  Pointing

- XML document that describes which protocols/ports/ranges are forwarded to which destination(s), and with what latency range & packet loss probability.
- port forwarder configures itself according to the document, and sits in the background buffering & forwarding traffic.

It's useful in 2 regards:
- It'll familiarize you with NIO's Channels, Selectors, and the necessary threading structure.
- It'll be a useful tool for when you come to write a future realtime multiplayer game, and want to emulate different connection conditions. (high latency, high packet loss, highly variable latency, asymmetric latency, etc etc)
23  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-10-20 17:13:04
Finished making this goliath for my 4yo nephew:

Base is Mary Berry's chocolate sponge cake. (3 layers, 10 inch)
Tower is sculpted from a Rice Krispies/butter/melted marshmallow mix.

Nom nom nom...


Excuse the chandeliers in the background; my sister has no taste Roll Eyes
24  Game Development / Networking & Multiplayer / Re: 1v1 real-time game - UDP - resending player's lost position packets on: 2015-10-20 01:13:25
If it's only 1v1, there's no need for an authoritative server; take the simple route and make it deterministic lockstep between equal peers.
Much simpler to implement and lower bandwidth requirements, though less flexible if the scope of your project changes.
25  Discussions / Miscellaneous Topics / Re: Generating .java file before compilation during build time on: 2015-09-02 10:46:35
I avoid preprocessors wherever possible, as it interferes with other tools that expect well formed Java source.
You can achieve the same effect with:
  • platform specific implementations of classes that are substituted in as part of the build process
  • platform specific constants that alter behaviour of shared classes(the constants themselves being contained within the aforementioned platform specific classes)

You can even have a form of inheritance with your constants via hiding.

Ideally though, you should write your code in such a way as it'll work on both platforms without need to rebuild it.
26  Game Development / Newbie & Debugging Questions / Re: Launching multiple clients - Android Studio + LibGDX on: 2015-08-24 00:32:29
Never used Android Studio (nor IntelliJ IDEA), but if it can't run multiple instances of any given project, it isn't a very well designed IDE.
27  Game Development / Newbie & Debugging Questions / Re: Eclipse, multiple classpaths? on: 2015-08-21 11:21:06
I have Eclipse project A which loads resources found in its project root.

I have Eclipse project B which uses project A. Whenever I execute project B, the resources A tries to load is not found, obviously because it's looking for the resources in project B root rather than A.

How do I address this issue?

For Project A:
"Java Build Path" -> "Order and Export" tab -> check the classpath elements that you wish dependent projects to have access to.
28  Game Development / Game Play & Game Design / Re: Article on pay to win games in Japan on: 2015-08-19 00:24:42
Choosing stupid* people as your target demographic is never a bad business decision. As true in mobile games as in door to door sales.

*I suppose the politically correct term would be 'vulnerable'.
29  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-08-18 03:22:04
Finally got a deobfuscated & decompiled project running!
No nefarious intent! I'm writing a multiplayer mod (deterministic lockstep) that will be implemented via bytecode instrumentation.
However concocting bytecode injections into obfuscated code for which I have no runnable source was proving to be extremely hard work.
So now that I have compilable source, I'm able to write the mod using regular techniques, and from this construct the instrumentation code necessary for injection into the compiled binaries.

On a related note:
Did you know; nesting interfaces into inappropriate classes is an incredibly simple technique for creating cyclic dependency chains that bork recompilation!

A extends B
B implements A.C

legal bytecode; illegal sourcecode.

The solution is deceptively simple though; elevate all static nested member classes/interfaces to be top-tier. (which involves nothing more than removing the innerclass attribute from every class that references them)

Oh, another thing I learnt today; Enum.valueof(Class<T>,String) doesn't use reflection for finding members.
Enum members have their name (and ordinal) passed into the constructor as the 1st & 2nd parameters.

This means you can obfuscate enums without worry of breaking external dependencies that might rely upon the enum names.
Though obviously you shouldn't, because:
1) Obfuscation of the enum member names will introduce new constant pool entries without making the old ones redundant, thus increase class size
2) The redundant information makes deobfuscation trivial anyway.


Oh yeah, and I finally understand the bytecode implications of all the different flavours of nested classes (along with their formal names!)

inner class:
class A {
class B {}

static nested class:
class A {
static class B {}

anonymous class:
class A {
new B() {};

local class:
class A{
class B {};

I must confess - in all my years of Java, I've never encountered a local class.
30  Java Game APIs & Engines / OpenGL Development / Re: Vulkan ETA late 2015, Android support, Apple NOT supported on: 2015-08-17 00:19:13
Apple isn't stupid, they'll do what's best for their business.
Pages: [1] 2 3 ... 70
CopyableCougar4 (62 views)
2016-06-25 16:56:52

Hydroque (94 views)
2016-06-22 02:17:53

SwampChicken (97 views)
2016-06-20 13:22:57

SwampChicken (100 views)
2016-06-20 13:22:49

SwampChicken (92 views)
2016-06-20 13:22:26

Hydroque (138 views)
2016-06-15 08:22:50

Hydroque (134 views)
2016-06-13 06:40:55

DarkCart (247 views)
2016-05-29 02:30:33

Hydroque (213 views)
2016-05-26 14:45:46

Mac70 (197 views)
2016-05-24 21:16:33
Making a Dynamic Plugin System
by Hydroque
2016-06-25 00:13:25

Java Data structures
by BinaryMonkL
2016-06-13 21:22:09

Java Data structures
by BinaryMonkL
2016-06-13 21:20:42

FPS Camera Tutorial
by Hydroque
2016-05-22 05:40:58

Website offering 3D Models specifically for games for free
by vusman
2016-05-18 17:23:09

Website offering 3D Models specifically for games for free
by vusman
2016-05-09 08:50:56

Website offering 3D Models specifically for games for free
by vusman
2016-05-06 11:10:21

Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17 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‑
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!