Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (532)
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] 2
1  Games Center / Showcase / Re: Sokoban Clone on: 2011-12-30 10:22:22
Hello,
the master gain is the way with which I change the sound volume...
so it looks like ubuntu doesn't support changes in its volume...

Before I've tried to use the Volume FloatControl but that didn't work on windows^^ So it may be possible that the volume control may work with ubuntu (maybe even all linux oses?) , but then I believe that it won't work with windows.

Because atm I don't use ubuntu I can't test it well mysel, so is someone here that has a little bit experience with ubuntu and JavaSound, wo may give me a few hints to solve this problem?

biro
2  Games Center / Showcase / Re: Sokoban Clone on: 2011-12-29 20:53:08
Thanks alot for your help,
I hope that I've fixed the soundissue, by changing the inputstream to an url like the link from ra4king suggests.

I'm uploading the new version at the moment, it should be avaible in a few minutes under the old url in my first thread.
It would be nice if you could test it again, and tell me if the problem still appears.

Greetings
biro

P.S.
The upload is complete now.
Before I forget it, the language you see is the correct one I assume? It's the first time that I work with more than one language^^
3  Games Center / Showcase / Re: Sokoban Clone on: 2011-12-28 23:25:14
Hello,
thanks for the feedback, the problem with the sound is, that it's very quiet. Please try pressing o and make the volume a little more loud.

If you should still hear nothing send me a console log please

biro
4  Games Center / Showcase / Sokoban Clone on: 2011-12-27 17:02:07
Hello,
I believe that's the first projekt I've shown you so far.

I hope everybody of you remembers the old game Sokoban, where the objective of the game was to push boxes on their responding Places.

