Show Posts
|
|
Pages: [1] 2 3 ... 18
|
|
1
|
Game Development / Newbie & Debugging Questions / Re: [Final Decision] LWJGL or LIBGDX
|
on: 2013-05-03 05:21:49
|
Libgdx also has a bunch of stuff already made for you that is not so trivial. If you need to ask what, then just look at the source and be wowed. The point of I am making is that making a game takes long enough to if you just want to make a game, then don't reinvent everything. All of the people on here spouting the "I want to understand what is going on" need to understand that you can know what is going on under the hood without creating that which is under the hood. OpenGL is actually I high level API when you look at it from assembly or machine language but we consider it low level. I know what OpenGL is doing when I call glBegin but I am not writing the driver calls from scratch or even the driver itself. If I wrote my own driver for my graphics card does that really give me bragging rights or make me super leet? No, I just like shooting myself in the foot or making a wheel that has only 6 vertices. @HeroesGrave Done more is meant as how much you did for game development. You probably would have made many more games if you used libgdx. Tinkering and GFX programming is an important part of making games.
I personally love tinkering and GFX programming as you can tell from what I post but neither are a game. They are part of a game but not one by themselves. @alaslipknot Yes, very much so. Libgdx itself is not hard to use and really streamlines things if you know what it is streamlining. (and set it up properly) In order to know you do not have to code your own version of what libgdx does but read up on what it is doing. I say move on to libgdx now as you can learn opengl while learning libgdx. Let me change things. Start with LWJGL and goof off for a while. Then when you want to get serious, use libgdx.
|
|
|
|
|
2
|
Game Development / Newbie & Debugging Questions / Re: [Final Decision] LWJGL or LIBGDX
|
on: 2013-05-03 01:06:29
|
|
...I have only used LWJGL bindings to opengl so I can only comment on that. It is very easy to setup a display and get a few things to show up. But once you get passed glBegin/glEnd stuff, that is where it becomes very difficult. Opengl is not glbegin/glend. There is much much more. I thought all was good until I ventured into VBO/VAO/shaders which is where ugly things can happen. And I still have not yet tried much more then a cube in 3D. Most people don't do much more then voxel works because it is so damn hard. (not to mention find some form of artist to make stuff for you)
Most nooby programers do not like libgdx because it is a shit storm to get setup. Even with the GUI to do it for you it is still confusing with all the xml/json/file directories you have to manage. I think that this is probably the biggest issue noobs run into when using libgdx. There is cliff in front of them and all the hand holds involve some other coding like language. (scene2D to say the least) There is also very little documentation on how to get more then the bare minimum done.
Even with that, I still think it is better to start with libgdx if you want to make GAMES. If you would like tinker and do some GFX programing then no, not libgdx. HerosGraveDev would have done a whole lot more if he/she (he right?) was using libGDX as he would not have to write say a spritebatcher, or wrapper for shaders, or a texture loader, or etc etc etc.
TL:DR : go libGDX for making games and OpenGL bindings to make cool effects.
|
|
|
|
|
4
|
Game Development / Newbie & Debugging Questions / Re: Mixing light-weight (Swing) and heavy-weight (AWT) components?
|
on: 2013-04-30 15:38:11
|
|
Does it work? What works is what is right.
Like I always say with optimizations and designing the "perfect" system. All you are doing is getting nowhere faster and more elegantly. Get something that works and then if it is slow or too hard to use just then, you should consider a better more efficient design. As you code and recode you will get better and better. The over all design and structure of the stuff you write will naturally improve. Get something that does something first.
You don't really need to extend canvas. All a canvas is, is what its name implies. Just need to grab the graphics object in the render loop from it.
|
|
|
|
|
5
|
Discussions / General Discussions / Re: AWESOME particle system
|
on: 2013-04-29 08:34:09
|
|
Very limited though. Nice to see someone mange to crank so many particles in just java2d but if you look at the source he does not do very many g.draw calls. (if any) most is directly manipulating pixels which is not very nice when you want to do more then program pixels.
I would love to know what his computer specs are because I simply can't see most peoples computers doing 1 mil particles. I also tried the code and although it compiled it just didn't do anything. Another reason why you should stay the hell away from java2D. It is not at all consistent on computers.
|
|
|
|
|
7
|
Java Game APIs & Engines / OpenGL Development / Re: glReadPixels Issue
|
on: 2013-04-27 01:22:52
|
|
UI is done in swing so that is not what I mean by UI issues. I mean that if I wanted to revamp the particle system then I would have to change UI elements.
I am using swing/awt and lwjgl so I am currently not actually using my own FBO. I render the previews with java2d and other such things as making changes to the animations (making them seamless) is much easier in java2d or at least I know how to do it in java2d.
Thank you for the code. I will change things to use an FBO and see if that will work.
You can layer the particles which means that you could have additive atop non atop add atop non etc. It is not just one time rendering all particles with additive or non.
Again thanks for the help.
|
|
|
|
|
8
|
Java Game APIs & Engines / OpenGL Development / Re: glReadPixels Issue
|
on: 2013-04-26 08:08:09
|
|
*sigh*
So I would have to change my whole particle system in order to use premultiplied alpha blending which I am ok with but that would also mean the UI would have to change which I am not ok with...for now. When I rewrite my system it will be not as special and more like libgdx but with more features.
Unfortunately, the issue I have now is when using davedes blending mode I get correct information except that nothing is additively blended.
The 3 step, which I should have read better, I do not do. That is to say, info is wrong coming from the frame buffer and does not get messed up after.
|
|
|
|
|
9
|
Java Game APIs & Engines / OpenGL Development / Re: glReadPixels Issue
|
on: 2013-04-25 02:24:22
|
|
I made the system before I knew how much better pre-multiplied alpha is which is why I am not using it right now.
I am using the default frame buffer right now. I will be honest and say that I am not very well versed in opengl so I blame my lack of experience and not the bindings them selves.
I will just change everything to pre-multiplied alpha and have an option for the user to say whether the image is pre-multiplied or not and if it is not I will load the file accordingly. I really hope this will fix it. I will post again if this solves it and maybe the LWJGL wiki needs and update.
|
|
|
|
|
10
|
Java Game APIs & Engines / OpenGL Development / Re: glReadPixels Issue
|
on: 2013-04-24 23:35:21
|
|
What would you like me to post? Name the things you think might be issues and I will post the relevant parts. If you really want I can post the whole damn thing but there are many things not necessary.
Thing is with just passing 0xff as alpha (no alpha) I get the right image. What is on the screen during testing is correct. Opengl is rendering properly. I can post how I setup opengl, render stuff, etc if that will help.
|
|
|
|
|
11
|
Java Game APIs & Engines / OpenGL Development / Re: glReadPixels Issue
|
on: 2013-04-24 23:01:29
|
|
So I am back at it trying to figure this shit out.
Looking at a single white block that fades out 8x8 pixels to keep the printouts readable. The color and alpha do not start at 255 but 250 or so but that should not make a huge difference. The alpha drops properly but so do the colors. Is opengl premultiplying everything when before I grab the pixels? When not using an image everything seems to look fine but when I load up an image that is not completely opaque, I start getting issues.
I know what pre-multiplied alpha is and it seems like the pixels returned are pre-multiplied. When I use the BufferedImage TYPE_ARGB_PRE I get the same results.
How would you reverse pre-multiplied alpha? I think I did it right but it did not help. Would rendering everything to an FBO work? I wouldn't think so but it is worth a shot.
I normally do not get pissed easily but this one really pisses me off because I can do almost the exact same thing in Java2D much much easier and it works. Hell I don't mind extra difficulty if the damn thing works.
|
|
|
|
|
13
|
Discussions / Miscellaneous Topics / Re: How to make a name for your RPG
|
on: 2013-04-23 03:11:15
|
|
Finding names for my games is super easy. I really have no idea why people have issues with things like essay titles, paper titles, game names, character names, etc.
Key thing is to build your world in your head a bunch. Think up all sorts of lore. Gods, cultures, peoples, everything. Once you have some foundation the name is trivial. Right now I am working on an RPG form of game which is named Haven. If you would like some help for some interesting names, post some details about your game and I could throw out some names. Heck, you will probably find your name while posting.
Here is one game idea/name that I have been wanting to produce but well...you know.
Game name is "You Will Die" Base defense game setup in the same formula as the Learn to Fly and Shopping Cart Hero games. You defend as long as you can and inevitably die. Then you go to a shop, buy some upgrades, and defend again. Throw in some Box2D physics to make it look like the "hero" is getting crazy swarmed and add some mega blood and BAM!!! Never ending fun. Well...at least I think it would be crazy fun. Game could work easily on android/iOS/desktop.
|
|
|
|
|
14
|
Java Game APIs & Engines / OpenGL Development / Re: LWJGL 2.9.0
|
on: 2013-04-22 17:58:30
|
|
Do the menus still appear under the lwjgl canvas?
I wanted everything to work with jre7 so I was using the nightly builds but they broke a whole lot of other things. Fixed focus issues with java 7 but got the menu item issues back.
|
|
|
|
|
15
|
Java Game APIs & Engines / OpenGL Development / Re: LWJGL 2.9.0
|
on: 2013-04-22 06:15:12
|
Windows:- Fix: focus problems with Display.setParent
- Fix: setIcon will now block until the taskbar icon has updated
- Fix: async state query for missed key events
Oh sweet baby Jesus yes. Does it still have the drawing issues with menus that drop down? Right now I had to throw in some hacky crap to make it clear the spot where the menu was.
|
|
|
|
|
18
|
Game Development / Newbie & Debugging Questions / Re: Typecasting in render method?
|
on: 2013-04-18 03:50:23
|
|
Keep in mind though that java2D can only render ints which means that a slow movement stutters due to the loss of precision. You can easily get away with a game update rate of 30 and render rate capped at 30 and keep things smooth with only integer movement rates. Another reason why java2D sucks for rendering.
|
|
|
|
|
19
|
Game Development / Game Mechanics / Re: First Post - Bufferstrategy, jpane and canvas?
|
on: 2013-04-15 14:34:41
|
I will let someone else get to the gameloop but I can help with the BS (no pun intended) JPanel and most Swing components are double buffered automatically and I do not think canvas is. They also use passive rendering which is not what we want. Normally, you use a canvas because it is meant to be used to draw stuff with where a JPanel is not. I have used both and with a few extra settings in JPanel, they both work fine. They whole thing is like you said, don't mux up AWT and Swing. The reason why we use BS is to keep things actively rendering and not passive which is what java2D wants to do. You also need to double buffer when you want animations to be smooth. pack() will automatically shrink all components into the smallest size in a JFrame. So if your frame is 1600x900 and your canvas is 800x600 it will make the JFrame 800x600. I may be wrong on this one. Now comes what you probably don't want to hear. Drop learning any rendering in Java2D. It is crap. Use libgdx or slick2D. No need to wonder about all the black magic java2D is doing and the reasons why. If you insist on java2D then before you wonder all the magical ways of getting java2D to perform right, here is this. http://www.java-gaming.org/topics/java2d-clearing-up-the-air/27506/msg/246444/view.htmlIf you would like, I can post my old classes that I used to get java2D to perform well but really you should just drop java2d.
|
|
|
|
|
20
|
Discussions / General Discussions / Re: why are people trying to use Java2D to make games?
|
on: 2013-04-12 00:56:56
|
Java2D is so very very very limited. I can do image processing...slowly. One of the big issues is not that it is super slow (which it is) but that the performance is inconsistent across systems. That is to say, on my desktop I easily get 5k sprites (64x64) but on my laptop due to crapy DX drivers, get fill rate limited after about 200 sprites at the same size. I could switch to the opengl pipeline which will fix the fill rate limit but gives all sorts of other issues. It is not consistent. Using opengl, my laptop gets fillrate limited again but easily hits 10-20k sprites using glBegin glEnd. Adding basic sprite batching and bam! 50k. You also cannot do any cool effects such as lighting, additive blending, or the all powerful shaders without bashing your skull into the ground and sacrificing valuable processing time to try and hack java2d to get it to do what you want. Java2D was NEVER meant for games. It is not as simply as just rendering. Rendering eats into frame rate which logic needs. If you want to make a game, then use a library/rendering method for games. *whisper* libgdx If you insist on writing your own engine/lib/everything then break out some assembly or use opengl bindings. If you STILL like java2d well then before you start asking all sorts of questions on performance and best method for rendering images, please read this. http://www.java-gaming.org/topics/java2d-clearing-up-the-air/27506/msg/246444/view.htmlOnce you are done reading that, shoot yourself in the foot because that is what you are doing by using java2d for rendering
|
|
|
|
|
21
|
Game Development / Game Mechanics / Re: Rotating Particle (Flamethrower) Tower Spawn Acceleration
|
on: 2013-04-11 04:02:18
|
If you get a box it is because you are using different speeds for x and y. If you want it so it looks like someone with a water hose spinning in a circle with flames instead of water, then what relminator said is right. You might be doing something different in your particle system. Here is how my emitters do this 1 2 3 4 5 6 7 8 9 10 11 12 13
| float temp = angle2 - angle1; float newAngle = (float) (((Rnd.randomPlus(temp))+angle1) * Math.PI/180); newAngle *= -1; if(randomV) { float v = Rnd.randomPlus(vel); x.setVel((float)(v*FastMath.cos(newAngle)),(float) (v*FastMath.sin(newAngle))); } else { x.setVel((float)(vel*FastMath.cos(newAngle)),(float) (vel*FastMath.sin(newAngle))); } |
Note in this I have extra options like random vel and emitting particles between 2 angles but the key is the x.setVel
|
|
|
|
|
23
|
Game Development / Newbie & Debugging Questions / Re: Measuring time inside render loop.
|
on: 2013-04-10 20:33:34
|
I told myself I would stop trolling here so much but I give in. Normally, you do not do any sort of logic in the rendering thread. That is to say, you do not care about delta or anything like that. For animation rendering, you would set which frame is to be render in your logic (update). Then when rendering comes, you render is. If this code is working fine for you, use it but do not try measuring delta time stuff in renderloop. Here is how I do animations or any form of timing. (no interpolation) 1 2 3 4 5 6 7 8 9 10 11 12 13 14
| int currentUpdate = 0; int frameRate = 60; updateMethod(delta) { currentUpdate++; currentUpdate *= delta; if(currentUpdate >= frameRate) { currentUpdate = 0; nextFrame(); } } |
This is just some psudo code. It will not take into account huge deltas but the key is to keep logic away from rendering.
|
|
|
|
|
25
|
Game Development / Newbie & Debugging Questions / Re: Collision Detection
|
on: 2013-04-09 08:08:43
|
|
hmmm after you use the intersects method find which side should be trivial.
In order for a object to move there must be a velocity right? Or some value you are incrementing by. Check to see if that value is positive or negative. Do this for both X and Y. Not to correct the collision you would need to find how much these objects intersect and subtract or add to the X and Y. Well look around at some Rectangle2D stuff in java and you will find what you are looking for.
|
|
|
|
|
26
|
Game Development / Newbie & Debugging Questions / Re: Simple Math Problem
|
on: 2013-04-09 05:25:55
|
Note that, that all can be done in one line but I use many for the sake of clarity. There is also an optimization that is not all necessary but might be something to look into. You will probably figure it out. Basically, stay away from anything that is not addition, subtraction, or multiplication.
@Stumpy: don't use sqrt. Squaring maxdistance is faster since we don't care what the actual distance is, just if it's lower than 400 units
I used it for the sake of clarity and left that part out as something he could figure out on his own. Please try and read everything someone says as the lack of communication can cause errors. I know that sometimes I type too fast. 
|
|
|
|
|
27
|
Game Development / Newbie & Debugging Questions / Re: Simple Math Problem
|
on: 2013-04-09 02:52:25
|
Don't do any of that. I will help with how the distance formula works. The idea is to create a triangle and then find the hypotenuse. So some psudo code. 1 2 3 4 5 6 7 8 9 10 11 12
| public boolean distanceCheck( loc1x, loc1y, loc2x, loc2y, maxDistance) { int xDiff = (loc1x-loc2x); xDiff *= xDiff int yDiff = (loc1y-loc2y); yDiff *= yDiff; int distance = Math.sqrt(xDiff+yDiff); if(distance > maxDistance) return false; else return true; } |
Note that, that all can be done in one line but I use many for the sake of clarity. There is also an optimization that is not all necessary but might be something to look into. You will probably figure it out. Basically, stay away from anything that is not addition, subtraction, or multiplication.
|
|
|
|
|
28
|
Game Development / Newbie & Debugging Questions / Re: Simple Math Problem
|
on: 2013-04-09 02:35:55
|
...this is 2d so we are basically going to be doing culling or w/e it is called in 3d but in 2d. Since you are using java2d which has some great utilities you should use. If you want a circle around your player of visible enemies that is very easy. http://www.purplemath.com/modules/distform.htmIf you want a square then for Gods sake use shapes/squares/rectangles that java2d gives you. They have a nice intersects method. I could post the code for both but that would not really help you learn so take this and have at it.
|
|
|
|
|
29
|
Java Game APIs & Engines / OpenGL Development / Re: glReadPixels Issue
|
on: 2013-04-08 23:58:04
|
|
I give up.
I have tried the nightlies of lwjgl and they only broke the gui. I have tried using the images graphics object and g2d.fillrect with the color set and that gave same results. I think java2d could be screwing with some shit... Could someone else try it and see if they get the same results as me? If it works fine for you then I MUST be doing something wrong.
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|