Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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 ... 10
1  Discussions / General Discussions / Re: GWT / ForPlay on: 2011-06-17 21:42:51
It isn't really comparable to the power of real Java and OpenGL. It may be useful for relatively simple games, and plenty of those can be great fun (see NES, SNES).

IMO, writing Java that compiles to JavaScript isn't a good idea in general. Good for them for getting something to work, but I personally don't want so much "magic" under the covers.

There are a lot of real, working examples that demonstrate that using GWT is a good idea. You're certainly entitled to your own personal preferences but saying that it's a bad idea, because you don't like it, isn't very compelling.

Disclaimer: I'm a member of the GWT team, and these are my own personal views - not Google's.
2  Game Development / Performance Tuning / Re: Benchmark Applet, browse and sort results of others! on: 2009-04-21 15:39:46
Sooner or later I will use that. By now, I don't want to learn all that new stuff.
I'm not using JSP/Servlets but my own server via sockets and there is already the stuff for simple multiplayer games and user management implemented.

Ok. If you're running your own socket server, then some re-work would certainly be required. I had visited your site, and it was not obvious to me that it was backed by anything like that. Smiley

Quote
The only simple example for Java for Google App Engine I could find was a guestbook via Servlets, not very interesting for me. I will wait some more time and decide later if Google could suit my needs (I don't want to just store scores).

LOL. We're certainly capable of doing more than storing your high scores. Smiley

The kinds of changes you'd need to port to App Engine would be adapting your client-server protocol to run over http. Instead of starting up your own single server process, you'd create a servlet entry-point that could serve your client requests. App Engine would automatically spin it up on as many JVMs as would be needed to keep up with your clients.

App Engine is designed to make applications transparently scale, and we can't do that for you if you do things like directly listen on sockets, etc...

Let me know if you change your mind and have any questions.

</shameless_plug>

3  Game Development / Performance Tuning / Re: Benchmark Applet, browse and sort results of others! on: 2009-04-21 05:40:46
Atm 25 euros per month but I can quit next month, what I will definitely do.
I'm not really interested in all that server administration/Linux thingy, I'm happy when able to run my WebAdmin and start my Java stuff without problems.  Wink
I can't help but plug Java for Google App Engine. No administration headache. Free for the first few million page views a month. Yada yada.

http://googleappengine.blogspot.com/2009/04/seriously-this-time-new-language-on-app.html
4  Game Development / Networking & Multiplayer / Re: Google App Engine on: 2009-04-10 07:00:07
Looks like rreyelts is working at google now. I wonder how much he's been pushing to get Java support added. Smiley

* Orangy Tang waves
* rreyelts waves back

Yep, that'd be me on that blog post. If you have any questions about Google App Engine for Java, ask away. Alternatively, you can post in our group.
5  Game Development / Performance Tuning / Re: Code optimization article on: 2007-05-15 20:12:35
The 'else' removal technique really depends upon the code in the if and else blocks being very small and very easy to undo. It also depends upon a branch prediction miss being likely and very expensive. You're best worrying about branch prediction within tight for loops. Even in that case, the processor's probably only going to mis-predict a few times out of all of the loop iterations. Also, you're increasing your code size, working against the instruction cache.

In general, I think we're moving away from the trend of branch prediction getting costlier, because we're moving more towards parallel programming - larger numbers of simpler cores combined with effective use of SIMD instructions. Cas made a statement a couple of years back about multi-threaded pipelines being pointless, but the reality is that anyone buying a new machine now is guaranteed to be getting at least a dual core setup, and in less than a year it's going to be quad core.
6  Game Development / Performance Tuning / Re: Quiet in here these days... on: 2007-02-12 23:42:51
Some other operations maybe to difficult for this method, requiring new scalar intrinsic to be defined.  The scalar intrinsic would then be vectorized.

Neat stuff. I'm a little confused what you mean by this last part. By "instrinsic", do you mean a new VM instruction?
7  Game Development / Performance Tuning / Re: how much memory does an instance of a class really take? on: 2006-11-21 20:35:14
So, in my 32bit system, each object had an overhead of 8 bytes...

Most JVMs that I know of have a 2-word object header used for pointers to class metadata, synchronization bits, etc... 2 words on a 32-bit system = 8 bytes. Practically speaking, it's extremely memory inefficient to store large data sets of small objects as full-blown Java objects. Generally, you'll see significant performance impacts due to GC, too.
8  Java Game APIs & Engines / Tools Discussion / Re: Stub API generator? on: 2006-10-31 19:17:38
That isn't what I'm after.

I want a tool to generate a stub implementation of a given library, in other words a 'do-nothing' implementation.
And for the record the 'public interface' of a library is all the libraries public classes, interfaces, methods & members - not just the classes that fulfill the java definition of an 'interface'.

I created one of these about six years ago or so. The concept was that we needed an API for people to compile against, while keeping the actual runtime encrypted. At the time, I just used reflection and generated source code. I don't remember it taking more than a day to go from concept to implementation, though I do remember there being a couple of sticky issues. Off the top of my head, you have to be concerned about package members if people can place classes in the same package, or protected members if people can subclass your classes. You also need to make sure all of your constants have their correct values.
9  Game Development / Performance Tuning / Re: Tiny object performance overhead on: 2006-09-25 19:19:00
However object pooling time is quite consistent and also does not hurt scalability on many CPUs.

It depends on what your pools look like. If they're MT-safe, that definitely hurts scalability. For example, Java heaps are tuned to be extremely fast for multi-threaded allocations. (They blow the bog-standard C++ allocators out of the water). They can do all sorts of dirty tricks like segmenting different areas of heap address space per thread to reduce contention. There are tricks you can do with object pools too (like creating threadlocal pools, but the cost of a threadlocal lookup isn't zero), but they aren't trivial and do involve other kinds of overhead.

