Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (601)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Newbie & Debugging Questions / Re: updating game files from server on: 2013-01-20 20:44:35
Let me see if i got this right.

I should have a list file on the server which holds all the checksums for all files, so it should kind of look like this:
item.java    8A9837D...ED1    [directory in the server, directory where to download to client]
   ...
dude.java  1D09B82... DF8    [directory in the server, directory where to download to client]

and i traverse through it line by line.

if a x.java is on the server but not on the client, i download that particular file
if a x.java's checksum differs from the client's checksum, i download that particular file and delete the old one

so this means my project should have a static "createCheckSum(File file)" function that must be called everytime i create some changes to my code, and I pass to this all of my .java files so that it can populate this list.

Am i on the right track here or did I completely miss your point? sorry if i did!
2  Game Development / Newbie & Debugging Questions / updating game files from server on: 2013-01-20 18:06:56
Hello,

I'm making a little game, which should have 2 Jars, one that runs first and whose job is to check the version of the client game and compare with the server version, if they differ i update the client files, if they're the same, i just run the application Jar.

I have a little server (only holds 20MB but that's fine for now), and I have a version.txt file which is what my updater compares the client version with.

My question is though, what would be a good way to determine which files to download and which ones are the same so don't bother downloading... my very barbaric solution was to check each and every single file from the server with each and every single file with the client but that's obviously not efficient.

Then I was thinking that perhaps each directory should have a version.txt file, so that if a directory version differs with the game, download the entire directory instead of the entire project, but that's still downloading stuff that i may not need.

Thank you for the help!
3  Game Development / Newbie & Debugging Questions / Re: Memory leak when drawing (2D game) on: 2013-01-05 08:05:59
right but do you traverse the 2D array every single draw call?

assuming 32x32 pixels fit on the screen that's 1024 iterations over the 2D array, every single draw call, I remember I tried that but it was much too slow, but I could try again see if it works.
4  Game Development / Newbie & Debugging Questions / Memory leak when drawing (2D game) on: 2013-01-05 07:54:53
Hello I have a question regarding the way i deal with drawing a scene.

TL;DR  What technique do you use to draw Tiles in your 2D game?


I first populate my tile map (essentially a 2D array of Images) once.

Once the 2D array is populated, i populate a buffered image, i set it to be the size of the 2D array (number of elements x size of image, etc)
  - Once the dimensions of said buffered image are done, i draw each image of the 2D array in the correct x and y location of the buffered image (start at 0, 0, then 0, 32, etc...)

So now i have this big buffered image, which is the size of the entire map (about 200x32px wide and 200x32px tall for the most part)

however, the issue comes when i draw the buffered image:

my draw function's signature is as follows:
  public void draw(   final Graphics2D g,
                        final int xOffset,
                        final int yOffset,
                        final int width,
                        final int height) { ... }

It basically takes a point and how wide and tall to draw (monitor size for example), once i have this information, I call the bufferedimage's subImage function, which takes in
an x and y location as well as the width and height, this returns the desired part of the big buffered image, that is what I draw.

However, I believe this causes memory leaks, I ran the profiler and generations usually go up at random intervals, all the way up to 8, probably more but I got tired of running the game.

My question is, what would be a better way of drawing a particular scene in the game?



5  Game Development / Newbie & Debugging Questions / Re: how to draw Sprites that turned to the left. on: 2012-12-08 04:08:13
I'm not sure I understand.

do you mean that my spritesheet should have some sort of x and y offset that should be used whenever i draw?

for example, if i extend my arm to the left, the x offset would be at like -30 or something, which would draw the entire image to the left.

I'm pretty sure that wasn't what you were talking about at all, but that actually seems a lot better than the "fix" that i have now... cool!

Here's how I do it.

When making a sheet, make a set frame width/height before putting it together (make sure it can hold all of the animations) So, when you're working on the sheet, be sure to center the sprites in the frames. That way when it animates, they aren't jittery.

To solve your left and right problem, if the character is symmetrical you could always flip the image horizontally. If you animated it right, the center alignment won't be messed up.

If you need an example I can throw one together.

Good luck bud.

EDIT:
To reiterate, each frame would be equal in width and height. Every sprite would go in a frame of the same size. So, a sheet would have 3x3, 16x16 frames. The first set containing an idle animation, the second running, and the third attacking. They would all be centered, so making an individual offset would no longer be necessary. Just be sure the frames are large enough to fit ALL potential sprites later or you may run into trouble.



ohhh... yeah yeah that's f**king brilliant.

My game was f**king up because i was using the dimensions of the actual Image as the collision hitbox, rather than having a separate invisible rectangle that represents the hitbox, so whenever the image changed dimensions it would f**k my game up (if i was beside a wall or something).

but yes, that seems like a really really good fix, (it seems so easy too, i'm stupid as f**k for never thinking of it).

Thanks a bunch!
6  Game Development / Newbie & Debugging Questions / Re: how to draw Sprites that turned to the left. on: 2012-12-08 03:36:31
I'm not sure I understand.

do you mean that my spritesheet should have some sort of x and y offset that should be used whenever i draw?

for example, if i extend my arm to the left, the x offset would be at like -30 or something, which would draw the entire image to the left.

I'm pretty sure that wasn't what you were talking about at all, but that actually seems a lot better than the "fix" that i have now... cool!
7  Game Development / Newbie & Debugging Questions / how to draw Sprites that turned to the left. on: 2012-12-08 03:01:30
I know it sounds like a cryptic question but it's been bothering for a while now.

I'm making some game, and the player has different Images that i use to give the illusion of Animation (when he walks, I rotate between 3 images, etc).

let's say that now my player wants to attack to the right, attacking means extending the arm of the player to whatever desired location, (really its just using an image with the dude's arm extended), naturally, since he's extending his arm, i am now using a wider image.

(this is an example spritesheet so you can see what i'm talking about http://spritedatabase.net/files/nes/193/Sprite/TrevorC3.png)

if the dude's attacking to the right, the arm is extended to the right, but there's no problem, since i draw to the canvas from the top left coordinate of the Image (x coordinate).

however, if the dude's attacking to the left, the arm is extended to the left, but there's a problem, since i draw to the canvas from the top left coordinate of the Image (x coordinate), now the "body" of the dude is drawn a bunch of pixels to the right instead of staying where it was, it's as if i were to try to punch something in front of me, but as i extend my arm, i walk backwards...

I'm not sure if i explained the problem... but can i get some help on this? I can clarify further if need be.

I kind of "fixed" this issue, essentially what i did was i looked at which animation image was displaying for that particular tick, and if it was one that made it extend its arm to the left i drew the character a few x pixels to the left.. but it seems like a hack to me rather than a legit fix...


Thanks!
8  Games Center / WIP games, tools & toy projects / Re: Untitled - 2D side scroller on: 2012-12-07 21:25:01
I thought i was reaching Hell or something, but one of the bumps were so big my jump speed wasn't enough to cross it, so i  was stuck.

I am VERY dissapointed!!!!1
9  Games Center / WIP games, tools & toy projects / Re: Untitled - 2D side scroller on: 2012-12-07 16:55:27
is the mountain meant to be like this?

all i did was walk left for a while, and suddendly the mountain took this shape.

http://postimage.org/image/h4fc4r7gt/
10  Games Center / Showcase / Re: DarkVania on: 2012-11-26 21:43:47
hmmm I'm getting there, i just asked my teacher about sleeping inside a game loop and he said that should never be done, the game should run as fast as it can but use some sort of variable that dictates how "fast" a sprite should move for that particular frame.

So i did just that, i no longer have a Thread.sleep(9) on my gameLoop, which is really, really good, it improves the look and fluidity on my laptop like you wouldn't believe.... thx guys, this is a really helpful forum, i just wish it were a bit more alive!
11  Games Center / Showcase / Re: DarkVania on: 2012-11-26 16:19:49
I keep hearing of this Slick2D thing on this forum... does that have faster drawing functions than Java2D or something? would it be a good idea for me to port this over to that?

anyways, about the nanoTime, it seems to me that if the computer clock is f**ked up and giving me some weird millisecond time, i assume it would also give me f**ked up nanosecond time, but i'll try your method and write back the results!
12  Games Center / Showcase / Re: DarkVania on: 2012-11-25 23:16:23
I actually just made a few changes to the game, and realized i probably should have posted this in the WIP sub-forum but I didn't see it.. can a mod delete this Thread so that i can put it there and not get bashed as some sort of spammer please?

Anyways, for the time being i'll include the changes here..

Should I upload a new version and add it here or wait for this to be deleted?


NOTE: One major issue that i have with the game is that on some machines, the player will jump lower than on others, i think this is because my game loop sleeps for a period of time (set to 9ms i believe) but even though it's supposed to sleep the same across all machines I realize relying on System.millis in not a good approach, but i don't see how i can have the game sleep the same amount of actual real time across all machines, any ideas?
13  Games Center / Showcase / Re: DarkVania on: 2012-11-25 17:35:17
alright thx for the input man,

I'll have to make the shield black even though it's supposed to be a Wooden shield!  : (

14  Game Development / Game Play & Game Design / Re: getting resources for your game on: 2012-11-25 17:32:05
that 40mm bofors AA gun seems a little OP!
15  Games Center / Showcase / Re: DarkVania on: 2012-11-25 16:54:54
oh okay, ignorant me thought all keyboards had the same layout, this game is apparently best played on N/A noob keyboards.
16  Games Center / Showcase / Re: DarkVania on: 2012-11-25 16:48:09
A Winner is me =D
Dark Souls player here, so got through it pretty quickly.
Seems like a very good tactical engine - this is fun.

Problems:
- The shield sprite is showing when you walk with it as well, however it doesnt work, only tested it against the spear. Also the shield sprite is a little small and unnoticeable
- Chip damage / block damage, should be shown in some way, only way to find out now it looking at the life bar.
- some ai bugs, if you go to close to a whip skeleton he may walk in place and hesitate
- the simple zombies should take one hit, OR should slow down when being hit
- if one whipping animation wasnt successful, due to being hit, the next one is sometimes cancelled midway - common simple programming mistake
- on the winning screen the cursor disappeared, so I couldnt click anything - you probably forgot to reset it after the game
- quitting the game somehow caused in a displaymode failure and I had to use windows setting to repair, I recommend adding a window mode to switch to by using the default ALT+ENTER
- indeed Z and X shouldnt be used - also a common mistake by QWERTY users, its very hard for QWERTZ people

Looks bad at first because of the placeholder graphics of course, but there is a really good fell to it. If I imagine there would be real sprites and cool music - this would kick ass


awesome reply!

yes, I am aware of every single issue you just mentioned!, except the invis cursor after winning, i was pretty sure i fixed that, maybe i released the wrong version.

the shield sprite is literally a 2x9 brown square, i couldn't be bothered to find an actual sprite for a shield (they're hard to find if all you want is the side of it) but yes I'm planning on much bigger/noticable shields in the future.

adding a numerical value when you hit enemies is in the works, same with different colored fonts when criticals are landed.

I've never found that whip skeleton bug, do you remember what you did when you encountered it?

I totally know what you mean about the attack animation restarting after being hit, (i fkin thought i fixed this too!) it was literally just one line of code that i added, i for sure uploaded an outdated version i apologize.

But i don't get the Z and X hate, what kind of weird ass keyboards do you people use??? but if you guys don't like it, tell me what they keys should be binded as and I'll just support those 2 version.

NOTE: also, could you please tell me how the game ran on your PC? was the camera movement very choppy?

thx for descriptive reply!
17  Games Center / Showcase / Re: DarkVania on: 2012-11-25 15:54:05
I essentially hardcoded the dimension of the DisplayMode object to be 800 by 600 instead of using the "best" that the user's monitor/video card can handle.

I assumed everybody could run a 800 by 600 that's why i made it so low, but it's really a simple fix, i actually have the code to use the client's "best" dimension rather than hardcoding a 800 by 600, but i decided not to use it because i actually thought it might give people trouble, live and learn!
18  Games Center / Showcase / Re: DarkVania on: 2012-11-25 13:42:33
Actually you are applied a brief moment of invul whenever you are hit, as stated on the upper left corner (but its not very clear at this point), but given the map is so short i found that if i made the invul longer you could just walk pass a lot of enemies, but later on i will enhance the invul frame.

Thx for feedback guys, ill answer the ones i remember:

Whip attack speed can be increased via items, theres one that enhances your atk speed by 20% for 15 secs, also like i mentioned, you'll be able to get better at particular weapons if you skill them up.

I use copyrighted material because a) im not making money off of this and b) im just testing my engine at this point.

