Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (723)
Games in Android Showcase (216)
games submitted by our members
Games in WIP (790)
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 ... 309
1  Game Development / Shared Code / Re: Simple orthographic camera controls on: 2017-04-22 16:20:41
And with 1.1 or 1.0/1.1 you easily get into inaccuracies in the zoom factors, accumulating errors (you might be zooming in/out for hours, ingame), which will ultimately cause off-by-one rendering issues where sprite-texels drift into unwanted neighbouring screen-pixels.

When the scrollwheel only controls an integer, and a float is converging to it (and actually reaching it, with a bit of nudging), it will always end up at exact zoom-levels in arbitrary orders of magnitude.
2  Game Development / Shared Code / Re: Simple orthographic camera controls on: 2017-04-22 16:16:16
It's not smooth Smiley (changing the zoom level at 60fps)
3  Game Development / Shared Code / Re: Simple orthographic camera controls on: 2017-04-22 16:10:29
When I did something similar for the SpriteEngine for Cas, the target scale was pow(constant, targetZoomLevel), the actual scale was a float which converged to targetZoomLevel over time: pow(contant, currentZoomLevel), where currentZoomLevel simply linearly approached or accelerated to targetZoomLevel. Using this approach you get smooth zooming across arbitrary orders of magnitude in linear time, similar to, say, zooming in Google Maps.
4  Game Development / Shared Code / Re: Simple orthographic camera controls on: 2017-04-20 17:48:54
Post a video of a demo Pointing
5  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-04-20 12:53:19
And never forget: things always get better, no matter what happens.
My poor brain just exploded.
6  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-04-18 08:12:19
And a site thumbnail shortcut thing:
Ah, the joys of proper image scaling Smiley
7  Game Development / Game Play & Game Design / Re: Graphics Backend Abstraction on: 2017-04-17 21:59:32
Porting being a no-op is, I think, an illusion. Different platforms require different gameplay and different performance trade offs. Whether or not your graphics-engine can seamlessly transition from HTML5/WebGL to multiple dedicated GPUs is a mere side note. The effort that is put into building an VK-like API on top of OpenGL is impressive, but by the time you're ready to publish your game, VK has probably gone mainstream, and WebGL would support it by then.

It all reminds me of some of the efforts Cas and I took upon us, to scale the sprite-engine from the low-budget to high-end GPUs, and seeking fast-paths through outdated drivers and/or hardware. It just got in the way of publishing the games, and that framerate bump wasn't ultimately worth it.

If this technical tinkering takes you 18 months, in that time high-end GPU performance has doubled, but more interestingly: your low-end supported hardware doubled in performance too. To make all that raw power, and super efficient API/engine worth the effort, you need a small army of artists and designers. A one or two man team most likely cannot come close to what the big (and free) engines support, so why not pick an art-style that hides the technical inefficiencies? It's hard enough to turn a tech demo into a polished, playable, purchable game. Very little of game programming is performance sensitive, so why focus all your energy on it?

My $0.02 Kiss
8  Discussions / Miscellaneous Topics / Re: Silly Programming Mistakes on: 2017-04-13 07:13:28
I've been making some silly mistakes lately.

Post your recent mistakes in this thread, and how long it took you to fix it.
I'll start:

hashMap.get(myString) = myObject
hashMap.get("" + myString) = null

Took me almost an hour!
That only breaks if myString is null, and putting null keys in your maps is... questionable, usually Smiley
9  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-03-31 10:31:49
Nice CRT distortion shader! Tongue
10  Game Development / Newbie & Debugging Questions / Re: LWJGL vs LIBGDX on: 2017-03-15 19:45:58
If you want help with your decision on either a wheel or a car, we'd need more information on what it's going to be used for, apart from 'travel'.
11  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-03-08 09:30:09
You could have removed the branching and the parameter Pointing
12  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-03-08 07:15:01
I had previously written a function that checked if a number was a prime, and so I just found the largest factor of 'n' checked if it was a prime [snip]
All (smallest possible) factors are prime by definition, no need to verify Smiley