Most people can just forget about allocation and pooling unless they're creating millions of objects / second, or using a class that has heavyweight initialization (e.g. database connections).
10  Game Development / Performance Tuning / Re: Tiny object performance overhead on: 2006-09-25 19:07:33
Off the top of my head, it is clearly impossible for *object creation* to be that cheap - you have to initialise lots of data in memory (think how much data an object actually contains under the hood if it contains merely a simple float)

Think about it in terms of allocation versus initialization blah^3. Allocation is reserving address space for the object, and initialization is assigning actual values to fields, etc... So, allocation can indeed be as fast as a pointer bump.

I've done this in C++ code where I've written custom allocators for a routine. The routine allocates some millions of nodes over it's relatively short (1 second) execution time. The allocator has a pre-allocated memory pool. When it needs to allocate a node, it simply bumps a pointer. No nodes get deallocated until the very end of the routine, at which point they are all "deallocated" by simply resetting the pointer to the top of the pool. This reduced allocation/deallocation times to just about nil.

You can do something similar in Java by creating an object pool, but those objects are still something that the gc is aware of.
11  Game Development / Performance Tuning / Re: Examples of high JNI performance overhead? on: 2006-08-21 14:44:37
In general, when I'm looking for speed involving JNI, I cross the Java/native boundary using DirectByteBuffers. When i'm looking for convenience, I just use Jace to proxy my objects back and forth. If I had any advice for speeding up JNI access, it would be to sort out all the performance issues regarding usage of Buffers.

1) Fix the problems with polymorphism. I seem to remember that there were significant performance issues once you use more than one type of Buffer. The advice was something along the lines of "only use 1 Buffer type in your app", and "cast to MappedByteBuffer". In any case, it needs to be fixed.

2) Fix bound checks or w/e it is that slows down Buffer accesses. This board has several little benchmarks laying around the site which show that people can get significant speedups using sun.misc.Unsafe in comparison to going through the Buffer interface.

3) Fix access to heterogenous data. Rather than having some homogeneous array of bytes, floats, or ints, my data is usually structural in nature. For example,

struct {
  byte b1;
  byte b2;
  int i1;
  int i2;
  float f1;
  float f2;
  byte[] bytes;
}

This doesn't lend itself well to optimized access, because you typically end up using ByteBuffer, which doesn't perform as well as simple mem accesses should.
12  Game Development / Performance Tuning / Re: Measuring disk io performance on: 2006-07-13 19:12:51
It was in the perfmon help.
13  Game Development / Performance Tuning / Re: Measuring disk io performance on: 2006-07-13 18:29:00
For format A the inner loop bascially consists of a read in x distinct files.
For format B this is x reads in a single file and all the reads are in consecutive parts of that file.

If you're reading from different files, you'll definitely induce a nice seek from each different file you read from. (Pretty hardware with command queueing and what not can alleviate this). For some caching software I wrote, I actually considered writing a queueing system so that I/O requests physically near each other would be processed together.

