Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (517)
Games in Android Showcase (123)
games submitted by our members
Games in WIP (577)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  Hunters4k  (Read 18793 times)
0 Members and 1 Guest are viewing this topic.
Offline Markus_Persson

JGO Wizard


Medals: 16
Projects: 19


Mojang Specifications


« Posted 2005-02-08 19:44:41 »

http://www.mojang.com/j4k/hunters4k/
woot broken board

Play Minecraft!
Offline Markus_Persson

JGO Wizard


Medals: 16
Projects: 19


Mojang Specifications


« Reply #1 - Posted 2005-02-08 19:47:03 »


Play Minecraft!
Offline darkprophet

Senior Duke




Go Go Gadget Arms


« Reply #2 - Posted 2005-02-08 19:58:13 »

U hav managed to hax evry OS to disply 4K instead of 1Mb! Gd God dis is awsome!  Grin

Jst kidin, DP

Friends don't let friends make MMORPGs.

Blog | Volatile-Engine
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #3 - Posted 2005-02-08 20:04:11 »

AwesomeWork;D

FSMThrewAInvalidDisplayModeException.Well,WindowedWorked:)

弾幕 ☆ @mahonnaiseblog
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #4 - Posted 2005-02-08 20:15:37 »

I have just enough space to say this: Dude, you suck. Grin

Great work. :-)

Java Game Console Project
Last Journal Entry: 12/17/04
Offline nonnus29

Senior Duke




Giving Java a second chance after ludumdare fiasco


« Reply #5 - Posted 2005-02-08 21:20:56 »

Awesome ai; creepy!  Excellent!
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #6 - Posted 2005-02-08 21:42:01 »

Since the board is back to normal now...

Fullscreen mode didn't work. It just gave me an InvalidDisplayMode exception.

The "crosshair" is interesting, but it's quite weird to have the crosshair jitter around.

The shading of the spheres looks pretty good. How did you do that? Smiley

弾幕 ☆ @mahonnaiseblog
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #7 - Posted 2005-02-08 22:59:31 »

Quote
Fullscreen mode didn't work. It just gave me an InvalidDisplayMode exception.


Fullscreen works on my GeForce 2 GTS, but windowed mode doesn't work on my Mac. It just shows a blank window. I didn't try fullscreen.

Quote
The "crosshair" is interesting, but it's quite weird to have the crosshair jitter around.


The jitter isn't all that noticable in fullscreen. Windowed mode is the ugly one.

Quote
The shading of the spheres looks pretty good. How did you do that? Smiley


He did procedural texturing. Basically, it's a formula of some sort that produces the pixels you want. The most impressive of these is the Perlin noise formula. Ever see POVRay? That's the Perlin algo.

Markus, you should really release the source code so that others can learn about procedural texturing.

Also, a radar would be really nice. :-)

Java Game Console Project
Last Journal Entry: 12/17/04
Offline Abuse

JGO Knight


Medals: 13


falling into the abyss of reality


« Reply #8 - Posted 2005-02-08 23:04:02 »

That is very impressive!

Still quite alot of optimisations you can do to the source if you feel like adding sound to it Grin

Heres some suggestions Wink


Change all your double & long constants to smaller types.
Some can goto byte/short/int the rest will be fine as floats.

A classic example of this is :-

1  
enableEvents(someLong);


it generates smaller bytecode if you push a byte (or in your case a short) onto the stack, and then expand it to a long.

This would be the equivalent of :-

1  
enableEvents((long)someByte);


In most cases, it will save you 7 bytes in the constants pool, but cost you 1 extra bytecode instruction - a total saving of 6 bytes.
In your case, your flags value is 511, so you will only save 5 bytes by doing this.



Also, for the instances where you have Constants that are multiples of one-another (for example -PI, PI and 2PI).
It occupies less space if you don't expand the multiplication.

e.g.

1  
2  
3  
4  
5  
20.23452f + 40.46904f

ldc 20.23452f  (2 or 3 bytes)
ldc 40.46904f  (2 or 3 bytes)
fadd


8 bytes in the constants pool,
min. 5 bytecodes (max. 7)  to perform the op.

total 13-15.

1  
2  
3  
4  
5  
6  
7  
20.23452f + 20.23452f * 2

