Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (553)
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  Discussions / General Discussions / Re: Can you just sit down and make a game? on: 2013-11-28 19:36:39
nope, cus when i do ... nothing but spaghetti code comes out. if the project is big enough i have to plan it out and then code it, then take a break, see how i can make it better, then go back and refactor most of the code hahaha   . This especially when working with new things ive never touched before.
2  Game Development / Newbie & Debugging Questions / Re: How does java use the GPU? on: 2013-11-26 21:43:29
How would I implement java2d into a buffered image renderer?

what do you mean ?
are we talking about rendering buffered images? because if so its just as simple as using a Graphics2D object to g.drawImage(yourbufferedImage,0,0,null);

but if you ofcourse are talking about the infamous pixel rendering method of getting individual pixel data and modifying it i would highly advise against it. It is really slow and you will get stuck using low resolutions.
3  Game Development / Newbie & Debugging Questions / Re: How does java use the GPU? on: 2013-11-26 18:23:05
maybe have a look at the java2d faq , http://www.oracle.com/technetwork/java/index-137037.html
4  Game Development / Newbie & Debugging Questions / Re: cant find fizzy on: 2013-11-26 06:41:25
Are we supposed to know what fizzy is? Tongue
Please elaborate...

sorry yes , its a jbox2d wrapper by kevin glass. all the links are on his site but they keep giving me a 404
5  Discussions / General Discussions / Re: rouge (roguelike/zorklike) on: 2013-11-26 06:04:15
just a suggestion , maybe you shouldnt name your init method Main(); instead maybe try init(); start(); or init everything in the constructor
6  Game Development / Newbie & Debugging Questions / cant find fizzy on: 2013-11-26 05:45:40
did fizzy get moved to a different place, i downloaded it like 2 years go but i no longer have the jar, when i went to download it again it gave me a 404
7  Game Development / Game Mechanics / Re: [SOLVED] Issue with smooth game loop on: 2013-11-26 03:53:41
i ran your fixed jar and it looks like you did away with the syncing all together.

this is the sync method i use and it works out really good  Smiley you can fit it into your code by simply calling sync(60); each loop cycle
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
   public void sync(int sync) {
         if (sync!=-1) {
            long diff = 1000000000L / sync + lastFrame;
            long now = System.nanoTime();
           
            try {
               while (diff > now) {
                  Thread.sleep((diff-now) / 2000000L);
                  now = System.nanoTime();
               }
            } catch (Exception e) {}

            lastFrame = now;
         }
    }

edit: also lastFrame is a long outside of the method initialized when you start your loop as lastFrame = System.nanoTime();
8  Java Game APIs & Engines / Java 2D / Re: Resource Loader / Loading Screen on: 2013-11-24 04:18:23
Better yet, you could use a hashmap, they're quite handy for resource loading and retrieval!

yeah this^^

i actually do this to index all my resources in a hash map but i have a different class apart from the resource loader to do that for simplicity hehe
9  Java Game APIs & Engines / Java 2D / Re: Resource Loader / Loading Screen on: 2013-11-23 23:47:52
since i abstract all my game resources such as images and sound files i made a GameResource interface that has a load(); method and a isLoaded();

then loading resources is as easy as calling load(); and in the load method just load the resource the way you normally would and then set loaded to true;

you can just as easily make an arraylist of <GameResource> and add all your resources , then amount_loaded/total_resources(make percentage) and use that to display your loading bar.
10  Game Development / Game Mechanics / Re: Best rendering method using pure java? on: 2013-11-19 01:32:49
i would suggest to just use the draw calls given by java. i too recently asked the same question and came to figure out that pixel manipulation of an image is much slower than just drawing said image. and you dont get all the built in controls (e.g transforms) . Also you cant have good resolutions with per pixel rendering since the better the res the slower it will run.

So like suggested before g.drawImage seems to do the trick quite nicely.
11  Game Development / Networking & Multiplayer / Re: Server game loop and syncronization questions on: 2013-11-18 08:00:43
Lol you should make it so that they are shooting something more appropriate ..... like unfertilized eggs and instead of having them blow up they turn into a fetus and fly away lol
12  Game Development / Newbie & Debugging Questions / Re: Problems loading TileMap into JFrame on: 2013-11-17 21:09:55
ummm... i might be looking at this wrong but you seem to be loading your map onto jlables which have nothing to do with your bufferstrategy's graphics. also you are drawing a rectangle the size of the game in front of your image.


