EvilZone

Programming and Scripting => Java => Topic started by: Deque on August 10, 2013, 02:44:44 PM

Title: Preview - Gladiator management game
Post by: Deque on August 10, 2013, 02:44:44 PM
Hello EZ.

I started to code a gladiator management game. The fighting stage is now playable.
You are the left gladiator and have to fight the one on the right side.

(http://s1.directupload.net/images/130810/t8s4nnla.png) (http://www.directupload.net)

I painted all sprites by myself except for the background. I will replace it later with my own painting.

Starting the program:

Extract Gladiator.zip. In Windows run start.bat, in Linux run start.sh.
On MacOS use your terminal and type: java -Djava.library.path=./gladiator_lib/native/macosx -jar gladiator.jar
For Solaris exchange macosx with solaris in the path.

Controls:

You will get into a basic inventory screen which I made for testing. Drag and drop the item you want to the character and press enter to start the fight.

space - attack
lctrl - block
enter - restart fight
arrow keys - walk

Code: https://github.com/katjahahn/Gladiators (https://github.com/katjahahn/Gladiators)
LOC: 1439
Download program: http://uppit.com/elem168tqcly/Gladiator.zip

Tell me your impressions.
Title: Re: Preview - Gladiator management game
Post by: Kulverstukas on August 10, 2013, 05:22:47 PM
What can I say. +1 for the effort but -1 because it crashed my system.
I'm running winxp SP2 and everything was fine, except for the huge delays (about a second or two) when you drop stuff on your gladiator. When I pressed Enter to fight, I was slapped with a BSOD.
I see you implemented log4j, but you probably turned that off because I didn't get any logs to post :/
Title: Re: Preview - Gladiator management game
Post by: Deque on August 10, 2013, 08:49:15 PM
What can I say. +1 for the effort but -1 because it crashed my system.
I'm running winxp SP2 and everything was fine, except for the huge delays (about a second or two) when you drop stuff on your gladiator. When I pressed Enter to fight, I was slapped with a BSOD.
I see you implemented log4j, but you probably turned that off because I didn't get any logs to post :/

I am sorry that your system crashed. But I really can not imagine why this would happen. I never had any problem like this, no delays, no crashes or anything like that. (Linux)
The game uses Slick2D and the native libraries that come with it. I will test it on Windows and see if the same happens to my system.
Logging is not turned off. It is on INFO level, but it is by now not written to a file, only to stdout.

Title: Re: Preview - Gladiator management game
Post by: Kulverstukas on August 10, 2013, 09:05:35 PM
Logging is not turned off. It is on INFO level, but it is by now not written to a file, only to stdout.
You should make it log to a file when releasing to public so that people can post their logs :)

You are going to the game dev side or what? I see you are releasing all kinds of games in Java...
Title: Re: Preview - Gladiator management game
Post by: Deque on August 10, 2013, 10:04:26 PM
You are right. Let's see if I can fix this. I tried on Windows 7 now and got these issues:
The framerate jumped to 800 fps which is way too much. (with Linux I always get 60-65 fps)
The lags after dropping items on the character appeared too.
The game took a long time to start.

It didn't crash, though.

I updated to the newest lwjgl version, but it didn't change anything.
I will see if limiting the framerate helps.

Quote
You are going to the game dev side or what?

I have some games in my mind that I really need to make. So, yes.
However, the last game I posted was for university. This one is for me.

Thanks for feedback to help me find some issues.
Next time I will turn on logging.
Title: Re: Preview - Gladiator management game
Post by: Deque on August 11, 2013, 01:21:39 PM
@Kulver: I believe that the high framerates are the cause, so I turned on VSync which synchronizes the framerate to your vertical display refresh rate. I would highly apprechiate it if you could try again if it works. But I understand if you don't feel like it because of the crash.

Here is the new download link: http://uppit.com/ocixxk4qil17/Gladiator.zip
Title: Re: Preview - Gladiator management game
Post by: Deque on August 12, 2013, 09:13:56 PM
Alright. I made some changes. First I used the targetFrameRate option. Second I set a limit to the logic updates of the game, so even if the framerate is high, it shouldn't use up the CPU that much. (The default option sets one logic update per frame)

Other than that I fixed the issue that choosing similar items won't move them back to the inventory and I added some new items.

I made a very small download for those who still have the old version (240KB). So if you still have the old folder, replace the gladiator.jar and the sprites folder from the download here:
http://uppit.com/sqhahw1tdkhp/GladiatorSmall.zip
Title: Re: Preview - Gladiator management game
Post by: Deque on August 13, 2013, 11:15:45 AM
@Kulver: Turned on logging now and achieved a steady framerate of 120 on Windows 8. It is still not as smooth as on Linux, but it works for me.
Title: Re: Preview - Gladiator management game
Post by: hanorotu on August 13, 2013, 10:11:26 PM
Very cool, will check it out later!