Hi !
Featured games (87)
games approved by the League of Dukes
Games in Showcase (672)
Games in Android Showcase (194)
games submitted by our members
Games in WIP (727)
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: 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)
2  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.
3  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).
4  Games Center / WIP games, tools & toy projects / Re: War of Conquest on: 2016-02-26 00:00:56
Instructions needed  Clueless
5  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?
6  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.
7  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.
8  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.
9  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.
10  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.
11  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.)
12  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.
13  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:
14  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.
15  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.
16  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.
17  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.
18  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)
19  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
20  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.
21  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.
22  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.
23  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.
24  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'.
25  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.
26  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.
27  Game Development / Game Mechanics / Re: How to code a sword swipe? on: 2015-08-16 16:21:02
I want to know what will be the position of A after rotating by 45°, from 0° to 45°

So just a simple rotation?

Translate so the origin of the rotation is @ [0,0], then apply the appropriate maths. (Silly old harry, caught a herring, trawling off America.  Cheesy)

Or better yet use whatever Math API you have to hand; the JDK can do rotation using AffineTransform.

So O is the center point, A is the sword's tip position, and A' is the sword's tip position after rotated by 45°.
The positions are in pixels and I use radians

The question is what is the formula to find the position A have after rotating this way? Grin
Do you mean you want to get back to position A after rotating 45 degrees? If so, just rotate -45 degrees or 315 degrees

Though inverting transforms like that is generally bad practice, as it'll introduce fp imprecision.
28  Game Development / Game Mechanics / Re: How to code a sword swipe? on: 2015-08-16 12:02:08
You don't say what API you're using, so I guess you aren't expecting code.

Regardless, the solution is to transform the polar coordinates of your arc to the Cartesian coordinates of the texture you want to map to it.

In Java2D you'd do this with a custom Paint/PaintContext.
If you look at the source for RadialGradientPaintContext, you'll see roughly what the transformation involves.


That said, if it's for 2D, and the arc is always going to be the same, you really should make it part of your art assets - it's far less complex to implement/maintain, and has the potential to look better too.
29  Discussions / General Discussions / Re: Oracle working on an AOT compiler for Java on: 2015-08-14 00:36:41
Tbh I thought that presentation sucked.

This presentation was much better: (completely different topic ofc Smiley
30  Game Development / Networking & Multiplayer / Re: How to deal with different packet sizes? on: 2015-08-11 01:13:11
If you're using TCP, then you're primarily working with streams not packets.

How the data you write to a stream is segmented into packets is (almost) completely beyond your control, and more importantly is completely irrelevant.
All you should care about is that the data you write to the OutputStream on one end, will be read back from the InputStream at the other.

It sounds like you've misunderstood some of the fundamentals.
Pages: [1] 2 3 ... 70
IanParcs (55 views)
2016-04-18 14:18:53

KaiHH (51 views)
2016-04-18 08:35:41

KaiHH (81 views)
2016-04-15 12:43:58

theagentd (83 views)
2016-04-14 02:16:17

theagentd (99 views)
2016-04-14 02:15:43

IanParcs (122 views)
2016-04-12 03:51:16

IanParcs (53 views)
2016-04-12 03:50:03

IanParcs (50 views)
2016-04-12 03:49:54

IanParcs (47 views)
2016-04-12 03:49:52

IanParcs (55 views)
2016-04-12 03:49:52
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

List of Learning Resources
by SilverTiger
2016-02-05 09:39:47

List of Learning Resources
by SilverTiger
2016-02-05 09:38:38

List of Learning Resources
by SilverTiger
2016-02-05 09:35:50

Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10 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!