Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (611)
Games in Android Showcase (172)
games submitted by our members
Games in WIP (657)
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 3 ... 32
1  Discussions / Miscellaneous Topics / Re: Hello, people. on: 2015-08-27 14:19:42
Welcome to the forum. Er, welcome to posting in the forum?

- Do you (we) have something you call youselves? (Like JGO:ers, J-draGOn:ers, etc.)

I always thought of us as JGO-ers (jay gee oh ers). I wonder if anybody calls it "jay go" instead, which would make us "jay goers"?

- Are there any certain guidelines I should follow when replying to threads (other than the rules)? Is it for example considered normal replying to somewhat old threads?

Normal rules apply. So yeah, replying to old threads is usually obnoxious. Be forthright with crossposts. Don't spam advertisements. The usual. This is a smaller community, so it's less anonymous than some forums, which tends to make conversations more polite and less trollish. If you do start trolling, you'll end up in the Chit Chat Monster.

- How often do you drink whiskey?

I think a lot of people here are still kids (sorry, teens). But I'm the ripe old age of almost 30, so I can say that whiskey is gross, gin is good, and beer is better.
2  Games Center / Showcase / Re: Monster Run on: 2015-08-27 13:06:23
Nice work. It's cool to see another JGO-er doing Ludum Dare!

The whole point of Ludum Dare is to create a complete game in 48 hours, and you succeeded at that. Like others have said, it would probably be more fun if it was a little faster (right now the player feels big and slow, smaller and faster feels more fun). But you've got a playable game with a beginning, middle, and end, so great job!
3  Game Development / Newbie & Debugging Questions / Re: About separating game logic from rendering on: 2015-08-26 13:43:03
Making the rendering code swappable is an interesting idea, nice one KevinWorkman.

Thanks. To be fair it's not really my idea, it's just the application of MVC logic to game development. Your model shouldn't care about your view or controller, to the point that you should be able to swap out your view and controller and have your model still function.

In my experience, the ability to swap out your view/renderer is more of a "best case scenario" goal to shoot for than it is something that actually happens very often. Most people probably don't care about literally being able to swap out a renderer, but separating your code as if you did care about it will make your life easier in other departments as well.

But then in some respects, keeping the render method as a part of the game object being rendered also has an elegance to it. After all, the game object would know best how it should be rendered and any refactoring or improvement made to the game object state can be easily updated in the rendering code in that game object class, rather than finding the renderer class and updating it there.

I agree, and that's how I code my own games. That being said, I generally do keep my model code in a step() function, and then my render code in a draw() function. It wouldn't be too hard to move my draw() function to a rendering class, and then swap out different rendering classes. If you keep your rendering code separate from your modeling code like that, you're still semantically obeying the guideline of swappability.
4  Game Development / Newbie & Debugging Questions / Re: About separating game logic from rendering on: 2015-08-26 13:11:25
I absolutely agree with Riven: especially if you're just starting out, any code you write is going to seem terrible in 6 months. This is a sign that you're improving. But it also means that spending a lot of time trying to refactor your code to be perfect gives you vastly diminished returns as compared to just finishing something that works and moving on to the next project.

It's nice to keep in mind the general guidelines of game development while you work, but I wouldn't become overly worried about strictly adhering to them. They'll become more natural to you over time.
5  Game Development / Newbie & Debugging Questions / Re: About separating game logic from rendering on: 2015-08-26 11:55:05
So does that mean you shouldn't use logic statements at all during the rendering portion of the code to determine whether to draw an object or not?


The "you should separate game logic and rendering" rule might be better restated as "your rendering code should not change your game state" instead.

It's completely fine (and expected) to poll your game logic (determining player position, etc) from your rendering code. But your game's model should be able to run completely independently of the renderer.

In other words, I should be able to write a renderer for your game, and I should be able to swap it in to your code with a one-line change (call my renderer instead of yours) without requiring any changes to the underlying game model.

This becomes useful for porting your game over to multiple systems. Oftentimes your game model will remain mostly the same, but only your rendering code will change. If you keep the two separate, that becomes pretty easy.
6  Games Center / Contests / Re: [Idea] Would anyone be interested in a Pure Java game jam? on: 2015-08-20 20:51:59
For me, if internet fame were cars, I'd be an Edsel.  Tongue

