Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (734)
Games in Android Showcase (222)
games submitted by our members
Games in WIP (811)
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 ... 365
1  Game Development / Newbie & Debugging Questions / Re: Using bytes to save space. Does that really optimise perfomance or not? on: 2017-08-18 09:14:46
Short answer: no.

Longer answer: when you start to use a lot of bytes - like megabytes, typically in arrays, or buffers - then yes. But as class members? No. Don't.

Cas Smiley
2  Game Development / Networking & Multiplayer / Re: Steam and Kryonet? on: 2017-08-16 15:27:05
Don't be afraid of port forwarding issues... most people can learn how to set it up on their home routers. Failing that though, weupnp will actually work ok. I don't think you really need Kryonet.

Cas Smiley
3  Game Development / Networking & Multiplayer / Re: Steam and Kryonet? on: 2017-08-16 15:08:02
One more thing, you said this requires Steam? Is there anyway I could test this without putting my game on Steam yet
Unfortunately you can't test Steam features without getting on Steam, which is a bit of a bugger.
I'd advise not using the Steam network APIs if you can help it and make something that works everywhere.

Cas Smiley
4  Game Development / Newbie & Debugging Questions / Re: Javafx vs libgdx vs LWJGL on: 2017-08-16 11:27:26
I really like JavaFX but I've come across some real facepalming issues with it, mostly to do with performance... or lack thereof. It will get a lot faster - keep an eye on the JavaFX mailing lists for news on that horizon - but right now it isn't guaranteed particularly high or consistent performance. And it can't do any post-processing effects or fancy shaders either.

Cas Smiley
5  Game Development / Newbie & Debugging Questions / Re: Javafx vs libgdx vs LWJGL on: 2017-08-16 10:26:22
You can use libgdx (or raw LWJGL) with JavaFX but it's not nice or pretty, and performance is only "adequate".

If you're going to make a UI-heavy game, use JavaFX.
If you're going to make a super awesome state of the art graphics heavy game, use LWJGL.
If you're going to make a game based on some pretty standard concepts like a sprite engine, animation, etc, use libgdx.

If you're targeting mobile, design for mobile first and foremost, and use libgdx.


Cas Smiley
6  Discussions / General Discussions / Re: Setting resolution for your game? on: 2017-08-14 09:51:42
There is no simple solution unfortunately. Believe it or not the days of widely disparate screen resolutions and aspect ratios (and even input devices) is actually a "new problem" facing the industry which hasn't actually had time to really adapt and work out best practices.

I've spent quite a lot of time making a state-of-the-art solution (using OpenGL). It is entirely aspect-ratio independent - as UI elements (including the game) are anchored to various screen edges and positions and each other - it is also resolution independent, as it is rendered at any arbitrary logical resolution (which can be finely adjusted by the user), but I always render the final display out at physical desktop resolution (or window size).  It is fiddly and complex but it's the only real way to do it right.

I think at a minimum you will need to come up with a system of anchoring so that you can place and resize your game "areas" according to the physical bounds of its full rendering area. This will allow it at least to not break on fairly arbitrary aspect ratios.

The resolution though is a different kettle of fish. It is possible to do in Java2D without a huge amount of hassle - render everything to a VolatileImage of the same aspect ratio as the target display. I would potentially use a VolatileImage that is twice the resolution of the target display. Then render the VolatileImage to the target, rescaling it to the target's physical resolution, every frame. It's perfectly fast enough.

Cas Smiley
7  Discussions / General Discussions / Re: Setting resolution for your game? on: 2017-08-14 08:30:29
I would try the following:
Find out which axis of the screen is smaller than the other one and then calculate the new dimensions for the game so that the game is "maximized" on one axis and then leave some black stripes on the bigger axis (center the game)
That also means that your game could keep its aspect ratio (e.g. 4:3).
At least thats what I did when I had similiar problems.

Cheers
This works well. A slightly more complex solution is to allow a bit of leeway by allowing elements of the game to move around a bit clamped to the edges - stuff like score and lives and things like that - and if you can, don't fill the empty background with black, but instead use a nice bit of "fading texture" or something that your main game section goes nicely with.

Cas Smiley
8  Discussions / General Discussions / Re: Setting resolution for your game? on: 2017-08-11 10:44:02
The short answer to this is sorta braindead but... use the user's desktop resolution and don't change anything. Scale your game to fit. (Easier using OpenGL obviously)

Cas Smiley
9  Games Center / Featured Games / Re: Demise of Nations for PC, Mac, Linux, Android & iOS on: 2017-08-09 10:52:53
Good luck! I did a retweet about it yesterday but I'm not sure how valuable that really is as mostly it's only other devs that follow us Smiley

Cas Smiley
10  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-07-29 09:47:01
For your funding goals and aspirations, I would suggest that Patreon is possibly a better fit. Kickstarter is a sort of all-or-nothing venture and it favours really big, really unique projects for stuff that fills a niche that no-one else has explored.

Cas Smiley
11  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-07-28 12:17:44
Yes but that's at odds with the pitch.

