Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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  
  Pocket Kingdom 4k  (Read 5834 times)
0 Members and 1 Guest are viewing this topic.
Offline Archibald

Junior Duke


Projects: 1



« Posted 2012-02-22 13:17:44 »

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


A turn based kingdom building game.
Offline UprightPath
« Reply #1 - Posted 2012-02-22 14:04:49 »

Good, if simple game. I'd have added a bit of randomness to it, in some form or another, but that's me. xD

Not sure how close are you to your space limit, but some information about the speed/value production of the various buildings might be in order. I know that when I was playing it I was left guessing at the rules (I looked at the code afterwards, and went "Oh, so that's what's happening!")

Offline ra4king

JGO Kernel


Medals: 350
Projects: 3
Exp: 5 years


I'm the King!


« Reply #2 - Posted 2012-02-23 03:46:35 »

Very fun! I managed to get 992 score, equipping 66 soldiers with a total morale of 126 and a castle size of 8.

Is there a max or target score? I have no idea how good that score is but for what I was able to accomplish, I'm proud of it Grin

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ReBirth
« Reply #3 - Posted 2012-02-23 03:49:16 »

There should be a goal to achieve, like good score above 3,000 or so on. I got +/- 1500.

Offline UprightPath
« Reply #4 - Posted 2012-02-23 04:27:41 »

There is a maximum! It's CastleSize*100+108+100. That's CastleSize*100 + Min(Pop,Weapons) + Morale.

Since there is no random component, it's rather easy to search the game's state-tree to figure this out (Perhaps a hint costly to do it, but...)

Offline Damocles
« Reply #5 - Posted 2012-02-23 05:01:08 »

Morale: 206
Soldiers: 102
Points: 1208

Funny little game.

Maby at the final stage there should be a war. The more soldiers you have, the
more lands (square Km) you can defend / conquer.

Offline ReBirth
« Reply #6 - Posted 2012-02-23 05:04:18 »

That's called Conquer System.

Offline Archibald

Junior Duke


Projects: 1



« Reply #7 - Posted 2012-02-24 09:31:38 »

Yeah, I usually add randomness and combat when I make thins kind of game. But the 4kb limit... Smiley

Score:
I think 1500 is good. A bit above 2000 should be max. Below 1000 is poor.


