The Alien Flux Development Diary (aka XAP)

21 February 2003

The XAP diary returns! So you thought it had all gone quiet, eh? Well XAP is back, and this time it’s got a proper name! Yes, XAP has cheesily been rechristened “Alien Flux”, because… well, just because. Ah yes, because Googling for XAP produces some weird software thing that’s been around for years.

So what’s been going on?

Well, many experiments have been going on. Mainly with the dreaded background. The old background, you may remember, was rather crap. Nice parallax crap but crap nonetheless.

The new background uses procedurally generated cellular textures, and procedurally generated bump maps.

At one point I tried to put lots of dynamic lights in the game, and had them all nicely attenuated. However, to do attenuated bump mapped lights requires two passes per light plus two more passes. With just one light in the scene my poor old P3-700/GeForce couldn’t even keep up at 60fps. So in the end I’ve opted for a simple, unattenuated lightsource directly over the player’s ship, which draws the whole background in two passes, and it’s all very nice:

http://www.shavenpuppy.com/xap/screenies/whoops.jpg

Bugger, got hit by an alien.

http://www.shavenpuppy.com/xap/screenies/revenge.jpg

Revenge. Die gidrah scum.

Other things that have been done: behold, a start on a proper title screen!

http://www.shavenpuppy.com/xap/screenies/newtitlescreen.jpg

Needs some more work though :slight_smile:

A few minor niggles and bugs have been fixed. In addition, the Emitter concept is back, so I’ve got Emitters which emit Particles once more. The gidrah res-in effect has been ditched because the “lininess” didn’t suit the new solid backgrounds. Tonight I’m going to experiment with some particle effects.

Chaz is working on doing the shield sprite (finally!) and he’s got to come up with the control panel to show the player’s score and other stats.

Here’s some more screenshots:

http://www.shavenpuppy.com/xap/screenies/incursion.jpg

The new Jelly Incursion!

http://www.shavenpuppy.com/xap/screenies/level2.jpg

Nice colours on this level

Cas :slight_smile:

Nice work :wink:

I’m working on a shoot’em up too… but it will only be payable in multiplayer…

I suppose this game has been made using SPGL ?

Sure has. Takes care of all the menial drudgery for me like loading textures and things.

Cas :slight_smile:

I’m not sure but… yellow “things” seem to be metaballs… are they ? or are they just predefined models ?

Those would be the “mad jellies” ::slight_smile: Nope, I believe they’re all sprites - just very detailed ones with lots of animation frames! (Cas has a pet graphic artist ;D)

Cas, where’d you get that font from? Looks a bit like the font from Quake3…

Are you using textured quads for everything, including particles, lasers, shadows etc?

Those jellies were metaballs once upon a time… now they’re just sprites :slight_smile: Everything’s a sprite. Except for dot-particles. I’m going to put some line particles in too.

Chaz is good isn’t he?

Got new particle system implemented tonight. Res-in effects are done but need tweaking, with some animated particles instead of plain spotlight particles. I think each gidrah needs its own res-in signature as well to give you warning of what’s coming.

Still running @ 60fps… ;D

The title screen font is one Chaz seems to have found somewhere. No idea what it is. The other font is of course Impact, which is the same as Q3A I believe.

Cas :slight_smile:

Wow, it’s starting to looking damn good! :o

How did you do the shadows? Are those grayscaled/alpha’ed versions of the original sprites?

No, the shadows are actually rendered from 3dsmax as well, but with the sprites turned off (ie. we render our 3dsmax sprites in two stages: the solid bit, and the shadow).

Cas :slight_smile:

Stuff done

[] Crackly sound effect for the gunner
[
] Smoke trails for the gunner
[] New res-in effect for gidrahs
[
] New res-in effect for player
[] Jelly particles
[
] Bonus points sound effects
[] Player drifts sometimes: need to come to a full stop
[
] Reprioritize sound effects

The gunner really is a mean looking little angry red ball-o’-nastiness now, with its unpleasant crackly noise and smoke.

The beamin effects need some work. Well, they need some particle sprite animations.

There’s finally a score display at the top. It’s just a temporary one but it feels rather more like a game when that’s there.