I had to google what that was, which I think proves your point...
7  Games Center / Contests / Re: [Idea] Would anyone be interested in a Pure Java game jam? on: 2015-08-20 14:19:15
They do host mini-LDs every month or so. I'm not sure how you get to be the host, how "famous" you have to be, or how long the waiting list is though.
8  Game Development / Newbie & Debugging Questions / Re: Reflection on: 2015-08-20 13:31:34
Yeah, I... kind of thought that would make my code twice as big Grin

I doubt it. Just draw your stuff once, and then draw it again upside down.

Alternatively, you could draw all of your stuff to a BufferedImage, and then draw that BufferedImage twice: once for the right-side-up, and once for the reflection.
9  Game Development / Newbie & Debugging Questions / Re: Reflection on: 2015-08-20 12:54:44
What you're saying doesn't make a ton of sense: you don't make a Graphics2D from a BufferedImage. You can create a BufferedImage using a Graphics2D though.

Graphics2D is the pen. BufferedImage is the paper. Graphics2D doesn't store what it has previously drawn inside itself. It stores that on the BufferedImage (or on the component you're drawing to).

You could get your BufferedImage's Graphics2D using the getGraphics() function, and then just draw to that.

But an easier solution would be to simply draw your stuff upside down as well whenever you draw it right-side up.
10  Games Center / Contests / Re: [Idea] Would anyone be interested in a Pure Java game jam? on: 2015-08-20 12:36:31
I'd say you're best bet is probably closer to Christmas maybe?

By then we'll be having another Ludum Dare...
11  Games Center / Contests / Re: [Idea] Would anyone be interested in a Pure Java game jam? on: 2015-08-19 11:51:47
Would anyone be interested?

Sure. Bring back the glory days of just sending jars to each other!

