Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (603)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (652)
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  
  Metro4K  (Read 3033 times)
0 Members and 1 Guest are viewing this topic.
Offline nullterm

Senior Newbie

« Posted 2007-01-10 04:01:34 »


Webstart -

Homepage -

A small city building simulation. Construct as big of a city as you possibly can. Keep it powered with utilities and safe with emergency services. The higher a section goes, the bigger it gets and the more it helps to fuel the entire city system. The more successful your city becomes, the more money you get to build it even larger.

Plan your city. Make sure that industrial pollution won't hinder the growth of residential areas. Make sure there is adequet transportation with streets. Use parks around the city and the waterline to make the city more beautiful for residential and commercial districts.

My 2nd contest entry (and game in Java).  An inspired re-make of an old classic.  More challenging trying to get the simulation working.  If there's one thing I wish I could squeeze in, it would be a system for communicating how well different areas of the city are doing (crime, pollution, utility, work, products, retail, etc).  May take a 2nd look at it to see if there's some more byte crunching I can do.  But there's only so much you can do in 4K, as you're well aware.  Wink

See the homepage for more details and instructions.

Have fun!

Offline g666

Junior Devvie

« Reply #1 - Posted 2007-01-10 11:36:28 »

Wow, a really well done game!

Looks nice and plays very nicely. Much more of a city sim than i would expect to be do-able in 4k.

If you have some more space tho, you could make it slightly harder, i ended up with so much money i couldnt spend it fast enough. Also you could give some more feedback to why areas are doing poorly.

desperately seeking sanity
Offline nullterm

Senior Newbie

« Reply #2 - Posted 2007-01-10 12:31:10 »

Haha, wicked city.

You nailed it right on the head with your two comments...

Once you get enough momentum, you can keep going.  Still trying to think of a way to balance it so it's not as easy. 

And I'd love to have more feedback.  I had a feature for displaying bars over the zones to monitor the stats.  But they had to get pulled out to slip under the size limit.

I just barely squeezed in the procedural water generation, which was a bigger plus than I thought it would be.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Orangy Tang

JGO Kernel

Medals: 57
Projects: 11

Monkey for a head

« Reply #3 - Posted 2007-01-10 13:45:49 »

Really cool.  Grin Even if it doesn't make it under the size limit, I'd still like to play a version with more feedback and stats.

[ - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline appel

JGO Wizard

Medals: 69
Projects: 4

I always win!

« Reply #4 - Posted 2007-01-10 13:47:40 »

I never liked these Sim games, although I remember playing SimTower way back...and enjoying it a bit.

But this entry is amazing Smiley Very nice achievement, I'm impressed.

Check out the 4K competition @
Check out GAMADU (my own site) @
Offline moogie

JGO Ninja

Medals: 16
Projects: 6
Exp: 10 years

Java games rock!

« Reply #5 - Posted 2007-01-10 21:28:34 »

some tips to reduce your jar size:

-use pngcrush or similar on your graphic file
-rename the graphic file to "m" instead of "m.png"
-convert all the static methods to non-static methods
-try to reduce the number of methods used (each method needs an entry for its signature in the resulting class file)
-I am not sure, but does your webstart version of the JAR selfexecuting? if so it is not necessary so remove the meta-inf directory to save space. (you will need to put it back in for your downloadable JAR version (which can be over 4k as long as the webstart version is under 4k)
-reduce the number of static and class variables as like with the methods, these variables' signatures are recorded in the class file. Instread try to make 'method scope' variables where you can.

Ideally you will only have two 'methods' one main entry method which will call the constructor where all your code is.

The main trick to fit more into 4k is to NOT think OO and do nastry procedual code Smiley

The final point is to run your .class through an optimiser (see 4KJO for a tool which attempts to find the best combination)

Java4k RIP 2014
Offline appel

JGO Wizard

Medals: 69
Projects: 4

I always win!

« Reply #6 - Posted 2007-01-10 22:50:57 »

Easy to optimize more.

I used bjwflate on the contents of your jar, and it went from 4.090 bytes to 4.039 bytes.

Also, you don't need that META-INF directory if your jar is webstartable. I deleted it and rezipped it, it' s now 3.906 bytes., saving you 184 bytes.

I took a look at your code using jshrink, and I noticed few things that could be done differently that could probably save you up to 100 bytes. You should take a look Smiley

You're using a lot of methods, try inlining them instead.

Check out the 4K competition @
Check out GAMADU (my own site) @
Offline moogie

JGO Ninja

Medals: 16
Projects: 6
Exp: 10 years

Java games rock!

« Reply #7 - Posted 2007-01-10 23:30:01 »

I just ran your game through 4KJO to make an embedded pack200 self exectuing JAR.

The only changes i made was to remove the main() method from your m.class and to remove the manifest.

I was able to compress it down to: 3651 bytes! (see the attached file)

With optimistaions to the structure of your program I would imagine another 100-200 bytes could be saved.

Java4k RIP 2014
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

SHC (14 views)
2015-08-01 03:58:20

Jesse (17 views)
2015-07-29 04:35:27

Riven (38 views)
2015-07-27 16:38:00

Riven (20 views)
2015-07-27 15:35:20

Riven (22 views)
2015-07-27 12:26:13

Riven (12 views)
2015-07-27 12:23:39

BurntPizza (32 views)
2015-07-25 00:14:37

BurntPizza (44 views)
2015-07-24 22:06:39

BurntPizza (25 views)
2015-07-24 06:06:53

NoxInc (33 views)
2015-07-22 22:16:53
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 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‑
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!