Galactic Conquest 4K

Hey everyone, I’ve just entered my submission to the Java4K contest: Galactic Conquest 4K, a simple yet fun 4X RTS in 4K :slight_smile: It’s even got a Terrible Space Monster in it!

You can play it at the Java4K site:
http://www.java4k.com/index.php?action=games&method=view&gid=370

Any feedback is welcome!

Making this game was actually less difficult than I anticipated. All the advice on these forums and the Java4K site on how to reduce JAR size and use all kinds of tools for that was very helpful. I’ve even learned quite a bit while making the game. Also, making such a small game is a great way to prototype a gameplay idea.

Once you set a collection point © and you remove it, no new spaceships will appear :slight_smile:

A lot of ships aren’t actually built. I checked a few stars/planets and very often ships wouldn’t appear when the counter reached 100%

Hey Riven, thanks a lot for trying it out!

Strange, I cannot seem to replicate this. I’ve tried setting and removing collection points, but spaceships keep on appearing. Maybe its related to your second point?

[quote]A lot of ships aren’t actually built. I checked a few stars/planets and very often ships wouldn’t appear when the counter reached 100%
[/quote]
This is actually a “feature” ;D I put a hard cap on the maximum amount of ships that can be built. However, I guess I need to find a way to put in a “cap reached” message somewhere and not simply make the newly built ships disappear into a black hole.

Reading your reply, I think my two points are refering to the same ‘feature’ and I simply didn’t observe it long enough to see that the collection point had nothing to do with the lack of new ships being produced.

I like the game, but the ‘space monster’ is really unfair. It’s strong and hops from planet to (nearby) planet, which most often means it ruins the game for 1 player, as it takes large amounts of ships to destroy. Whenever I see the space monster spawning near me, I simply restart the game.

The Space Monster is indeed a completely random element in the game. I think it needs about 75 ships to destroy, which is quite a lot indeed. I’ll see if I can tune it somehow to make it a bit less of a game changer.

Wow that was a really fun game. Fortunately for me, the space monster spawned far away so by the time he reached my planets I killed him in an instant, then I dominated the rest of the universe. This actually reminds me of a similar game from last year’s Java4K competition. I’ll try looking for it and update this post.

EDIT: Aha!! Moo4K

It seems to be a really interesting 4X game. I will give you later deeper comments about its gameplay. For now, I can just add that you should have advertised it as a real time 4X, which differentiates it a lot from last year’s Moo4K, which was a turn based game.

Well, I did list under features: “4X RTS in just 4K!” Also, the difference is quite obvious once you start playing ;D

Ah yes, I did see Moo4k. It’s got some simularities, although it’s more menu-based, it’s got map scrolling and its turn-based instead of real-time. Anything that smells like Master of Orion 2 sounds like fun to me.

One thing I tried to do with this little game is to reduce the 4X type of game to its most simple uncomplicated form, and to make the UI as simple as possible. I guess I like simplicity.

I think you meant http://java4k.com/index.php?action=games&method=view&gid=346 ?

Ah no I never played that one :confused:

Ah nice, haven’t seen that one yet. I think I did get some inspiration from a similar game I played on android a bit quite some time ago, at least as far as the simple controls are concerned.

I often take a deeper look into the java4k games in common, as well as in yours in general. Mainly to get rid of the space monster, but also to simplify the controls (more mouse interactions).
Anyway i got stuck in a common problem i always have and somehow unable to understand.

You use a lot of continue instructions and they are all something like this

while/for loop {

instruction
continue;
instruction

} //while/for loop

I know how to deal with break/continue commands, but i have no idea what should happen if you add a continue in a loop with no statement limiting the continue execution.
From what i know is that continue breaks the instruction chain and moves back to the loop, while break breaks out of the loop.

But what is if you add a continue like the way you did?


while (i2 < i / 30)
              {
                if (i21 < 255)
                {
                  arrayOfInt6[i21] = 4;
                  arrayOfFloat1[i21] = ((i2 + 1) * 10 * 3);
                  arrayOfFloat2[i21] = (i13 + 20);
                  arrayOfFloat3[i21] = 0.0F;
                  arrayOfFloat4[i21] = (128.0F * i1 * 0.85F);
                  arrayOfFloat6[(i21++)] = 1.0F;
                }
                i2++;
                continue; // what is this good for, since the whole code below does not seem to become executed in general, or am i'm wrong?
                i1 = 0;
                while (i1 < 2)

Hey Localhorst, funny you take such a close look at my code :smiley: However, I don’t recognize the code you put up here. In my code I use no continue statements whatsoever, but I do use some break statements, for a quick search in an array, e.g.:

// Find available fleet
for (int sh = 0; sh < MAX_NUMBER_OF_SHIPS_PER_RACE; sh++) {
	if (fleetOrigin[starOwner[s]][sh] == -1) {
		// There is a fleet available, so lets move
		fleetOrigin[starOwner[s]][sh] = s;
		fleetDestination[starOwner[s]][sh] = closest;
		fleetProgress[starOwner[s]][sh] = 0;
		fleetShips[starOwner[s]][sh] = starShips[s];
		starShips[s] = 0;
		break;
	}
}

However, I just checked and nowhere in my code does a break or continue statement appear with other statements following it in the way your code sample shows. Neither can I find the constant values listed, like 30, 255, and so on. Does this have something to do with the way you disassembled the bytecode? I can’t imagine the compiler making such mistakes.

Ay, so it is probably a weird result made by the Decompiler - i somehow trust too much into the result of this jad tool, but the one of the pro’s is that once you understood the code you know how it works :slight_smile:

http://pastebin.com/kgKbcHu9

Cheers

I recommended you use jd-gui, it’s the best decompiler I’ve found.

Ok, made an update based on the comments made, and because I managed to squeeze out a few more bytes using the JoGa tool. The graphics are much nicer now, and are using antialiasing. Also, I rebalanced the space monster so it’s less of a game breaker if you’re in bad luck.

Unfortunately I had to remove the 1,2,3 keyboard controls for selecting ships because I needed the bytes. However, to avoid RSI I changed the selection sequence when clicking a star from 1, half, all to all, half, 1. This saves a lot of clicking since usually people will want to send all of the ships instead of just one.

If you’re still curious, I’ve put the source code online too :smiley:

http://www.java4k.com/index.php?action=games&method=view&gid=370

Wow, what a fun game! Really addicting! Like it and wish it took part in at least 8k games :slight_smile: