Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (580)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  tiny_world  (Read 3961 times)
0 Members and 1 Guest are viewing this topic.
Offline dapy
« Posted 2013-02-16 18:54:04 »

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



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:



Er... how did that happen?! I'm about to lose to the AI:



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

Cheers,
dapy
Offline sproingie
« Reply #1 - Posted 2013-02-16 19:39:00 »

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.
Offline Damocles
« Reply #2 - Posted 2013-02-16 20:28:30 »

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

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline deathpat
« Reply #3 - Posted 2013-02-16 20:51:29 »

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

work in progress : D A E D A L U S
Offline sixtyten

Junior Member


Projects: 1



« Reply #4 - Posted 2013-02-16 21:07:38 »

Not much to say but: Very cool!  Cool
Offline loom_weaver

JGO Coder


Medals: 17



« Reply #5 - Posted 2013-02-17 02:40:38 »

Very nice!

Enhancement request: holding down the arrows to scroll too.
Offline StephR

Senior Member


Medals: 9



« Reply #6 - Posted 2013-02-17 09:48:48 »

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

JGO Wizard


Medals: 69
Projects: 2
Exp: 5 years


Java guru wanabee


« Reply #7 - Posted 2013-02-17 10:27:35 »

Very, very, well done! Smiley

The only lack I have is that the computer is extremely slow that it's impossible not to win Tongue

Mike

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline jonjava
« Reply #8 - Posted 2013-02-17 11:22:45 »

Very nice! Reminds me of settlers II.

Offline Grunnt

JGO Wizard


Medals: 55
Projects: 9
Exp: 5 years


Complex != complicated


« Reply #9 - Posted 2013-02-17 12:33:39 »

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 Grin

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline RobinB

JGO Knight


Medals: 37
Projects: 1
Exp: 3 years


Spacegame in progress


« Reply #10 - Posted 2013-02-17 12:44:32 »

Awsome Cheesy
Offline dapy
« Reply #11 - Posted 2013-02-17 14:08:07 »

Wow, I'm humbled by all the positive replies, especially the comparison with the excellent Settlers games Grin

Procedural generation rules in 4K !

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.

Enhancement request: holding down the arrows to scroll too.

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!

The only lack I have is that the computer is extremely slow that it's impossible not to win Tongue

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)...
Offline zngga
« Reply #12 - Posted 2013-02-17 19:06:50 »

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 code never has bugs... it just develops unexpected features!
Offline Mike

JGO Wizard


Medals: 69
Projects: 2
Exp: 5 years


Java guru wanabee


« Reply #13 - Posted 2013-02-17 19:31:08 »

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

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 Smiley

Mike

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline dapy
« Reply #14 - Posted 2013-02-17 20:00:26 »

My build order is something like this... (top secret)

Cheers for that, I might tinker with the AI.

FAO everyone else: no peeking at Mike's post Tongue
Offline bernieberg

Senior Newbie


Medals: 1



« Reply #15 - Posted 2013-02-18 17:20:01 »

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
Offline dapy
« Reply #16 - Posted 2013-02-19 00:53:36 »

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. 

Now that is a very good idea!
I'm a bit short of bytes, but I'll see what I can do...
Offline jojoh

JGO Knight


Medals: 5
Projects: 7


games4j.com


« Reply #17 - Posted 2013-02-20 01:22:05 »

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:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
   // 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.

Offline Jens_S
« Reply #18 - Posted 2013-02-20 20:10:39 »

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

Maybe a bit easy, but still fun to play and very addictive.
Offline sproingie
« Reply #19 - Posted 2013-02-20 23:16:57 »

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.
Offline dapy
« Reply #20 - Posted 2013-02-21 00:31:08 »

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.

Great stuff, I really appreciate you taking the time to experiment with the code!
I added your logic and played around with it. The game plays out really well if you allow the AI to build up its villages. More troops = more fun, I think. However, if you build 1 soldier quickly, you can take all of the villages on the map before the AI gets the chance to develop.
Nonetheless, I think your logic is a step in the right direction.

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.

Oddly enough, there is a comment in my notes, saying: 'single resource pool versus resource pool per village - latter is more like Civ, encourages each town to be properly developed'... not sure this worked out quite as I originally intended!

I seem to be getting 2 comments regarding the difficulty: from developers (i.e. you guys) - "it's too easy"; from friends and family - "it's a bit hard". Perhaps I need to find friends/family who are more competent game players  Grin

Anyway, I hope to submit a new version with 'improved' AI in the next few days. Time will tell if it really is 'improved' or not!
Offline bernieberg

Senior Newbie


Medals: 1



« Reply #21 - Posted 2013-02-21 16:08:51 »

I seem to be getting 2 comments regarding the difficulty: from developers (i.e. you guys) - "it's too easy"; from friends and family - "it's a bit hard". Perhaps I need to find friends/family who are more competent game players  Grin

If you have room perhaps you could have a easy/hard AI options?

--
bernie
Offline toasten

Junior Member





« Reply #22 - Posted 2013-02-22 21:43:10 »

Really Addicting
Offline dapy
« Reply #23 - Posted 2013-02-24 15:49:17 »

I've just uploaded a new version to the usual place.

This includes tweaks to the balancing and the AI. Hopefully this version will provide more of a challenge!

Here are the changes:
  • AI build rate is much faster
  • each AI has its own opening strategy for the first few buildings
  • each new woodcutter/mine that you build reduces the effectiveness of all buildings of the same type in that village (thanks bernieberg for that idea)
  • villages gain background resources 33% quicker

I have a couple more things that I would like to add, but space (in bytes) and time (my free time) are conspiring against me...!
Offline PeterNicholson

Senior Member


Medals: 3
Projects: 1



« Reply #24 - Posted 2013-02-24 15:59:21 »

Really Addicting

I agree Cheesy

Subscribe to me on YouTube: http://youtube.com/javaprogrammerguy
Offline Mike

JGO Wizard


Medals: 69
Projects: 2
Exp: 5 years


Java guru wanabee


« Reply #25 - Posted 2013-02-24 17:46:42 »

Still a bit too easy but at least it is a step in the right direction Smiley One awesome thing to add would be difficult level where, if you select medium/hard, the computer starts cheating and gets extra resources.

Mike

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline dapy
« Reply #26 - Posted 2013-02-26 02:15:39 »

One awesome thing to add would be difficult level where, if you select medium/hard, the computer starts cheating and gets extra resources.

You read my mind!  Grin
I've uploaded another version, which includes a difficulty level. Press any key (er... except alt/shift/control...) to toggle between normal and hard difficulty.
If you don't see the difficulty level in the top right-hand corner, then please clear your java applet cache.
Offline bainit

Junior Member


Medals: 1
Projects: 1



« Reply #27 - Posted 2013-02-27 23:46:29 »

haha, very nice game. I like this kind of games.
You have my vote Grin
Offline forthx

Junior Member


Medals: 1
Projects: 1



« Reply #28 - Posted 2013-02-28 00:56:08 »

I can give you a way to win in les than 2 min in hard mode. Past 10 min you have few chance if you don't posses half the town. So for me the game balance have little problem.
Last time I clean the map with only 1 troop in 92s.
I admit it stay a very good game Wink


Teach this to your IA and nobody can win Wink

Build just 1 ore then1 wood building at start, as fast as possible in this order.
Wait and use your first troop to kill purple (or nearest enemy, generally purple build ore building fast then he is more dangerous) since IA build 3  building at start he has 0 troops to defend. If you are fast you can kill another IA in the same way. Now you may have 2 troop and last IA one... finish him !
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (51 views)
2014-04-15 18:08:23

BurntPizza (47 views)
2014-04-15 03:46:01

UprightPath (63 views)
2014-04-14 17:39:50

UprightPath (45 views)
2014-04-14 17:35:47

Porlus (62 views)
2014-04-14 15:48:38

tom_mai78101 (86 views)
2014-04-10 04:04:31

BurntPizza (144 views)
2014-04-08 23:06:04

tom_mai78101 (243 views)
2014-04-05 13:34:39

trollwarrior1 (202 views)
2014-04-04 12:06:45

CJLetsGame (209 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!