Because I had a little bit free time the last week I tried to write my own Sokoban, with which I succeded.
The game supports two languages: german and non german (which let's you play the game in english), and because I'm kind of unlucky with java web start and applets I've only got a .jar file for you, if you have a good tutorial for me I'm happy to take a look at it.

The reason for only adding 12 levels it, that I'm not too sure about the copyrights from the level in the web, so I made these 12 level myself, I hope you don't mind that.

Here a few Images:







The sound I used is from http://incompetech.com/m/c/royalty-free/, I hope I made no mistake with my credits, and that you'll like it.

Link: (.wav Files are freaking huge, so my game is about 28mb large I hope you don't mind...)
http://armado.info/images/sokoban/Sokoban.jar

Some Shortkeys:
m = map (shows the complete map, the best choice when the map is larger that the screen)
o = options
f1 = help (shows the Shortkeys)
r = level reset
b = reset your last move

Many Greetings biro

P.S.
I've only tested it with windows 7 and XP so I'm not too sure if it rund on Linux and Mac, it would be nice if someone could test it there Cheesy
5  Game Development / Newbie & Debugging Questions / Re: One Programinstance on: 2011-11-26 18:12:39
Hello,
thank you for your fast answer, but I'm not sure if that's what I need...
I'm searching for a way to write a program that can be operated the same way as mysql on linux, as example.
When you start mysql on linuy you need the command: mysql start
One command -> One operation and it doesn't block the terminal.
If I want to use another command on my server like getting its status I write: mysql status
One command -> One Operation

I want to implement this behavior in my server. I don't want to have a server app that blocks my terminal full time. And I don't want an application that I can't operate when I close its terminal.

Greetings
biro
6  Game Development / Newbie & Debugging Questions / One Programinstance on: 2011-11-26 14:49:12
Hello World!
I'm trying to write a server application, for which I have a few Questions. My problem is, that I only want to have one active Serverinstance running at anytime. Because I only want to use the typical console on windows or the terminal on linux to run my server, I have the problem, that I can't get my running server instance back, when I eventually close my Terminal/console. My Question is now, that I need a way to at least contact my earlier startet Serverinstance, even if I closed its Terminal, can someone show me a way to do that? My Idea is creating ServerSocket in my running Serverinstance, so that I have a way to contact it, but because it should only accept commands from localhost I don't know how to write it the right way, so I would like, if I there is a way without a ServerSocket out there.
Another problem is the part, where I check for another Serverinstance has anyone an idea for that?

Greetings
biro

7  Game Development / Newbie & Debugging Questions / Re: Networking on: 2011-06-06 17:01:49
Hello,
I have a question about this:
I wouldn't send objects through the network, but only text, that stands for my missile.
As an example:
I would send:
m:11:move:11/22

m = missile
11 = ID of the missile
move = the command
11 = the new x-coordinate
22 = the new y-coordinate.

So why sending objects, when text should be a little bit faster?

if you want less text you could send byte messages... where you change move to a number and the symbols through a a few selected bytes...

biro
8  Game Development / Newbie & Debugging Questions / Re: lacking return type?! on: 2011-06-06 16:57:00
apparently this is lacking a return type, I can't see how I can only return true if I have to place a return outside the if block, which is what the exception seems to be suggesting :S anyhow here's the code any help would be appreciated:

1  
2  
3  
4  
5  
6  
7  
public boolean hitTarget (int x, int y) {
         if ((x>= this.boxX)&&(x<= (this.boxX +this.boxW))&&
                 (y>= this.boxY)&&(y<=this.boxY + this.boxH)) {
             return true;
         
         }//endIf
}



For the sake of completeness, you could also have solved this by:

1  
2  
3  
4  
5  
6  
7  
8  
public boolean hitTarget (int x, int y) {
         if ((x>= this.boxX)&&(x<= (this.boxX +this.boxW))&&
                 (y>= this.boxY)&&(y<=this.boxY + this.boxH)) {
             return true;
         
         }//endIf
        return false; // just to make sure all code branches return a value
}



or by:

1  
2  
3  
4  
5  
6  
7  
8  
9  
public boolean hitTarget (int x, int y) {
         if ((x>= this.boxX)&&(x<= (this.boxX +this.boxW))&&
                 (y>= this.boxY)&&(y<=this.boxY + this.boxH)) {
             return true;
         
         } else {//endIf
           return false; // just to make sure all code branches return a value
        }
}

9  Game Development / Newbie & Debugging Questions / Re: Obtaining a usable Url.getFile() from a Resource? on: 2011-06-06 16:54:06
Hello,
Quote
Linux uses / as a path separator. Windows uses \, although in some contexts (e.g. url address bars) / will be translated. /usr usually contains data (system resources). The user directories are in /home on most (all?) Linux distros; on OS X they're in /Users; not sure about other Unices.
sr, that I got that one wrong, but I only said how I remembered it to be, and it looks like it was wrong -> That's the reason why I asked for an answer from someone who uses Linux more often Cheesy

Quote
You can't obtain a file from within a jar-archive (the ! is the separator between the location of the containing jar file and the path inside the archive of the contained file).

So if you really need the file, you have to read it from the InputStream and write it to some temp file you can use afterwards.
Sorry to correct you... but you can. I often get my pictures out of my jar Files, and other things too. I think you meant, that you can't ADD things to your jar-Archive while you're using it.

biro


10  Game Development / Newbie & Debugging Questions / Re: Obtaining a usable Url.getFile() from a Resource? on: 2011-06-06 11:25:18
Hello,
I'm not sure if I understand your question correct...
But the main difference is, that in your first code-line you loaded the File from outside a jar-file and from the second code-line from inside a jar-file. That is because you use the class.getRessource() method, that uses the path from your ressource, which can be inside a jar-file, which means the ! in your second code-line.

To the Question what happens on another OS, I would guess That the link is a little changed, because it has another filesystem, Linux par example has "\" as it's root folder, while windows has no root-folder, the nearest thing to the root-folder on windows is the C:/ volume, so your first link would look like:
1
   
file:/\usr\Phil\...\workspace\Fivefold\bin\com\adonax\fivefold\audio\elders.ogg

the / after file:/ stands for the root-folder, please notice that linux or unix all in all doesn't use / for the folder-file seperator, but \ for them!!!
usr is the Folder that inhabits the user-homefolders. (The name can change from Linux OS to Linux OS)

To the second the Question:
I'm not sure why you need a better way? Do you get an error when you use this command to open your ogg File? Because your file-link should be changed acording to your OS under your JRE, so that the command should work everywhere.

Hope my knowledge helps.

P.S. I use Windows as my main OS, so I hope for a comment from someone who uses Linux more often!

biro
11  Game Development / Newbie & Debugging Questions / Re: Tiled Maps, or Position maps on: 2011-05-24 20:40:05
Hello,
I don't want to work on the images.
I want to work on an 2 Dimensional Array that represents the underground material the field has, earth, water, sand, minerals...
This Array will be read from an File. After I've extracted the file to my Array I create the picture (pixel for pixel).
The building system should be very much like the on from the Settlers 4 if you don't know it watch a trailer on youtube. Only that it will have no heigth, like hills have.

At the moment I'm not entirely sure what kind of data this 2 Dimensional Array should contain per pixel. Should it only be the kind of background/soil or maybe a stock for it too? (like 20 coal), and how long does it need to create such an array, and is it's "jumping ability" affected by its size?

Greetings
biro
12  Discussions / General Discussions / Re: Plagiarism in games (Tetris and so on) on: 2011-05-23 10:16:09
Hello,
Why not ask the rightsholder, if it's alright for him to use a few graphics in your game?
Because it's a kind of advertise I don't see why he should say no, at least not if it's a good and fun game.

biro
13  Game Development / Newbie & Debugging Questions / Re: Tiled Maps, or Position maps on: 2011-05-23 09:53:13
Hello,
thanks for you answers.

@aazimon:
The point with the pixels is, that I don't want to create "Objects" like mountains and trees, I want to create more or less soils, like earth with minerals (gray color) for mines, green earth for farms, yellow for deserts, etc. Trees, you already correctly said, will be added through objects, that represent them and their whereabouts.

The important question to the pixels is: Is it possible to save the soils (for the pixels) in an 2D Array, that is let's say 10000*10000 or 100000*100000 times large?
How performant would that be?

On another note:
On this kind of map I would need to implement a more complex collision control for building units, and buildings, a simple way would be to check every already built building with the new building I want to buiild, if they collide i won't and can't build it.

Question:
How performant would this system be, when I have let's say 1000 building built, how long would it need until all buildings are checked for collision with the new one I want to build?

Greetings
biro

14  Java Game APIs & Engines / Java Sound & OpenAL / Re: JavaSound error when playing exported WAV file from http://www.bfxr.net/ on: 2011-05-22 16:42:17
Hello,

What I would do, is try to convert the sound file twice the first time to, as example, mp3 and the second time back to wav. I think that could solve the problem.

biro
15  Game Development / Newbie & Debugging Questions / Re: How does java handle Threads? on: 2011-05-22 01:16:08
Hello,
that's a good bridge to another question:
Does anyone know, how to talk to a specific CPU core?
Par example:
I have 2 Threads, and I want that the first Thread goes to core 1 and the other to core 2 (and I already know that java does that automaticaly), does anyone know how to do that, how to talk to an specific core?

Greetings
biro
16  Game Development / Shared Code / Re: Application Updater (similar to Webstart) on: 2011-05-21 10:29:32
Hi,
thanks alot for your sharing!

biro
17  Game Development / Newbie & Debugging Questions / Tiled Maps, or Position maps on: 2011-05-21 10:27:45
Hello,
I'm thinking about the best way to write a strategie game. as far as my imagination gets me I can think about 2 ways to implement a 2D gameworld:
1) A Tiled Map, you make your board/field out of smaller fields, called tiles, these tiles each have the same hight and width, and are represented through an Object in your 2 Dimensional Array, that contains informations about units, buildings etc. on this tile.

2) A positionbased map, On this kind of map the building- and unitobjects have a position object, that tells us where it is, and they also have an radius or hight and width, when you move the units on this map you change their position Object and the render method does the remaining.