Can someone check if I submitted everything correctly (the jar file has no "manifest", probably; I'm a bit confused about these Java only specific things) and if there is nothing in the code that would crash the game? I started learning Java less than a week ago Smiley
Offline Mike

JGO Wizard


Medals: 84
Projects: 1
Exp: 6 years


Java guru wanabee


« Reply #8 - Posted 2012-02-24 20:01:07 »

108 soldiers, 265 morale, castle size 17, score 2073 Smiley

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline StephR

Senior Duke


Medals: 9



« Reply #9 - Posted 2012-02-24 23:49:50 »

Cool kingdom management game, Archibald. I checked a bit your code, and I noticed that you used a lot of methods in your class. If you have the time to do it, you should try to limit them to the start, run and handleEvent ones, in order to save some bytes.

So you may add a random event each turn, as bad or good weather, that would impact on food, and also some enemy raids, that would steal some food or destroy some building. Soldiers and the castle may decrease the impact of these raids.

But if you haven't the time for such changes, don't worry, your game is interesting enough as it is now.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Archibald

Junior Duke


Projects: 1



« Reply #10 - Posted 2012-02-25 00:29:13 »

I checked a bit your code, and I noticed that you used a lot of methods in your class. If you have the time to do it, you should try to limit them to the start, run and handleEvent ones, in order to save some bytes.
The methods cost in Java is confusing. I added more methods to save space, but it seems it is not working that way...

Would this:
1  
2  
3  
4  
   private void drawTopString(String s,int x,int y){
   setColorRainbow(0.7);    g.drawString(s,x+1,y+1);g.drawString(s,x-1,y-1);g.drawString(s,x-1,y+1);g.drawString(s,x+1,y-1);g.drawString(s,x,y+1);g.drawString(s,x,y-1);g.drawString(s,x-1,y);g.drawString(s,x+1,y);
   g.setColor(Color.orange);       g.drawString(s,x+1,y+1);g.drawString(s,x-1,y-1);g.drawString(s,x-1,y+1);g.drawString(s,x+1,y-1);g.drawString(s,x,y+1);g.drawString(s,x,y-1);g.drawString(s,x-1,y);g.drawString(s,x+1,y);
   }
be more compact than this?
1  
2  
3  
4  
5  
6  
7  
8  
   private void drawOutlineString(String s,int x,int y){
   g.drawString(s,x+1,y+1);g.drawString(s,x-1,y-1);g.drawString(s,x-1,y+1);g.drawString(s,x+1,y-1);g.drawString(s,x,y+1);g.drawString(s,x,y-1);g.drawString(s,x-1,y);g.drawString(s,x+1,y);  
   }
   
   private void drawTopString(String s,int x,int y){
   setColorRainbow(0.7);    drawOutlineString(s,x,y);
   g.setColor(Color.orange);        drawOutlineString(s,x,y);
   }
Offline StephR

Senior Duke


Medals: 9



« Reply #11 - Posted 2012-02-25 01:32:20 »

Archibald, to save space in this 4 Kb competition, the first rule would be "no more than the start, run and handleEvent methods in your class".

Yet, I just tried Riven's compressor tool chain on your source code, using Proguard, Pack200, Kzip and Zip2Gzip, and I reduced it to a mere 2 567 bytes.

So maybe you should try to understand how this tool chain works, instead of reducing the number of the methods in your program, as time is lacking. You'll find many informations about it in this thread :
http://www.java-gaming.org/topics/indiespot-compression-not-working/25147/view.html
Offline Archibald

Junior Duke


Projects: 1



« Reply #12 - Posted 2012-02-25 13:36:14 »

Yet, I just tried Riven's compressor tool chain on your source code, using Proguard, Pack200, Kzip and Zip2Gzip, and I reduced it to a mere 2 567 bytes.
I used ProGuard and JoGa for 3 965 bytes.
I have no Pack200 and can't find any download.
Offline toasten

Junior Duke





« Reply #13 - Posted 2012-02-25 14:08:28 »

Great game.

Is 2350 still "a bit above 2000"  Grin
Got it in 3rd try.  105 Soldiers, 245 morale and castle at 20.

Some hints on how the values changing at the next level would be nice.  Something like: "Food 100 (+10)"  or  "Iron 30 (-2)"

Offline Damocles
« Reply #14 - Posted 2012-02-25 14:22:26 »

Quote
I have no Pack200

You probably have it already,
check the bin folder of your JDK (whe javac is also), it must be in there

just type pack200 in the commandline to verify if its linked by the OS

Offline Mike

JGO Wizard


Medals: 84
Projects: 1
Exp: 6 years


Java guru wanabee


« Reply #15 - Posted 2012-02-25 18:44:42 »

108 soldiers (seems to be max seeing as that's the end population), 265 morale and castle of lvl 18, 2173 points Smiley

Also, festival only costs 150 even though it says 200

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline Mike

JGO Wizard


Medals: 84
Projects: 1
Exp: 6 years


Java guru wanabee


« Reply #16 - Posted 2012-02-25 18:53:24 »

108 soldiers, 280 morale, castle lvl 20, 2388 points Smiley

EDIT: 93 soldiers, 300 morale, castle lvl 20, 2393 points. Almost to the max I think

EDIT: 57 soldiers, 300 morale, castle lvl 21, 2457 points, seems like castle lvl is more important than soldier count.

EDIT: 1 soldier, 300 morale, castle lvl 22, 2501 points, yup, castle lvl>soldiers, peace ftw! Smiley

Last EDIT Smiley

41 soldiers, castle lvl 22, 300 morale, 2541 score Smiley

I give up Tongue

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline UprightPath
« Reply #17 - Posted 2012-02-25 19:12:42 »

Let's see... Maybe?

It's probably close. Hmmm, 300 Moral is probably just about the best you could manage, and it's probably close to what you'd get by managing to get 86 more Bricks and 43 more Wood. xD

Offline Mike

JGO Wizard


Medals: 84
Projects: 1
Exp: 6 years


Java guru wanabee


« Reply #18 - Posted 2012-02-25 20:21:58 »

I lied, I needed that last big record Tongue

I think it's possible to get 2-3 points more but I give up for real Wink

3 soldiers, 300 morale, castle size 23, 2603 points Smiley

Mike

EDIT: To make it more interesting and give several ways to play I'd suggest the following:

Have several levels of research and make food and mine research more interesting.
Have an upgraded castle give you more inhabitants (or at least have them pay more tax)
If you have lots of food people should come to your city quicker
Food decaying if you have a lot laying around
Not having an army after turn 30 or so should make you lose money due to raiding

and so on... Smiley

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline Mads

JGO Ninja


Medals: 26
Projects: 3
Exp: 6 years


One for all!


« Reply #19 - Posted 2012-02-26 06:08:11 »

I was overthrown Sad How does that even work?

Offline UprightPath
« Reply #20 - Posted 2012-02-26 06:13:07 »

Overthrown: Moral == 0. Moral == 0 when you have several consecutive turns without enough food.

Offline Archibald

Junior Duke


Projects: 1



« Reply #21 - Posted 2012-02-26 12:51:30 »

New version: production details on "tooltip" and overthrown cause explained.


The "do not use methods" is a myth. I have redid it and there was no change (whatever I gained from the removal of a method I lost on an additional if clause which I had to use instead). Anyway, that's my limit, can't fit anything more in 4kb.
Offline StephR

Senior Duke


Medals: 9



« Reply #22 - Posted 2012-02-26 14:53:34 »

Archibald,

I suppose that if your program relied initially on many methods, changing it in a version without any method may not be very effective in order to spare some memory. But if it didn't rely on any method from its very conception, then I think its size would be smaller.

Just tested your last version and didn't meet any bug. The addition of these tooltips was a good one.
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.

Longarmx (38 views)
2014-10-17 03:59:02

Norakomi (29 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (28 views)
2014-10-15 16:18:58

TehJavaDev (56 views)
2014-10-14 00:39:48

TehJavaDev (55 views)
2014-10-14 00:35:47

TehJavaDev (46 views)
2014-10-14 00:32:37

BurntPizza (64 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (78 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!