Quote
but I would like to be able to measure this. In other words I would like to get a breakdown of the read operations showing %seeking and %actual reading. Don't know if this is possible in the first place though...

If you're running under Windows, you can use perfmon. This section from the doc seems relevant:

"You can also check the value of Avg. Disk Bytes/Transfer. A value greater than 20 KB indicates that the disk drive is generally performing well; low values result if an application is accessing a disk inefficiently. For example, applications that access a disk at random raise Avg. Disk sec/Transfer times because random transfers require increased seek time."
14  Game Development / Performance Tuning / Re: Measuring disk io performance on: 2006-07-13 16:38:29
After running this test with the two formats I get the following results:
Format A: ~554ms per tile
Format B: ~106ms per tile

I don't exactly understand how your tiles correspond to your grid height, grid width, and level, but my guess is that you're doing a lot less physical seeking in your second version. A full seek is gonna cost you a lot (10ms maybe?), so you don't want to be performing hundreds of them.

My suggestion is to organize your data on disk so as to minimize your seeks during load time.. You can transfer a heck of a lot of data very fast, if you're just doing block i/o. It's the same principles as file fragmentation. Fragmented files can really screw you up badly, because the disk will have to do a lot more seeking for what should have been just block transfers.
15  Discussions / Miscellaneous Topics / Re: Java PSX emulator on: 2006-06-01 19:59:35
Hi Guys,

I actually attended the session at JavaOne where Lombardi talked through and demonstrated their PSX emulator. It was pretty cool stuff. I learned some nifty tricks I hadn't thought of - like using a custom ClassLoader to allow you to generate static references to code that doesn't exist yet (i.e. code that you have yet to dynamically recompile). I talked a little bit to the presenter afterwards, and he was a pretty cool guy. We talked some about skipping BCEL/ASM to generate bytecode binaries directly from templates.

Anyway, I'll look around and see if I can find that dynarec code. IIRC, there were a few bugs in it, but it was generating code correctly for Ms. Pac Man and Galaga.
16  Game Development / Performance Tuning / Re: jni memory allocation problems on: 2006-05-31 17:02:48
You can also set the address space for java.exe to be 3G instead of 2G.

I wrote about this in my blog at http://jroller.com/page/rreyelts/20040914

Basically, you won't be able to grow your Java heap over 1.3G or so, because it needs to allocate its heap contiguously, but you can use the extra 1G of address space for your native code - which is exactly the problem you're trying to solve here.
17  Java Game APIs & Engines / Java 2D / Re: What does sun.awt.ScreenUpdater do? on: 2006-03-28 13:00:25
Clever code and algorithms is what makes the world go round. Seriously, almost anything of any interest has cleverness associated with it. The beauty in cleverness is hiding it behind simple and elegant interfaces.

If you're writing CRUD business apps, then ignore everything I just said.
18  Game Development / Performance Tuning / Re: Why mapped objects (a.k.a structs) aren't the ultimate (performance) solutio on: 2006-03-26 17:40:19
Quote
In case of intel CPUs, this means LITTLE_ENDIAN, but Java types are all BIG_ENDIAN.

Java "the language" is big endian - Java "the virtual machine" is not.

That is, to say, Java types look and feel as if they are big endian to you (the programmer), but they are stored in your machine's memory in the native byte order of your machine. If that were not the case, I couldn't even begin to imagine the kinds of performance hits Java would suffer when performing even the simplest of operations.

Language features (like bitwise-operators) that make Java feel like it is big endian, are just there to help you write portable code.
19  Game Development / Performance Tuning / Re: Why mapped objects (a.k.a structs) aren't the ultimate (performance) solutio on: 2006-03-20 18:24:57
Being able to set the Byte Order is important... being able to map to Direct Byte Buffers so the C code can have efficient access to the data is also significant.

Specifically for interacting with huge gobs of C++ data. Passing the data through a DirectByteBuffer with a strongly typed flyweight facade means great speed with very little abstraction penalty.
20  Game Development / Performance Tuning / Re: Why mapped objects (a.k.a structs) aren't the ultimate (performance) solutio on: 2006-03-20 18:16:28
On the other hand, still nobody has told me about a situation in real app, where copying the data to a buffer would be the bottleneck. so there should no hurry, even for this type of optimization.