[Edit:] further inspection of your code revealed that you are going all wrong about double buffering and active rendering. If it is your goal to make a game, i would suggest that you do not render your maps on to Jlabels and render them with your bufferstrategy's graphics object using the g.drawImage(); method(create an art gallery so you dont load all your images over and over each render).
Also like i pointed out before you are clearing your screen with
1  
2  
g.setColor(new Color(72, 152, 72));;
      g.fillRect(0, 0, getWidth(), getHeight())


so anything that was rendered before that is not shown.
13  Games Center / WIP games, tools & toy projects / Re: Explosions [v0.8.2] on: 2013-11-17 19:56:13
yeah those settings sound good Smiley
and neat i didnt even check my high score hehe.

finally got the konami code to work . i wasnt pressing enter lol pretty neat little surprise
14  Game Development / Networking & Multiplayer / Re: Best practices for a multiplayer top-down shooter? on: 2013-11-17 19:48:31
20 times is too fast in my opinion, I would send packets ever .3 seconds. There's no need to clog up the pipeline with information you can just interpolate client side!

i am aslo working on a similar project. ive read mixed things... such as you must send UDP updates as fast as possible, only when required blah blah the list goes on.
but how does one interpolate data client side to prevent the same client from cheating?
15  Games Center / WIP games, tools & toy projects / Re: Explosions [v0.8.2] on: 2013-11-17 09:34:09
really nice Smiley played through the whole thing. so here is the criticism

1)it got less challenging as it progressed and more balls were added since there was so many that the chain would spread so fast and far that i would win the level missing only two balls.
2)it got really repetitive , maybe add more variety in gameplay. like maybe make the color shading mean something(slow or fast expanding) or add more variables that affect the way the chains are formed.
3) konami code didnt do anything :/
4) MOAR SETTINGS PLS Smiley

but all in all it is a really nice looking  and addicting game.
16  Games Center / WIP games, tools & toy projects / Re: Renoria - Java MMORPG on: 2013-11-15 09:22:51
I think the art looks great. its not hard to tell that this game is inspired by maple story. Although i would change some of the more obvious ones like the identical green blobs just to avoid copyright issues.
17  Game Development / Newbie & Debugging Questions / Re: Best way to render with java2D on: 2013-11-14 19:58:22
Easy hack for doing fullscreen and controlling resolutions. Render everything to a Volatile image at the internal resolution you want. (small drop in performance) then render the VA to the jframe/canvas at the right aspect ratio of the internal resolution and scale based on how large the jframe/canvas is. For full screen, set the frame to undecorated and its size to the size of the native resolution.

internal is 800x600 let the jframe/canvas be native resolution and just scale the internal VA as much as you can and still have it fit inside the jframe/canvas. Make sure to center it and you my have to take mouse inputs and convert them into the internal resolution but that is trivial.

Look at my Retro project to see what I mean.

Here are the 2 files that control much of the core rendering other then g.drawImage stuff

http://pastebin.java-gaming.org/78230686e72
http://pastebin.java-gaming.org/823087e6275



oh thats a nifty little way of doing it. im actually using the graphics device getfullscreenwindow method to invoke a true fullscreen , for the java2d version of the game anyway
18  Game Development / Newbie & Debugging Questions / Re: Best way to render with java2D on: 2013-11-14 06:08:26
What kind of a game are you trying to run?

Java can also improve its speed by making the canvas/frame where you are drawing a fixed size. If you can get away making your game on an 800x600 surface, then you can pull even more speed out of it.

