tiny_world

Here is my effort for this year’s 4K contest - an isometric real-time strategy game called tiny_world:

http://imageshack.us/a/img856/8955/tinyworld0.png

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

The game was inspired by this post about random terrain generation, plus a couple of great little strategy games from previous J4K contests, especially this one from Grunnt (I hope you don’t mind).

I thought it would be interesting to combine the two ideas - random terrain generation plus simple strategy mechanics - and see what happened. tiny_game was the result!

A few more obligatory screenshots…

Starting to take over the north of the map:

http://imageshack.us/a/img818/3792/tinyworld2.png

Er… how did that happen?! I’m about to lose to the AI:

http://imageshack.us/a/img96/6617/tinyworld3.png

Anyway, I hope you enjoy playing this as much as I enjoyed making it.
As always: comments, feedback etc are much appreciated!

Cheers,
dapy

I have applets turned off everywhere now so I can’t play any of the 4k games that easily, but hot damn does that ever look impressive for a 4k game.

Very nice world sim and terrain generation, reminds me of the settlers.
Well done for 4k.

Very nice ! Your game just took one hour of my time :slight_smile:

Not much to say but: Very cool! 8)

Very nice!

Enhancement request: holding down the arrows to scroll too.

Procedural generation rules in 4K ! This Tiny World has a complex gameplay and a great design. Well done !

Very, very, well done! :slight_smile:

The only lack I have is that the computer is extremely slow that it’s impossible not to win :stuck_out_tongue:

Mike

Very nice! Reminds me of settlers II.

Haha, this is inspired by a game I made? Wow! The terrain looks great, and whats more important: it’s a fully playable and fun game! Everything’s smooth here, and the AI does pose a challenge (which depends on the starting positions I guess, but that’s cool).

Very impressive, congratulations on a great little game ;D

Awsome :smiley:

Wow, I’m humbled by all the positive replies, especially the comparison with the excellent Settlers games ;D

Totally agree - it’s amazing what procedural generation can do, even with a simple algorithm (as is the case here).
Hopefully, the source code is commented well enough for people to find the 20 or so lines of PG code. Experimenting with this kind of thing is great fun, and is one of the main reasons why I write 4K games.

Good idea - I did start out with this functionality, but removed it to save space. I’ll add it back in if I can find the spare bytes!

I fear you’re better at playing my game than I am! Care to share your strategy, so I can teach Mr AI?

At one stage in the development, the AI would beat me 90% of the time. Now it wins 33% of the time, depending on the starting location. Either I’ve become less stupid (unlikely), or the AI has become more stupid (oops)…

I lost many an hour to this game! Great job. My only suggestion is to add the cost of buildings, maybe displayed on hover? Perhaps make different buildings cost different resources. If you have room. Otherwise this is an awesome game!

My build order is something like this:
Wood
Wood
Wood
Farm
Wood
Farm
Wood
Stone
Farm
Stone
Stone
Farm
Soldier
Soldier
Conquer npc village
Farm
After this, add food when needed to keep a couple of soldiers around for defense and add extra buildings if running short on one of the materials, use the rest of the soldiers for conquering things

It is a slow start but seeing as the computer never rushes it pretty much guarantees a win :slight_smile:

Mike

Cheers for that, I might tinker with the AI.

FAO everyone else: no peeking at Mike’s post :stuck_out_tongue:

Perhaps there could be diminishing returns with each building you build at the same town… Right now I just mass produce at my first town and turtle until I have enough soldiers to conquer the entire map all at once. There does not seem to be much motivation to attack other towns earlier in the game.

Great game and great presentation!


bernie

Now that is a very good idea!
I’m a bit short of bytes, but I’ll see what I can do…

That is really amazing how much life you have managed to squeeze into a 4K game. I do however agree that it is a bit too easy. I had a quick look at the code and made an attempt to make it a bit more challenging. It can certainly be improved quite a bit more, but it gave me a good challenge. I changed a small piece of the code ~2/3 down:


	// compare resource income to desired income: village with below desired resource income => more likely to build to accumulate that resource
	int bestScore = -1;
	int bestIndex = -1;
	for (j = 0; j < 3; j++) {
		// base build score is dependent on levelTime versus resource income: resource income should increase over time
		int score = 0;
		// less likely to build if we have enough ore for a soldier
		if (entity[TOTAL_ORE] >= COST_SOLDIER_ORE) {
			score -= 32;
		}
		
		if (j == RESOURCE_WOOD) {
			score += (8 - entity[TOTAL_WOODCUTTER])*4;
		}
		// more likely to build a farm if the village has low food and a food deficit 
		if (j == RESOURCE_FOOD &&  entity[USED_FOOD] > entity[GAINED_FOOD]) {
			score += (8 - entity[TOTAL_FOOD])*5;
		}
		score += 16 - entity[TOTAL_RESOURCE_INDEX+j]/4;
		if (score > bestScore) {
			bestIndex = j;
			bestScore = score;
		}
	}

I don’t think that the changes will take up more space than the original code, and in my view it made a really cool game a tad bit better . You do as you please with the code above naturally.

One idea to make the whole thing more strategic and prevent the “building one village” approach, could be to have one common resource pool for all villages for each player. Not sure where the villagers should be spawned though.

Anyway, congrats on a really cool game.

Nice game! I like the fancy zoom function and the isometric view.

Maybe a bit easy, but still fun to play and very addictive.

I finally got around to playing it, and it’s a fun little game, though I agree that it’s entirely too easy. I’m really impressed by how nicely the elevations are rendered, it’s better-looking than a lot of tile renderers ten times the size.