Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (686)
Games in Android Showcase (198)
games submitted by our members
Games in WIP (758)
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 ... 71
1  Discussions / General Discussions / Re: Pokemon GO 'augmented reality' game on: 2016-07-13 18:04:22
Few would consider a child scribbling all over the Mona Lisa to be augmentation; just sayin'  Grin
2  Game Development / Newbie & Debugging Questions / Re: getters and setters vs public vars on: 2016-07-10 11:10:32
Every
...
have sense ^^

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
public void Proc_Collis(){
   Return_Collis.Reset_Data();//Always first
   if(!Check_Colis()){
      return;
   }
   Return_Collis.have_Collis = true;
   ///calculate Pos_Offset + Velocity
}
class Return_Collis{
   static public boolean have_Collis;
   static public Vec3 Velocity;
   static public Vec3 Pos_Offset;

   static public void Reset_Data(){
      have_Collis = false;
      Velocity = new Vec3();
      Pos_Offset = new Vec3();
   }
}


If I encountered that in a code base, I'd run for the hills.
3  Game Development / Newbie & Debugging Questions / Re: getters and setters vs public vars on: 2016-07-09 11:11:36
a variable like "speed" in your example would be good (in my opinion) to make public. This is because you cant do:
player.speed++;
player.speed *= 10;
player.speed %= 30;
etc...
easily with getters and setters

Encapsulation. A class of objects should manage its own state.

If you've got code all over the place directly manipulating the speed of the player (either the member directly, or through getters/setters), then you've failed to properly encapsulate your code.
4  Discussions / Miscellaneous Topics / Re: Scripting Language on: 2016-07-09 10:55:06
That makes sense. Thanks for your reply.

This lead me to a blog which details out some nice information

It detailed out for me two types of VMs: Stack and Register. I like the register based one, which was obviously more promoted. I rarely deal with stacks anways.

As of now I am just messing around trying to discover how things work more down deep. Everyone eventually writes the 'basic' language at some point. Aha Smiley

That blog is good, though it doesn't address the most important advantage of a stack-based VM; portability.

A stack-based VM can be run on a processor with any number of registers.
Equally a stack-based VM can be easily transposed onto a register-based VM. (as demonstrated by the translation of java bytecode into dalvik bytecode)

Essentially a stack-based VM is more abstract, and thus more flexible.
True it leaves more work for the JIT to do, but (beyond the most naive of implementations) doesn't mean it's necessarily less efficient.

Rather than attempting to write your own VM, I'd suggest just studying Java's VM specification. It's an excellent document:

https://docs.oracle.com/javase/specs/jvms/se7/html/index.html
5  Discussions / Miscellaneous Topics / Re: Scripting Language on: 2016-07-09 02:44:43
1  
2  
3  
push 32
push a
add


Does add pop 32 and pop a from the state? Or should future pushes pop the second push in that pop has to be ran twice to edit push 1? Or am I getting this process wrong?

If we're talking about a stack based (virtual) machine:
- the push instruction would take one operand (in your example 32 or a) and push it onto the stack.
- the add instruction would pop the top 2 values from the stack, add them together, and place the result back onto the stack.

There are many resources on the Internet explaining how basic stack based VMs work.
6  Game Development / Newbie & Debugging Questions / Re: Temporary ObjectOutputStream wrapping InputStream on: 2016-07-07 09:58:42
Buffering of input streams is horrible Undecided ; it makes for fragile code and breaks the encapsulation of streams.

Contractually isn't the only foolproof way of 'temporarily' using any buffered input stream(incl. OIS), to return it as a new wrapper of the passed in stream? Therefore requiring any subsequent reads to pass through the (potentially non-empty) buffer, and in so doing making the new stream permanent not temporary?

Though this obviously creates the potential for an ever increasing chain of streams & buffers due to multiple invocations.

7  Discussions / General Discussions / Re: What does your dream language look like? on: 2016-07-06 17:14:11
This  Cool

https://www.youtube.com/watch?v=OjuptfaTqyo&feature=youtu.be&t=123
8  Discussions / Business and Project Management Discussions / Re: How to package game files on: 2016-07-05 23:30:18
I would compare it to locking my vehicle. Stealing is against the law and even so, someone may be able to get in there by various means to take things. Maybe even the car itself. But that still doesn't deter me from locking it whenever I exit. Of course it's not a bullet proof method to keep my things completely safe but I'm not about to stop locking my car.

I just want something simple to package everything into a file rather than leaving all my sprites out in the open.

Your analogy isn't really equivalent; yes you lock your car because it makes it harder to break into, but:
1) This increased difficulty for the thief increases the chance of their detection.
2) Which encourages the thief to go elsewhere.

Obfuscating your resources (or code) doesn't increase the chance of detection (it remains zero), nor does it encourage the thief to go elsewhere (if they need what you have, you are the only source).

Moreover there exist tools, that operate at the binary level, able to identify & rip image, sound, and video assets both from disk & from the in-memory representation.

Obfuscating your resources might deter the casual browser; but the casual browser isn't the one who is going to use your assets in a damaging way. (They may in fact be using them in a constructive way, building a wiki or the like)

Thus you're at best wasting your time, and at worst impeding fans of your game.
9  Game Development / Shared Code / Re: XM File Formats on: 2016-07-04 00:22:14
Stop wasting your time reinventing the wheel (badly); write some games instead!

:edit:

...and for the record, PNG images don't have to be compressed.

Back when I was doing J2ME work for MIDP1 devices a neat way of doing image rotation was to:
- store the png images uncompressed inside the jar (relying on the jar's own deflate to keep the file size reasonable)
- load each into a byte[]
- rotate the uncompressed pixels in the IDAT chunk in situ (never supported multiple chunks, so image size was constrained)
- recalculate the CRC
- then pass the byte[] to the midp1 image loader.

A horrible hack, but useful knowledge as it forced me to become intimately familiar with the excellent PNG format.
10  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.
e.g.

drawX = prevX + (currentX-prevX)*alpha;
11  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?
12  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.
( https://docs.oracle.com/javase/specs/jls/se8/html/jls-4.html#jls-4.2.3 )
FP-strict forces all intermediate values to be constrained to the same precision as the operands.
( https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.4 )
13  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.
14  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)
15  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.
16  Discussions / General Discussions / Re: Interesting proposals: Java 9 and beyond on: 2016-03-16 11:58:04
1  
2  
3  
4  
5  
6  
7  
      String s = Cast_Me(aaa, String.class);
   static public<T> T Cast_Me(Object Obj, Class<T> cl){  
      if(cl.isInstance(Obj)){
         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).
17  Games Center / WIP games, tools & toy projects / Re: War of Conquest on: 2016-02-26 00:00:56
Instructions needed  Clueless
18  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?
19  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.
20  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
21  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.
22  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.
23  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.
24  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.)
25  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
26  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
27  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.
28  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.
29  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.
30  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.
Pages: [1] 2 3 ... 71
 
roseslayer (507 views)
2016-08-06 11:43:29

roseslayer (465 views)
2016-08-06 09:43:11

xTheGamerCodes (538 views)
2016-08-04 15:40:59

xTheGamerCodes (532 views)
2016-08-04 15:40:24

orrenravid (878 views)
2016-07-16 03:57:23

theagentd (957 views)
2016-07-11 14:28:54

Hydroque (1053 views)
2016-07-06 05:56:57

Hydroque (1036 views)
2016-07-03 08:52:54

GrandCastle (851 views)
2016-07-01 09:13:47

GrandCastle (643 views)
2016-07-01 09:09:45
Rendering resources
by Roquen
2016-08-08 05:55:21

Rendering resources
by Roquen
2016-08-08 05:52:42

Rendering resources
by Roquen
2016-08-08 05:50:38

Rendering resources
by Roquen
2016-08-08 05:49:53

Rendering resources
by Roquen
2016-08-08 05:32:39

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
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!