Java-Gaming.org Hi !
Featured games (86)
games approved by the League of Dukes
Games in Showcase (649)
Games in Android Showcase (181)
games submitted by our members
Games in WIP (699)
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  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?
2  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.
3  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.

https://www.youtube.com/watch?v=hfW9SqBrB3U
4  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.
5  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.
6  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.
7  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 https://ngrok.com/

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:
http://stackoverflow.com/questions/8523330/programming-p2p-application/8524609#8524609

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.)
8  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.
http://4thline.org/projects/cling/

In their user manual they have a rudimentary example of how to request a port mapping on a network's NAT gateway.
http://4thline.org/projects/cling/support/manual/cling-support-manual.html#section.PortMapping
9  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:
http://gdcvault.com/play/1022195/Physics-for-Game-Programmers-Networking
10  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.
11  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.
12  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.
13  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 http://www.java-gaming.org/index.php?topic=22088.0

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

http://4thline.org/projects/cling/support/manual/cling-support-manual.html#section.PortMapping

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.
14  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)
15  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...



:edit:

Excuse the chandeliers in the background; my sister has no taste Roll Eyes
16  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.
17  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.
18  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.
19  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.
20  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'.
21  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!
e.g.

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.

:edit:

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

inner class:
1  
2  
3  
class A {
class B {}
}

static nested class:
1  
2  
3  
class A {
static class B {}
}

anonymous class:
1  
2  
3  
4  
5  
class A {
{
new B() {};
}
}

local class:
1  
2  
3  
4  
5  
class A{
{
class B {};
}
}


I must confess - in all my years of Java, I've never encountered a local class.
22  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.
23  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.
24  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.

:edit:

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.
25  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:

https://www.youtube.com/watch?v=uNgAFSUXuwc (completely different topic ofc Smiley
26  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.
27  Game Development / Networking & Multiplayer / Re: Fast Paced Multiplayer Interpolation/Extrapolation or both? on: 2015-08-09 12:42:58
http://gdcvault.com/play/1022195/Physics-for-Game-Programmers-Networking

Really good talk.

Given how easy Java makes it to implement deterministic lockstep (w.r.t. strictfp), I'm surprised it's not a more popular choice for Java games - especially with the quite significant downsides of the alternatives. (bandwidth / maintainability)
28  Discussions / General Discussions / Re: Windows 10 on: 2015-08-04 21:17:14
Windows 10 forced me to append "_optout" to my wifi SSID.
That's all I know so far.  Angry

How approachable is Win10's UI for those of us who use Win7 and skin it to work as much like WinXP as possible?

Have they finally sorted out the Explorer UI?
By sorted out, I mean have they got rid of the cluttered, wasteful, redundant (and worst of all compulsory!) Explorer navigation, status, tool & ribbon bars?

That would be the 1 thing that might make me upgrade from Win 7, that and a restored Windows search that is capable of doing *exhaustive* searches.

Basically I want the best bits of Win7 + best bits of WinXP, and none of the shiz that's in Win 8.
Is Win 10 configurable enough to satisfy these desires?
29  Game Development / Newbie & Debugging Questions / Re: My map load parser is taking ages on android on: 2015-07-29 17:44:42
Is there a reason you're using human-readable map files?

Loading 4 bytes into an int is a lot more efficient* than loading half a dozen chars into an array, then parsing them into an int.

*smaller data files, lower peak memory consumption & faster execution.
30  Game Development / Performance Tuning / Re: Optimizing Conway's Game of Life on: 2015-07-24 13:40:02
Ew, all that unnecessary branching (e.g. in setBit )
Clear the bit, then OR it with the desired value. No need for a branch!

Also, while it's probably not your performance bottleneck, it's good practice to only treat your bitsets as bytes when you're putting them into your byte[], in all other cases handle them as ints.
Otherwise the compiler will end up adding implicit casts around operators. (as Java only has operator bytecodes for integer types, not byte types)
Pages: [1] 2 3 ... 70
 
KaiHH (59 views)
2016-01-31 23:15:29

sci4me (88 views)
2016-01-23 21:47:05

sci4me (75 views)
2016-01-23 21:46:58

KaiHH (108 views)
2016-01-19 13:26:42

theagentd (189 views)
2016-01-05 17:10:00

ClaasJG (208 views)
2016-01-03 16:58:36

chrisdalke (197 views)
2015-12-28 06:31:21

Guerra2442 (228 views)
2015-12-25 03:42:55

Guerra2442 (225 views)
2015-12-25 03:27:21

theagentd (261 views)
2015-12-21 14:43:24
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

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48
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!