Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (756)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
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
1  Discussions / General Discussions / Re: Why java over other languages? on: 2013-02-06 23:45:29
I believe lambdas were going to be in the original java, but did not make it due to time constraints.

I think when we get used to them, they will be a good thing, removing unnecessary verbosity.

As I understand it will open other possibilities such as a java version of the c sharp RX ( which is some cool stuff.

2  Discussions / General Discussions / Re: Model-View-Controller (MVC) in Games on: 2013-01-31 21:22:31
to follow up, the role of the Controller is to interpret events from the ui and interpret them into the language model.

It isn't a place to put 'control logic' which is pretty meaningless.

Anyway, I'm glad your solution works.
3  Discussions / General Discussions / Re: Why java over other languages? on: 2013-01-31 21:16:17
great tools
simple (got less simple after generic wildcards)
established - large amount of tools & libraries that are mostly free.
familiar syntax, lakes it easy to learn.
You can run the same code on various problems.
It changes slowly (perhaps also a negative.). But IMO compared to micrsoft projects they change their mind all the time. e.g. bye bye winforms, bye byesilverlight.

Java hits a pretty sweet spot as a general programming language.

On the negative side, it's suffered from chronic underinvestment, particularly on the desktop.
it's overly verbose too.

It's interesting to see what comes next, will existing languages handle the proliferation better (e.g by adding functional constructs), or whether the 'more' functional languages win out.
Interesting times1

4  Discussions / General Discussions / Re: Model-View-Controller (MVC) in Games on: 2013-01-23 00:26:13
"Controller : the behavior of a model, modifies the state of an object"

In my opion, this is one of  themost common falicies of  MVC. The role of the controller is actaly quiet specific, although very badly name. It'S roles is to intepret user gestures from the View and interpret them into something the model can undertsand.

The model should contains not only the state but the behaviour of the model. Otherwise you get an anemic domain model h

Which ican be ok, but misses out the OO goodness. Also pushing more functonility into your model makes it easer to write unit tests - the model is the most easily tested.

5  Discussions / Miscellaneous Topics / Re: Is programming as a job boring? on: 2013-01-06 18:14:03
Most people find their jobs boring. Not everyone can be astronaughts or lion tamers.

I programmed before school age. I feel very lucky to now get paid for it. There is still the thrill when you hit 'go' and the machine does stuff.

Saying that, there are boring parts to the job, but meh, that's life.
6  Discussions / General Discussions / Re: The hidden cost of C++ on: 2012-09-20 16:07:41
probably right - ignore me!
7  Discussions / General Discussions / Re: The hidden cost of C++ on: 2012-09-20 15:02:32
Like with String magic overload of +, the mathematical operators could just magically work on Double, Long, AtomicLong, Integer etc. No need to declare anything at the Number level.

Also the compiler could be clever enough to use primitives to avoid the boxing overhead and aid performance. Again magic, but there already is magic hardcoded stuff like this in the jvm.
8  Discussions / General Discussions / Re: The hidden cost of C++ on: 2012-09-20 14:09:35
The maths syntax is definitely more familiar and easier to understand. Whether the java-like syntax is sufficient is dependent on how much maths you are doing I guess.

Could this not be like operator overloading for Strings in java? ie. baked into the language for numbers but not open for general (mis)use. Just a thought *strokes virtual beard*
9  Discussions / Miscellaneous Topics / Re: Things you disagree with in the java language on: 2012-08-31 15:12:30
The rubbish choices for default access modifiers. Fields should default to private, methods to public.

The general verbosity of java sucks, e.g. when dealing with classes with a single method, e.g. ActionListeners, Runnables, Callables etc. This will hopefully get better in Java 8 with lambdas.

Wildcards in generics suck, or maybe I suck at them.

Some of the APIs suck, like Date/Calendar, URL/URI and the decision to bundle so much stuff in the standard distribution (CORBA anyone?). Hopefully remediated in Jigsaw in 8 or 9.

Still Java is awesome. Going back to c++ again feels like going in a timewarp.
10  Java Game APIs & Engines / Engines, Libraries and Tools / Re: The Java Rabbit Engine - a 2D Game Engine written with LWJGL on: 2012-08-28 11:52:55
It seemed simpler to be able to say

than something like
if(this.getParentGame().getInput(Input.KEYBOARD).getState(Keyboard.KEY_X) == KeyState.KEY_DOWN)...

which seemed to me to be the logical extension of not using static classes.

Not really a fair comparison. A fairer version of 2) would be :