ldc 20.23452f  (2 or 3 bytes)
dup
fconst_2
fmul
fadd


4 bytes in the constants pool,
min 6bytecodes (max. 7) to perform the op.

total 10-11. A possible saving of upto 50%! =)


Adjusting some constants to allow them to be represented in a smaller type will shrink your constants pool.

For example, if you can, change all constant value usage from 128(short) to 127(byte).


Adjusting similar constants so they are identical, to eliminate constants from the constants pool saves you 2 fold - smaller constants pool, and reduced usage of the larger ldc2 instruction.


You could get rid of the 6 static fields, and replace it with 1 Object array. It would add some array dereferencing, but would allow you to have the minimum of 1 member variable.


The compiler &| obfuscator is adding in some bolox code ->
1  
2  
3  
4  
5  
if(g1 != g1)
    break;
    //  651 1193:aload           22
    //  652 1195:aload           22
    //  653 1197:if_acmpne       3356

Still unsure why this happens, but i've had it happen to me several times.


dispose()ing of the JFrame, rather than System.exit()ing,
would be cleaner (no low level Exceptions from Java2D), and may even give you a smaller constants pool!


You are using both BufferedImage & MemoryImageSource, eliminating the MemoryImageSource and doing it through the BufferedImage API may save some space.


Re-ordering some of your instructions (especially where you are repeatedly accessing the same Object reference), so you can take better advantage of the dup2 instuction to duplicate values (the object reference) on the stack 2 at a time.


Get rid of the Random class usage, this will save tonnes in your constants pool.
while poor programming practice, Math.random() will suffice.


In many places in the code, there are duplications of load instructions, when a dup instruction would generate smaller bytecode.

Here for example, you could save 2 bytes by swapping the second fload of each pair, with a dup.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
double d1 = Math.sqrt(f13 * f13 + f15 * f15);
    // 1643 2841:fload           38
    // 1644 2843:fload           38
    // 1645 2845:fmul            
    // 1646 2846:fload           39
    // 1647 2848:fload           39
    // 1648 2850:fmul            
    // 1649 2851:fadd            
    // 1650 2852:f2d            
    // 1651 2853:invokestatic    #75  <Method double Math.sqrt(double)>



Note all these optimisations pay no attention to how the changes will effect the efficiency of the jars zlib compression.
It would be near impossible to try and taylor the layout of your code so it got the most out of the compression.
The best you can hope to do, is make the basic class file as small as possible.

Ouch! Just noticed there is some StringBuffer usage in there.
Getting rid of that will save you atleast 40bytes.

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline mlk

Junior Duke




Muppet!


« Reply #9 - Posted 2005-02-09 03:48:54 »

Fantastic.  Grin

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

JGO Kernel


Medals: 191
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #10 - Posted 2005-02-09 04:02:42 »

Brilliant! Superb! Git! Smiley

Kev

Offline Markus_Persson

JGO Wizard


Medals: 16
Projects: 19


Mojang Specifications


« Reply #11 - Posted 2005-02-09 04:37:24 »

=D


The "crosshair" is actually the mouse pointer. Changing it to Cursor.CROSSHAIR took up less space then making it invisible, plus it saved me the space it'd take to draw a crosshair manually. Woot, hacks kick ass.


I will open up the sourcecode for both this and dungeon4k Real Soon Now(tm).



Oh, and abuse.. you have far too much free time. Wink
If I get some, I'll look into your suggestions. =)

Play Minecraft!
Offline rdcarvallo

Senior Duke


Projects: 5
Exp: 15 years


2D Java games forever!


« Reply #12 - Posted 2005-02-09 10:35:03 »

Great game..  

   
Embarrassed  Well, I give up!  DooM4K si doomed!

  Rafael.-
Offline Malohkan

Senior Duke




while (true) System.out.println("WOO!!!!");


« Reply #13 - Posted 2005-02-09 10:55:03 »

wonderful!  I wish I could play it in a larger screen though Smiley  Fullscreen didn't work for me here (on a Linux box) either.

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Offline jojoh

JGO Knight


Medals: 5
Projects: 7


games4j.com


« Reply #14 - Posted 2005-02-09 10:57:59 »

Absolutely amazing!  Cool

Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #15 - Posted 2005-02-09 11:43:08 »

Awesome!

Offline Morre