I believe, the Tiled Map is the easier one to implement, but not as multifunctional as the position map, what makes the Tiled Map (at least for me) easier is, the easier posibility to build a uniue terrain. On the Tiled Map you do it with an attribute of your tile object, that says what kind of terrain it is (I would do it so), but with an position map that gets a little bit harder. My way of doing it would be to create an 2D pixel-array, that says what terrain is on which pixel, and when I'm trying to build something I check for a collision (checking every coordiante in the range of the new building for the right terrain).

My Questions are:
1) What do you use?
2) Maybe what do you want to use, and why? (If it's different from question 1)
3) How large can this 2D pixel-array be, that it's still performant enough?
4) Everything else you know about this topic.

Reasons for me asking:
I'm thinking about writing a strategy game, that gives you as much freedom as possible, and for that I want to implement a "position map" that let's the user build and move everything as exact as possible.

Greetings
biro
18  Game Development / Newbie & Debugging Questions / Re: Books and Tutorials? on: 2011-05-16 14:55:35
hello,
I believe that my own grammar gives enough hints about my language knowledge too Wink

Back to the topic:
Hm I'm not sure if it's so important to stick with english books, at home I have at least 3 books about java not in english, but my own language, at the moment I have no english book about java at home, but that doesn't mean, that I'm to shy to read one when needed or that I'm unable to read an english tutorial, but luckily I find enough information about java in the net in my native language... I don't know wherefrom Shazer2 is, but if he's from a country that has a lanrge enough java programmer comunity than he might find good books in his own language too, and I'm sure that here is at least one active user that knows his language and can give him a few good suggestions for books in his own language. If that shouldn't be the case then I fully agree with you and he should look for an english book/tutorial.