The other way to get a good amount of speed is to control the amount of draw calls to the system. (This way, you don't have to clear the background buffer every frame, but only when an image changes). This increases the speed of Java2D a lot depending on the nature of the game.

Of course, it just depends on the game you are trying to make. The above methods work wonders, but if you really need some more speed, then you'll have to logically pull it out.

the game will be rendered in different resolutions with the possibility of full screen mode Other than that the screen will not be resizeable. Can you elaborate on how to control the amount of draw calls? and what this "nature" would consist of
19  Games Center / WIP games, tools & toy projects / Re: Level Editor Tool for 2D games on: 2013-11-13 23:32:54
As far as the GUI goes, I designed all of the components in Photoshop and Paint.net. I use the 'paintComponents()' method built into awt.* as a way to draw the buttons to the screen. I tried using the GUI's built into swing for the prototype version of this app, but I got overwhelmed with the nasty complications embedded with that library haha!

You can see how I did it by looking at the EditorGUI class code I wrote: https://github.com/doppl3r/Dark-Saunter/blob/master/src/editor/EditorGUI.java

Feel free to download all the source code for this project from that link, maybe it can be of use Cheesy

ok man cool , hehe . again great work on the look and feel . it really does look professional .

Maybe change the cursor when the user is using a certain tool . like you do when they use the drag tool but for everything else too Smiley
20  Games Center / WIP games, tools & toy projects / Re: Level Editor Tool for 2D games on: 2013-11-13 23:17:11
wow man it is really neat. could use a bit more functionality but the interface is very slick and polished.

maybe add a select tool.

also would like to know how you got everything looking so nice ? Cheesy is it a custom ui ? gridbag?
is there a tut you can point me to? hehe i currently also made a map editor for a game i am working on but it is very ugly in respects to the iu and component placement
21  Games Center / WIP games, tools & toy projects / Re: Text Editor! on: 2013-11-13 07:12:57
cool , is this only for learning purposes? or do you plan to go somewhere with it? also i think that your problem with it not showing content at the start without being resized first can be solved if you make a call to MainFrame.revalidate(); after your init code is done.
22  Game Development / Newbie & Debugging Questions / Re: Best way to render with java2D on: 2013-11-13 03:10:50
Well, why stress it then? Your engine seems more than fine! If you have more than 1000 images visible on the screen at one time, you're doing something very wrong anyway. I would say just go with it, don't worry too much about the performance seeing as its only ever going to be used by one person!

yeah i understand , my goal was just to make my software run well on all devices (even if for some reason they cannot get lwjgl to work) with as little graphical discrepancies as possible hehe . Thanks for all the great responses everyone Smiley
23  Game Development / Networking & Multiplayer / Re: Server game loop and syncronization questions on: 2013-11-13 03:02:09
ORGASM.
<a href="http://www.youtube.com/v/oZai73uc4g8?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/oZai73uc4g8?version=3&amp;hl=en_US&amp;start=</a>

Success! Now I can proceed to implement a framework XD.

lol looks like your multiple cock textures need some good ol alpha blending
24  Game Development / Newbie & Debugging Questions / Re: Best way to render with java2D on: 2013-11-13 02:54:31
Well, that's interesting that Java2D actually is faster with its built in functions, I always assumed that it would be faster directly manipulating the pixels. Oh well, the first few months of my coding career were a lie!

yeah man when i started out a while back people swore by it. In the end i ended up just using lwjgl because why not haha . I was going to have to sooner or later. This backwards compatibility is only due to (like i said) one of my main testers not being able to run my game hehe.

and i dont think its an issue with his openGL, he gets an unsatisfied link error which doesnt seem to happen on any other comp other than his.

back on topic though... i can get away with actively rendering 1000 400x200 images that have been made compatible at around 60 constant fps.
i have atholn2 4 core 3.0GHZ and an ati 5800 HD series with 2.5gb VRAM .

if i try any more than the 1000 i get a serious fps drop.
mind you this is without culling or checking for dirty regions because i just want to see how much i can render at once.
25  Game Development / Newbie & Debugging Questions / Re: Best way to render with java2D on: 2013-11-13 00:16:00
@opiop65 we have tried that and several other things to no avail. it is why i have instead chosen to refactor my engine so that  i may continue coding the game instead of trying to fix his problems . in the future if we do fix it , the engine will be more than able to use lwjgl.

@Mac70 I am currently using a similar method of loading my images. Although i do not quite know how much i am getting out of it by creating compatible images. i have tested with various image types and they all seem to give the same performance.
26  Game Development / Newbie & Debugging Questions / Best way to render with java2D on: 2013-11-12 22:20:23
so lately ive been working on a few projects with the use of lwjgl, but have ran into some problems with people being able to run my projects(just 2 reported cases)
i cannot be sure that the problem is not with my code but i ran all my programs on about 12 computers and it was worked on 10... so yeah i dont think it is an issue with the client.

Anyway i figured since one of these 2 computers is of a very good friend and its crucial that he help me test my program that i would put in a fall back to Java2d of my program . ive gone and abstracted all my graphics calls and rendering mechanisms but ive come to a dilemma.

In looking for the best ways to render with java2d i found a plethora of methods but not all seem viable. a lot of people suggest i do per pixel rendering onto a buffered image and then g.draw that image because(and this is their logic) making calls to g.drawImage has a lot of overhead.

so what you do with this pixel method is make a new image and draw  straight into the raster using a pixel[] array. We do this by looking through each pixel and blah blah blah you get it.

contrary to what i read online, this method was very very slow.

running uncapped rendering one image onto the screen using this method my fps dropped to around 400 fps as opposed to 2300fps when using the g,drawImage.   

so currently i am sticking with g.drawImage to draw every single object since its way faster than looping through 40k pixels each frame.


Now my question is . is there some way to optimize rendering images with Java2D?  from personal experience or prior knowledge what can you guys come up with?

Thanks in advance Smiley
27  Game Development / Newbie & Debugging Questions / Re: get LWJGL display to focus on: 2013-11-08 19:16:31
The LWJGL Display has no requestFocus() method, however if you are using using Display.setParent() or AWTGLCanvas (as your question implies) then you just need to request focus on the Canvas that LWJGL sits on (the parent Canvas).

i have tried several variations of this but i cant seem to get it to work. i want it to be able to get key input using Keyboard class when the mouse is inside the display but its not working :/
28  Game Development / Newbie & Debugging Questions / get LWJGL display to focus on: 2013-11-08 08:53:48
googled all day and could not find anything on the subject.

is there a way to requestFocus(); for lwjgl display?

it is inside a jframe and i would like for it to be focused every time the mouse hovers it.

there is also other swing components in this program that do take focus from time to time.
29  Game Development / Newbie & Debugging Questions / Re: BIC BOI memory leak issue. Known cause. need fix on: 2013-11-07 21:06:10
So i have thought about it for a while now and jotted down some ideas and it looks promising.

i will approach this on a command by command basis as suggested above. It will take a bit of re-coding but it should be too hard and it will eliminate all unnecessary copying of unchanged tiles/chunks ect.

Each time an edit is made a new command object for the specific action being done will be made;
changes will be added to said command object.
and when the edit is done, said object will be added to the UndoManager.
while there the undo manager will use the command hatch() or kill() methods to either undo/redo an edit.

But yeah seems i was creating too much garbage too fast for the gc.

Thanks for all the help everyone.
30  Game Development / Newbie & Debugging Questions / Re: BIC BOI memory leak issue. Known cause. need fix on: 2013-11-07 19:29:00
@philfrei & @theagenttd
I am using both the windows memory manager and the JvisualJVM
i am also looking at heap dumps and it is where im getting all my data from

Like already written, do not save world copies in the undo manager.
Look up the command pattern. Create command classes for setting and deleting tiles, filling areas, whatever.
Store the affected tiles in each command, give them an undo method, keep a command history in the undo manager. Limit possible undo steps.
Done.  Smiley

Yeah i have come to the conclusion that this is the only way. will need to look into it more in depth. Any resources on this would be appreciated Smiley
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.

CopyableCougar4 (24 views)
2014-08-22 19:31:30

atombrot (34 views)
2014-08-19 09:29:53

Tekkerue (30 views)
2014-08-16 06:45:27

Tekkerue (28 views)
2014-08-16 06:22:17

Tekkerue (18 views)
2014-08-16 06:20:21

Tekkerue (27 views)
2014-08-16 06:12:11

Rayexar (65 views)
2014-08-11 02:49:23

BurntPizza (41 views)
2014-08-09 21:09:32

BurntPizza (33 views)
2014-08-08 02:01:56

Norakomi (42 views)
2014-08-06 19:49:38
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

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!