I optimised the fixed-point maths routines. Now divides are done using integers (longs in fact), and the square root function now works for values > 1.0f :slight_smile: It wasn’t too useful doing square roots of such tiny magnitudes, but now nearly all square roots come from the look-up table.

The new particle system is nice, with particles bouncing, having mass, friction, and such like. There’s also a new ShadowedParticle which I’m using to draw jelly particles. When you blow up a jelly it explodes into lots of little blobs which bounce around a bit. Looks quite amusing.

The blobs have some cuter sound effects in now. Little squeaks. It’s getting a bit too fun to shoot them deliberately though.

Brian says it crashes nastily when he tries to leave the game. He’s got an ATI card - a sooper-dooper MonsterWilly Radeon Nob-Wavulon.9700 which cost him 3 month’s salary. I suppose I should try and learn the ATI vertex object extensions which will extract better performance from Radeon cards. Trust Nvidia and ATI to come up with two completely different APIs to do the same thing. Although I have to say, the ATI one - even though I haven’t used it - appears much, much, better thought out and is completely platform independent. The Nvdia VAR extensions rely on an annoying WGL call.

1.24am

The SPGL Image class got a major tweak tonight. The images are now split out into planes and then recorded as deltas before sending to the gzip compression that writes them to disk. The end result? A.F.'s graphics payload has dropped from about 4MB to 2MB!!! This is a major win! And it only took me an hour to get it all perfect.

The next thing to do is compress the sound, with JOrbis. This should probably take a bit longer but will likely achieve about 3-5x compression. I want reasonably high quality sounds.

Cas :slight_smile:

Much fun with Jet Professional. Today I finally took the plunge and shelled out £500 for Jet Professional 3.0. Ouch! Especially having gotten used to free software.

Jet 3.0 is good. But let me say this about the whole native compilation debate right now:

  • right now native compilation produces considerably faster, leaner code than any JVM implementation. Alien Flux starts up in the blink of an eye, and runs at 100% speed, like a proper game should. By comparison, the client VM can’t even achieve 60fps, and takes about 5x longer to start up (even when the disk cache is “warm”). The server VM actually runs at around the same speed as the Jet compiled application. Full marks to Sun for putting their money where their mouths are on this one. However it takes an age to start up and the code runs like an epileptic slug for about 30-60 seconds. This gives such a bad impression I’d be surprised if didn’t affect my conversion rate significantly - it looks unprofessional.

  • Jet, for me, is only really good because I’m not relying on a vast amount of supporting classes in the AWT, Java2D and ImageIO to do my work for me. I’ve written my own, teeny weeny highly optimised code to do exactly what I want. If I were to use the AWT in any for at all, my Jet code would suddenly bring in another 5Mb of compiled code and I’d miss the holy grail of 5Mb payload, and be back to the same old distribution problem. Believe me, I’d much rather have gone for an embedded VM instead if we could have got the size down to under a megabyte, but the hopeless performance of the client VM and the jerky nasty unprofessional feel during warmup of the server VM currently preclude the situation even if we could ditch all the JDK cruft.

  • Jet code is actually really quite compact. Once it’s all zipped up, the final executable only appears to be a megabyte larger than the zipped .jar file!

Rant Alert

Seeing as I’m facing the same dilemma right now as maybe any other professional thinking of turning to Java for professional games development is facing, perhaps I could once again take this opportunity to plea with Chris to collar a Sun marketechture type and whisper these ideas in his or her ears:

We want Sun to develop a JVM and JDK specification designed solely for gaming because the existing technology is not good enough. (Actually, I want to develop it, working for Sun). The client VM is too slow. The server VM is fast enough but takes too long to warm up, each and every time. The garbage collection of either of them is still not tuneable to vsync or limitable to a given number of microseconds per vsync. The GC tuning options are by default incorrect for games (which generally seem to require -Xincgc -Xconcgc for smooth operation). Escape analysis is critical for gaming performance without terribly ugly code. We need structs to access native data structures. The compiled code is still thrown away at each invocation. The JDK is far, far, too large and needs to be about a megabyte when compressed to be viable. An “embedded” VM is the only realistic solution for a professionally developed game. (See Sun internal memo about incompatibility issues, performance troubles etc). We suggest that AWT and friends are removed and replaced with a cross-platform performance graphics library (LWJGL + some 2D code anyone?) to beat back the onslaught from DirectX and C# which are currently a far better technology than Java and OpenGL due to their close integration. Remember - this is a JVM and JDK specification designed to bring killer games to the masses on all platforms - not a JVM and JDK designed to bring generic windowed desktop applications to the few who understand Java.

