Basically you want to re-think your networking.There is little point sending 33 messages per second.Your snakes move straight on unless a turn message is sent - and the snake can only turn at specified points (I would be very surprised if the snake could make a turn every 33ms), so at most you only need one message sent for each possible turn point, only if the snake actually turns. If no turn occurs, the snake will just move forwards.

When you send a turn message to the server, you should state where the turn occured. Given the snakes position in the world, the clients should be able to work out how long ago the turn occurred and apply the change as though it happened 'in the past' for these snakes. Remember that it can easily take 200ms for the other clients to receive the message from you.

The server only ever needs to send the 'turn' positions, and occasionally (oce every 5 seconds?) an x,y position & length to the clients. Use these to re-sync the worlds on the client, and then just use 'turn' messages when they occur. YOu should get the traffic down to a few hundred bytes per second, if that.

I recall your quote from when we posted the full version to the off topic thread:

Quote

That's going to be a bit tricky to pull off in a 1.1 VM :/

Its actually getting easier now as we have our nice software rendering library. All we had to add for this one was additive/subtractive blending for the glass covers & scores fading out (nice embossed look to them too!)

We have just added the Java version of our latest game to our site.Please give it a try, & let me know if you have any problems/comments etc.(We also updated our site to use CSS layout, so if you get any wierd glitches in the look of the site please let me know about them too!)

While testing our new game (applet), we found that right-clicking outside the window on the web page hosed the 1.4.2_01 VM. Works fine with my 1.4.2_04 VM, but not this machine with the _01. So we installed the latest version from the Sun site (1.4.2_06).

It all works nicely now.

BUT: Using the Sun Plug in to select a previous VM version is now totally broken! Any applets we try to access with the _01 versionnow chuck an exception - something to do with a ProxyManager!

Its a real shame as we need to switch VMs to test various versions & their 'idiosyncracies', but installing the latest one has completely bust them

I have a friend who is a games artist, and he has started using the Virtools interface. It allows you to program with click & drag logic boxes & the like, as well as coding specific functions at a C/Java type level if you need to. He has knocked up some interesting little games (see them on www.playgen.com) and he has almost no prior programming experience.

re crystalsquidPairing? Ignoring lastest version of CPU? Oh dear, just again that ugly microoptimalizations for old CPU. It was a reason why Intel didn't improved it fast enough.

I like assembler & optimising at this level

If you know what you're doing you can usually double the speed of any decently large function (such as vector transform & perspectivise, software renderers etc.)

The insights from learning how to optimise can help you write C/Java code that runs at least 10% faster just by knowing a few tricks and how code is really translated - and once it becomes second nature then it doesn't cost any more development time - and done properly it rarely produces code that would appear in this thread

You would have to sign your applet to be allowed to do this. Unsigned applets can only talk to the server they cam from. By far the easiest way to do this is to have the web server as the game server and have the applets talk to that.

It _is_ possible to do it all with server side scripting alone, where the applet will request a game state every so often, the server then maintains a database of each games state (allowing for multiple games at once) and handles this. But it would probably be easier (& more secure) to have a dedicated server program that runs the games and the applets are thin-clients.

Letting the applet handle any game logic/game decisions leaves it open for abuse - someone could easily build a hacked applet that lets them win all the time. Using a server to handle game logic severely limits this.

xchg takes 3 cycles for r/r, and is non-pairable.xor takes 1 cycle each, and IS pairable, so in the simplest case you could exchange two pairs of numbers in the time taken to 'xchg' just one.

On PII and above the xchg IS pairable, but still takes 3 cycles.

Also, there is the chance the compiler may try to xchg with a memory pointer instead of two registers. this is extremely slow and forces a memory lock to occur (>15 cycles!).

Plus, not using the temprary register means that the instructions are much easier to interleave with other operations, making the compilers job significantly easier increasing the chance that they would end up paired (taking an average of 1.5 cycles)

Google for 'Agner Fogg' - he has written what I would consider to be the bible of pentium optimisation

Quote

I should dig up some of my old assembly-code. That's a really ugly language, and dangerous as well

I use pretty much the same applett class in my 3D renderer, and that manages 50fps (theres nothing else going on though - no sound etc.). Not sure what else is different, but something Im doing is causing the event loop to fill up.

After a fruitless morning googling for what this might be, I have come to the conclusion that either:a) The profiler is lying.b) Its telling the truth, and noone knows what this eventloop is doing or how to get it to stop