Any number > 1 can be factorized into a series of primes, raised to some power.

145499 = 83^1 * 1753^1
145500 = 2^2 * 3^1 * 5^3 * 97^1
145501 = 145501^1

(2, 3, 5, 83, 97, 1753 and 145501 are primes)
13  Discussions / Miscellaneous Topics / Re: What I did today on: 2017-03-07 23:47:39
Decided I was finally going to tackle the problems on Problem 3 was to find the largest prime factor of 600,851,475,143, managed to write a small 15 line program that does it in 9ms. Seems like it would be rather easy, but my first two ideas made the JVM run out of memory. Made me so happy to get it working so fast. Cheesy

Time to tackle all the things!

Maybe my definition of largest prime factor is wrong?
   private static long maxPrimeFactor(long num) {
      long max = 0;
      for (long i = 2; num > 1; i++)
         if (num % i == 0)
            num /= (max = i--); // decrement i, the factor may repeat
      return max;

maxPrimeFactor(600851475143L) <-- returns 6857 in 65us (0.065ms)

Only when the prime-factors are really big, you have to optimize.
14  Java Game APIs & Engines / OpenGL Development / Re: OpenGL - Draw multiple objects issue on: 2017-03-05 11:45:52
When using instancing we cannot do that anymore, because we are back at model-space. So, we need a way to represent rotation. We could get away with a single rotation angle, but that would then require to evaluate sin/cos in the shader. This however would hurt performance more than storing 3 additional float values for the 2x2 matrix, in which that sin/cos calculation has already been done once on the CPU.
If you take a 16bit integer (giving you up to 0.005 degrees of accuracy), you can then lookup the sin/cos values in a uniform-buffer or (as a fallback) a texture. This reduces 128 bits (4 floats) to 16 bit, at the cost of 2 lookups on the GPU. I expect that would yield a slight performance increase. You can decide to use only 10 bits, reducing the side of the uniform-buffer. For grass even 256 distinct rotation angles (8 bit integer) would be enough.
15  Game Development / Performance Tuning / Re: Quadtree Efficiency? on: 2017-02-23 10:56:27
Developers asking these questions shouldn't be making games that require anything more than grids Pointing

It may sound patronizing, but it's true Smiley

(I'll show myself out Kiss)
16  Game Development / Performance Tuning / Re: Quadtree Efficiency? on: 2017-02-22 13:58:38
Grids are extremely fast and trivial, but you need to spend some time tweaking them when you have objects with negative positions. Since you'll typically implement them as 2D arrays, negative indices will be a problem.

You just add a value to the coords to ensure they are positive... you'll never need negative cell index logic.
17  Game Development / Newbie & Debugging Questions / Re: mt object wouldnt load image on: 2017-02-22 07:38:06
Not sure why you think you have to use "//" -- did you see "\\" and attempt to swap the slashes to make it cross-platform? Simply use "/"

That will be the first step to solve your problem. This thread will help you with the next steps:
18  Game Development / Performance Tuning / Re: Quadtree Efficiency? on: 2017-02-22 07:18:07
Use grids. They have a lot less cache-trashing, and the logic is trivial. You will have quite a lot of empty cells, but that's OK.
19  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Ongoing project: Type-Safe access to ByteBuffers on: 2017-02-11 13:27:22
Yes. Pointing
20  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Ongoing project: Type-Safe access to ByteBuffers on: 2017-02-11 11:37:13
I've reviewed existing approaches related to this topic.

I think I've found everything about it, but if someone knows about a tool or framework I haven't mentioned, please tell me.

Quite an impressive review!

@StructField: Used to declare a field to be part of the struct. Fields without it will be considered to be transient in respect to the structs layout.
@CopyStruct: Used to declare methods to return a copy of the struct.
@TakeStruct: Used to declare methods which take a parameter, which is a mapped struct object.

@CopyStruct and @TakeStruct both refer to the return-value (unrelated to parameters). It is basically an instruction to the callsite, on whether to copy the struct that was returned to the head of its stack (in case it was stack allocated in the called method), or take it as is (in case the struct was malloc-ed or pre-existing, surviving the scope of the callee).
21  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Ongoing project: Type-Safe access to ByteBuffers on: 2017-02-05 14:09:11
LibStruct is zero-copy. You just map a struct to an existing memory pointer / buffer
22  Games Center / Contests / Re: Urgent announcement about on: 2017-02-04 21:19:31
So I don't like registering domains anymore, because if u choose to move on then someone will swoop in and take up whatever u were doing.

You could have spared yourself this outcome by handing over the domain to those who offered, I vaguely recall I wasn't the only one. You already stated that you wished to handover the site, but that there were no takers, so it was your intent to see a continuation of the java4k site. Why did you choose not to take the offer, let the domain expire and expose it to the trolls?
23  Java Game APIs & Engines / OpenGL Development / Re: LWJGL-3 What is the best way to make a voxel engine? on: 2017-02-03 20:10:15
We have a dedicated sub-board for Cube World Projects Pointing

You'll find a lot of discussion about the topic!
24  Games Center / Contests / Re: Urgent announcement about on: 2017-02-03 16:13:40
How is this hacking? Somebody abandoned a domain, they bought it - at most this is copyright infringement, I think.
25  Discussions / Miscellaneous Topics / Re: Retrieve random point inside regions of Perlin noise? on: 2017-02-01 17:08:51
Use floodfill indeed. And drop the requirement that your game is supposed to be infinite. Not a single gamer cares about infinity Smiley

Try to make a relatively small world, and make a fun, functioning game - that is hard enough!
26  Games Center / Contests / Re: Urgent announcement about on: 2017-02-01 09:16:24
Some months ago I let the domain expired, the contest had been dead for 3 years. I had offered to others to adopt it but no takers.

Hey, I offered to be your fallback volunteer Smiley

If, and only if, there are no suitable volunteers, please extend the domain registration, I will reimburse you. Once that is done, we can take some time to transfer ownership of the domain & website.

IMHO should stay online if only for historical reasons.
27  Game Development / Newbie & Debugging Questions / Re: Lighting whoes on: 2017-01-31 08:24:37
@JESTERRRRRR, yes, light is cumulative.
28  Game Development / Newbie & Debugging Questions / Re: Libgdx HTTPRequest on: 2017-01-10 22:44:45
Note sure what you mean, as CORS is not used for <img src="..."> requests, and is used for ajax-calls with specific http-methods and non-trivial http-headers. So it does not stop content leeching of images and I'm not sure how many people leech content through the ajax API... Smiley

In earlier versions of Chrome, you could disable CORS with the CLI param:

Anyhoo, this is a tad offtopic. If you wish to elaborate I could split it off this topic.
29  Game Development / Newbie & Debugging Questions / Re: Libgdx HTTPRequest on: 2017-01-09 18:02:46
CORS is actually a security measure, not a way to block content leeching.
30  Game Development / Performance Tuning / Re: Tips for reducing frame rate spikes due to JIT early in a game? on: 2016-12-26 17:42:14
Shouldn't we go back to the original post and wonder whether all assertions are correct?

A 1000ms JIT pause is highly unlikely, given that the JIT does its work incrementally.

I bet it's a code path that the OP isn't expecting, triggering a lot of disk I/O, the incorrect initialisation of a data-structure, etc etc.

If you simply profile your code (and use System.currentTimeMillis / System.nanoTime to confirm your suspicions) you'll most likely find the culprit quite quickly.
Pages: [1] 2 3 ... 309
buddyBro (183 views)
2017-04-05 03:38:00

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

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

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

Rule (632 views)
2017-03-19 12:42:17

Rule (637 views)
2017-03-19 12:36:21

theagentd (648 views)
2017-03-16 05:07:07

theagentd (583 views)
2017-03-15 22:37:06

theagentd (423 views)
2017-03-15 22:32:18

theagentd (352 views)
2017-03-15 22:31:11
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 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!