P.S. Just to be sure, how good/bad is my english language?^^

Greetings biro
19  Discussions / General Discussions / Re: Raspberry Pi ultra-low-cost ARM based computer (about the size of an USB key) on: 2011-05-16 12:33:14
Hello,
any information about a release date?

biro
20  Game Development / Newbie & Debugging Questions / Re: Books and Tutorials? on: 2011-05-16 09:56:04
Hello,
do you have a preferable language, int which you want to read the book?
I ask this, because I'm myself not an english native speaker...

Many Greetings biro
21  Game Development / Newbie & Debugging Questions / Re: Updater on: 2011-05-15 22:51:45
Hi,
thanks for your answer, it looks like you're the only one that thinks about using an Update software for his/her game^^.
Now to your answer:
I believe the problematic part is the download part. I wouldn't open a broswer page, because for me that looks kind of unproffesional, so my software should be able to download the update too. The problem is, how do you get the file from the server to your client? I have a few ideas about that, one is using an FTP Server with subfolders that are namened after the programmversions, so the client must only look for the right subfolder, and than needs to download everything inside it. If you use an FTP Server I think it's the best approach to use one of the few FTP Libarys for java, which have already implemented the FTP protocoll.
More interesting is, at leat I think so, to write your own protocoll and Update-SERVER. I already tried to play a little bit with the filetransfer in java, it doesn't look so hard, you read the files with an InputStream, then you send it to your client through an OutputStream, sounds very easy, but strangely if I send the file to another PC I often have a package loss.... But if I make the filetransfer PC-Intern it works fine...

how would you solve the problem to get the Files from the Server to the client?

Many Greetings
biro 
22  Game Development / Newbie & Debugging Questions / Updater on: 2011-05-13 23:18:43
Hello,
I believe a few of you know the problem that they wrote a game, and after they've finished and released it it's the time for the first big update/patch. Now it would interest me how you do these updates. Do you post a new version on your website? Do you only update your applet (if you have one)? Or do you perhaps have written an updater for your client, that automatically checks for updates?

What interests me the most, is the last one, the updater software, how would you write one if you haven't? Or if you have one how did you write it? Do you use an FTP-Server with the new Fileversions? Or did you write your own Fileserver with its own Protocol?

