Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (564)
Games in Android Showcase (151)
games submitted by our members
Games in WIP (605)
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 ... 54
1  Game Development / Shared Code / Re: StraightEdge, some questions on use... on: 2015-03-17 11:28:54
Hi Jamz,
Nice to hear from you, thanks for your kind words.
I haven't worked on straightedge polygon library for a while, but I still use it in my projects.
Recently Google code announced that it will shut down so I plan to migrate to GitHub where I hope others might be able to help and get involved with fulfilling feature requests since I haven't enough time for now.
1. I haven't integrated Area class but I agree that it would be nice to have. I should add it as a feature request.

2. I never got soft shadows working, but there are some cheating methods you could use to make it appear as so. Paint the shadow edge as feint grey line. Or use multiple light sources or 'eyes' to cast multiple shadows and paint them on top of one another in a translucent colour so they appear as soft shadows.

3. Yes that's absolutely right.

4. Vision is actually very quick, so the way you propose is fine. It's path finding which is expensive.

5. OpenGL would be great, I did make a LWJGL port once but I was more interested in java2D at the time since it was more reliable. There were a lot of openGL driver problems in the past. I have been meaning to make an openGL version. By the way, in the comments page on google code you can see that some people have ported the library to android and I think they're using openGL to render. The drawing code should be quite easy to switch to openGL from java2d. It's the number one thing I've been planning on doing in my next holiday.

6. The default scale method scales relative to the 'centroid' of the polygon. There is another method which scales relative to an X,Y location, which you can make the origin of the map and then scaling should work as you want. Perhaps I should change this to abide by the 'principal of least surprise'.

I haven't looked into box2DLights (https://github.com/libgdx/box2dlights) very deeply but it certainly looks fantastic and is popular here. It has the benefit of built-in libgdx and openGL rendering, and I notice that the author has achieved soft shadows. I will try to learn how he does that.

Cheers,
Keith
2  Game Development / Newbie & Debugging Questions / Re: Check for lan servers on: 2015-03-11 10:34:01
Here's a method to do that
https://github.com/EsotericSoftware/kryonet/blob/master/README.md#lan-server-discovery
3  Game Development / Game Mechanics / Re: Making GUIs on: 2015-03-04 15:41:12
Fair enough. I wasn't trying to be passive aggressive, but the onus usually isn't on us to prove every little misunderstanding wrong. When we get people making posts like "teh jav is suck, C++ is faster and you can use it for games" - we usually just tell them that they're wrong and leave them to their own research, right? If they have specific code showing specific benchmarks we can talk about that, but generally we just tell them "you're wrong, here's some links explaining why, now if you have some code, please post it."

Thanks, and no hard feelings either. I think it's great that a solution might have been found. If I had to pay for all the experts who participated in this thread it would surely cost thousands!   Cool

But there was obviously a misunderstanding which is evident in the code you posted. You were talking about direct-rendering inside an empty JPanel which is pretty simple, there was no swingComponent.paint(Graphics2D) going on so there were no Swing GUI components (except the empty JPanel) being actively rendered. Whereas I was talking about drawing Swing components on top of the game graphics at 60Hz.

I thought this was obvious, and I also thought that you and PrinceC would only talk with such authority on the topic if you had actually achieved active rendering with Swing components painted on top of the game graphics without involving the EDT. Therefore I figured that sharing your secret and posting code would not be hard. But that's fine, it was just a misunderstanding about what 'direct rendering' meant. Next time I'll be more specific.

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.
I think your system is perfect, it's exactly what I would want in a GUI library too. No bundled EDT thread, and you probably have an update and paint method, with no locks since you do all the work in your own single thread. Swing should be able to be used like this, there was no need to tie the GUI component library to the EDT. Let the programmer manage his own threading problems. Yet for some reason you disagree with me  Huh
4  Game Development / Game Mechanics / Re: Making GUIs on: 2015-03-04 14:44:57
The method you're looking for is called push(), but it's on EventQueue itself.  You don't replace the Toolkit queue, you push another on top of it.
Thank you, I'll try that and report back. It certainly looks like the solution I'm after, which is great.