if (getParentGame().getKeyboardHandler().isKeyDown(Keyboard.KEY_X))...

another alternative would be to 'push' the keyboard handler to the client, rather than the getParentGame().getKeyboardHandler() 'pull'. Which would give you client code of :
if (keyboardHandler.isKeyDown(Keyboard.KEY_X))...

The main benefits of an approach like this are :
1 Unit testing is easier - you can inject in different Test Doubles
2 Polymorphism. You could have different implementations of these classes. This could make your code more flexible.

The main cost being the extra overhead & complexity. I would say that this is quite small but definitely non-zero.


11  Discussions / General Discussions / Re: Odd and original game-design ideas on: 2012-07-16 14:30:12
Higgs-Boson. You play an elementary particle and have to avoid detection by CERN-type people to prevent them blowing up the World. Also involves some time travel mechanic.
12  Discussions / General Discussions / Re: Odd and original game-design ideas on: 2012-07-16 13:37:08
Mobile RPG. Uses the geolocation on your phone. Quests can be assigned to actual physical locations . Quests can blend real and imaginary adventuring in some way - some kind of treasure hunt/clue solving using the actual environment.
Players can form groups literally with other players around them.

or something like that.

I guess that probably isn't original....
13  Game Development / Game Play & Game Design / Re: Generics, interfaces and awkward dependancies on: 2011-12-31 00:11:26
I would also add that IMHO beyond trivial collection uses, generics introduce more complication than they remove.
14  Game Development / Game Play & Game Design / Re: Generics, interfaces and awkward dependancies on: 2011-12-31 00:10:13
Rather than having IImage implement Resource, you could use composition instead.
class ImageResource implements Resource {

  private IImage image;

  public IImage getImage() { return image; }


then you can write,

ResourceHandle<ImageResource> handle = resources.get(“icon.image”);
ImageResource imageResource = handle.get();
IImage image = imageResource.getImage();

15  Discussions / General Discussions / Re: Things I'd like to see in the language on: 2011-11-17 13:08:45
No primitives - converting to primitives should be a compiler problem

Classes default to public, instance variables private and methods public.

switch on enums should handle nulls

checked exceptions should be removed

stop stuffing more stuff in the class libraries

16  Discussions / Miscellaneous Topics / Re: I'm Married on: 2010-07-01 08:44:11
Called and cold are different in British English too.  Huh
17  Discussions / General Discussions / Re: Replacements for xstream? on: 2010-06-23 09:02:41
You could use java.beans.XMLEncoder and XMLDecoder which are in the standard jre
18  Discussions / General Discussions / Re: Java 7 to get Closures! on: 2009-12-24 14:43:05
My personal take on this, is that the mulitprocessor revolution is coming, or has come. Unless we find some other solution, machines many many processors will be the norm. 2 is the norm now, extrapolating with Moore's law we hit > 200 processors before 2020.

*If* this does happen, our current programming methods with regards to concurrency will not scale. A solution will be found and accepted to this. Currently it seems to be looking like the adaption of ideas from functional programming although there are other ideas abound such as transactional memory. Whatever it is, it will take the headache out of multithreaded programming, either by making it difficult to do unsound things or providing lots of scaffolding to make it easy to do the write thing.

Where would this leave Java? Well there is still going to be huge investment in java lying about. As we've seen with COBOL, it's not going away anytime soon, even if new software will rarely choose it. I see the addition of closures as enhancing the ability of these programs to harness the power of multiprocessing, maybe in just focused performance critical sections. This would allow these programs to live and breathe a lot longer.

I totally understand the problems of bolting on features to the language. Generics are a case in point - I think we can all appreciate the good and the bad of them.

So, there's no easy answer. I think for me, maybe it's too early. Servers with massive numbers of processors are not yet the norm and it even remains to be seen whether they will be. Maybe we will work out another solution to the problem. Maybe it should be java 8?

Happy Christmas,
19  Discussions / Community & Volunteer Projects / Re: Community Project Mark 562 on: 2009-01-09 17:14:08
anything we do should highlight Java's particular strengths as a game platform. 

Crossplatform-ness? A game you can play on PC, MAC, Linux, Phone etc
20  Game Development / Game Play & Game Design / Modelling track in top down racer on: 2009-01-06 08:56:54

I'm starting on a top-down racer in the style of micro machines, although using a more traditional "grand-prix" style track.

I am stumbling on how to represent the tracks.

I'm trying to use Slick (1st time) and my first stab involved trying to create a shape that represented the tracks geometry. The idea being that I could use the shape to test whether the car is on the track.
However Slicks polygons don't seem to support having holes in the middle - which all tracks will - consider a simple loop.

So a) is this a good approach, b) is Slick a good choice and c) any other ideas/direction.