JGO Knight


Medals: 2
Projects: 10


I'm Dragonene on IRC.


« Reply #16 - Posted 2005-02-09 12:06:19 »

I think you're allowed to sign jar's without it counting towards the 4k limit, as long as you can present the same game in a 4k unsigned jar... is this wrong? If it is, I have to remove all my webstarts :S

Offline Malohkan

Senior Duke




while (true) System.out.println("WOO!!!!");


« Reply #17 - Posted 2005-02-09 12:15:21 »

Now all you need to do is combine this game with one of the 4K RPG's Grin

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Offline luisoft

JGO Coder


Projects: 6


Java games rock!


« Reply #18 - Posted 2005-02-09 23:50:04 »

may I say: the WINNER! It really amazing game for only 4kb...
Offline Kommi

Junior Duke




All opinions will be lined up and shot!


« Reply #19 - Posted 2005-02-10 00:53:16 »

Very cool. When will the source be avaliable Smiley ?

Kommi
Offline Markus_Persson

JGO Wizard


Medals: 16
Projects: 19


Mojang Specifications


« Reply #20 - Posted 2005-02-10 06:26:57 »

I'll make a signed webstartable version when I get home tonight, for easier testing. =)

Code is coming, but I've got a feeling it might be a good idea to delay it a bit.
Wouldn't want "Hünters4k" or something coming out a week before the end of the competition. Wink

Play Minecraft!
Offline Daniel_F

Junior Duke


Projects: 2


Java games rock!


« Reply #21 - Posted 2005-02-10 07:15:26 »

Thats amazing, never thought so much could be put into 4k.
So far the best java4k i have seen Wink
Offline bitshit

Junior Duke




Java games rock!!


« Reply #22 - Posted 2005-02-12 20:06:30 »

Quote
Code is coming, but I've got a feeling it might be a good idea to delay it a bit. Wouldn't want "Hünters4k" or something coming out a week before the end of the competition.


Looking forward to that, Im working on a raycaster in Java too (not 4k though  Wink) and always appreciate fellow programmers sharing their tricks... yes i'll share all my work too... when i get my website finished  Roll Eyes
Offline Evil-Devil

Senior Duke


Medals: 2


Fir Tree Master


« Reply #23 - Posted 2005-09-15 09:27:52 »

Even the thread is old and the DL link is broken. I'll like to see that 4k entry Smiley
Offline cborders

Junior Duke





« Reply #24 - Posted 2005-09-15 13:01:35 »

It worked for me!  It's a really fun game!  Any new about the thoughts of open source?
Offline anarchotron

Junior Duke




...precious bodily fluids.


« Reply #25 - Posted 2005-09-15 15:55:49 »

Same here.  That's really impressive.
Offline Alan_W

JGO Knight


Medals: 8
Projects: 3


Java tames rock!


« Reply #26 - Posted 2005-09-16 06:56:17 »

That's pretty neat.  Much more 3D in 4k then seems humanly possible Smiley

Time flies like a bird. Fruit flies like a banana.
Offline triple-ace

Senior Newbie





« Reply #27 - Posted 2005-09-27 08:38:01 »

GREEEEAAAAATTTTT!!!! as a newbie, what in my head now is : what is the source code looks.

I'm looking forward in seeing the code....
Offline Markus_Persson

JGO Wizard


Medals: 16
Projects: 19


Mojang Specifications


« Reply #28 - Posted 2005-11-06 20:27:22 »

Sorry about the _huge_ delay, but.. eh.. I forgot. Cheesy
I forgot over and over again.

Anyway, here's the source code:
http://www.mojang.com/notch/D.java

Do what you want with it. :-)

Play Minecraft!
Offline esu

Innocent Bystander





« Reply #29 - Posted 2005-11-09 19:13:49 »

This one is great!

Pages: [1] 2
  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.

TehJavaDev (33 views)
2014-10-27 03:28:38

TehJavaDev (27 views)
2014-10-27 03:27:51

DarkCart (41 views)
2014-10-26 19:37:11

Luminem (22 views)
2014-10-26 10:17:50

Luminem (27 views)
2014-10-26 10:14:04

theagentd (33 views)
2014-10-25 15:46:29

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

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

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

lcass (43 views)
2014-10-15 16:18:58
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!