Or we could just soldier on with the 1.4 client VM, watch our pitiful sales, and decide to compile our code with Jet. Bang goes the Mac/Linux dream. Eventually we get sick of the other hassles too and start using C++.

I’m for hire and I can make this happen for Sun. Within 12 months we can give Java its killer client platform. CV’s on my website. This is the only job I’d consider relocating for. What it doesn’t say on the CV, unfortunately, is that I’m not a team player, I’m a team leader. Everyone will succeed provided they do what I say. Just ask all the other bastards I’ve made rich over the last 8 years. There’s no room for democracy and namby-pamby half-arsed decision making when you need an energetic visionary to lay down the law. Remember that, Sun? When you were engineers with ideas and a will to make it happen?

Arrogant? Maybe. At least someone’s got some determination instead of excuses. Rant ends. Job offers by email please ;D Hate mail & flames to the PM account here.

Cas :slight_smile:

Much fiddling with res-in effects, to no great effect. Shrank the shadows to half size and half frame rate to save a load of space. They look very nearly identical to what they were before but take up an eighth the room now. We’ve still got to cut about half the frames of animation out of the game I reckon because I’ve got another 3 gidrahs to add to the demo yet and probably a boss. (How the hell am I going to squeeze a boss in to the remaining space!!!??)

Chaz put the shield in today - looks nice - had to remove the player’s shadow whilst it’s on because it looked strange. I’ll fade it from white down to red when it runs out by using colour modulation. I might put a colour modulation on the floor as well to sort of illuminate around where the player when the shields are on too.

Chaz is currently working on the score panel. We’re having a nice big fat score display, and smaller displays with clusters of smarbombs and player lives in rows, animated. The shield bar I’ll just draw as a coloured quad.

Still haven’t gotten around to doing the new laser. The res-in effects need fixing first though I think. Later today maybe. First I’ve got to go to Sainsbury’s and argue with a customer services mong about a bottle of Mr Muscle I bought yesterday which unscrewed itself on the way home and emptied itself all over a loaf of bread and a box of tampons (predictable results). Should be amusing getting them exchanged :stuck_out_tongue:

Cas :slight_smile:

Just a question… are you working for Sun ?

[quote]are you working for Sun ?
[/quote]
Considering he avoids as many standard java API’s he can, creates native bindings and uses native compilation, probably not ;D

But, I think Sun should notice that for gaming his approach totally makes sense and maybe Sun should give him the chance to make things happen this way.

hum… I know the way that Sun’s directors thought (my dad is the “technical” & marketing director of Sun France so :wink: (“technical” mustn’t be the right work in english… in french it’s “Directeur technique”…) and I’m not sure that it’s the way they think about developping games in Java…
They want Java to be flexible, powerfull and easy to use (maybe too easy ?) so I don’t think Cas’ point of view would be approved by Sun… even if it’s a good point of view (in my thoughts :)).

Oooh, look, I’m a YaBB God now, so I shall have to verily spake unto thee and so forth:

It is written that he doth Not work for Sun, but his Divine Intervention in Sun would bring forth light, a huge market, and Bigger Prophets :wink: for the Shareholders and Unbelievers;

And it is written verily that he smote the JVM disciples and within 12 Months had created a Game JVM in his own image, and on the 13th month he Rested and enjoyed his Vastly Appropriate Salary;

It is written in the Book of Revelations: And then he spake unto Sun’s CEO and did command him that there should be a Home Computer of great prowess which used the Great Surplus of Sparc Chips, ATI 3D hardware, and Java on top of a Microkernel operating system; and the Market would rejoice for there was finally a Home Computer once again to replace the Amiga and C64, and that this machine would be ready within 12 months, and that games written for this Console would work seamlessly on a PC with the new GJVM. Furthermore he commanded it should cost less than £500 or no one would want it.

