Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (569)
Games in Android Showcase (154)
games submitted by our members
Games in WIP (618)
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 ... 342
1  Discussions / General Discussions / Re: Where can I find fast spatial querying? on: 2015-04-16 08:53:17
For a tower defence game you'll only need a regular cell grid. Well, that's what I've used, and it's plenty fast enough.

Cas Smiley
2  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > Now on Steam! < on: 2015-04-14 12:13:26
I feel as if I need some sort of additions to the game wrt. attacking/defending. Like soldiers and barracks or something.

Cas Smiley
3  Discussions / General Discussions / Re: Hiring a Java developer on: 2015-04-13 09:27:03
Are you sure we couldn't just answer a few of your questions here?

You could always send some money too of course  Pointing

Cas Smiley
4  Games Center / WIP games, tools & toy projects / Re: RFLEX - A simple, rage-inducing arcade game by Radirius on: 2015-04-07 23:11:45
It's a great concept - similar simplicity and presentation to Super Hexagon, which did rather well.

Cas Smiley
5  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > Now on Steam! < on: 2015-04-07 22:52:16
Yeeargh, Slick  Pointing Keviiiiiiiiiiiiin!

Cas Smiley
6  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > Now on Steam! < on: 2015-04-07 22:26:02
Today, I actually had a good sit down this evening and played Retro Pixel Castles for the first time Smiley Can't figure out how to make food! Gah.
While I was playing I had the good sense to profile it, and here is what it produced:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
Flat profile of 2278.94 secs (172965 total ticks): main

  Interpreted + native   Method
  0.3%     0  +   258    org.lwjgl.opengl.WindowsDisplay.nGetPbufferCapabilities
  0.0%     0  +    41    org.lwjgl.opengl.WindowsContextImplementation.nSwapBuffers
  0.0%     0  +    32    org.lwjgl.opengl.WindowsDisplay.nResetDisplayMode
  0.0%     0  +    31    java.io.FileOutputStream.close0
  0.0%     0  +    30    org.lwjgl.opengl.WindowsDisplay.nSwitchDisplayMode
  0.0%     0  +    26    org.lwjgl.opengl.GL11.nglGetFloatv
  0.0%     0  +    25    java.net.SocketInputStream.socketRead0
  0.0%     0  +    21    java.net.DualStackPlainSocketImpl.connect0
  0.0%     0  +    21    org.lwjgl.opengl.EXTFramebufferObject.nglCheckFramebufferStatusEXT
  0.0%     0  +    18    sun.nio.ch.FileDispatcherImpl.close0
  0.0%     0  +    14    org.lwjgl.opengl.WindowsDisplay.nDestroyWindow
  0.0%     0  +     9    org.lwjgl.opengl.GL11.nglGetTexImage
  0.0%     1  +     8    org.lwjgl.opengl.GL11.nglGenTextures
  0.0%     0  +     9    org.lwjgl.opengl.WindowsPeerInfo.nChoosePixelFormat
  0.0%     0  +     8    org.lwjgl.opengl.GL11.nglTexImage2D
  0.0%     0  +     7    java.io.RandomAccessFile.close0
  0.0%     0  +     7    java.io.WinNTFileSystem.rename0
  0.0%     0  +     7    org.lwjgl.openal.AL10.nalBufferData
  0.0%     0  +     5    sun.nio.fs.WindowsNativeDispatcher.CreateFile0
  0.0%     0  +     5    java.io.WinNTFileSystem.delete0
  0.0%     0  +     5    org.lwjgl.opengl.WindowsContextImplementation.nDestroy
  0.0%     0  +     4    java.util.zip.ZipFile.close
  0.0%     0  +     4    java.net.NetworkInterface.getAll
  0.0%     0  +     3    java.io.WinNTFileSystem.getLastModifiedTime
  0.0%     0  +     3    java.io.FileInputStream.readBytes
  0.8%    75  +   638    Total interpreted (including elided)

     Compiled + native   Method
  0.4%   375  +     0    rpc.particles.ParticleModule.update
  0.1%   118  +     2    rpc.entities.EntityModule.getMobType
  0.1%    55  +     0    org.newdawn.slick.state.StateBasedGame.update
  0.1%    53  +     0    rpc.utilities.PathFinder.searchForResourceTile
  0.1%    51  +     0    rpc.entities.EntityBase.updateAnimation
  0.1%    43  +     5    rpc.guielements.play.Interface.render
  0.0%    43  +     0    rpc.particles.ParticleModule.render
  0.0%    36  +     2    rpc.utilities.PathFinder.findPath
  0.0%    37  +     0    rpc.entities.EntityBase.combatSearch
  0.0%    32  +     2    rpc.particles.ParticleModule.initController
  0.0%    25  +     0    rpc.entities.EntityReachMap.buildReachMap
  0.0%    23  +     2    rpc.resources.ResourceModule.updateResourceCount
  0.0%    20  +     0    org.newdawn.slick.openal.WaveData.convertAudioBytes
  0.0%    18  +     1    rpc.entities.EntityBase.updateAI
  0.0%    18  +     0    rpc.map.CollisionModule.initController
  0.0%    18  +     0    rpc.objects.ObjectRangeBuilder.createSingleRange
  0.0%    16  +     0    rpc.BackgroundModule.update
  0.0%    13  +     0    rpc.resources.ResourceModule.renderSelection
  0.0%     1  +    10    rpc.LightingModule.addLightStraight
  0.0%     9  +     1    rpc.ShadowModule.initController
  0.0%     7  +     2    rpc.LightingModule.updateLightMap
  0.0%     8  +     0    rpc.utilities.PathFinder.searchForEntity
  0.0%     7  +     0    rpc.entities.EntityModule.update
  0.0%     6  +     0    rpc.entities.essence.EssenceBase.checkTarget
  0.0%     5  +     0    rpc.entities.VillagerUtility.getHarvestingWork
  1.3%  1119  +    62    Total compiled (including elided)

         Stub + native   Method
 56.6%     0  + 52790    org.lwjgl.opengl.GL11.nglGetFloatv
  9.0%     0  +  8399    org.lwjgl.opengl.WindowsContextImplementation.nSwapBuffers
  7.9%     0  +  7382    org.lwjgl.opengl.GL11.nglColor4f
  5.3%     0  +  4962    org.lwjgl.WindowsSysImplementation.nGetTime
  4.4%     0  +  4063    java.lang.Thread.yield
  3.9%     0  +  3677    org.lwjgl.opengl.GL11.nglTexCoord2f
  3.2%     0  +  2968    java.lang.Thread.sleep
  3.0%     0  +  2793    org.lwjgl.opengl.GL11.nglVertex3f
  1.0%     0  +   939    org.lwjgl.opengl.GL11.nglEnable
  0.8%     0  +   765    org.lwjgl.opengl.GL11.nglTranslatef
  0.6%     0  +   528    java.lang.Object.hashCode
  0.5%     0  +   434    org.lwjgl.opengl.GL11.nglBegin
  0.4%     0  +   375    org.lwjgl.opengl.GL11.nglBindTexture
  0.4%     0  +   365    org.lwjgl.opengl.GL11.nglEnd
  0.1%     0  +   106    org.lwjgl.opengl.GL11.nglGenTextures
  0.1%     0  +    68    java.util.zip.Inflater.inflateBytes
  0.1%     0  +    56    org.lwjgl.opengl.GL11.nglCallList
  0.1%     0  +    55    org.lwjgl.opengl.GL11.nglPopMatrix
  0.1%     0  +    51    java.io.FileInputStream.open0
  0.0%     0  +    41    org.lwjgl.opengl.GL11.nglVertex2f
  0.0%     0  +    39    org.lwjgl.openal.AL10.nalSourcef
  0.0%     0  +    38    org.lwjgl.opengl.GL11.nglLoadIdentity
  0.0%     0  +    36    org.lwjgl.opengl.GL11.nglGetError
  0.0%     0  +    34    org.lwjgl.opengl.GL11.nglPopClientAttrib
  0.0%     0  +    31    org.lwjgl.opengl.GL11.nglDisable
 98.0%     6  + 91398    Total stub (including elided)

  Thread-local ticks:
 46.1% 79665             Blocked (of total)
  0.0%     2             Class loader


