Show Posts
|
|
Pages: [1] 2 3 ... 11
|
|
1
|
Discussions / General Discussions / Re: Arrrgg... sequence diagrams ... so hard to get motivated..
|
on: 2013-05-24 15:33:25
|
|
I'm not even sure there *is* a meaningful UML standard. I always get confused when I try to use UML since it's so fuzzily defined. Class diagrams have been of some use, although I doubt I use UML with those precisely.
Edit: and sequence diagrams? I think I used those a couple of times for thinking out / communicating about communication protocols.
|
|
|
|
|
2
|
Game Development / Newbie & Debugging Questions / Re: {lwjgl} drawing font cause very low FPS and remove all the other graphics
|
on: 2013-05-13 19:08:59
|
text() should not be a method, unless you are referring to texting someone. Instead, should be drawText() or something of the sort. The "draw" object would be better renamed "rednerer" or "drawer". All for code readability ofc. I think it's just some simplified test code. Second, if you can't figure out why it causes low FPS (longarmx's rationale is correct, I think) you need to really think about what happens when you intialize variables and call methods.... Yeah, that is actually good advice. Try to read some more books and tutorials on Java programming, and learn a bit more about the garbage collector. Oracle has some pretty good tutorials on its site. About your code: 1 2 3 4 5 6
| public void text() { TrueTypeFont font; Font awtFont = new Font("Times New Roman", Font.BOLD, 24); font = new TrueTypeFont(awtFont, true); font.drawString(100, 50, "test ", Color.white); } |
Try creating the objects only once and reusing the objects, e.g.: 1 2 3 4 5 6 7 8 9 10
| private TrueTypeFont font;
public void init() { Font awtFont = new Font("Times New Roman", Font.BOLD, 24); font = new TrueTypeFont(awtFont, true); }
public void text() { font.drawString(100, 50, "test ", Color.white); } |
That should resolve your performance issue.
|
|
|
|
|
3
|
Java Game APIs & Engines / Engines, Libraries and Tools / Re: libgdx game templates and free AD space for your game
|
on: 2013-05-13 18:59:22
|
This idea reminds me of Garry's Mod. It's a nice sandbox and a nice toy. alot of games out there are exactly the same so why do we need to reinvent the wheel every single time when we can all benefit from helping each other out by sharing code That is true. Good examples of this are LWJGL, LibGDX and other open source frameworks. I'm personally very grateful for the work that the makers of those frameworks and libraries did, and how they share it for the benefit of all. Somehow I feel that what you are describing is pretty much what the JGO forum is: a place to help each other and to share code, to get feedback or attention for the indie games you develop. It's a cool idea you have, but aside from the massive complexity of such an undertaking (it's not KISS at all), I'd say what you propose is already reality, although in a somewhat different form.
|
|
|
|
|
5
|
Discussions / Business and Project Discussions / Re: The nightmare of taxes, and what can I do about it
|
on: 2013-05-10 13:41:16
|
Recently me and my friends decided to make a game. We were all very inspired about it and wanted to sell it for a small price (8$). First of all: as long as you do not have a game people want to play this is not a problem. If you are so worried about this you should talk to a specialist on taxes in Hungary, e.g. an accountant or a tax advisor. Finally, tax evasion is illegal and plainly stupid. It's a form of corruption that ruined Greece and most other southern European economies and it is something that IMHO should be exterminated with extreme prejudice where possible.
|
|
|
|
|
7
|
Discussions / General Discussions / Re: Registration Activation Quiz
|
on: 2013-05-10 10:33:24
|
This forum is a private service offered for free. If Riven would like a new user to upload a movie of him or her singing a christmas song to prove that he or she is not a bot that would be perfectly allowable  Answering a couple of questions such as the registration activation quiz is such a minor effort compared to the value you get that I really do not see what the problem is. Anyone too lazy to google the answers to a few questions is most likely too lazy to be serious about game development anyway.
|
|
|
|
|
8
|
Discussions / General Discussions / Re: Blogpost about Java for Game Programming
|
on: 2013-05-08 11:02:11
|
What you wrote about Java and C++ in terms of performance is simply wrong, these are just prejudices. Java has been able to become even in some cases a bit faster than C++ during the last 10 years. Don't blame Java. If you get worse performance, it will be probably mainly your fault. I don't think he's writing a scientific paper here, just a blog post. If the engineers at Google draw the same conclusions in a benchmark that looks pretty good to me I have no trouble believing that highly optimized (i.e. requiring a LOT of effort and expertise) C++ code can blow Java out of the water in some cases. Here's some quotes from the benchmark which give a great summary IMHO: C++ provides the best performance by far, but it requires the most extensive language-specific tuning. The algorithm was simplest to implement in Java, but garbage collection settings make both Java and Scala difficult to benchmark accurately. The most important point I think is: who cares? Maybe for some highly specific cases in which you have to squeeze out every last drop of performance this may matter. But I don't think it matters at all for 99.99% of the games out there, and people should choose the language they like and are most productive with.
|
|
|
|
|
10
|
Game Development / Newbie & Debugging Questions / Re: Game Versioning or Numbering
|
on: 2013-05-08 09:46:12
|
seriously, why do you care  ? my game titles are always something like "am Angry", "Why you don't work ?","Rotate me" "shoot me please" etc ... it's a professional way to push yourself forward  It's a fun way, but it may make it a bit difficult for users to communicate with you. Consider the following feedback from your beta testers: I just tried the "am Angry" update (or was "shoot me please" the latest version?) but it seems that the bug from the "Rotate me" update is back again.
|
|
|
|
|
11
|
Game Development / Newbie & Debugging Questions / Re: Game Versioning or Numbering
|
on: 2013-05-08 09:43:35
|
You may also consider using an automatically incremented build number to identify the exact version of your software. In other words, every time you build the code, the build number increases by one. If you show this build # in the main menu or something then users can always see precisely what version of the software they have. Here's a good post on how to automate this if you are using Ant scripts. I'm working on a similar approach.
|
|
|
|
|
16
|
Game Development / Newbie & Debugging Questions / Re: Can games like Super Meat Boy or Binding of Isaac be recreated with Java?
|
on: 2013-04-26 09:55:15
|
Think of it like this: In the hypothetical scenario where the devs of SMB made SMB on Java instead of C++, or set out to recreate SMB using Java... would it be able to produce exactly the same game? Yep. Thanks. What is typically used to incorporate and make flash-based graphics (which SMB uses) interact in Java? What do you mean by "flash-based graphics"? The original Meat Boy was made using Flash, but the sequel using (I think) C# and XNA. Graphics are typically bitmap-based, either drawn yourself using a tool such as GIMP or Paint.net, or using some public domain sprite library. By the way, I found this nice blog post on starting game programming by the makers of Super Meat Boy  Here's a quote from the post with Good Advice: Find a language that clicks with you and start coding. In the beginning it is important to have as much instant gratification as possible. You want to be able to get something on the screen quick and build from there. You want to be able to edit what you create and add on to it easily. Instant gratification is key to staying motivated when starting out, you probably don’t want to be learning a new language while making your game. If you try to learn a new language while creating your game, chances are you will spend weeks reading and have nothing to show for it except knowledge that you have not yet been able to apply to your game. That can be pretty discouraging.
Stick to what you know, or go the easiest most comfortable route possible to acquiring skills to start work on your game. So if you know a little Flash, use Flash, if you use C++, use C++, if you only use Java, then use Java. There is no such thing as “the official game development language”. ALWAYS remember that. Minecraft is written in Java, Super Meat Boy is written in C++, Farmville is written in Flash, some other game people play is written in HTML 5, some other game people play was made on Index cards. The point is: It doesn’t matter. Find a way you can make your game comfortably, and make it with that.
|
|
|
|
|
17
|
Game Development / Newbie & Debugging Questions / Re: Can games like Super Meat Boy or Binding of Isaac be recreated with Java?
|
on: 2013-04-26 09:18:42
|
Personally, I feel like the best way to learn how to create a game is to take an existing game and try to clone it. That way, I have a roadmap to follow and practice my skills along the way. This is why I'm worded my thread title like that, but that's just me. One more thing, maybe this approach works for you, but usually the advice is to start with a really, really simple game and work your way up. As in, if you do not have programming experience try to make a little text-based game first (e.g. some word puzzle). If you do have programming experience, maybe try a simple tetris clone. Then try a simple shooter. And if all goes well, try making a platformer (which is really a quite advanced type of game).
|
|
|
|
|
18
|
Game Development / Newbie & Debugging Questions / Re: Can games like Super Meat Boy or Binding of Isaac be recreated with Java?
|
on: 2013-04-26 09:15:55
|
Thanks Mac70. I think one can say the same for other programming languages, but what I was getting at was more of: If one tries recreating Super Meat Boy in Java for example, can they make it look, feel and control in exactly (or at least almost exactly) the same way without too much trouble? I'm not sure what you are looking for. Making a game like Super Meat Boy is very, very hard. There is no way in any language to make such a game "without too much trouble". I'd argue that Java is a relatively easy language to learn, and that it should be as easy, or easier, to make something like Super Meat Boy using Java (e.g. using LibGDX library) as in any other language. But much depends on what programming language you are familiar with. I've heard good things about game maker, maybe check that out? But I'm first and foremost interested to know if Java can recreate that aesthetic and feel of those games. If yes, where should I start? The programming language is pretty much irrelevant for that. What you need from a programming language, Java can offer. Much more important is the art. You need a good artist to recreate an aesthetic such as those games, and a good artist is much harder to find than a good programming language 
|
|
|
|
|
19
|
Discussions / General Discussions / Re: Free To Play/In-App purchases
|
on: 2013-04-25 17:10:55
|
|
Personally I do spend quite a lot on games but I avoid "free to play" like the plague and I doubt more than 0.1% of my gaming expenses have gone towards buying things in "free to play" games. The "free to play" label is an instant turn off for me and I never bother to check out those titles anymore.
Personally I'd rather call those games "differentiated spending" games, since they're not free but rather you can choose how much you want to spend. Calling a "differentiated spending" game free to play is a bit like calling a paid game with a demo "free to play". I like gaming because it allows me to escape for a while to a different world, much like a good book (e.g. fantasy or science fiction) does. In-game purchases bring the big bad outside world, with all its unfair inequalities, into the game world. No longer is buying a game buying a nice safe fantasy world to play in. Instead you enter a world in which there's aggressive salesmen lurking around every corner wanting to relieve you of some of your real-world cash.
Anyway, since it apparently is the hype thing these days and it appears to be a profitable approach to game development, I can't even really exclude the possibility of publishing a game based on this model at some point in the future. After all, bread's gotta be on the table. But I don't like the model for how I play games.
|
|
|
|
|
20
|
Game Development / Newbie & Debugging Questions / Re: Typecasting in render method?
|
on: 2013-04-18 10:38:53
|
1
| g.drawImage(player, (int)playerX, (int)playerY, this); |
My thought was that in my class, the playerX and playerY would keep it's "true" float value. And then chop off the deciamls when rendering. This will, I think, result in a more accuarate speed because it doesnt lose the decimals every cycle. There is no higher accuracy than a pixel accuracy, this is a hardware limitation. The way you do it is pretty much optimal: using floats and only casting them to ints when rendering. Only if you are working with tile maps you may need to pay close attention to the way things are rounded: if one row of tiles gets its position rounded up, and the next round rounded down the result may be a tiny but very noticeable gap. So perhaps in that case you could try rounding up or down to avoid this. But that doesn't seem necessary in you case.
|
|
|
|
|
22
|
Game Development / Game Mechanics / Re: First Post - Bufferstrategy, jpane and canvas?
|
on: 2013-04-15 20:36:05
|
Welcome! Really, I don't mind hearing that. I've seen that before on here quite often. The only reason I haven't been looking into libraries is that I want to begin working on my projects the "right" way. I don't mind the idea of a library, I just wonder, are they really more efficient? I'm afraid of using them as a crutch simply because its easier. If they're actually better then I'm on board.  If that's the case, is there a pro/con page for the popular ones? Using Java2D when there's LibGDX around is less like not using a crutch and more like breaking your leg intentionally :-) Java2D is a o.k. place for beginners to start, as it does not introduce some complexities relating to the use of libraries (e.g. some classpath stuff) and allows you to start at a very basic level, but it is generally lacking in features and performance compared to the OpenGL-based alternatives such as LibGDX, Slick2D or LWJGL (which is more of a basic wrapper that underlies both). Especially since you seem to have quite some programming experience just starting using one of these libraries may be a good idea. Or just try some extremely simple games using Java2D to get the hang of it. With regards to 1: I never used interpolation in this way (too complex for my little brain), but kind of understood how it works after reading this brief explanation.
|
|
|
|
|
23
|
Discussions / Miscellaneous Topics / Re: Procrastination Issues
|
on: 2013-04-13 09:02:17
|
But, the problem I've realized is that I burn a lot of that energy away by checking up on the various forums/blogs/social networks. So, by the time I actually get around to thinking about programming, I am already wondering about the next TV show/game/movie I want to see, and do that instead. That's so recognizeable... Especially at the beginning of the day it makes a huge difference if I directly start with work or programming, or whether I spend "just a couple of minutes" on what is essentially procrastination. If I start working on the important things I tend to continue working on them, and vice versa if I start doing less important things, it tends to degrade into doing even less important ones. Break the cycle. Prioritize. Thanks, good advice! I'll work on following it. 
|
|
|
|
|
24
|
Discussions / General Discussions / Re: Managing gamestates and entities, singletons
|
on: 2013-04-12 15:30:46
|
Of course if you're a hobbyist then you can do what you like  but I'd advice you to give the above some consideration. Try it, you might just like it. Haha, you tell a convincing story  For my hobby project which I'm working on alone it still seems to be too much overhead, but especially on large complex projects with multiple people working on it I can see how it would be great (maybe even indispensable). I may play around with it a bit.
|
|
|
|
|
25
|
Discussions / General Discussions / Re: Managing gamestates and entities, singletons
|
on: 2013-04-12 14:13:35
|
But how can you ensure that for a singleton? You are right of course, thanks for the heads up. Everybody who likes to save development time and raise the overall quality level. Perhaps if you're working in a (large) team and in some specific use-cases this is true. For me it just feels like keeping 2 rapidly evolving code-bases in sync (the code itself and the unit test code meant to test it), resulting in a load of extra work and very little extra value. Maybe for someone who has a different approach to coding it works better.
|
|
|
|
|
26
|
Game Development / Newbie & Debugging Questions / Re: Render off screen
|
on: 2013-04-12 14:04:54
|
I'm not sure exactly how to phrase a search for this, but I don't understand how, java2D at least, handles this aspect of rendering or if it does at all. If you tell it to render an object wholly outside, or even partially outside, does it save itself the cpu and not render it at all? I mean the way I understand it, every one of those draw methods affects some matrix of pixels (I think of it as a 2D array), and then the show method is called and it is shown on the screen, is that correct? Yup, I should not worry too much about stuff you draw off-screen. Usually for a game you draw the graphics on a 'back buffer' (which is indeed a bit like a matrix of pixels or a 2D array), and then draw the back buffer to the screen you see on the monitor. The rendering API, be it software or hardware makes sure that it doesn't waste time rendering things you cannot see, so I would not worry about that if I were you. Here's how I do rendering in the Java4K games, which shows the use of a back-buffer in an applet: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| import java.applet.Applet; import java.awt.Color; import java.awt.Graphics2D; import java.awt.RenderingHints; import java.awt.image.BufferedImage;
public class Java2DTest extends Applet implements Runnable {
public void start() { new Thread(this).start(); }
public void run() { BufferedImage screen = new BufferedImage(800, 600, BufferedImage.TYPE_INT_RGB); Graphics2D g = (Graphics2D) screen.getGraphics(); g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); Graphics2D appletGraphics = (Graphics2D) getGraphics();
do {
g.setPaint(Color.black); g.fillRect(0, 0, 800, 600);
g.setPaint(Color.red); g.fillRect(100, 100, 200, 200);
g.setPaint(Color.blue); g.fillRect(3000, 3000, 200, 200);
appletGraphics.drawImage(screen, 0, 0, null);
try { Thread.sleep(10); } catch (Exception e) {
}
} while (isActive()); } |
|
|
|
|
|
27
|
Java Game APIs & Engines / Engines, Libraries and Tools / Re: Slick2D faster movements at higher FPS
|
on: 2013-04-12 13:48:11
|
lower FPS -> higher Delta x = velocity * delta;
higher FPS -> lower Delta x = velocity * delta;
x = x ?? That is correct, unless the velocity changes due to acceleration within the time period indicated by delta. The mathematically 'correct' way to handle such situations is quite complex (at least for people like me who are not overly mathematically inclined) involving integration and other stuff to avoid different deltas having different effect. Even then, collision detection brings additional difficulties. By far the simplest way to do this is simply fix your timestep. If delta is a constant, small value, you wont have to bother with all the mathematical complexities. Take a look at the game loop ra4king posted earlier here, it's simple and it works. I use a loop based on this one, with some minor adjustments.
|
|
|
|
|
30
|
Discussions / General Discussions / Re: Managing gamestates and entities, singletons
|
on: 2013-04-12 11:23:41
|
You should avoid singletons wherever you can. The singleton is reasonable called an anti pattern.
How would you unit-test a singleton? Who actually unit-tests game code anyway? And what makes unit-testing a singleton particularly difficult? The reasoning "do not use singletons because it is an anti-pattern" basically says: "do not use singletons because do not use singletons", which is no reason at all. I use singletons & static functions for certain things and they work just fine. Practice overrules theory as far as I'm concerned. Some things I found singletons to be useful for accessing a global asset manager, the graphics and sound modules, preferences, and some other stuff that needs to be accessed everywhere. For these things using a singleton is much cleaner and more manageable than passing around masses of objects everywhere around your code-base. That said, like anything in coding you have to take care in using singletons. I try to avoid singletons that allow changes to game state (e.g. an entity system that may be accessed anywhere), as this tends to make debugging much more difficult.
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|