(just don't make it MASSIVE)

Why not? Bring back the glory days of just sending massive jars to each other!
12  Discussions / General Discussions / Re: Recurring issue with making games on: 2015-08-11 13:55:05
You might want to post this as a question in its own thread. I'm sure it's an easy fix.
13  Discussions / General Discussions / Re: Recurring issue with making games on: 2015-08-11 13:27:16
Also note that you can deploy libGDX as JavaScript.
Yeah but its a huge pain in the butt to get it to work. Especially with Eclipse. And then your code would also be... yeah...

I've never had problems with it.
14  Game Development / Newbie & Debugging Questions / Re: JButtons on top of an image on: 2015-08-07 20:22:01
I have an image I use as a background in a JFrame (by putting it in a JLabel). I have a pair of JButtons I want to add on top of that image.

Don't do that. Your background should not be in a JLabel.

Instead, extend JPanel and override the paintComponent() method. Draw your background there, and then use that JPanel like you would any other JPanel. Add it to your JFrame, and then add your JButtons to the JPanel.

Recommended reading:
15  Discussions / General Discussions / Re: Recurring issue with making games on: 2015-08-07 13:52:01
I think the focus on languages/platforms of most of the replies are wrong. At least, that was not my problem when I jumped from project to project for years.

It is more a matter of motivation, organizing your time, setting yourself realistic goals.

I don't disagree with you. But, choosing the right language can go a long way towards helping you stay motivated.

That's why I recommend Processing to people just starting out. You get immediate feedback: 1 line of code and you've got a ball displayed on the screen, following your mouse around. No boilerplate, no worrying about how classes and objects work. And then you can deploy it as JavaScript and send that link to people without worrying about the mess of Java deployment.

So yeah, motivation is key, but choosing the right language is definitely part of staying motivated.
16  Game Development / Newbie & Debugging Questions / Re: Best Practices for Creating New Objects on: 2015-08-06 14:18:11
Yep, exactly. Shaving a second or two off of an hour-long process isn't really worth it, especially if it took you a week to develop and will take the next person to inherit the project a month to understand your code.

That's an exaggeration, but I've seen enough over-engineered code to be pretty wary of anybody who wants to talk about "optimization" or "efficiency" before even identifying a problem or specific goal ("make it as efficient as possible" is not a specific goal).
17  Game Development / Newbie & Debugging Questions / Re: Best Practices for Creating New Objects on: 2015-08-06 13:30:50
Although this is very true, I think there's some value in training yourself to use more optimal patterns from the get go.

I don't disagree with you, but as this thread shows, it's not always obvious what "more optimal" means. Trying to outsmart the JIT compiler is often a bad idea.

My main point is that it's a waste of time for novices to worry too much about "efficiency" before they really understand how the basics work. Writing better code comes with practice.
18  Game Development / Newbie & Debugging Questions / Re: 2D-MMORPG physics engine on: 2015-08-05 19:09:03
I'm very familiar with developing and have a lot of java background, but I've only recently decided to try and make a game when I'm not at work. It's just something that I have avoided because in the back of my mind it seems like such a massive task that I literally wouldn't know where to start or what books to read -- so I posted here and just started coding to the best of my OO ability.

Along with starting much smaller, you might look into participating in game jams. Ludum Dare is in 3 weeks, and it's a great way to force yourself to work on smaller games. But smaller game jams are happening all the time: try or for a start. Also check out One Game a Month.
19  Game Development / Newbie & Debugging Questions / Re: 2D-MMORPG physics engine on: 2015-08-04 22:22:02
Kevin, I’m glad you posted because I think you’re the reality check that I may need

I really don't mean to be discouraging. In fact, I think the only way to learn how to program is by, well, programming! So you're already off to a good start, just because you're trying something.

That being said, underestimating the scale of a project is a mistake that novices (and non-novices!) make all the time. After all, what does the first M in MMORPG stand for? :p

When I first registered and asked for some advice in regards to an mmorpg, I was told that I could focus on making a single player model of the mmorpg game that I am aiming to build. Furthermore I could plan for network and scaling later after I get a good foundation of player, monster, and environment. Is this a poor approach? My overall goal is to detect player vs environment collisions via tiles, and player vs monster collisions via the objects themselves.

In general, my advice is always: start smaller. Break your problem down into multiple individual steps. Break those individual steps down even further. Create prototypes that explore one aspect of your larger goal. Create a single-player game to help you figure out how Box2D works, or how it scales. Create a separate non-graphical game that explores how networking works. Keep these "games" as simple as possible. When you get each one working separately, then (and only then) think about combining what you've learned into one bigger piece.

So, sure, you should focus on the basic collision detection and whatnot first, especially if you haven't finished a game before. But I would argue that it's a waste of time and energy to try to make decisions now, at the prototype level, that will affect your big end goal.

By that I mean: you should start by making Mario. Explore how collision works in a game like that. Don't worry about whether what you're doing will scale or not, or how networking will affect it. Create a small game that uses Box2D. Start over and recreate that same game using basic tile collision. Boom: now you know how to use both.

Then start over again and create a networked chat application. Build from these small steps towards an end goal, but don't try to make decisions about your end goal until you can pretty much answer the questions yourself.

It's a bit like this: let's say I don't know how to build houses. I don't even know how to build a tree house. I have no idea how to create a roof that won't leak, let alone how plumbing or electricity works. And now I ask you: I'm planning on building a castle, so which type of wood should I use for the drawbridge?

The answer to that question is that I shouldn't be asking that question yet. I need to practice by maybe building a fort first. When I figure that part out, maybe I should move up to a treehouse. Maybe I should separately build a little moat and see what types of bridges work best, without even worrying about the castle that will be inside that moat.

I'm not sure if that metaphor works, haha.

Could you elaborate on why Box2D would not be the best approach for handling collisions?

Box2D might be a fine option. It's a great option for a single-player physics game. Is it the best option for a non-physics game that can just use simpler tile-based collision detection (like Mario)? Probably not, only because it's overkill. Is it the best option for a game that handles collision detection on the server? Maybe, but your entire setup will look completely different, and what you define as "efficient" might mean something else.

My real point is that we can't really answer the question for you. It depends more on your personal preferences and coding style, and more on the exact type of game you're building (which even you probably don't exactly know yet), more than it does cold hard technical facts. The only way to get a more concrete answer is by building small prototypes that test out different theories.

I’m starting to get the feeling that I have started programming from the incorrect approach. I have handled nothing in terms of client vs server and only have a single player instance of a game that I would eventually like to make open to other players once things look a little ‘nicer’.

I wouldn't say that you've got an incorrect approach, just maybe an overly optimistic plan. Think about it this way: you're working on a single-player prototype right now, not your final goal of an MMORPG. That final goal comes later, after you've built up some knowledge about how these individual pieces (collision detection, networking, etc) work.

Alternatively would you be able to point me to reading material that you think may be helpful for a person in my position?

The best advice I can give you is always: start smaller. Instead of asking about how efficient Box2D is for an MMORPG (which we can't really answer, because that question is extremely broad), build a small prototype that tells you more about how many entities Box2D can handle, what types of information it gives you, etc. Then do the same thing with tile-based collision. Repeat until you can start combining these fuzzy concept into a more cohesive whole.

And if that sounds tedious, well, welcome to programming!

Edit: I am reminded of this:

(Again, I'm not trying to be discouraging! We all tend to bite off more than we should be chewing- that's part of the fun of being a programmer! But the only way to get to our big end goals is by starting smaller and working our way towards them.)
20  Game Development / Newbie & Debugging Questions / Re: 2D-MMORPG physics engine on: 2015-08-04 18:35:40
Yes, of course it was written to be efficient. That's the whole point.

But in my humble opinion, you're asking the wrong question.

Box2D was written to be efficient at performing a specific task. That task is calculating rigid body physics and collision in an arbitrary world space.

So the question is not: "is Box2D efficient?", it's: "is Box2D the right tool for my job?"

You're talking about tile-based collision, which doesn't seem to jive with Box2D. Mario doesn't need to use Box2D. If you're comparing Box2D's "efficiency" against a tile-based collision detector, then that's a completely different question. You can't really talk about efficiency without defining exactly what you mean by "efficient". Otherwise you're comparing apples and oranges. You're also talking about an MMORPG (which is an entirely separate issue, but I'll digress on that one for now), which doesn't seem to jive with Box2D either. What portion of collision calculations are you doing on the server? What are you doing on the client? These are questions that you should answer now instead of later, and they should come before you start asking about the "efficiency" of Box2D.
21  Game Development / Newbie & Debugging Questions / Re: Something I managed to hack together today on: 2015-08-04 12:34:34
This probably belongs in the WIP board?
22  Game Development / Newbie & Debugging Questions / Re: Best way to handle multiple references to a resource on: 2015-08-04 12:18:10
Use a profiler to understand by-reference? Surely by the time you know enough to make sense of the profiler output, you will probably understand by-reference...  Smiley

His original question was about how his code affects memory. The way to test that is by using a profiler.

But to really understand what's going on under the hood, then understanding what "pass by value" means with references is a good place to start.
23  Game Development / Newbie & Debugging Questions / Re: Best way to handle multiple references to a resource on: 2015-08-03 14:10:16
If I have a "Content" class which stores a static sprite image, and then I create 100 sprites which all take this image as a parameter, will I have 100 instances of this image in RAM or just 100 pointers to the static image?

The best/only way to answer questions like this is to do some profiling. How much memory does your program use if you have a single reference to the image? How much memory does it use if you have 100? 1000? 1,000,000?

But to understand the basics of what's going on, I highly recommend reading these two articles:
24  Discussions / General Discussions / Re: How does JGO use long polling? on: 2015-08-03 12:55:49
Riven: That's even more interesting. So behind the scenes you're still doing "active polling" (or whatever it's called). That's probably easier than trying to add a hook into the message posting system (especially for complicated sites with multiple user actions), but I wonder if you're concerned at all about making unnecessary calls to the database, especially if a good portion of the time there are no connected users? (I assume there are a few hours each day where nobody is connected, that might be a false assumption though.)

noctarius: That sounds closer to what I'm actually doing. I'm using Spring's DeferredResult, which I believe uses Servlet 3's async stuff. You make an interesting point about incorporating session data into the data structure that holds waiting objects. That way you can do it by session instead of by request: if that session then makes a new request, you can probably throw away any old requests by that session.

That will probably not be correct if the user has multiple pages open though. Hmph.
25  Discussions / General Discussions / Re: How does JGO use long polling? on: 2015-08-02 22:24:55
That's interesting, thanks for the reply.

That's a little lower level than I assumed, but I guess the question is the same: won't you end up with a big list of sockets? Wouldn't it be possible (or even easy) for bad guys to overload that list until something breaks? And aren't you keeping around references to a bunch of sockets that have been disconnected, since users make a request every time they load a page? Am I missing something, or are those references so tiny that it's not a real concern?

Apologies for the dumb questions, I've just been trying to wrap my head around this stuff for a few days now. It's been an unproductive weekend!
26  Discussions / General Discussions / How does JGO use long polling? on: 2015-08-02 21:56:30
I'm wondering exactly how the "there are X new posts" notification at the top of this very site works.

I know the basics: it uses ajax to request the number of new posts, and then I think it uses asynchronous long polling on the server side to only return the number when it changes.

But on the server side, doesn't that mean there are a bunch of threads (or maybe a thread pool) waiting on that update? More to the point: if I refresh the page 500 times (sorry Riven), doesn't that mean there are 500 threads (or thread pool tasks) waiting around- 499 of which are now pointless, since I'll only ever receive the last one? Isn't that a potential memory leak- if I get a bot to constantly refresh the page and create more of those waiting objects, won't it eventually break?

I'm asking about this site, but what I'm actually trying to figure out is the correct way to do this in Spring. I'm not sure how different JGO's php server is from a Java server, but I'm hoping the above questions are general enough to apply to my situation as well.
27  Discussions / General Discussions / Re: Recurring issue with making games on: 2015-08-01 14:41:43
If you're afraid of JavaScript, you might want to check out Processing. Its syntax is based on Java, and in fact by default it is Java. But it makes it much easier to get something visual and interactive up and running without all the boilerplate of Java.

You can also deploy Processing as JavaScript using Processing.js. This might be an easier gateway into the JavaScript world, especially if you have a background in Java.

Also note that you can deploy libGDX as JavaScript.
28  Discussions / General Discussions / Re: Recurring issue with making games on: 2015-07-31 18:30:30
Like has already been said: start smaller. Work on prototypes instead of games. Try to always have something that works versus constantly working towards an elaborate end goal. Your scope should be a weekend or a week instead of months. Not finished after that? Too bad, publish it (remember, always have something that works) and move on to the next thing. If one of your prototypes captures the crowd's attention, then maybe start thinking about putting more work into it.

Ludum Dare is in 3 weeks, and it's a great way to force yourself to work on smaller games. But smaller game jams are happening all the time: try or for a start. Also check out One Game a Month.
29  Game Development / Newbie & Debugging Questions / Re: I want to work in 3D? on: 2015-07-30 12:24:00
3D math is not trivial. It's a pretty huge subject by itself. What type of math are you learning about right now?

For starters, you might look up a basic linear algebra tutorial or online course. But learning this stuff will take months or years, not days or weeks, so you're going to have trouble finding an all-in-one tutorial.
30  Game Development / Newbie & Debugging Questions / Re: Ball loses speed when it bounces straight up on: 2015-07-30 12:07:21
Can you post your code, preferably in the form of an MCVE?
Pages: [1] 2 3 ... 32
Roquen (11 views)
2015-08-29 11:30:54

GamerC4 (23 views)
2015-08-22 20:38:50

GamerC4 (22 views)
2015-08-22 20:37:18

GamerC4 (26 views)
2015-08-22 20:37:01

Kefwar (30 views)
2015-08-22 18:07:24

GamerC4 (24 views)
2015-08-22 01:00:24

GamerC4 (37 views)
2015-08-22 01:00:17

GamerC4 (24 views)
2015-08-22 00:57:35

GamerC4 (25 views)
2015-08-22 00:56:59

BurntPizza (29 views)
2015-08-21 01:38:01
HotSpot Options
by Roquen
2015-08-29 11:33:11

Rendering resources
by Roquen
2015-08-17 12:42:29

Rendering resources
by Roquen
2015-08-17 09:36:56

Rendering resources
by Roquen
2015-08-13 07:40:51

Networking Resources
by Roquen
2015-08-13 07:40:43

List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30 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‑
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!