Global summary of 2278.94 seconds:
100.0% 173043            Received ticks
  0.0%    75             Received GC ticks
  1.9%  3296             Compilation
  0.0%     2             Other VM operations
  0.0%     2             Class loader

 
Note here and there the total lack of any pathfinding code contributing to the CPU usage. In fact notice the total lack of CPU usage. You spend 98% of your time in native code! And half of it is nglGetFloatv, which I can't for the life of me think why you would ever call it.

Cas Smiley
7  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > Now on Steam! < on: 2015-04-07 21:30:18
Generally the most effective optimisation strategy is discarding the majority of your data persecutioncomplex
... or not doing any optimisation at all, if it's actually fast enough and there's other things to be doing instead Wink

Cas Smiley
8  Games Center / Featured Games / Re: [Slick2d] Retro-Pixel Castles > Now on Steam! < on: 2015-04-07 19:15:24
@Rayvolution: use a PriorityQueue for the open list. It is much faster than inserting values into a sorted array.
Better still, a BinaryHeap. (Source in RotT originally courtesy of pjt33 - still coming in useful to this day!)

Cas Smiley
9  Discussions / General Discussions / Re: Concurrency Library on: 2015-03-31 22:41:39

Sidenote: Why isn't the false sharing issue fixed in ABQ? It seems trivial to add object field padding to force seperate cache lines for these fields.