And amongst the followers of Beelzebub Gates and all his little Wizards there was a wailing, and a gnashing of teeth, as they forgot about Home Computers completely in their strategy. And the minions of Sony did despair and tremble in their boots, for those former loyal customers bought their Sons and Daughters the Sun PC that I had designed, and learned to Code according to the Commandments.

Amen.

Cas :slight_smile:

9.30pm

Poor confused mong at Sainsbury’s was very helpful and exchanged my Mr. Muscle, loaf, and tampons without complaint :slight_smile:

I seem to be having a brain block over getting the gidrah’s bullets to fire directly at the player regardless of either entity’s velocity. Maybe I’m a bit tired. All these 2am working nights…

Oh dear, I appear to have addicted Charlotte to NetHack (new version out recently).

Cas :slight_smile:

I noticed by accident that some ancient code in the SPGL was doing something a bit strange. On further investigation, I realised that all along I’d been serializing the fonts twice and storing them in the resources file as well as the .jar! I got suspicious of this, and had a nose around some other bits in the SPGL I haven’t looked at for years, and guess what - all my dynamically generated textures, cunningly coded so I didn’t have to waste download space, were also being serialised!

So I set about doing a big clean-up of all the SPGL code today. Now it’s somewhat neater, faster, more efficient, and bug-free. But the best news, as far as I’m concerned, is that nearly a megabyte has vanished off the Alien Flux distribution. Phew! This means we’ve easily got room for all the new gidrahs and code that needs to go in. Hurrah! Also, I’ve determined that, for A.F. at least, turning the inlining down low reduces the final executable size massively but appears not to affect performance significantly.

Suffered a minor blow to morale and confidence today - Dexterity are no longer accepting submissions for publication. Apparently they want to concentrate on doing a few very high quality games instead of many more mediocre games. They’ve already got about 15 games for sale and a few in the pipe so I can see where they’re coming from. Half of their games are exceedingly mediocre though (especially the arcade ones), so perhaps I can convince them otherwise with Alien Flux… but now it looks like Garagegames might be new next best option.

Anyone know any other good online publishers?

I’m always thinking about the possibility of self-publishing but that’s a rocky path that’s hard to follow. For sure, we’ll make less money earlier on because about, ooh, 50 people will perhaps visit my site in the next year or so. It’s a tough decision.

You know, A.F. would make a fantastic Playstation game.

Cas :slight_smile:

Chaz has finished the GUI panel with the score, lives, smartbombs, shield and level display on it. It looks really nice, in a sort of glowing transparent green plastic kind of way :slight_smile: To save space, it’s cunningly designed in five pieces, and each piece is symmetrical in both X and Y, so we only need to store a quarter of it and mirror it over both axes. I’ll bung it in the game tonight and it should suddenly start looking a lot more like a proper game.

Discovered an interesting foible in Jet. The global optimiser chucks out unreferenced private methods. And so it should. However, it unwisely chucks out readObject() and writeObject() methods which are of course only used by serialisation. A bit irritating. (Dleskov? You still on these boards?)

Gradually we creep towards the public test. There’s a couple of important bits of technology need to be added first though: Ogg Vorbis, still lurking in the back of my mind; and optimised ATI drawing using array objectsl; and of course the useless ancient card driver path which doesn’t do the bump-mapping etc.

Fixed the alien bullet velocity problem by just adding the gidrah’s velocity to the bullet… bit of a con if the gidrah fires at 90 degrees to its current velocity but there you go. I suppose I could modulate it with a dot product.

I think I might tackle the new laser effect now.

Cas :slight_smile:

[quote]Discovered an interesting foible in Jet. The global optimiser chucks out unreferenced private methods. And so it should. However, it unwisely chucks out readObject() and writeObject() methods which are of course only used by serialisation. A bit irritating. (Dleskov? You still on these boards?)
[/quote]
Well I gave up before the whole thing switched to YaBB, as most people here were strongly against native compilation… But noticed java-gaming.org in the referrer log and - I am here again. :slight_smile:

Anyway, for guaranteed response you should have reported the problem to us at
java@excelsior-usa.com or through this Web form. We accept defect reports from everyone - and you are now the valued customer using the Professional Edition!

Besides, how do you find the new GC in JET 3.0? Is it causing considerable pauses? Did you compare memory consumption figures? Did you try tweaking the memory manager as described in Application Considerations / Application Memory Usage Tuning?