Agent: 00PK

NOW WORKS ON WINDOWS, LINUX, AND MAC OS X.

I’ve been making a game for the past three months called “Agent: 00PK.” In it you play as a spy who uses her incredible parkour skills to sneak into enemy bases and rescue the world from nuclear destruction.

This isn’t anywhere near done, but there’s plenty to demo if people want to give it a look. And if you don’t know what parkour is, be sure to check this link: http://www.youtube.com/results?search_query=parkour&search_type=

Features
• Over 40 different parkour moves your character can perform (not all implemented yet).
• Realistic physics (a modified version of Phys2D, and currently the gravity is too low).
• Adaptive AI (current not a very good AI because the learning function has issues, but nonetheless uses a Q-Learner algorithm).
• Pretty sprites made with PNG-16 encoding, and expansive compressed backgrounds (although I haven’t made nearly all the graphics yet).
• An intricate level editor that allows you to construct anything you can imagine.
• OpenGL and OpenAL via LWJGL.
• Robots with simple AI and Guards with Q-Learning AI. Lasers, bullets, homing missiles.

Known Bugs
• If you’re at standing and hold the jump button, you’ll do a crazy super jump.
• You can often grab an edge from an inappropriate distance, or can’t grab one when you should be able to.
• If you try to play past the third level, the game will break (no other levels made yet).
• If you see an “ugly” sprite, it’s because the animation for it hasn’t been added in yet.
• You can’t jump while running.

Controls
The controls are all customizable, but it should be noted that they’re very context sensitive. If you’re using the defaults, here are some hints:
• Move around with the left and right arrow keys.
• Press C while moving to do a forward jump. Press C while still to do a standing jump.
• Hold C when near an edge to have your character grab and hang (for as long as you hold C).
• While hanging with C, also press Z and X to do a pullup and get on the ledge (careful this is sort of buggy, you might be hanging too low to actually get up).
• If you have just jumped at a wall, press Z, X, and C, to do a “Tic Tac,” which will propel you in the other direction.
• If you have just jumped at a wall, press C to do a Wall Jump. Currently, this is broken.
• If you are landing from a drop, hold down C to do a parkour roll. This will lower the likelihood of death from falling.
• If you are landing from a drop, hold down X to do a precision landing. This increases your friction on landing.

Cheats
There are cheats in the game to mess around with things.
• Kitty Cat Kong
• Joints of Steel
• Bullet Speed
• I am David Belle
• Moon Shoes
• Coo Coo Raw Cha

I think that’s about it. Have fun! There is a significant amount of tweaking that needs to happen to make this game more enjoyable, but you’ll get the idea. Oh, and in order to finish a level, follow your compass in the bottom right corner. It will lead you to a glowing arrow that is the “exit.” A good hint for getting past the guards is that they can’t shoot you while you hang on a ledge. Try it out.

Download Webstart here:


(latest Webstart update: April 15, 2008)

Updates:
• April 13, 2008 – Initial upload of early build.
• April 14, 2008 – Support added for all OS’s, repeat texture loading bug fixed.
• April 15, 2008 – Simple AI added, more guards placed in levels, JNLP file size optimized, texture loading optimized. Debug turned off, with cheat (Coo Coo Raw Cha) to turn it back on.
• April 16, 2008 – Training levels being worked on, physics further tweaked, pushable blocks added, individual hit boxes for hands added. Destructible terrain being worked on.
• May 13, 2008 – Robots added. Homing missiles added. Level selector added. Webstart custom level support added. Webstart save file support added. Bug fixes and tweaks. Sound added. Level loading optimized.

Doesn’t work for me:

Empty window pops up and then I get an exception:


java.lang.NullPointerException
	at apk.Sprite.getWidth(Sprite.java:91)
	at apk.ImageManager.getSprite(ImageManager.java:68)
	at apk.OptionMenu.draw(OptionMenu.java:83)
	at apk.OptionMenu.start(OptionMenu.java:65)
	at apk.Agent00PK.showOptionMenu(Agent00PK.java:100)
	at apk.Agent00PK.<init>(Agent00PK.java:54)
	at apk.Agent00PK.main(Agent00PK.java:62)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
	at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
	at com.sun.javaws.Launcher.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

So maybe your resource loading does not work?

Hi!

It works under Linux. It is very slow because of the driver, not your fault. I got a popup telling that there is an error while saving and I don’t understand why the images are loaded each time I restart the game.

Would you like your game to be added to the Java game tome?

same here

Wow. It’s like Aladdin for the Super Nintendo except in real life. In other words, it’s a real life platformer where you can catch the edge of a platform with your hands, but you don’t whack your head on bricks.

That’s just great.

Not much more luck for me.

Windows XP SP2
Java 1.6.0_05


java.io.IOException: Cannot find: Images\Interface\Default0.png
	at apk.TextureLoader.loadImage(TextureLoader.java:292)
	at apk.TextureLoader.getTexture(TextureLoader.java:178)
	at apk.TextureLoader.getTexture(TextureLoader.java:144)
	at apk.Sprite.<init>(Sprite.java:68)
	at apk.ImageManager.initialize(ImageManager.java:27)
	at apk.Agent00PK.<init>(Agent00PK.java:46)
	at apk.Agent00PK.main(Agent00PK.java:62)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
	at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
	at com.sun.javaws.Launcher.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