hmm.. apparently not so trivial after a little investigation. Or at least, not widely known about.

Cas Smiley
10  Game Development / Newbie & Debugging Questions / Re: Best Practise - Quad Trees on: 2015-03-30 15:44:01
Spasi did a nice optimisation and benchmark of a Java quadtree using a structs library in LWJGL.
11  Game Development / Newbie & Debugging Questions / Re: Best Practise - Quad Trees on: 2015-03-30 08:38:24
So, what Roquen was hinting at is that Java might not be a very good language in which to implement a quadtree structure. Of course if you have a box of nails and the only tool you have handy is a hammer,  well, there you are. But why did he say this?

Two aspects of most things in comp sci are the physical structure of things in memory and the algorithms to access them efficiently. Sometimes a thing works really well because the precise way it is laid out in memory makes it extremely efficient to work with, and quadtrees is one of these things. In C, quadtrees are densely packed structures  using pointers to bits of itself, all stored in a contiguous block of memory. It's as efficient as it can possibly be.

In Java, the best you can do is a great big sprawling heap of instances scattered all over memory. Each instance itself has a whole load of extra guff associated with it somewhere else in memory, too. So though on the surface of it, it looks like you've got a neat looking data structure and perfectly simple algorithms, like a swan paddling on a lake it's all serene on top but there's a lot of furious thrashing going on underneath where you can't see it. Then you wonder why it's slower and takes up vast amounts of RAM.

Cas ☺
12  Discussions / Miscellaneous Topics / Re: Python Load Balancing. on: 2015-03-27 14:39:29
Python explodes in flames!

Cas Smiley
13  Game Development / Newbie & Debugging Questions / Re: OSX 10.10 seems to have broken my games on: 2015-03-26 14:42:11
Hm, using 2.9.2 here. Maybe I need to get that updated.

Cas Smiley
14  Game Development / Newbie & Debugging Questions / Re: OSX 10.10 seems to have broken my games on: 2015-03-26 13:04:04
Er... is OSX 10.10 actually released then? Or is it still beta?

Cas Smiley
15  Game Development / Newbie & Debugging Questions / Re: OSX 10.10 seems to have broken my games on: 2015-03-25 17:57:30
Actually both Smiley Basically when launched, game does nothing at all. No output in Console allegedly.

Cas Smiley
16  Game Development / Newbie & Debugging Questions / OSX 10.10 seems to have broken my games on: 2015-03-25 10:07:47
... has anyone here got 10.10? Would you be able to do a bit of testing and sleuthing for me?

Cas Smiley
17  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-03-24 09:46:30
Sent my first DMCA violation report to Google. Titan Attacks has been out on Android in the Humble Bundle for just a few days and someone has already pirated it.

Cas Smiley
18  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-03-18 09:40:56
I used to have a bit of code in my games that went something like this:
1  
if (vendor.indexOf("Intel")) { return false; } // f**k Intel


Cas Smiley
19  Game Development / Newbie & Debugging Questions / Re: Going to build 2.5d Game on Facebook by JavaFX , your advice? on: 2015-03-15 14:36:19
Mostly it's because users just have it blocked, or have an ancient version of it, or it just plain doesn't work properly.

Cas Smiley
20  Game Development / Newbie & Debugging Questions / Re: Going to build 2.5d Game on Facebook by JavaFX , your advice? on: 2015-03-15 10:34:54
Java-in-the-browser is a world of pain - best avoided. The tech to use is HTML5/CSS3/JS with some sort of middleware library to make it less unpleasant.

Cas Smiley
21  Discussions / General Discussions / Re: The Khronos Group announces "Vulkan": the successor to OpenGL on: 2015-03-14 11:27:02
Yes, "draw calls" in Vulkan will be data inside a command buffer, not actual function calls.
The strange thing is almost all of the stupid hoops we go through right now to get performance are basically... building command buffers of objects which when executed in the main thread will run OpenGL commands  Cranky