thanks in advance for any help,
cheers, Don.
21  Game Development / Game Mechanics / Physics library for top-down racer on: 2009-01-05 11:04:29

I'm thinking of writing a top-down racer in the style of micro-machines. I was thinking of using a physics library to help handle things like drag, & collisions and the like. Is this a good plan?

If so what library? Is Phys2d suitable? I know it is 2D like my game however all the demos seem to assume down the screen is down (as opposed to in my case, into the screen).
Any other libraries worth considering?

22  Games Center / 4K Game Competition - 2009 / Re: World Rally Driver 4K on: 2009-01-02 17:06:09
Hactually me from the UK, playing through a US proxy. Great game. How'd you do the physics?
23  Java Game APIs & Engines / Tools Discussion / Re: Code generation tool / language suggestions on: 2008-05-14 08:09:52
Use a templating engine like Freemarker? or Velocity?
I've used Freemarker before with good outcomes.
24  Discussions / General Discussions / Re: How to meld libraries together in a clever way? on: 2007-11-29 13:50:00

In general I would not write my own serialization library because it is reinventing the wheel.

It's difficult to give more than that as it is not obvious what all the requirements are.

You could have a look though at XStream, which serializes objects to XML. You can provide bespoke serialization via converters. It is very good.

thanks, D.
25  Discussions / General Discussions / Re: How to meld libraries together in a clever way? on: 2007-11-28 14:24:28
This is what the adapter pattern is for (

This is the same as blah's point c.
26  Discussions / General Discussions / Re: Alternative Java-based languages on: 2007-11-12 10:06:04
The thing that normally catches me out is NPEs. So I'd really rather like a "not null" modifier for variable declarations. Eclipse already goes some way to detecting that something may be null when referenced but I want to be able to declare that at the interface level.

Intellij has a "not null" and nullable annotation which work well.

Although generally I try and use NullObjects and avoid using null as much as possible. This is particularly true when returning collections or strings. It's rare that there is a semantic difference between returning a null and an empty collection or string, so I like to avoid the null and prevent the possible NPE.



27  Game Development / Performance Tuning / Re: Fully utilising Multi cores/Multi cpus? on: 2007-10-26 08:30:58
each thread has a pool of objects. This pool is represented by a linked list.

in the main logic loop of each thread:

A Thread grabs task from task queue
same thread calls a "dowork" method on the task.
Task requests an object from the pool and uses it internally.

I'm envisaging a different algorithm.

For each task in the queue, create a class that implements Callable, takes a task and calls dowork in it's call method.
Create an ExecutorService with the amount of threads you want (e.g Executors.newFixedThreadPool() or cachedThreadPool())
Submit all the Callables to the service via invokeAll


The executor service handles the rest for you, monitoring the queue of tasks, handing them out to idle threads, and retasking threads when they have finished.

thanks, D.
28  Game Development / Performance Tuning / Re: Fully utilising Multi cores/Multi cpus? on: 2007-10-25 14:37:11
Thread.currentThread() gives you a handle to the current. Not sure why you would want that though.
29  Game Development / Performance Tuning / Re: Fully utilising Multi cores/Multi cpus? on: 2007-10-25 08:27:39
NB. the stack based approach is basically done for you in the 1.5 concurrency package.

ExecutorService  executorService = Executors.newFixedThreadPool(1000)

30  Game Development / Performance Tuning / Re: Fully utilising Multi cores/Multi cpus? on: 2007-10-24 08:40:27
The more processors you have the less likely you'll max them all out. That's inevitable.
You might want to try having more threads than processors, say twice or three times as much and see what the result is. Generally having more threads will increase processor utilization and benefit performance until the overhead from synchronization and thread creation counterbalances that.

Pages: [1] 2 3
DesertCoockie (56 views)
2018-05-13 18:23:11

nelsongames (88 views)
2018-04-24 18:15:36

nelsongames (78 views)
2018-04-24 18:14:32

ivj94 (763 views)
2018-03-24 14:47:39

ivj94 (95 views)
2018-03-24 14:46:31

ivj94 (647 views)
2018-03-24 14:43:53

Solater (108 views)
2018-03-17 05:04:08

nelsongames (189 views)
2018-03-05 17:56:34

Gornova (430 views)
2018-03-02 22:15:33

buddyBro (1090 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

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