I wrote a GIS mapping engine from scratch. To make it perform fast, I stored the mapping data directly in memory. We're talking about hundreds of millions of objects worth of data. First of all, I can't even hold those many objects in a 32-bit JVM, because their headers alone, would cost me a gigabyte of memory. Second, copying that data around just to use it would be pure insanity. Third, having that many objects in memory thrashes the gc every time it goes to do a full scan.

So, to get around these problems, I load the data into DirectByteBuffers which I wrap with flyweight classes. I think structs is a terrible name for this. It'd be better off being called FlyweightView or some such thing. The whole point around this, is that you're avoiding the creation of huge numbers of stateful objects. Flyweight is a well known and understood name for this.

If I weren't bothered with a bajillion other things right now, I would just write the bytecode transformations for it so there would be an end to the discussion. /sigh
21  Game Development / Performance Tuning / Re: SSE / SSE2 - SIMD wrapper on: 2006-02-10 16:39:10
Raghar, your idea is clean, and above all, it's safe (from sandbox POV) but either it requires a change in the JIT and in the class-spec, or dynamic compilation of SSE code done by the app (requires a C compiler!). Those are not going to happen in the next few years, while the alternative is so incredibly trival, as AndersDahlberg showed us.

Actually, I think I'm going to have a go at making a SIMD DSL for Java. It shouldn't require a pre-compiler, but it would obviously require you to load a native library. It would probably have an optional post-compilation step that would allow you to verify that your SIMD program was syntactically correct, and probably create a simpler/quicker representation of the program for runtime. I'll probably do something trivial just to demonstrate the interface/model is workable.

22  Game Development / Performance Tuning / Re: which collection to use? on: 2006-02-02 15:49:10
Quote
Thats *really* your bottleneck?  You've proved this with a profiler??
I would be astonished if the rest of your code was so beautifully tight that this was significant.
I wrote a spatial index where autoboxing was, at one point in time, a bottleneck in the index. (About ~50 million objects in the index, with query times running in the low milliseconds). I ended up creating my own special "GeometrySet" interface which enabled me to avoid most boxing/autoboxing at the expense of more complexity.

Of course, I wouldn't randomly go around getting rid of all boxing, but it can be a bottleneck in tight loops that deal with _many_ objects.
23  Game Development / Performance Tuning / Re: future jni optimisations on: 2005-05-09 17:28:45
Quote
If you know an e book variant of Computer Organization and Design it might be interested to look at it
Sorry - I'm not aware of one. If you live near me, I can loan you my copy. :)

Quote
but I don't think propagation of a wrong, non intuitive term is reasonable action
LOL.

God bless,
-Toby
24  Game Development / Performance Tuning / Re: future jni optimisations on: 2005-05-09 14:51:54
Quote
Thanx. I'm often using either EIP, or words "execution point", for this.  It's handy especially if you have multiple of them.

IIRC, EIP stands for extended instruction pointer - it's just Intel's specific register naming for the x(3)86. My understanding is that PC/program counter is the prevalent term in the industry. If you haven't read it already, you might want to take a look at "Computer Organization and Design" (Patterson and Hennessy).