Many Greetings
biro
23  Java Game APIs & Engines / Engines, Libraries and Tools / Re: Slick -> First copy() that rotate and than subimage on: 2011-04-30 11:07:44
Hello,
sorry if I should do a kind of double post now, but I believe that it's stylistic better if I write this in a new post.

Today I continued to experiment on my mĀ“litte Programm and the result is very satisfying, or at least half satisfying!
I got my programm so far that it draw the picture now correct, meaning a subimage of the rotated original. Looks like the only thing that needed to be done was a flush() on the graphics of the copy. The only thing I don't like is that everytime my programm shows me now the picture it also says:  

Sat Apr 30 10:58:22 CEST 2011 INFO:Offscreen Buffers FBO=true PBUFFER=true PBUFFERRT=true
Sat Apr 30 10:58:22 CEST 2011 DEBUG:Creating FBO 50x50

Can someone translate that for me in an english that I can understand please?^^

Here the used code:
1  
2  
3  
4  
5  
      Image draw = img.copy();
         draw.rotate(grad);
         Image aimg = this.getCopy(draw);
         Image newdraw = draw.getSubImage(actx, acty, this.tilewidth-actx, this.tileheigth-acty);
         newdraw.draw(0, 0);


And here the getCopy() Method, that only does flush at the moment...

1  
2  
3  
4  
5  
6  
7  
  private Image getCopy(Image img) throws SlickException {
      Image aimg = new Image(img.getWidth(), img.getHeight());
      Graphics g = img.getGraphics();
      //g.copyArea(aimg, 0, 0);
     g.flush();
      return aimg;
  }


What I now don't understand is why the flush is needed, for that the subimage gets taken form the rotated picture and not from the not rotated one, maybe someone can explain that to me. And maybe someone has another Idea for how to write it shorter.

Greetings
biro

Edit:
It looks like that my rotation method kills my fps... while I have an undrosseled fps from between 3000 and 5000 I have only and fps of about 20 when my screens shows and rotated picture... Hope someone can help me and has an more efficient way to get a subimage from an rotated image...

24  Java Game APIs & Engines / Engines, Libraries and Tools / Slick -> First copy() that rotate and than subimage on: 2011-04-29 19:28:09
Hello,
like the topictheme already says I'm trying to use Slick (it's my first time) and my programm works surprising well, but now I met my first error^^
To the Problem:
I have a few "master"pictures, that I create once and don't reload if I've used them. Now I want to rotate this picture, but because I don't want to work with my master picture I make a copy of it, with the simple command copy() so far so easy. Not I use the rotate command on it (I rotate it 90, 180, 270 and 0 degrees), and than I need a little part of this rotated picture on my display, to get this little part I use the subImage command from the Image class of Slick.

My Problem is, that after I do all that and my programm shows me the result I see, that I have a subimage of the picture, which isn't rotated... I think, that the problem is the shadow copy that the copy command created... But I'm not sure how to make a FAST hard copy... Maybe you can help me.

Here the code:

1  
2  
3  
4  
5  
         
                        Image draw = img.copy();
         draw.rotate(grad);
         Image newdraw = draw.getSubImage(actx, acty, this.tilewidth-actx, this.tileheigth-acty);
         newdraw.draw(0, 0);


Thanks alot for your help, if this isn't enough code just ask me.

biro
25  Game Development / Newbie & Debugging Questions / Re: New to game programming on: 2011-04-27 08:14:07
Hello,
@ReBirth: isn't it better to use only the normal swing components for a sudoku-game? In the past weeks I wrote one too as a gift for a family member and as practice, I only used JPanels for the blocks and JLabels and JTextFields for the single numbers. If they were given I use a JLabel and if not a JTextField with a validater behind it.

biro