Cas Smiley
22  Discussions / General Discussions / Re: The Khronos Group announces "Vulkan": the successor to OpenGL on: 2015-03-11 17:53:25
I think that might be the case with OpenGL driver calls too - they are "so cheap" that they don't add up to much (and they're in user space too unlike DX)... until you start to do 100,000 of them. Problem that JNI calls have is that they can't be inlined and thus have to go through the whole push stack & PC, call, return & restore bollocks that inlining basically eliminates.

Cas Smiley
23  Java Game APIs & Engines / OpenGL Development / Re: How to avoid duplicate shader code? on: 2015-03-09 14:37:17
Let us assume for now that it simply crashes Intel drivers, unexpectedly produces working results on Nvidia drivers despite incorrect inputs and assumptions, and doesn't work on AMD because of correctly implemented specifications which state "unspecified behaviour" in cases where Nvidia picked a sensible fallback.

Cas Smiley
24  Java Game APIs & Engines / OpenGL Development / Re: How to avoid duplicate shader code? on: 2015-03-09 12:34:23
You have 2 mains attaching one fragment and one vertex shader, have'nt you?
Clarification: one main() per shader type. So one main() in the total vertex shaders, and one main() in the fragment shaders.

Cas Smiley
25  Game Development / Newbie & Debugging Questions / Re: Issue with "old" lwjgl game on: 2015-03-09 11:26:57
It looks like in between then and now the display framebuffer format you get using "default" arguments is different. Maybe depth buffer or something. Amongst possibly other things.

Cas Smiley
26  Java Game APIs & Engines / OpenGL Development / Re: How to avoid duplicate shader code? on: 2015-03-08 23:54:39
+1 for CopyableCougar4's solution.

Alternatively as I understand it you can attach as many shaders as you like to a program provided there's only 1 main()... so correct me if I'm wrong here but you could stick your computation functions into "library" shader functions and just call into them.

Cas Smiley
27  Java Game APIs & Engines / OpenGL Development / Re: Using Slick2D's Image.getGraphics crashes on some machines on: 2015-03-05 16:19:41
Actually that looks like a driver bug to me.

Cas Smiley
28  Game Development / Game Mechanics / Re: Making GUIs on: 2015-03-04 16:06:41
There is indeed a little confusion here as to what you were trying to do, which is now clearer. Basically hijacking Swing to render itself on top of some other scene maybe rendered by LWJGL, am I right? Which is indeed possible, though what you probably want to actually be doing is rendering the Swing UI to a BufferedImage and then blitting that on top of the GL scene. It's fiddly though and requires some fun with event queues as hinted back along... and at the end of the day you'll have a fugly Swing UI on top of your pretty game which sort of defeats the point :|

The libgdx UIs seem very capable - see Spine for an example of a UI made entirely in libgdx and rendered with OpenGL. No Swing involved!

Cas Smiley
29  Discussions / General Discussions / Re: The Khronos Group announces "Vulkan": the successor to OpenGL on: 2015-03-04 16:01:43
For ARM platforms it doesn't matter as basically that means "phones", and the systems are pretty much shipped complete. Nothing else is really relevant. Playstation and Xbox obviously but they do their own weirdy things anyway.

Cas Smiley
30  Game Development / Game Mechanics / Re: Making GUIs on: 2015-03-04 14:54:23
There's nothing special about it. It's just designed primarily to be an OS-event-driven UI library for normal UIs, for which its design is perfectly optimal.

FWIW I've got my own UI library I use for making games UIs. It executes in the main loop, and renders in the main loop, and doesn't even use "events" (just a horribly complex load of state machines). As soon as I want to do anything asynchronous, I have to punt it out into another thread and I am only allowed to interact with my own UI in the main thread. It's a solution you'll end up with time and time again - it's best to accept that's the way it works.

At least with static import and lambda Runnables now it's nowhere near as fiddly and ugly as it used to look:
1  
invokeLater(()->{ setText("Finished!"); });


Cas Smiley
Pages: [1] 2 3 ... 342
 
Riven (22 views)
2015-04-16 10:48:47

Duke0200 (35 views)
2015-04-16 01:59:01

Fairy Tailz (27 views)
2015-04-14 20:13:12

Riven (28 views)
2015-04-12 21:36:37

bus hotdog (45 views)
2015-04-10 02:39:32

CopyableCougar4 (46 views)
2015-04-10 00:51:04

BurntPizza (46 views)
2015-04-06 22:06:58

ags1 (51 views)
2015-04-02 10:58:48

Riven (49 views)
2015-04-01 18:27:05

ags1 (66 views)
2015-03-31 10:55:12
How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27
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!