What is most disturbing is that it runs at exactly the same speed ( 30fps and it should be 50fps) on my 2.4GHz machine, AND on the PII 400MHz low spec machine!! Much wierdness...

Any help in understanding what is goping on would be greatly appreciated

Its mostly working (using cunning additive/subtractive blends for fast transparencies) but seems to run at about 20fps irrespective of the PC its on (2.4GHz Athlon or a 400MHz PII both run at the same speed) so something fishy is going on...

If you're bored, try our new game (PC only Im afraid):Puzzle StaxWe are currently working on a luvverly new Java web version (having some performance issues hence the profiler question last week) but if you can't wait you can download the demo & tell me what you think </shameless plug >

As a games proffesional (previously a lead core tech engineer writing graphics engines) I would have pooh-pooh'd java straight off due to the legacy of 'interpreted language'.

My advice would be to big up the JIT compilers by usingthe anology of the bytecode being the intermediate output in the compiler, and the final compile being on the target machine - hence able to optimise for the specific processor in question. Won't convince any console coders (fixed processor) but may sway a few PC programmers to the cause. Also point out that improving VMs would mean the code gets better optimised at a later point without you haveing to do any more work

There are various reasons. We use a srange page with javascript (to show a pre-loading box, or 'you don't have Java' messages) as well as server access control to the resources. Sufficed to say it works fine in a browser, and the closest AppletViewer comes to running it is this error:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Exceptioninthread"main"java.util.MissingResourceException: Can't find resource for bundle sun.applet.resources.MsgAppletViewer, key appletpanel.badattribute.exception at java.util.ResourceBundle.getObject(ResourceBundle.java:314) at java.util.ResourceBundle.getString(ResourceBundle.java:274) at sun.applet.AppletMessageHandler.getMessage(AppletMessageHandler.java:39) at sun.applet.AppletPanel.showAppletStatus(AppletPanel.java:701) at sun.applet.AppletPanel.init(AppletPanel.java:185) at sun.applet.AppletViewer.<init>(AppletViewer.java:175) at sun.applet.StdAppletViewerFactory.createAppletViewer(AppletViewer.java:80) at sun.applet.AppletViewer.parse(AppletViewer.java:1062) at sun.applet.AppletViewer.parse(AppletViewer.java:996) at sun.applet.Main.run(Main.java:138) at sun.applet.Main.main(Main.java:80)

Seeing as the debugger can happily connect to the VM when it is running, I was kind of hoping one of the many profilers out there would be able to do the same. JProbe has some comments on the site about doing this, but when I try with the latest version I just get an full-on access violation from IE.

Tom; This is actually doing exactly the same maths as the post in (5) but removes the need for a divide when generating the line equation. If you write out the vector maths and re-arrange it you get the maths for the test1 test2. At least thats how I wrote this!

The Java client can simply request a specific php page like hiscore.php and supply the arguments for the name, number, etc. The PHP on the server side can then do whatever database processing you like and return a fake 'page' to the applet, complete with the top 10 scores, and your rank.

Yep. then adjust the code so an allocated one is automatically tagged onto the active list and away you go

Another method is to allocate a fixed array of 'maxParticles' and a counter for how many are used. When one 'expires', you just swap the reference to the last active and the expired one in the array and decrease the counter by one. This way, nothing needs 'sorting', the active ones are always at the start of the array, and nothing needs allocating/deallocating again.

However - it is worth noting that with Java these may actually make the code slower & more complicated, as the GCs have come a long way in recent versions.

I used to help select candidates & perform interviews for programmer jobs at my last place (large European publisher), and heres my thoughts on the matter:

Profesional games development usually look for one of two things: Experience, or potential.2 years writing games is good, any more is better.

However, the thing which really shows it is a good demo. It doesn't have to be a quake-beater by any means, but for mainstream console work you should have something using 3D, showing movement and decent graphics (not programmer art - there are plenty of free textures out there that can make a demo look halfway decent). It doesn't have to be a game! Console games are written by large teams, only the top few need to be able to put whole games together.

The other end of the spectrum would be Java oriented web games or mobile phone games. For these, a demo of a 2D game is more appropriate again with respectable graphics, effects, and preferably and good gameplay. This should be some kind of playable game. these are generally written by much smaller teams, and so demonstrating you can handle ALL the input/AI/collision/etc. is more important.

Things employers will be considering:

Given your History degree, are there other roles/aspects where it could be useful? What skills did a history degree give you (researching, thouroughness, working with other people, etc.) that can be applied to development? The fact you changed direction can be counted in your favour if you show it demeonstrates flexibility and a willingness to learn.

Age: this is an important concern because of salaries. The older you get, the more responsibilities you have (wife, mortgage, kids, etc.) and so the higher the salary they will expect to pay. Note that this is 'expect' - this sort of consideration will happen when they see your CV, before you even get a chance to talk to them.

Most places will consider hiring a beginner (on a low salary - but beware the expected expectations mentioned above) if they can show that they have the potential to be good, the willingness to learn, and the ability to fit in with teams. A well made demo or two can show you have the potential (& the necessary starting skill), but the other aspects are just as important to a potential employer.

Don't be concerned about companies 'ripping your demo off'. Firstly you shouldn't do anything too innovative (they may not get it, etc.). Secondly, after a few years writing professionally you will look back on your demo and think 'Flaming Heck - that was rubbish!'. And last but not least, almost all publishers will consign your demo to the bin after viewing it. Partly for legal reasons, but also because they are only interested in seeing what it shows you can do programmatically, and not what the content/idea actualy is (there is probably not a huge amount you could show that would be new to them).

Sorry for the long ramble, but I hope it helps

(PS: I know of only 3 testers who made it into actual development. one as an assistant designed, one artist, and one coder. They had a VERY hard time of it, needing nearly a year of pestering to get the chance after they first said that was what they wanted to do. Dev. tends to look down on testers, particularly those who 'think they can code too'. Sad but true.)

The cross product of 2 vectors produces a third vector that is perpendicular to the two input vectors (A and B), and has magnitude AB sin theta, where theta is the angle between the two vectors. If one of these vectors (B) is a unit vector (1 unit long), then the result is A sin( theta ). This value is the distance of the point from the line.

As we are in 2 dimensions, the cross product 'vector' would be entirely up the z- axis, so we can skip most of the cross product and just use the 'z component':

(A x B)z = distance from line = Ax * By - Ay * Bx

If this distance is less than the error, we are along the line.

Step 2:To test if we lie between pointA and pointB, we need the distance of the point along the line. This is done with the DOT product, which gives AB cos (theta).

(A . B) = distance along line - Ax * Bx + Ay * By

Google for 'cross product', 'dot product' and trigonometry to find more

PS: Can someone set 'code' to use Courier or some other fixed-space font please?

If you are doing TURN based games (dominos, cards etc.) you can actually get away with mainly PHP/MySQL on the server side. A nice Linux server with Apache, PHP4, MySQL4 is robust, easy to use, and cheap to run. Especially if you have the resources of a computer science department at your disposal! This can easily provide the lounges/etc. and there is a wealth of example code for PHP/MySQL out there.

The Java games themselves (applets if you want them embedded on the web pages) then request specific 'php pages', and the php can then send any data it likes as a response (such as the current state of the game). The one aspect to be aware of here is that the php pages cannot contact the clients directly - they can only respond to requests FROM the client. However, if the clients ask for updates every 10 seconds or so it is workable - and possibly the simplest way. Use the MySQL database to maintain the state of each game & any chat messages.

For more complex games (of if you require the server to broadcast messages to clients), either use a Java server or a C++ server. These should still be able to access MySQL databases (although I don't know hopw the Java does this) - which provide the info for the players in the games, lounges, etc. the applets would then open TCP connections to the server app when the game starts. This is more complex for the networking side - but could be easier if your happier dealing with code & sockets.

Au contrair. I am quite certain that we're clear of this patent. The gist of it (by my reading) is that you effect pan&rotate&zoom by re-transforming the projected coordinates, instead of going all the way back to the original 3D coordinates. Neat trick. If I had thought of it, I probably would have implemented it as an optimization. Glad I didn't think of it!

Actually, the optimization in the patent is far more trouble than it's worth on modern processors, and I think it's unlikely that the technique is still in use.

Also, I imagine that integrating a clipper into a pipeline that is re-projecting 2D coordinates must be a real mess.

-Joshua

Sadly thats not it. Its a (very broad) patent on having a view-space, and describes storing the object [psitions in one space (model spave) and transforming them to a view space and then screen - i.e. what everyone does.

in particular the patent covers the user panning around an object and zooming - exactly the sort of interface you use.

You probably also fall foul of 4,742,474 (frame buffers consisting of arrays of numbers!!!)

the patents are all amazingly broad, & quite probably use prior-art, but it seems this is one of those companies who make 'business' of buying duff patents and stong-arming other companies into stumping up licenses.

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