Edit:
@ra4king: don't you mean setIgnoreRepaint(true)? because false is the standart value.... So it would be meaningles to set it false..
Should I setIgnoreRepaint on the canvas as well or only on the JFrame?
26  Game Development / Newbie & Debugging Questions / Re: New to game programming on: 2011-04-26 23:17:59
hello,
I will try that tomorrow!
One more question: if you add a render loop, how high do you set the framerate or fps, and how do you ensure, that the framerate is being kept.

Many Greetings biro
27  Game Development / Newbie & Debugging Questions / Re: New to game programming on: 2011-04-26 23:08:38
hello,
like I said, I do that in my Listeners, each time someone draggs the screen, the render method is called, and this part works, the problem is the render tag after the startup in my construktor Gui() (see my posted code), this render invoking shows for a few milliseconds the desired screen, after these few milliseconds it get's gray agai, until I invoke the render() method throug my listener. Any Ideas?
28  Game Development / Newbie & Debugging Questions / Re: New to game programming on: 2011-04-26 18:40:59
Hello,
Hello,
my problem is not the animation, at the moment I have no real animation, I only need to update the field, when a user gives a command, that changes the world in some aspects. Then should the world be refreshed. And for that I don't need a loop if I'm not wrong, the problem is, that if I don't use a loop and draw the pictures on the screen I see them for a few milliseconds after these few milliseconds I see a gray window again, and I want to know why.
I know that when I want to add animations I need a constant loop, that refreshs my screen, but at the moment that is not needed Wink
But let's look a bit in the future, to a time when I add animations or some other feature that needs a graphic refresh loop, than how should I drossel it, so that it won't eat 100% of my CPU power? My guess is that I should use sleep() for that, but how do I calculate the right amount of milliseconds my thread should sleep, so that my cpu doesn't need to create such a high output and on the other hand, that my "animation" is still fluid?
Please don't forget to answer the question about doing it at first without a loop and why the correct screen is only shown for a split second.

Greetings
biro

use double buffering.
Please take a look at my code, if you do you'll see that I use the double buffer from canvas, so that is definitivly not the reason!

biro
29  Game Development / Newbie & Debugging Questions / Re: New to game programming on: 2011-04-26 15:56:28
Hello,
my problem is not the animation, at the moment I have no real animation, I only need to update the field, when a user gives a command, that changes the world in some aspects. Then should the world be refreshed. And for that I don't need a loop if I'm not wrong, the problem is, that if I don't use a loop and draw the pictures on the screen I see them for a few milliseconds after these few milliseconds I see a gray window again, and I want to know why.
I know that when I want to add animations I need a constant loop, that refreshs my screen, but at the moment that is not needed Wink
But let's look a bit in the future, to a time when I add animations or some other feature that needs a graphic refresh loop, than how should I drossel it, so that it won't eat 100% of my CPU power? My guess is that I should use sleep() for that, but how do I calculate the right amount of milliseconds my thread should sleep, so that my cpu doesn't need to create such a high output and on the other hand, that my "animation" is still fluid?
Please don't forget to answer the question about doing it at first without a loop and why the correct screen is only shown for a split second.

Greetings
biro
30  Game Development / Newbie & Debugging Questions / Re: New to game programming on: 2011-04-26 11:20:55
Hello,
thanks for your answers, but in my case I don't need a constants update loop. I only want to update the screen, when it's need, which is after you drag the screen or you resize the frame and after you start the programm. So why should I use a thread, which burns so many many resources, and when I need a thread, how much should I reduce the the framerate (I believe I should do it with the sleep() command, so how many millisecs. should I let the thread sleep?).

Thanks a lot for your answers
biro   
Pages: [1] 2
 

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

The first screenshot will be displayed as a thumbnail.

pw (14 views)
2014-07-24 01:59:36

Riven (14 views)
2014-07-23 21:16:32

Riven (13 views)
2014-07-23 21:07:15

Riven (15 views)
2014-07-23 20:56:16

ctomni231 (43 views)
2014-07-18 06:55:21

Zero Volt (40 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (36 views)
2014-07-16 23:30:00

Cero (50 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!