Author Topic: Anyone using Java here?  (Read 2247 times)

0 Members and 1 Guest are viewing this topic.

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Anyone using Java here?
« on: March 14, 2013 »
I'm a little over 3 weeks into learning the java language (need to since a publisher wanted to publish one of my  games to android).

At first I hated it, but after a few hours I learned to like it. 

The way a approach my learning is to make a game (weird) but it helps me to learn the language in a faster pace and I used Java2D (instead of OpenGL) to do the GFX in order to force me to learn the intricacies of the language.

So far, here's what I've done:

Update:





DL(with source):
http://rel.phatcode.net/junk.php?id=139

No sound version:
http://www.rel.phatcode.net/Temp/%5bJava%5dZweihanderNoSound.zip

Notes:
Quote
Zweihänder

Relminator
http://rel.phatcode.net

Language - Java
Graphics Context - Java2D
Sound - TinySound by Finn Kuusisto
Platform - Anywhere there's a JVM
GFX - AAP, Rel and some GFX fillers I found on the net
Music - VGmusic

Source license - Free to use as long as credit is given.

* No in-gameplay heap allocation so GC should not kick-in midplay.
* Used a "recycling" system to manage all the entities so heap allocs are only done at startup
* Entity manager is batched to minimize ram-latency (behaviors and animators are still not batched)
* Not sure if tinysound allocates memory on play().
* One enemy type for now but making other enemies should not be too hard.
* Needs better GFX (excepting bullets)

BTW, Does this thing stutter on your setup? If it does, how about the no sound version?  Does the no sound version still stutter?

Comments on code are welcome.
« Last Edit: March 22, 2013 by relsoft »
Challenge Trophies Won:

Offline Hotshot

  • DBF Aficionado
  • ******
  • Posts: 2114
  • Karma: 91
    • View Profile
Re: Anyone using Java here?
« Reply #1 on: March 15, 2013 »
I used to do Java years ago when I was at college but I hate it as I was struggling with it...

Java2D could be interesting and I guess it is easier than C++ but not sure about C++ with game library(Such Allergo, SDL and So on) thought :)

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1666
  • Karma: 133
    • View Profile
Re: Anyone using Java here?
« Reply #2 on: March 15, 2013 »
holly mother!!!

lol your bullet hell engine is incredible (eyegasms to be had). i've not run it in years but its come on a long long way.

how do you find java 2d?! i done a course on java about three years back but it was all focused on the language itself. by the end of the course i vowed id never touch it again lol. looking at this defo has me interested again though.

awsome stuff as usual rel.
esp as its in java.
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: Anyone using Java here?
« Reply #3 on: March 17, 2013 »
I salute anyone who can code in Java - I find the development kit to be confusing.

Either I'm missing something simple or you guys are geniuses.
You are our 9001st visitor.
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17378
  • Karma: 497
  • evil/good
    • View Profile
    • My Homepage
Re: Anyone using Java here?
« Reply #4 on: March 17, 2013 »
I use Java in work as the real time pricing rules that sit between our broker software, web services and comparison sites are written in a rather unusual combination of Java and Drools..  Because of the strange combination, Eclipse does not generate any compile errors, it's used purely as a text editor! The rules are compiled using Apache Ant and the only way to debug code is to be very, very careful when writing it and then use loggers in the code to trace through and see where it fell over if it crashes in the test environment.  I've done this for the last 2 years now, it's not too difficult but it was a steep learning curve at first... As for graphics in Java, I wouldn't know where to start!

Shockwave ^ Codigos
Challenge Trophies Won:

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1666
  • Karma: 133
    • View Profile
Re: Anyone using Java here?
« Reply #5 on: March 19, 2013 »
lol that sounds like fun Sw... do you find your self doing the one eye closed one eye half open as your testing code out?
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17378
  • Karma: 497
  • evil/good
    • View Profile
    • My Homepage
Re: Anyone using Java here?
« Reply #6 on: March 19, 2013 »
lol that sounds like fun Sw... do you find your self doing the one eye closed one eye half open as your testing code out?

I've never actually put a catastrophic bug live into the system but the potential for harm is really high so putting new pricing rules is a very, very scary thing knowing that there are thousands of requests an hour hitting our web services I could blow a lot of money in one go!
Shockwave ^ Codigos
Challenge Trophies Won:

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Re: Anyone using Java here?
« Reply #7 on: March 22, 2013 »
Thanks guys!!!
I've updated the engine and decided to make a little game out of it(WIP)

I also used a "recycling" technique so that there would be no heap allocs in-game.  GC should not kick in while in-play.

Version with sound:
http://rel.phatcode.net/junk.php?id=139

No sound version:
http://www.rel.phatcode.net/Temp/%5bJava%5dZweihanderNoSound.zip




Please tell me if it still stutters.

See first post.

Challenge Trophies Won:

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1666
  • Karma: 133
    • View Profile
Re: Anyone using Java here?
« Reply #8 on: March 24, 2013 »
hey rell thats awsome mate!

i do get stuttering however, its happening at periodic times maybe every 10 seconds im on an i7 3.4 cpu so its not that.. at a guess it feels like the vm is doing some processes thats conflicting with your game at those periods.

top stuff though!
Challenge Trophies Won:

Offline MattR

  • ZX 81
  • *
  • Posts: 2
  • Karma: 1
    • View Profile
Re: Anyone using Java here?
« Reply #9 on: July 02, 2013 »
Nice. Very Cave-like.

I'm using Java2D to re-create basic demo techniques as well.

Cheers,
Matt