nsigma at least understands the problem and offers some directions to the solution. The run-your-game-loop-on-the-EDT solution is obvious and isn't the solution I'm after which is painting the GUI in my own thread.
And I say this in the friendliest way (eyeballs @Riven Wink ) - What's so damn special about your own thread?  Do you complain that main() doesn't run in your own thread?  Now, I'm not 100% sure this is the way to go, or that AWT wouldn't kick up a fuss about it, but it would be the simplest way - just make sure to manually drain and dispatch the event queue!
1  
2  
3  
4  
5  
6  
7  
public static void main (final String[] args) {
  EventQueue.invokeLater(new Runnable() {
    public void run() {
      actualMain(args);
    }
  }
}

There's nothing special about my main game loop thread. But what's so special about the GUI library? I just don't think that a GUI library needs to bundle a thread with itself and force me to do all event handling, painting and logic on it. I mean, what if the physics, lighting, AI and scripting also insisted on running all their code on their own threads? It'd be a nightmare. I don't see what's so special about a GUI when all it's supposed to do is update and paint like everything else  Huh

Quote
If you're stuck with using another thread, I have doubts, as you do, about active rendering from another thread while the EDT is still processing events - not just on the paint() thing, but also because models aren't thread-safe.  So, custom queue ...
It seems as though Swing model updates are also just events on the EventQueue, so I should be able to intercept them if EventQueue.push() works out.

By the way, I stumbled on this java.net forum thread which was written by the Swing dev's Scott Violet and Dmitri Trembovetski:
https://www.java.net/node/644028
Dmitri says that the context-switching from calling invokeLater is expensive in the last post. So perhaps there's also a performance reason why rendering from a single thread is a better idea.

Thanks for your advice nsigma, much appreciated.
5  Game Development / Game Mechanics / Re: Making GUIs on: 2015-03-04 03:40:44
And here's a really dumb program that follows the bullet points at the bottom of that link to perform active rendering in Swing, off the EDT:
1  
2  
3  
4  
5  
6  
               Graphics g = myPanel.getGraphics();
               g.setColor(Color.WHITE);
               g.fillRect(0, 0, myPanel.getWidth(), myPanel.getHeight());
               g.setColor(Color.BLACK);
               g.drawRect((int)ballX, (int)ballY, 100, 100);
               g.dispose();

I don't think that you understand the problem, which is to paint Swing components inside the game loop, not rendering inside an empty JPanel. There should be a swingComponent.paint(g) in there.

When you switch to active rendering you're in control of paint() not the EDT.
setIgnoreRepaint only stops the operating system (OS) events from calling paint, not internal changes to the menu. See the java docs:
Quote
Sets whether or not paint messages received from the operating system should be ignored. This does not affect paint events generated in software by the AWT, unless they are an immediate response to an OS-level paint message.
This is useful, for example, if running under full-screen mode and better performance is desired, or if page-flipping is used as the buffer strategy.
So for example, if the game logic calls setText(String) on an in-game GUI JLabel, then inside the JLabel.setText method repaint is called, which posts an even to the EventQueue, which will occur on the EDT even though setText was called from the game loop thread, conflicting with the painting of that button in my game loop thread.
Stopping this is difficult, as basil said it requires 'interception' of the event on the EDT which is not easy. I thought it was impossible since no-one has shown how it is done without reflection hacks, but I'm open to being proved wrong. nsigma is the only person who has offered reasonable advice, and even then I wonder if it's possible.

You can do all that already!  To paint, you could use active rendering, or if you're running your game loop in the EDT you could control the default Swing paint mechanism.  For the other two, use Toolkit.getSystemEventQueue() to get access to the queue.  If you're running your game loop in the EDT, just pull events and dispatch (see component.dispatchEvent()).  Otherwise, push your own EventQueue implementation on top of the existing and override EventQueue.dispatchEvent() to filter / pass to your game thread.  The latter might have an issue if anything was using EventQueue.isDispatchThread() though.

nsigma at least understands the problem and offers some directions to the solution. The run-your-game-loop-on-the-EDT solution is obvious and isn't the solution I'm after which is painting the GUI in my own thread.
How do you push your own EventQueue? I note that there is Toolkit.getEventQueue but no Toolkit.setEventQueue()?
I would like to see your EDT-event interception idea work. As I said, no-one has demonstrated this being done that I have ever found.

Nuff of this. We all have our ill-informed moments. No need to 'gang up' on our beloved Keith. I'm sure lots of people found new information in this thread about the inner workings of Swing - we should focus on sharing such information instead of telling eachother how ill-informed we are, over and over and over. We don't need N similar corrections from N people quoting the same statement. It gets old rather quickly.
Thanks, it's nice to be beloved! I'll be the first person to admit that I'm wrong, but so far it seems that people either don't understand the problem or dismiss it as not being a problem.

I would like to treat the GUI like everything else in a game: with an update and a paint method. I thought that is what we would all want Huh

Quote
Like I've said several times now, this is not just a Swing thing. Almost every GUI library (including OpenGL, Android, JavaFX, libGDX, and JMonkeyEngine) uses this model. I promise that the people behind these libraries have put more thought into it than you or I.
If every GUI library has an EDT like Swing, I'm surprised. I think it's a design deficiency because it's inflexible. According to the principal of loose-coupling, Swing's event system, painting and logic should be separable, but clearly they aren't.

Quote
Edit: And like Cas says, none of this really matters. If you really think you need to go through all of this rigmarole with active rendering and threading in Swing: you're either wrong, or you should be using a different library that handles it for you.
On the whole I like the swing libary and it's what I know. If I could re-use it in my games I would. But the way it enforces everything to be done on the EDT is quite irritating. I will try libgdx's scene2d.ui, nifty or TWL for my next projects.

That tutorial guide gives no working examples, and even worse, it seems to indicate that active-rendering swing components from a non-EDT game loop thread in a thread safe way is impossible, since it says:
Quote
Don't put drawing code in the paint routine. You may never know when that routine may get called! Instead, use another method name, such as render(Graphics g), which can be called from the paint method when operating in windowed mode, or alternately called with its own graphics from the rendering loop.
It seems to indicate that a swing component's paint method can be called at any time from the EDT (with or without setIgnoreRepaint) and therefore you can't truly paint swing components in your own game loop thread.

By the way, it's great to be part of a forum where we can debate interesting topics like this.
6  Game Development / Game Mechanics / Re: Making GUIs on: 2015-03-03 06:02:42
As that article said:
Quote
...processes (threads) and monitors (locks) are duals. Well, yes, it's true. In some sense we are using the event thread to implement a global lock. We could invert things, and create a global lock that is equivalent to the event queue.

If there was more flexibility in the Swing API's threading model then I think it would be a better library which could be used in directly-rendered games without forcing us to do everything on the EDT. The EDT is an unnecessary and annoying aspect of the API which could have easily been done differently, such as using locks or letting the developer use their own game loop thread. However, the Swing API has no flexibility to do this.

As I said, I can't see why the Swing engineers couldn't:
  • Expose a hook to let us see the OS event queue in our game loop thread if we want so we can take the events we want to consume and make game logic updates
  • Let us call an update method on the Swing components with any relevant events for them given as an argument which would happen in our game loop thread,
  • Let us call paint on the Swing components from our game loop thread and repeat.

@KevinWorkman and @PrinceC. While I appreciate both of your input on the forum since your posts are often very insightful and entertaining, in this case it's disappointing to see you repeatedly dismiss me as 'not really understanding how threading works' while failing to answer my question, which is: show me how you can make Swing render in your own thread without the event dispatch thread (EDT).

If you can do it as easily as you say, I'd be very impressed. The code would be an important contribution to the community since the Swing library is well designed in general, we're all familiar with the API and it comes included in the jdk.

I've tried to make Swing run in a direct rendering game not rendered on the EDT, and so have many others including the swing-gl programmers, but we all failed in one way or another. The swing-gl programmers only make it work using reflection hacks to overcome the lack of flexibility in the Swing API.
In my multiplayer networked game SydneyEngine (http://www.java-gaming.org/topics/multiplayer-top-down-view-shooter/18019/view.html), I use Swing menus but was forced to use invokeAndWait(renderSwingMenus) to draw the user interface on the EDT, since the swing API forces it to be so.

the only thing that sun did not do well is to give us proper control over polling and flushing queues - which is done by the EDT for us.

What exactly do you want by "proper control" above what EventQueue or a custom subclass gives you (assuming you can re-appropriate the dispatch thread)?  Not that I don't agree with all of your second sentence!  Wink
I agree with basil. I would like to use the swing GUI without having to change my threading model, which I think is completely unnecessary for a GUI to impose. Imagine if every library insisted that its code run on a specific thread. There'd be invokeAndWait equivalents every time I tried to use any libraries' code, making quite a mess.
7  Game Development / Game Mechanics / Re: Making GUIs on: 2015-03-01 06:56:44
The closest thing that I could google which showed swing components being re-used, possibly in a direct rendering game, was this project:
https://code.google.com/p/swing-gl/
The problems I describe about the swing libraries being inflexible and not exposing hooks are made apparent in this statement by the swing-gl projects' authors:
Quote
Important: At the moment we use a nasty hack to make event system work: Set dispatcher field of Container class with reflection. This hack most probably won't work on non-SUN JVM's and will break in the future. However we beleive event system can also be made work with a custom Toolkit and a dummy Peer. Indeed we seek help from AWT/Swing gurus about this subject.
I think this shows that the Sun programmers did not make the Swing library with re-usability in mind, they have designed the swing library to be used on the event dispatch thread only. Which is not a bad thing for most people and probably a sensible design choice. But it's a pity for us game programmers who would like to use the swing components in a direct-rendered game, rendered in our own thread.
8  Game Development / Game Mechanics / Re: Making GUIs on: 2015-03-01 00:05:04
Lol, well I appreciate your direct answers, but how would you achieve those things? I've never heard of anyone doing it, because I presume that it's impossible.

If it was possible, why does everyone choose to reinvent the wheel by making more GUI libraries rather than leveraging the existing Swing library? I know that swing uses java2d rather than opengl, but graphics2D can be over-ridden with calls to openGL so that can't be the problem.
9  Game Development / Game Mechanics / Re: Making GUIs on: 2015-02-28 01:25:57
It seems like it wasn't thought out very well by the Sun swing engineers.

This is a pretty presumptuous statement. Can you name any other thread-safe gui libraries?

Recommended reading: https://weblogs.java.net/blog/kgh/archive/2004/10/multithreaded_t.html

Thanks for the link. Most widely used GUI libraries are 'heavyweight' since they use the operating system components rather than Swing which is lightweight, and has the opportunity to do things with more flexibility.

I like this quote at the end:
Quote
"processes and monitors are duals". Well, yes, it's true.
In some sense we are using the event thread to implement
a global lock. We could invert things, and create a global
lock that is equivalent to the event queue.

This is my major gripe with Swing. Swing takes sole control of the operating system (OS) event queue in its event dispatch thread (EDT), forcing us to do all of our work on the EDT or making us do messy invokeAndWait's all the time.
I can't see why the Swing engineers couldn't:
  • Expose a hook to let us see the OS event queue in our game loop thread so we can take the events we want to consume and make game logic updates
  • Call an update method on the Swing components with any relevant events for them given as an argument which would happen in our game loop thread,
  • Call paint on the Swing components from our game loop thread and repeat.

That way Swing components could be used in a 'direct-rendering' game loop thread, rather than the current requirement where everything to do with them must be done on the EDT.

You'll understand one day, probably when you start really understanding threading...

Cas Smiley

Don't be patronising. I understand threads reasonably well.
10  Game Development / Game Mechanics / Re: Making GUIs on: 2015-02-27 11:35:49
I can't really see anything good about the EDT. I don't see why painting, logic and event processing should be restricted to the same thread. It seems like it wasn't thought out very well by the Sun swing engineers. I remember when Java 1.4 was being released and the 'do everything on the EDT' rule was being promoted by Sun engineers, which was presented as a new best practice despite the fact that Swing had been around for years before and even the sun java tutorials at the time were calling Swing object code on non-EDT threads.

I persevered and used Swing in my own game loop thread anyway. But to my horror, some swing components trigger events in their own code which are processed on the EDT and then painting and logic threading problems arise between my game loop thread and the EDT.
11  Game Development / Game Mechanics / Re: Making GUIs on: 2015-02-27 09:49:04
Making GUI components is incredibly hard. Next time I do a project with a GUI I'll try to use someone else's code and save time.

I haven't used libgdx's scene2d.ui (https://github.com/libgdx/libgdx/wiki/Scene2d.ui) or TWL (http://twl.l33tlabs.org/) but I've heard they're both very good.

Another which was good but has since been abandoned is pulpcore (https://code.google.com/p/pulpcore/).
It's no longer maintained but has some good GUI component code that you could pilfer.

All of these projects are generously licensed as either apache 2 (libgdx) or BSD (TWL and pulpcore).

Last time I made a semi-complex GUI rendered in java2D I had to use Swing. But swing and javafx force you to use their own threading model. Everything must be done on the event dispatch thread rather than your game loop thread, which is quite irritating.
12  Java Game APIs & Engines / Java 2D / Re: VSync on: 2015-02-18 15:44:23
In java2d it isn't.

In openGL (LWJGL and JOGL) you can set vsync on and off using their API's.
13  Discussions / General Discussions / Re: What's your day job? on: 2015-02-18 15:39:10
...some teachers are only there to squeeze coauthored papers out of students...

Yes that's a particularly rotten thing that goes on. Typically the poor students that these researchers prey on are the international students from impoverished countries who are extraordinarily smart and hard working but would never complain lest it jeopardise their chances of obtaining or keeping their visa and job.

I've been teaching English in Seoul, Korea in a variety of forms for 21 years (which I suppose makes me incompetent at English). These days I run my own hot dog shop in central Seoul, teach a handful of one-on-one private English lessons at a nice hourly rate, and divide the rest of my time between hacking away on throw-away games & web apps and watching VOD movies with my wife.

Sounds like a pleasant life! I've heard that the highest paid teachers in the world are from South Korea, and that like most Asian countries, teachers are held in high regard like doctors and lawyers. The Chinese even have 'teachers' day' (https://en.wikipedia.org/wiki/Teachers%27_Day)
14  Discussions / General Discussions / Re: What's your day job? on: 2015-02-18 13:54:26
Interesting to hear everyone's stories and impressive careers.

I'm studying finance and economics, trying to find out why house prices are so high for my thesis. I also do teaching and I'm sure that some of my students think I'm incompetent, but hopefully they're a minority.

it does come at a slight cost and that is incompetent teachers.
Beats Texas. We have teachers that are incompetent AND psycho.

All teachers are incompetent Smiley
"Those can can, do. Those who can't, teach." - old proverb

I agree that many university teachers appear incompetent. But I'd like to share why. Teachers are not compensated based on their teaching, they are promoted according to their research output, and fired if they don't perform: publish or perish.

The root of the problem is that students choose universities based on the institutions' notoriety and ranking, which is based on their research output, which leads to hiring good researchers who typically find their teaching responsibilities a chore.
For example, the newest or worst-performing researchers are often tasked with running the large first year 101 courses. This is not because they're inspirational and well-prepared, it's punishment for being at the bottom of the pecking order. The best researchers with the most cachet have their choice of classes which is almost always the small, easy to organise subjects that take the shortest time to mark. The very best researchers usually buy out their teaching time using research grant money, so you will never even meet them as a student.

The teachers are not idiots, they're rationally responding to the incentive system they operate in which puts no value on teaching.
15  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-02-07 16:31:39
It's funny that the graph doesn't include Android which is the most recognised brand and has the biggest install-base.
Perhaps Android is not included because it doesn't use GNU's GPL'ed software. Though it is based on the linux kernel.
16  Discussions / Miscellaneous Topics / Re: Unit Testing: Waste Of Time? Discuss on: 2015-02-05 12:52:10
I've never used unit-testing before, but it sounds useful for those reasons jmguillemette mentioned.
Most of the bugs that I make for myself are due to threading, and apparently unit testing threading problems is very difficult:
http://stackoverflow.com/questions/12159/how-should-i-unit-test-threaded-code
17  Discussions / Miscellaneous Topics / Re: Java Certificates on: 2015-02-01 08:19:44
I did the java certification exam (twice!) just because i had no formal qualification and wanted to show on my resume that i was a serious programmer.
Unfortunately i failed the first time because it was harder than i thought!

I agree that if your name is on a big project then it's not necessary.
18  Discussions / General Discussions / Open source licensing of creative works on: 2015-01-31 07:30:07
When choosing an open-source license, I'm inclined to use the GPL 'copyleft' share-alike style license since it's the most restrictive, and gives me the option of putting a less restrictive license in the future if I want. Whereas if I release my work with a more permissive license such as BSD or the unlicense, then I will never be able to make it more restrictive if I want. I've lost the option.

What are your thoughts on this issue?

The reason why I ask is that I maintain a website for my students to answer questions relevant to the subjects that I teach:
http://www.fightfinance.com
Recently a new teacher took over one of my subjects. I'd like to let her continue using the tutorial questions and answers that I made.
It would be nice to see my work continue to be used after I lose interest in it.
However it would be upsetting if a textbook publisher poached all of my work and wrote a textbook based on the questions and charged students to buy it.
For this reason I'm inclined to use a creative commons attribution share-alike license, which is similar to GPL:
https://creativecommons.org/licenses/by-sa/4.0/

Some background for those who are not familiar with the broad families of licenses:
  • Unlicense/creative commons (CC) zero/public domain style licenses. Bitcoin uses the unlicense.
  • Apache/BSD/MIT/CC attribution style licenses. BSD unix obviously uses the BSD license.
  • Copyleft GPL/CC share-alike, and then copyright. Linux, GNU, Webkit browser (Chrome and Safari), Wikipedia, and Oracle Java (with class path exception) use the GPL license.

Here's some data on the prevalence of each license:
https://www.blackducksoftware.com/resources/data/top-20-open-source-licenses
http://blogs.the451group.com/opensource/files/gplusage.png

Altruistic programmers and authors choose the most permissive licenses which are the public domain or attribution BSD-style license.

Most open source projects use GPL which forces any improvements to the code base to be shared. Businesses dislike contributing to projects with this license since it nullifies any competitive advantage from their investment because they have to share their improvements with potential competitors.

For software that I want to make money from, of course I maintain copyright.
But so far I've made no money from any software! So I always end up open-sourcing my work after I realise that I won't be able to sell it because there are a million free and better alternatives or because I lose interest and then I slap a BSD style license on it.

Jimmy Wales founded Wikipedia, arguable the greatest open-source resource, and has now moved on from there to make private wiki sites for games and other things that he can make money from. That's quite an interesting switch.
http://en.wikipedia.org/wiki/Wikia
19  Discussions / General Discussions / Re: Schemes to teach the masses to code on: 2015-01-29 15:03:40
I personally had the impression for a long time that programming was this thing that only math geniuses could do. This wasn't aided at all by the fact that, in high school, while there was a computer programming class, being in the most advanced math track was seemingly a prerequisite for taking part.
That's funny, I often thought that math geniuses were disadvantaged when doing programming since equality in maths and assignment in programming use the same = symbol but are quite different ideas, consider 'y = y+2', which makes no sense in maths but is perfectly acceptable in programming.

...Fewer than one in thirty people will ever have any use for it, if that. Probably a lot less...
If you consider MS Excel to be programming, which it basically is, then more people than you think know how to program.
For example, most people working in the finance and insurance services industry would know how to do a VLOOKUP in MS Excel and that industry employs 1 in 25 workers in Australia:
http://www.abs.gov.au/ausstats/abs@.nsf/Lookup/by%20Subject/1301.0~2012~Main%20Features~Employment%20in%20Australian%20Industry~241
20  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-23 18:08:02
I made something similar for polygons (regions) rather than points which was just a simple 2D array of tiles. Would be interesting to see your algorithm working with overlapping regions too.
What do you plan to use your algorithm for?

Sounds like the good ol' Bin.
R-trees can be used for arbitrary shapes as well, both storage and queries, the two types of queries most suited to them is intersection/containment (given shape S, what objects in the tree intersect it?) and k-nearest neighbors.
http://en.wikipedia.org/wiki/R-tree

I'm entering a contest which requires fast spatial queries; I deemed R-trees the way to go.
Now to port it to C...  persecutioncomplex

Interesting topic. Thanks for the link to the bin, yes I made a crude version of a bin. It surprises me to see how far academics have studied geometric algorithms like this.
I notice on the wiki page that bins have similar characteristics to hashmaps. This must be an advantage of the bin over the tree since it makes queries O(1), assuming no collisions.
Trees on the other hand cannot go straight to the correct leaf, they have to climb through the branches from the trunk which is O(log(n)).
But the disadvantage of the bin is that data is often clustered and with each bin being the same size there will be some full bins and lots of empty bins wasting memory.
Is this a correct assessment?
21  Discussions / Miscellaneous Topics / Re: What I did today on: 2015-01-21 12:43:47
Been prototyping an R-tree implementation using fancy Sort-Tile-Recursive bulk loading, as detailed here.

Generated from random points, notice the nice, clustered, non-overlapping (leaves) packing:
...
Probably one of my favorite data structures.
Nice job. Looks great.
I found that caching objects in local groups can speed up 2D pathfinding and even rendering significantly. I made something similar for polygons (regions) rather than points which was just a simple 2D array of tiles. Would be interesting to see your algorithm working with overlapping regions too.
What do you plan to use your algorithm for?
22  Discussions / General Discussions / Re: Client/Server Library Discussion on: 2015-01-08 14:24:38
I used MINA and it works well but just figuring out how to send a byte array was very painful.

I haven't used Kryonet but peoples' feedback in the forum is very positive and fellow JGO'er Nate is the developer and he's very astute.

A similarly good API that you might consider is that made by Riven, https://code.google.com/p/pyronet/ which is very fast and low-level.

Some discussion of the API's and the origin of pyronet and kryonet can be found here:
http://www.java-gaming.org/topics/pyronet-lowlevel-nio-wrapper/20647/view.html

Cheers,
Keith
23  Discussions / General Discussions / Re: 2015 Game Development Goals on: 2015-01-01 09:34:53
I recently discovered that this will require me to learn C which I'm quite excited and scared about.

You don't necessary have to know C/C++ to learn OpenGL, though some guides may require you to understand the basic syntax.
- Jev

I've read that openCL computation kernels are programmed in C99. From wikipedia: http://en.wikipedia.org/wiki/OpenCL#OpenCL_C_language
Quote
The programming language used to write computation kernels is called OpenCL C and is based on C99

As are openGL shaders. From wikipedia: http://en.wikipedia.org/wiki/OpenGL_Shading_Language
Quote
OpenGL Shading Language (abbreviated: GLSL or GLslang), is a high-level shading language based on the syntax of the C programming language.

Cheers,
Keith
24  Discussions / General Discussions / Re: 2015 Game Development Goals on: 2015-01-01 05:23:51
Over 2014 I was happy to learn novice-level html, javascript, SQL, linux and tomcat java enterprise edition and java server pages. Game-wise I made little progress but that's fine, I think these broad web development related skills will come in handy for games eventually. 

For 2015 I plan to learn about openCL and openGL. I recently discovered that this will require me to learn C which I'm quite excited and scared about.

It's nice to see so many new folk at JGO, and the older people still contributing interesting insights. Happy new year everyone  Smiley
25  Games Center / WIP games, tools & toy projects / Re: Defiance - An open-source multiplayer 2D shooter game in Java. on: 2014-12-31 01:40:42
Perhaps it's because one of the bots picked up speed shoes?!

GreenLantern made lots of awesome improvements to the game play. My favourites are the tranquiliser gun, rocket launcher, grenades and the trash-talking bots.

26  Games Center / Contests / Re: TAFSJ - The Actually Finish Something Jam on: 2014-12-23 11:23:39
Here is progress for today(warning: 21.9mb gif; click here for still image):
To be continued next week!

Great soft shadows, nice work!
27  Discussions / Miscellaneous Topics / Re: Markus bought a new house on: 2014-12-20 03:18:44
I couldn't live happily in a house like that - too much excess!

Me too! But does it say in the video that he'll live in it rather than rent?
He has to invest his money in something. Buying a big house isn't a bad investment, especially if he rents it out. It's better than blowing cash on a fancy car that just loses money.
The US real estate market hasn't fully recovered from it's big slump in the financial crisis, especially in LA, so I think he's made a good investment:
https://research.stlouisfed.org/fred2/series/LXXRSA


Some religions say that righteous people should donate 10% of their salary to charity (and Christians say that you should save another 10% for hard times in the future).
I'm sure Markus has given some money to charity, and probably gets hassled to every day, but he has no obligation.
28  Discussions / Miscellaneous Topics / Re: Markus bought a new house on: 2014-12-19 11:41:12
Incredible house. Markus is a hero.
It does look like a suitable place for minecraft HQ with the blocky architecture and flat lines everywhere  Cheesy
I still hope that one day I'll make it big like him.

As an aside, I wonder if he bought the house to live in or as an investment that he'll rent?
I'm doing research on house prices for my phd thesis. Average gross rental yields in Australia are 3.8%, which means that his $70m house should cost $2.66m per year to rent. However most high-end property rents for much less.
This indicates that buyers of high-end property place a premium on ownership and the benefits of not having a landlord. They also hope for high capital gains to make up for low rental yields.
29  Discussions / General Discussions / Re: Educational Game Ideas (for comp) on: 2014-12-19 11:22:17
Your chemistry idea is awesome, sounds like crafting which is all the rage.
30  Games Center / Contests / Re: End of 4K. Thanks all! on: 2014-11-30 03:01:40
I'm wondering what the greener pastures are? HTML5/WebGL/javascript as SimonH suggests?

I'm also moving my interests to other pastures.

Would it be heresy to suggest an HTML5 contest instead? I love java dearly but we have to be pragmatic.

Despite never participating i also thought it was a fantastic contest and enjoyed playing the games and seeing the horror and genius of the code.
Pages: [1] 2 3 ... 54
 
theagentd (9 views)
2015-03-27 23:08:20

wxwsk8er (52 views)
2015-03-20 15:39:46

Fairy Tailz (43 views)
2015-03-15 21:52:20

Olo (28 views)
2015-03-13 17:51:59

Olo (30 views)
2015-03-13 17:50:51

Olo (35 views)
2015-03-13 17:50:16

Olo (41 views)
2015-03-13 17:47:07

ClaasJG (40 views)
2015-03-10 11:36:42

ClaasJG (39 views)
2015-03-10 11:33:01

Pippogeek (47 views)
2015-03-05 14:36:23
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!