Jump to content

  • Log In with Google      Sign In   
  • Create Account

thok

Member Since 23 Dec 2011
Offline Last Active Yesterday, 04:35 AM

Topics I've Started

Unity vs. a more "lean" game engine

31 January 2016 - 06:25 PM

Hi there, it's been a while since I've posted.

 

I'm looking to start a new game project. I've been developing software for a long time, and I recently started learning some 3d game programming (through a university class) with jMonkeyEngine. It's going great! I'm getting more and more comfortable with 3d programming. I still have a ton to learn, but after spending just a few days playing around with jMonkeyEngine, I'm getting the feel for it.

 

The person I'm collaborating with is an artist (2d, 3d, textures, models, level design, etc.). We're trying to find the right tools for our first project, which will be a 3d game with some simple mechanics. He's played around with Unity in the past, and suggested that I check it out. I'm on the fence, to be honest. I'm a software developer at my day job. I like things to be lean, clean, and minimal. I code in vim mostly. I avoid IDEs like the plague, except in the case of Java, which makes my fingers hurt if I don't have some good code completion. ;) jMonkeyEngine appeals to me because I can just start writing code. Every time I've tried to dig into Unity in the past, I never could grok what is going on; it just seems like a lot of magic. It seems bloated and verbose, and the everything seems very tightly coupled together: level design, game objects, and game "scripts" all just thrown into one massive GUI. I found it noisy and unreadable. Despite all of the good things people say about Unity, I honestly just don't have a good first impression of it.

 

On the other hand, because everything is integrated, there's no need to figure out how to handle asset pipelines, level design/building, etc. (With JME, for example, I would have to figure all of that stuff out for myself, and maybe even build custom tools just to put everything together.) So already I can see some tradeoffs. In Unity, I/we could build our levels by basically just dragging things around in the graphical editor. With JME, I'd have to either a) find a secondary tool to help me model the levels, b) write my own editor (not ideal), or c) just do everything in code (also not ideal).

 

So finally to my questions: To those who have experience with Unity, is my initial impression at all accurate? To the veteran programmers out there, what's your opinion of Unity, especially in terms of its programming approach? If I go the "leaner" route (even with a "batteries include" engine like JME), am I going to have to end up writing all of the stuff that's "missing" (which Unity already has)?

 

I understand that the use of tools and the approach different people take is highly subjective. I'm really interested to hear peoples' experiences and opinions on this.

 

Sorry for the long-winded post. I appreciate any feedback! =)

 

Cheers,

-Lars


LWJGL/Slick: Strange color state when loading/rendering textures

03 November 2012 - 08:51 PM

Hey guys,

I'm new to OpenGL and I've been playing with LWJGL, and now Slick (since it provides some utilities for loading textures).

I was experiencing a very strange issue in my project, and I was able to reproduce it by slightly modifying the sample code from here:
http://lwjgl.org/wiki/index.php?title=Slick-Util_Library_-_Part_1_-_Loading_Images_for_LWJGL

Here's the code which produces the error:
http://pastie.org/5179268

The important changes are:
  • line 81 (to specify a 16x16 solid red png)
  • lines 113-193 (to draw a 100x100 white rectangle)
Here's the really strange thing.
  • If I disable the texture loading (init()), skip drawing the texture, and go straight to drawing the white rectangle, I get what I expect: A white rectangle in the upper left corner. This is what it looks like: http://i.imgur.com/t4D8n.png
    (Modified code here, which the texture loading/drawing disabled: http://pastie.org/5179294.)
  • If I keep the texture loading/drawing, and then try to draw the same white rectangle, it draws a red rectangle instead.
    So with this code http://pastie.org/5179268, I get this: http://i.imgur.com/bU5pp.png
  • If I repeat step 2 with a 16x16 solid blue png, I get same result, except everything is blue instead of red.
Sample images:
blue - http://i.imgur.com/VjgR1.png
red - http://i.imgur.com/7DVqj.png

Anyone know why this is happening? It seems like some global state is being tainted, but I have no idea how to reset, clean, or avoid it. I've been banging my head against this for days, so any ideas would be greatly appreciated.

Thanks!

Java Swing/AWT, Screen Tearing, and Double Buffering

18 August 2012 - 01:29 PM

Hi there,

I'm working on a 2D platformer game in Java. I'm writing everything from scratch using basic Swing and AWT components.

I'm making good progress on things (collision detection with platforms, level rendering, level scrolling, etc.). However, I've stopped feature development until I can get an issue resolved: jittering/screen tearing.

I've extracted the basic rendering technique from my code base and have been able to (visually) reproduce the error with just a little bit of code.

In my project, I'm using an RK4 integration technique (describe by http://gafferongames...gration-basics/) in the main game loop. For this example, however, I've simplified the update loop to a simple 10 millisecond SwingTimer.

Main.java: https://gist.github.com/3389133
GameWindow.java: https://gist.github.com/3389137
GameCanvas.java: https://gist.github.com/3389138
GameKernel.java: https://gist.github.com/3389139

This example just makes an orange rectangle (the "player") move back and forth across the screen. Even with this simple example, I can see the screen tearing.

I've been reading tons about double buffering techniques (including several forum threads and this series of articles: http://docs.oracle.c.../doublebuf.html). What I've implemented in the code above seems to be the simplest possible way to achieve hardware-accelerated double-buffered rendering. (At least, I'm assuming this taking advantage of hardware acceleration; I'm pretty newb when it comes to graphics programming.) I've tried other more sophisticated approaches suggested in the Java documentation of BufferStrategy (http://docs.oracle.c...erStrategy.html). I've followed this almost to the letter, and even added a call to Toolkit.sync() (a suggestion from a thread I read). Here's basically what I have in my game right now: https://gist.github.com/3389202

Unfortunately, all of this fancy code doesn't seem to affect any change (good or bad), compared to the simple double buffering technique I pasted above. At this point, I'm kind of doing things in "cargo cult" fashion: thrashing around until _something_ works.

I could use some help. Can anyone tell me what I'm doing wrong? Or perhaps the better question to ask first is, can anyone reproduce this screen tearing issue with the code I posted above (so I can rule out the possibility of this just being an issue with my machine)?

Platform info:

Mid 2010 MacBook Pro
OS X 10.7.4
JDK 1.6.0_33
NVIDIA GeForce GT 330M 256mb
1680 x 1050 display

Any tips are appreciated. Cheers!
-Thok

Collisions with non-rectangular geometry

30 December 2011 - 05:59 AM

Hi there,

I'm currently working on my first game from scratch for the learning experience and for fun. It's a simple 2D platformer written in Java using basic Swing and AWT components for the graphics. Nothing fancy.

For the sake of simplicity, all of the entities in my game (which, at the moment, only consists of the player character and terrain/platforms) are represented by rectangles. This makes collision detection and response (I'm using a simple projection method) incredibly simple: All entities are rectangles and thus all collision intersections are rectangles. Collision intersections are created using Rectangle2D.createIntersection() (http://docs.oracle.com/javase/6/docs/api/java/awt/geom/Rectangle2D.html#createIntersection(java.awt.geom.Rectangle2D).

For this project, I don't plan on using anything more sophisticated than this.

However, for future projects I'm curious to know about how collisions are handled with other types of geometry, such as triangles. I imagine this is problem that you would need to solve in order to have sloped terrain, right? I've done a bit of searching on the web and so far haven't come up with much. Can anyone suggest any articles or other resources that deal with these kind of collisions?

Cheers!

PARTNERS