(http://www.amazon.com/exec/obidos/tg/detail/-/1558606041/ref=pd_sim_b_4/002-4303307-4332012?%5Fencoding=UTF8&v=glance)

Even if you have a lot of industry experience, I think this book can help you solidify a lot of your understanding of computer architecture and give you a vocabulary you can share with others. (There's also "Computer Architecture: A Quantitative Approach", for more detailed study).

God bless,
-Toby Reyelts
25  Game Development / Performance Tuning / Re: floating performance on: 2005-03-15 12:43:00
Quote
I'm not saying the JIT compiler would become faster if it was open sourced (maybe it would if IBM or the JRockit team helped out), but I'm pretty sure some parts of the JRE code would improve (less bugs and better performance).

I think the "open-source issue" is a red herring, here. For all useful purposes, the JRE is already open-source. If you're interested in seeing bugs gets fixed in the JRE, or certain performance improvements being made, submit the source code changes to Sun. For example, I submitted source code fixes for performance problems in URLDecoder, and they are now in the 1.5 JRE, almost verbatim.

God bless,
-Toby Reyelts
26  Game Development / Performance Tuning / Re: floating performance on: 2005-03-07 15:50:37
Quote
We're working on moving to VC 2003 from vc6 for mustang. The 'free toolkit' from MS is not usable, as it's missing some important and widely used libraries, not available for free.

I'm continually amazed how many people out there are still using VC++ 6.0. That compiler was initially released circa 10 years ago, and it hasn't been patched in like 5. My guess is that the compiler allowed such incredibly broken behavior that the migration efforts to move up to a relatively conforming compiler are very significant.

Off the top of my head, I remember problems with template member functions, for loop conformance, auto_ptrs in containers (no warnings), multiple inheritance with virtual base classes, improperly namespaced classes/functions, non-inlined template definitions (ODR issues)...

It's an example of how Microsoft has really hurt cross platform development. They focused so much on supporting their class libraries and proprietary funky compiler extensions, meanwhile putting no effort into fixing a horribly broken compiler. Sad

I think that they should have been sued in countries like Germany which have very strict laws about advertising and standards conformance. Had they had to put a sticker on their box from the get go which said that their compiler had 152 known compliance issues, I think their market share wouldn't have been so high.

God bless,
-Toby Reyelts
27  Java Game APIs & Engines / Java 2D / Fast Gaussian blur? on: 2005-02-15 05:34:55
I'm trying to use Java2D to create a glowing effect behind shapes (for example, text), and the performance seems to stink.

I'm using a Gaussian kernel with the ConvolveOp along with a RescaleOp to even out the blur. I'd like to be able to blit about 100 convolutions in about 100ms, but I'm definitely not seeing that level of performance. (Btw, I'm keeping the Gaussian very small - a radius of 3).

Basically, my setup looks like this:
 1) Render highlight colored shape to pre-multiplied buffer
 2) Filter with gaussian into another pre-multiplied buffer
 3) Filter with rescale
 4) Blit from pre-multiplied buffer to screen compatible back buffer
 5) Render foreground colored shape to screen compatible back buffer on top of blurred shape.

Anybody have any suggestions for speeding this up?

Two problems I see:  
 1) The convolve has to happen on a pre-multiplied buffer which makes the blit to my backbuffer/screen slow.
 2) I have to clear my buffer on each run.

I can't see how to get away from either of those problems.

One strategy I was considering was stuffing as mamy shapes as possible into the same buffer and performing the blur on them all at once. One problem I see with that is that the Gaussian may take longer to run because it would be operating on dead pixels in space unoccupied by neighboring shapes.

Another obvious solution is caching the blurred images, but that's more of a last resort thing.

God bless,
-Toby Reyelts
28  Discussions / Miscellaneous Topics / Re: I invented a game but I need help on: 2005-02-02 13:18:11
Quote
I poked around Google, and came up with a good map to use as a mask for creating your own:

Alternatively, you could download free GIS shape files for country shape data. This would give you much more accurate polygons. The shape file format is pretty simple to parse, but if you don't want to write your own parser, OpenMap  (http://openmap.bbn.com/) is free, and includes one.

God bless,
-Toby Reyelts
29  Discussions / Jobs and Resumes / Re: The purpose of this forum on: 2005-01-31 18:17:59
I'm basically interested in seeing any positions that are related to software development. What would be really cool is to only allow people who are full members (i.e. 100 posts or whatever it is) to post jobs. Anyone who didn't have a full-membership would have to appeal to the mods or another full-member before they could post a position.

God bless,
-Toby Reyelts
30  Discussions / Jobs and Resumes / Re: Java 2D/3D programmers needed on: 2005-01-31 02:01:33
Quote
Seems like a fair salary to me... maybe that's just the exchange rate.

Just do a search in atlantajobs.com for senior Java engineer. I think you'll find that $75K-$90k is about average, not very, very, good. Maybe the job is great and all, but the compensation is nothing special.

God bless,
-Toby Reyelts
Pages: [1] 2 3 ... 10
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

BurntPizza (18 views)
2014-09-19 03:14:18

Dwinin (34 views)
2014-09-12 09:08:26

Norakomi (62 views)
2014-09-10 13:57:51

TehJavaDev (84 views)
2014-09-10 06:39:09

Tekkerue (42 views)
2014-09-09 02:24:56

mitcheeb (64 views)
2014-09-08 06:06:29

BurntPizza (47 views)
2014-09-07 01:13:42

Longarmx (35 views)
2014-09-07 01:12:14

Longarmx (39 views)
2014-09-07 01:11:22

Longarmx (36 views)
2014-09-07 01:10:19
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!