java.io.IOException: Cannot find: Images\Interface\OptionMenu.jpg
	...

Work PC has done the same here too:


java.lang.NullPointerException
	at apk.Sprite.getWidth(Sprite.java:91)
	at apk.ImageManager.getSprite(ImageManager.java:68)
	at apk.OptionMenu.draw(OptionMenu.java:83)
	at apk.OptionMenu.start(OptionMenu.java:65)
	at apk.Agent00PK.showOptionMenu(Agent00PK.java:100)
	at apk.Agent00PK.<init>(Agent00PK.java:54)
	at apk.Agent00PK.main(Agent00PK.java:62)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
	at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
	at com.sun.javaws.Launcher.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

W2K J1.5

java.lang.NullPointerException
	at apk.Sprite.getWidth(Sprite.java:91)
	at apk.ImageManager.getSprite(ImageManager.java:68)
	at apk.OptionMenu.draw(OptionMenu.java:83)
	at apk.OptionMenu.start(OptionMenu.java:65)
	at apk.Agent00PK.showOptionMenu(Agent00PK.java:100)
	at apk.Agent00PK.<init>(Agent00PK.java:54)
	at apk.Agent00PK.main(Agent00PK.java:62)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
	at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
	at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
	at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
	at com.sun.javaws.Launcher.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)


java.lang.NullPointerException
	at apk.Sprite.getWidth(Sprite.java:91)
	at apk.ImageManager.getSprite(ImageManager.java:68)
	at apk.OptionMenu.draw(OptionMenu.java:83)
	....ETC...

console shows


java.io.IOException: Cannot find: Images\Interface\Default0.png
	at apk.TextureLoader.loadImage(TextureLoader.java:292)
	at apk.TextureLoader.getTexture(TextureLoader.java:178)
	....ETC...

java.io.IOException: Cannot find: Images\Interface\OptionMenu.jpg
	at apk.TextureLoader.loadImage(TextureLoader.java:292)
	at apk.TextureLoader.getTexture(TextureLoader.java:178)
	....ETC...

	....ETC...
	....ETC...

#### Java Web Start Error:
#### null

I think he got the point ;D

Sure, that sounds great. Yeah, I loaded all the sprites into the map, so it’s really odd that they get completely reloaded, but I’ll change that sometime soon.

As for all these bugs, it’s probably because I didn’t do the ulta-safe way of loading resources from within my classpath. I’ll try to change that and find a PC to test it on to see if I get better results. Should be good to go later today.

Thanks for all the responses!

Okay, the game now works on Windows. ;D

It was a simple fix… the problem was that I was using file.separator to choose resource paths, which is a / on most systems but a \ on Windows. I was originally using file browsing instead of class path stuff, so that’s why I had the \ stuff.

But why can’t Windows just get with the program and use / like everyone else? ::slight_smile:

Actually you can use / on windows when working with files in java. In fact I never use backslashes at all…

Oh really? Someone had told me that but it didn’t work when I tried it before. Maybe they added that since 1.4 (last time I tried it). Good to know, for sure.

When trying to exit the game

java.io.FileNotFoundException: C:\Program Files\Mozilla Firefox 3 Beta 4\Players\Eli.pksave (The system cannot find the path specified)
	at java.io.FileOutputStream.open(Native Method)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at java.io.FileOutputStream.<init>(Unknown Source)
	at apk.FileManager.save(FileManager.java:20)
	at apk.ModelGL.factorKeyPresses(ModelGL.java:254)
	at apk.ModelGL.runMainLoop(ModelGL.java:76)
	at apk.OptionMenu.makeChoice(OptionMenu.java:155)
	at apk.OptionMenu.factorKeyPresses(OptionMenu.java:125)
	at apk.OptionMenu.start(OptionMenu.java:66)
	at apk.Agent00PK.showOptionMenu(Agent00PK.java:100)
	at apk.Agent00PK.<init>(Agent00PK.java:54)
	at apk.Agent00PK.main(Agent00PK.java:62)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
	at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
	at com.sun.javaws.Launcher.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Yeah, you can’t save the game because there is no Players folder. I’ll fix that in a future update, for now just ignore it. You’ll most likely get the same sort of message if you try to save a level.

More updates and bug fixes implemented. Things should download and load significantly faster now, and I put in a simple AI to replace the failing Q-Learner AI (although I should get that working soon). If you still want to see the Q Learner AI, you can use the debug cheat. Its AI file isn’t in the JAR, though, so it will start with an “empty” brain. The guards make it significantly more fun, adding an actual element of difficulty. :-X

[quote]Simple AI added, more guards placed in levels, JNLP file size optimized, texture loading optimized. Debug turned off, with cheat (Coo Coo Raw Cha) to turn it back on.
[/quote]

looks interesting, the controls feel very “slippy” though

Lovely graphics!
The physics were really weird, to the point of making the game unplayable. Sliding around and floating through the air for fifteen seconds isn’t much fun.

What’s with the weird perspective? The starting area seems to have an escher-like fence around it, and your appear to see the street behind you from above, yet most other things are seen from the side.

Basically, I’m a terrible artist. I drew half of the level from 50% magnification and then remembered I was zoomed in ;D.

And yeah, the physics totally need work. It is completely playable if you get used to it (I can beat both levels with no issues), but I absolutely agree I need to do things like increase gravity and give you more control over sliding and whatnot on the ground.