With artists it's a bit like engineering: reliable, cheap, quality - pick two attributes.

Cas Smiley
12  Discussions / General Discussions / Re: JGO Twitter List on: 2017-07-28 10:33:42
Sort of an irony given how LWJGL made him a billionaire and I cry myself to sleep every night on a pillow of dashed hopes  Cool

Cas Smiley
13  Discussions / General Discussions / Re: JGO Twitter List on: 2017-07-28 09:52:47
Markus is not exactly his old self... seems to have been replaced by some sort of simulacrum.

Cas Smiley
14  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-07-28 09:29:08
Oh I dunno, KS critique is interesting Smiley

Here's what I have to say about the pitch - being a semi-pro indie game developer: $4k is peanuts. Like, nothing. You can hire an actual professional artist for 2 weeks for $4k, and this is a bit at odds with the stated goals. 2 weeks will maybe get you one unrigged model with no UVs or animation. So a bit of thoughtful chin-scratching might be in order on the proposed scope and required funds.

Cas Smiley
15  Discussions / Miscellaneous Topics / Re: Cheerpj: convert any Java application and library to a browser-based Web app on: 2017-07-28 08:34:52
Well, there's Nashorn.....

Cas Smiley
16  Discussions / Miscellaneous Topics / Re: Cheerpj: convert any Java application and library to a browser-based Web app on: 2017-07-27 10:13:36
This is a shame as JavaFX is truly a breath of fresh air to work with, give or take certain minor issues.

Cas Smiley
17  Discussions / Miscellaneous Topics / Re: Cheerpj: convert any Java application and library to a browser-based Web app on: 2017-07-27 09:51:34
All these efforts baffle me. Why Javascript? Seriously just why? It doesn't have to be the defacto clientside language. Someone integrate the JVM directly into Firefox please, and get rid of all the contentious APIs and sandbox it properly this time. It really can't be that hard.

Cas Smiley
18  Discussions / Miscellaneous Topics / Re: Cheerpj: convert any Java application and library to a browser-based Web app on: 2017-07-27 09:05:51
What bothers me about this is just how ass-backwards it is.

Cas Smiley
19  Discussions / General Discussions / Re: JGO Twitter List on: 2017-07-26 12:51:16
@puppygames

Cas Smiley
20  Game Development / Newbie & Debugging Questions / Re: Game "running out of memory" with 32-bit JRE's on: 2017-07-26 12:04:55
For me, it's the Steam market, which last time I looked was under 5% of users still using 32-bit OSes and falling.

Cas Smiley
21  Game Development / Newbie & Debugging Questions / Re: Game "running out of memory" with 32-bit JRE's on: 2017-07-26 10:26:13
If it works then it works, as far as I'm concerned Cheesy I'm 100% behind AdoptOpenJDK.

Now if only there were JVMs that ran on PS4 and XBOne...

Cas Smiley
22  Game Development / Shared Code / Re: Tagged Human JSON (THJSON) Parser on: 2017-07-26 09:12:19
Latest version now committed to Github. I've included a /lib/thjson.xml Notepad++ syntax definition file that colours THJSON files reasonably well.

This version now uses the results of @function call directives and feeds them back into the parser - though the default listener interface simply returns the original @directive as a JSON string so if you don't want to do anything special then nothing special happens. If necessary you can enclose the entire call in quotes.

Example:
1  
{ person: @"Sausage McGinty" }


The string is passed to the function() method in your listener. You can parse it any way you like. You could implement it as follows:
1  
2  
3  
public String function(String text) {
   return "{ name: \""+text+"\", age: 44 }";
}


This would then be seen by the parser as:
1  
{ person: { name: "Sausage McGinty", age:44 } }


It'll allow a stack depth down to 16 levels if you get rather fancy and start having the returned thjson itself containing @calls...

So there you have it... macros.

Stuff returned from root-level @directives is not parsed - instead that's for you to control the listener in arbitrary ways. The best uses I can think of it are some sort of "#include" functionality and some way to map class name tags to actual Java class names in this sort of manner:
1  
2  
@alias monster net.puppygames.treasuretomb.Monster
@alias bullet net.puppygames.treasuretomb.Bullet


I do hope people find a use for this code because it's what I've been sorta looking for, for the last 15 years Smiley

Cas Smiley
23  Game Development / Shared Code / Re: Tagged Human JSON (THJSON) Parser on: 2017-07-21 10:03:44
Rewrote it all to be basically "user friendly" instead of "fiddly but fast". It's now layered slightly, using a special input stream, which feeds a tokenizer, which then feeds a parser, which then spits out actual parsed strings and numbers. Everything possible to slow it down but make it simple Smiley

Did some benchmarks - meaningless of course relative to everyone else but relative to each other quite interesting:

Raw "getResourceAsStream" read() throughput is 17MB/sec on this machine
The THJSONInputStream read() reads at 8MB/sec, keeping track of line & column number and converting all line endings into Unix format (single \n)
The THJSONTokenizer also manages 8MB/sec despite all the extra thinking it does to read tokens and construct them
The THJSONReader parses thjson at a rate of 7MB/sec, despite all the extra thinking it does to ensure tokens are being read in the correct order

I'm happy with reading 7MB of data in a second, I think. What is actually being done with the data that is being read is likely to be far slower.

Cas Smiley
24  Game Development / Shared Code / Re: Tagged Human JSON (THJSON) Parser on: 2017-07-19 16:12:50
Well, exactly. It will still be very bloody quick.

Cas Smiley
25  Game Development / Shared Code / Re: Tagged Human JSON (THJSON) Parser on: 2017-07-19 10:28:47
Hmm so I think trying to be fancy and have a listener return events on a byte[] array with offsets and lengths is maybe a bit too much of a step too far in the quest for "efficiency" at the expense of "flexibility" and "utility".

Simply accepting input only in the form of a byte[] array is way less flexible than an InputStream, even if it is "faster".

Similarly, passing "strings" to the listener in the form of subsets of the original byte[] array with offsets and lengths, when world+dog is just going to turn it into a String anyway, also seems a bit onerous. And likewise the parsing of values which is an exercise rather pointlessly left to the implementation of the listener.

So I think I'm going to change it all around to use InputStream and return Strings and parsed values to the listener, super-efficiency be damned. It's more useful if it's ... useful.

Cas Smiley
26  Game Development / Shared Code / Re: Tagged Human JSON (THJSON) Parser on: 2017-07-18 09:32:54
So I rewrote the parser completely. It's now hideously complicated Cheesy But it also now works for any input I've cared to throw at it, and isn't going to blow up with a StackOverflowError if someone creates a rather arbitrarily complex thjson document.

I've also added a new feature: @directives and @functions.

At the root of the thjson document, @directives are parsed verbatim and sent to the listener, and you can then interpret the data after the @ in any way you like. For example, you could use it to do some sort of "include" system:
1  
2  
@include "/thingy.thjson"
@include http://www.thjson.org/test.thjson # Comments at end of line are not passed to listener though


You can include @functions in any place where a member value or array value is present. The contents of the @function are again passed to the listener to be interpreted in any way you like, and you must return a String which is then given to the parser as a substituted value. The value itself is then parsed to see if it's a boolean literal, number, or string:
1  
{ x: @getX, y: @getY, z: [@getZ] }


Cas Smiley
27  Game Development / Newbie & Debugging Questions / Re: Game "running out of memory" with 32-bit JRE's on: 2017-07-17 17:23:09
Give 'em an embedded VM.

Cas Smiley
28  Game Development / Newbie & Debugging Questions / Re: Game "running out of memory" with 32-bit JRE's on: 2017-07-17 12:26:21
Your best bet is to shut everything down then open your app
Back when I was dealing with this I would try that but generally it's at best an unreliable work-around and not gonna work for anyone else - the only real solution is as you say, move to 64 bit. Or figure out how to use a much smaller heap Wink

Cas Smiley
29  Game Development / Newbie & Debugging Questions / Re: Game "running out of memory" with 32-bit JRE's on: 2017-07-17 08:33:58
I found that I was generally unable to allocate over 1GB of RAM with the 32 bit VM. I switched to 64-bit and never looked back. >95% of the worlds desktop computers are now 64 bit and rising, and it solves so many little niggly issues it's a no brainer.

Cas Smiley
30  Game Development / Shared Code / Re: Tagged Human JSON (THJSON) Parser on: 2017-07-12 14:32:42
There we go, all done. You can now write THJSON as well. It can be fed either JSON, a Map<String, Object>, or POJOs.

POJO output is rather simple and comes with some specific restrictions:
1. Object graph must be acyclic!
2. There are no "references"... everything is written out verbatim, every time
3. Though you might expect it to, the POJO writer does not natively understand Lists or Maps in your POJOs because it can't make guarantees about the generic types or even the class involved. So it outputs them like it outputs any other POJO.
4. ... however it can handle arrays and other nested POJOs.

In theory I could also make an annotation-controlled Java object serializer that would address some of these shortcomings, and introduce a proper object graph that can handle references and cycles, but that's for another day.

I've not made the POJO deserializer yet... maybe tonight.

Also fixed numerous little bugs in parsing and output.

Cas Smiley
Pages: [1] 2 3 ... 365
 
cybrmynd (41 views)
2017-08-02 12:28:51

cybrmynd (58 views)
2017-08-02 12:19:43

cybrmynd (66 views)
2017-08-02 12:18:09

Sralse (80 views)
2017-07-25 17:13:48

Archive (502 views)
2017-04-27 17:45:51

buddyBro (650 views)
2017-04-05 03:38:00

CopyableCougar4 (1136 views)
2017-03-24 15:39:42

theagentd (1142 views)
2017-03-24 15:32:08

Rule (1115 views)
2017-03-19 12:43:22

Rule (1091 views)
2017-03-19 12:42:17
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
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!