Regarding jumping, i want you to be able to increase jumping mastery with skills/items, but yes i prob need to buff it a little bit.

Btw i forgot to mention, you have a shield, and you can parry the whip skeletons if you shield up JUST before their whips hit you, it takes a bit of practice but if done right you will stun them for 2 secs, leaving you time to land free hits as well as absorbing 100% incoming damage.

Im just glad its running fine for most of you guys.
19  Games Center / Showcase / Re: DarkVania on: 2012-11-25 05:36:35
very good,

for now you can only have a whip, but I want you to find other types of weapons like daggers/hammers/ etc, and allow you to specialize in particular weapons, so if you commit to training daggers then you get faster attack speed and cast on hit modifiers, or chances to stun if you commit to training hammers etc.

I'm working on adding magic/pyromancies, but you have to aim properly, it's not gonna be homing missiles or whatever.

NOTE: btw, could you tell me how well/badly it runs on your PC? this game uses only Java2D for rendering, and I realize that may be a little slow..
20  Games Center / Showcase / Re: DarkVania on: 2012-11-25 05:23:34
Like i said....

download the .zip.

unZip it to whatever directory you want

make sure graphics folder and DarkVania.jar are in the same directory.

double click DarkVania.jar, there's no need for me to change anything, i've tested this in 2 computers.
21  Games Center / Showcase / DarkVania on: 2012-11-25 01:40:08
Please delete thread!
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (30 views)
2014-12-15 09:26:44

Mr.CodeIt (20 views)
2014-12-14 19:50:38

BurntPizza (42 views)
2014-12-09 22:41:13

BurntPizza (76 views)
2014-12-08 04:46:31

JscottyBieshaar (37 views)
2014-12-05 12:39:02

SHC (50 views)
2014-12-03 16:27:13

CopyableCougar4 (48 views)
2014-11-29 21:32:03

toopeicgaming1999 (114 views)
2014-11-26 15:22:04

toopeicgaming1999 (102 views)
2014-11-26 15:20:36

toopeicgaming1999 (30 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

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
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!