CraftCraft

Hi, I wanted to show my progress on “CraftCraft”

http://damocles11.byethost9.com/craftcraft4k.html

Its a RTS/Mission Game.
You are command of a Rebel Group, that has to fight of a Military Invasion,
on several parts on one of your Space-Supply-Stations.
Your basic Objective is to kill all Intruders, on several sections of the spacestation to finish each mission.

Left-Click / Drag: select your units.
Right-Click: order to walk

The game contains yet:
-Fog of War
-Full Pathfinding
-simple Statemachine AI

You will notice that most of your companios are locked in Stasis-Chambers, get close to release them
At Start and at some Positions are Healing docks, wich slowly regenerate Health to the unit that steps onto them.

Thanks, Damocles

Here the sourcecode:

http://damocles11.byethost9.com/applet/CraftCraft.java

All in 4k? Amazing stuff. Keep up the good work.

The Fully Packed Version is around 4300Bytes currently,
I probably have to squeeze some stuff a bit more.

oh thats impressive for 4k, still a bit buggy e.g. drag select (from bottom-right to top-left) doesn’t work or that mission doesn’t end when it should. Still very nice so far.

Yes, there are some bugs left.
They would be easy to solve without a 4k limit.

I probably have to cut down on some graphical features, to have more space for
a smoother gameplay.
The statemachine can probably be written more efficient too.

Any Suggestions:
What should I cut out in favor of gameplay:
-Fog of War
-Unitsprite (makeing a lower Quality version)
-simpler Maprendering
-the Pathfinding (replacing it with a simple direct walk)
-Image smoothing

Fog.

Cas :slight_smile:

Yeah, fog is the least necessary of the features you listed.

The game is very impressive. The graphics are great.

How exactly do you get your guys to attack? Is there a way to specifically target an enemy soldier? I have trouble getting my men to engage unless they’ve been sitting still and the enemy has be firing at them for some time. If there isn’t a way to target a specific enemy, I would put that on top of any potential feature wishlist. Without it my mad actual-starcraft skills are useless.

Yes, the unit-attack routine is flawed.
Your units have a cool-off time to look for enemies, after getting a move command.
(Trying to make a mix between normal and attackmove)

If I have space, I can implement an attack-movement (using A key), and a normal movement (ignoring others , until reaching destination)


Or I have to “redraw” from the 4k goal, and
make a complete RTS with Basebuilding and different Units in 8k :wink:

Heh, I made a complete RTS with basebuilding and ten different units in 4k last year by skipping pathfinding, scrolling, and fog of war. So I think you’re fine with just the ones I missed, it makes us even ;).

The thing with these kind of games is defining the stuff you can get without, and just put the most useful things in.

You can define pathfinding away, saving yourself space for something more valuable.
Fog-of-war is fine, it does serve a purpose in the gameplay, forcing the player to explore.

Even as a non-4k, the graphics look amazing. :o

Gave it a quick try.
Completed the first mission in around 5th try. Quite hard for a first level. :slight_smile:

When I completed the mission the screen seemed to go all white. After a while I started to click it, and got the following error:

[quote]Exception in thread “Thread-10” java.lang.ArrayIndexOutOfBoundsException: -143
at C.a(Unknown Source)
at C.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
[/quote]
Other than that, it looks really nice (despite graphics being a Starcraft ripoff).
Checked the size of my source code for a half-finished game i’m working on to comparison => 4k seems quite amazing! :slight_smile:
How much would you say the quality of the code, that is readability, stability (corner case checks among others) are affected by these constraints?

  • Scarzzurs

I will add some corner case checks, and better unit reaction first.
Then I will see how much I “hang over” the 4k Limit. I can probably replace the Unit-Graphics with a vector-generated one, should
save some space.

Taking out the FofOfWar would result in a problem with the gameplay, as its easy to see where to go, and the enemies are.
Some graphicsl stuff and the Texts should be cut out too. Especially the text wastes a lot of space.

Something Else:

I cant seem to load my “pack.gz” file via the net, but it works locally.
Does the webserver have to impose some Mime-Type defenition to make it load?
I cant really change the Apache settings.
Maybe someone else has to host it then.

(thats why the larger jar version is used here)

I get one of these:


Exception in thread "Thread-10" java.lang.OutOfMemoryError: Java heap space
	at java.awt.image.DataBufferInt.<init>(Unknown Source)
	at java.awt.image.Raster.createPackedRaster(Unknown Source)
	at java.awt.image.DirectColorModel.createCompatibleWritableRaster(Unknown Source)
	at java.awt.image.BufferedImage.<init>(Unknown Source)
	at C.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Kev

fixed some little Bugs:
-level ends when dead
-Missions should progress correctly
-scroll and click are now in “Bounds”
-Units attack quicker
-switched mission 1 and 3

Doesn’t work. Same OutOfMem exception as Kev.

Worked on my desktop, just not on my laptop. It’s really kick-ass!! :slight_smile:

Kev

Its quite memory intensive. (the tradeoff to making the file small, there is not much space to make a
more advanced memory management)

But I could also run it on my EEEPC netbook with 1GB ram.

This is quite amazing!

I love it. Excellent 4k work going on here. :smiley:

The graphics are great. I’ve never written a RTS myself, so am going to have a good look :slight_smile: I’m curious about the AI logic.

Regards, Alan

(P.S. I had a bit of difficulty with the mouse scrolling action. When I opened the page, my mouse just happened to be on the edge of the applet and the game area rapidly shot off the page leaving me with a blank area.)

Uh, well, I did not made it quite.
Anyhow, here the reduced version, if anyone likes to try.

http://www.indiespot.net/app/java-four-kay-test?task=html&resource=download.e1da054763ec93fd7d166514641310f5.progrd.java6.bj&className=C&w=800&h=600&ok=resize

Here the sourcecode :wink:

http://damocles11.byethost9.com/applet/CraftCraft.java