Fantasy World Creations

Fantasy World Creations => General Discussion => Topic started by: Hasabushi on November 17, 2013, 06:35:17 PM

Title: Java Programming Hilarity
Post by: Hasabushi on November 17, 2013, 06:35:17 PM
I've been working on a Bard's Tale type game and was testing some of the code when I had this interesting encounter. Remember all this is randomly happening. So with no further adue' I present

Sir Mordrid vs the Rat :D



Sir Mordrid gains the advantage!
Sir Mordrid swings his sword doing...
1 points of damage
Rat repells
1 points of damage!
The Rat repelled all damage!

A Rat has gained the advantage!
A Rat attacks Sir Mordrid with
bite attack doing...
1 points of damage!
Sir Mordrid repells
6 points of damage!
Sir Mordrid repells all damage!

A Rat has gained the advantage!
A Rat attacks Sir Mordrid with
bite attack doing...
1 points of damage!
Sir Mordrid repells
6 points of damage!
Sir Mordrid repells all damage!

Sir Mordrid gains the advantage!
Sir Mordrid swings his sword doing...
1 points of damage
Rat repells
1 points of damage!
The Rat repelled all damage!

Sir Mordrid gains the advantage!
Sir Mordrid swings his sword doing...
1 points of damage
Rat repells
1 points of damage!
The Rat repelled all damage!

Sir Mordrid gains the advantage!
Sir Mordrid swings his sword doing...
1 points of damage
Rat repells
1 points of damage!
The Rat repelled all damage!

Sir Mordrid gains the advantage!
Sir Mordrid swings his sword doing...
1 points of damage
Rat repells
1 points of damage!
The Rat repelled all damage!

Sir Mordrid gains the advantage!
Sir Mordrid swings his sword doing...
2 points of damage
Rat repells
1 points of damage!
Rat took 1 points of damage!

A Rat has gained the advantage!
A Rat attacks Sir Mordrid with
bite attack doing...
1 points of damage!
Sir Mordrid repells
6 points of damage!
Sir Mordrid repells all damage!

A Rat has gained the advantage!
A Rat attacks Sir Mordrid with
bite attack doing...
1 points of damage!
Sir Mordrid repells
6 points of damage!
Sir Mordrid repells all damage!

Sir Mordrid gains the advantage!
Sir Mordrid swings his sword doing...
2 points of damage
Rat repells
1 points of damage!
Rat took 1 points of damage!

A Rat has gained the advantage!
A Rat attacks Sir Mordrid with
bite attack doing...
2 points of damage!
Sir Mordrid repells
6 points of damage!
Sir Mordrid repells all damage!

A Rat has gained the advantage!
A Rat attacks Sir Mordrid with
bite attack doing...
1 points of damage!
Sir Mordrid repells
6 points of damage!
Sir Mordrid repells all damage!

A Rat has gained the advantage!
A Rat attacks Sir Mordrid with
bite attack doing...
1 points of damage!
Sir Mordrid repells
6 points of damage!
Sir Mordrid repells all damage!

Sir Mordrid gains the advantage!
Sir Mordrid swings his sword doing...
2 points of damage
Rat repells
1 points of damage!
Rat took 1 points of damage!

Sir Mordrid gains the advantage!
Sir Mordrid swings his sword doing...
2 points of damage
Rat repells
1 points of damage!
Rat took 1 points of damage!

A Rat has gained the advantage!
A Rat attacks Sir Mordrid with
bite attack doing...
2 points of damage!
Sir Mordrid repells
6 points of damage!
Sir Mordrid repells all damage!

Sir Mordrid gains the advantage!
Sir Mordrid swings his sword doing...
2 points of damage
Rat repells
1 points of damage!
Rat took 1 points of damage!

Sir Mordrid
**uses special skill** SHIELD BASH

Rat takes 5 damage from SHIELD BASH

Sir Mordrid
**uses special skill** SHIELD BASH

Rat takes 5 damage from SHIELD BASH

Rat is dead!


The Results of the battle are:
Sir Mordrid Killed 1 Rat!



Now remember Sir Mordrid can do up to 7+ points of damage. So this is quite hilarious, he finally just resorted to shield bashing the bugger :D
Title: Re: Java Programming Hilarity
Post by: Throndir on November 18, 2013, 10:40:22 AM
Is that a bug or something? Its great how the shield does more damage than the sword.
Title: Re: Java Programming Hilarity
Post by: Hasabushi on November 18, 2013, 12:21:27 PM
Something with the logic that caused the bug, it's only happened once, but it's def hilarious.
Title: Re: Java Programming Hilarity
Post by: Hasabushi on November 18, 2013, 07:09:51 PM
I'm actually considering using my engine to develop "Silver Arms" into a RPG using the deep system I'm designing :) You could be the creative designer that does all the plot work and world building :)
Title: Re: Java Programming Hilarity
Post by: Grimston on November 18, 2013, 07:26:25 PM
Java = The Problem :D

I detest java, probably due to its crappy debugging/compiler errors
Title: Re: Java Programming Hilarity
Post by: Hasabushi on November 18, 2013, 07:50:54 PM
Ahh come on :P, You Don't like public private abstract static void implemented methods :P

Actually I always do my design in Java, JavaFX, although on release I tend to lend more toward Visual C# or Python. for final release.

And yes Java does have some issues especially in debugging, but once you get used to the ex's and alot of Try-Catch's you can easily track down the expections, of course granted, that takes experience. Also remember java 7 has come a long way since java 1.1. Just look at the memory allocation now compared to then as well as excellent garbage collection (unlike C++) catching all those dead Objects :D

**UPDATE**
And actually Java wasn't the problem, I found the error in that the ArrayList, didn't get one of its index's cleared, that was a programmers error, something that with just the right set of circumstances could happen :D
Title: Re: Java Programming Hilarity
Post by: Grimston on November 18, 2013, 08:20:16 PM
I will agree that java has come along way, but it still a pain in the ass to read error on "Line 73" while you only have 70 lines.... just because it cant count lines, when it compiles the byte code :P (The error was actually a missing semi colon on line 13)

I prefer to write everything in C#.

One thing I would like to see is C# ASM Library's be nicer calling pure assembly code from C# for speed improvement.
Title: Re: Java Programming Hilarity
Post by: Hasabushi on November 18, 2013, 08:26:53 PM
That I can totally agree on.

As far as errors like that netbeans has alot of useful tools in debugging.
I tend to always forget a ")" in a rather long an obnoxious if/else logic method lol I think 115 lines has been my longest if statement :D. And it gives me an error in line 512 LOL

Also I find the console logger to be my absolute best friend :D

Wanna try something really fun, build a complete roleplaying engine in PHP LOL, it can be done, but man the growing pains :P
Title: Re: Java Programming Hilarity
Post by: Grimston on November 18, 2013, 09:14:26 PM
Java is a fairly strange language with debugging, Netbeans does help a lot thankfully.

PHP is so much fun, and I have tried that, cant remember how it went, think I got it up to walking around a world, using lots of AJAX and JavaScripts. I think I had basic combat as well.... lost on my old hard drive anyway :(