Show Posts
|
|
Pages: [1] 2 3
|
|
1
|
Discussions / General Discussions / Re: Game Engine vs. A Game Library
|
on: 2013-05-23 23:02:34
|
Generally, a library does something more localized, where an engine or framework has a much broader usage.
This is the complete opposite of what some of the others have said. Haha. Clearly the proposed purpose of the two vary from person to person.
|
|
|
|
|
2
|
Discussions / Miscellaneous Topics / Re: Hey everyone!
|
on: 2013-05-23 18:12:22
|
|
Why it is becoming outdated, it is still perfectly usable for personal projects, and has a lower learning curve. And not everyone cares to have their game on every platform ever.
|
|
|
|
|
3
|
Discussions / General Discussions / Re: Game Engine vs. A Game Library
|
on: 2013-05-23 17:33:55
|
It's not that I'm over-thinking it, as much as I'm interested in the topic. I know there are several nuances and discrepancies that really fudge the line between the two. But, I'm just forming a more concrete separation for my own endeavors and understanding.
My suggestion is to think more about how to code than what label to stick on it. Well, that suggestion isn't really on topic. It's just a question. It's not something that's keeping me awake at night. I'm sure if there was something you were interested in, you wouldn't appreciate if someone told you not pursue the topic. 100% agreed. Its also the "is a tomato a vegetable or a fruit" kind of deal to be honest. To one group of people an engine is a set of tools to create games with while to a whole other group of people it is something that needs to be upgraded yearly to magically get better graphics.
Yes, and that's why I made this thread, so I can understand how other people thought of the matter, to get a pool of opinions, and weigh them against each other for a better overall definition (for myself). I understand that which is which and what does what is almost purely semantics. I'm not looking for someone to step up and just lay down what's what. I'm just interested in the subject, that's all.
|
|
|
|
|
5
|
Java Game APIs & Engines / OpenGL Development / Re: Object Management
|
on: 2013-05-21 08:38:38
|
|
I'd create an Image class to abstract what you have, so you can just do something like Graphics.drawImage(Image), and then you can have your Object class that contains an Image, as well as all the moving logic and whatnot.
|
|
|
|
|
6
|
Discussions / General Discussions / Re: Registration Activation Quiz
|
on: 2013-05-21 07:01:36
|
|
Man. That jam character is persistent.
I don't even know what you guys are talking about...as in, I don't remember even doing a quiz to become a member. Kind of shows how trivial it is to someone who comes here for legitimate reasons.
|
|
|
|
|
7
|
Games Center / WIP games, tools & toy projects / Re: Platformer
|
on: 2013-05-20 09:50:57
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| java.lang.NullPointerException at java.io.Reader.<init>(Unknown Source) at java.io.InputStreamReader.<init>(Unknown Source) at game.level.LevelLoader.load(LevelLoader.java:14) at game.Game.<init>(Game.java:25) at game.Main.initObjects(Main.java:128) at game.Main.<init>(Main.java:25) at game.Main.main(Main.java:160) Exception in thread "main" java.lang.NullPointerException at game.Game.tick(Game.java:42) at game.Main.tick(Main.java:100) at game.Main.loop(Main.java:55) at game.Main.<init>(Main.java:26) at game.Main.main(Main.java:160) |
In case that's useful
|
|
|
|
|
9
|
Game Development / Newbie & Debugging Questions / Re: Threads for long computations?
|
on: 2013-05-20 01:36:19
|
A basic thread is relatively simple in Java, using the Thread class. The idea is you create a new Thread object and pass it an object that implements the Runnable interface: 1
| Thread t = new Thread(runnableObject); |
The Runnable interface has a single method you must implement called run(). This is the code that'll run in a separate thread. To execute it, you do start: And that's all there is to it. Again, at a basic level. This should be enough, if all you need to do is run some calculations in a separate thread.
|
|
|
|
|
11
|
Games Center / WIP games, tools & toy projects / Re: Squares
|
on: 2013-05-18 09:49:14
|
|
Mmm. When you jump and then press up, you just kind of stay in the air (You can still move left, right, and down)until you let go. I don't know if that's intentional. Pressing up while not jumping causes me to move up about 1 pixel.
Also, colliding with the bottom of platforms cause the square to shake until there isn't an intersection.
|
|
|
|
|
12
|
Discussions / General Discussions / Re: Game Engine vs. A Game Library
|
on: 2013-05-18 05:49:03
|
|
It's not that I'm over-thinking it, as much as I'm interested in the topic. I know there are several nuances and discrepancies that really fudge the line between the two. But, I'm just forming a more concrete separation for my own endeavors and understanding.
|
|
|
|
|
13
|
Discussions / General Discussions / Re: Game Engine vs. A Game Library
|
on: 2013-05-17 15:19:04
|
|
So, pretty much the consensus is that a library gives you functionality for something particular like image loading, audio, etc. and an engine is built on top of several libraries to give you all that functionality in one place.
Which brings me back to why Slick2D or LibGDX is considered libraries, when they technically provide the ability to implement most aspects of a game without the use of additional libraries.
And on a slightly different note, keeping this on a 2D graphics level, what is it that is happening when an engine is built from several libraries? As far as I can tell, you could just dump several libraries into a single archive and call that an engine with no additional code.
|
|
|
|
|
14
|
Discussions / General Discussions / Re: Game Engine vs. A Game Library
|
on: 2013-05-16 15:01:23
|
|
The difference between a game engine and a game library is the core question. The extra stuff after that is just some things to consider when answering the question.
And by your definition, an engine is just a library that abstracts another library. Which honestly, I'm not going to say is false, as I wouldn't be asking the question if I knew. But, I have to feel there would be more to it than that.
|
|
|
|
|
15
|
Discussions / General Discussions / Game Engine vs. A Game Library
|
on: 2013-05-16 14:51:17
|
|
I've been working with a guy for several months on a project we've been calling a game "engine", but after all this time, we've kind of realized that we don't know what distinguishes an engine from just a library.
Slick2D and libGDX are game libraries JMonkey3D is considered a game engine
What exactly makes the difference? From what I can understand, an engine is pretty much a framework that you just build on top of/modify. Something like Yii or Django, in terms of web dev.
A library is just a set of classes/utilities you can use?
If an engine is just a framework, what part of a typical game is locked into the framework that would restrict your freedom of development? (Based on the idea that frameworks usually lock you into a certain implementation method of what you are doing)
Since, for libraries like Slick2D and libGDX, you generally just extend some sort of Game class and build around that, what makes them not an engine?
Thanks for any clarification in advance.
|
|
|
|
|
17
|
Discussions / Suggestions / Re: Auto Update unread posts site
|
on: 2013-04-28 21:31:06
|
|
Yes, I know. I'm just saying, in my opinion I think that works better than what you are suggesting. In your scenario, it seems like you are always staring at the new posts section just waiting for...well, a new post. The way it is now, you can browse about the forum and you are notified when a new post is in.
|
|
|
|
|
19
|
Java Game APIs & Engines / Engines, Libraries and Tools / Camera Class Zooms and Cuts Off Image
|
on: 2013-04-28 02:05:23
|
I'm working on implementing a simple camera to use with my projects. It works like it should, except when it draws the image, it is zoomed in, and some of the bottom and right side are completely cut off. First, here's the code for the class (keep in mine I use the Slick2D Image and GameContainer): 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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
| public class ECamera { protected Image bg;
protected float camX, camY;
protected float bgWidth, bgHeight;
protected GameContainer gc; public ECamera(GameContainer gc, Image bg) { this.bg = bg;
bgWidth = bg.getWidth(); bgHeight = bg.getHeight();
camX = camY = 0;
this.gc = gc; }
public void centerOn(float x, float y) { camX = x - (gc.getWidth() / 2); camY = y - (gc.getHeight() / 2);
if (camX < 0) camX = 0; if (camX + gc.getWidth() > bgWidth) camX = bgWidth - gc.getWidth();
if (camY < 0) camY = 0; if (camY + gc.getHeight() > bgHeight) camY = bgHeight - gc.getHeight(); } public void draw() { this.draw(camX, camY); } public void draw(float offsetX, float offsetY) { if (bg != null) gc.getGraphics().drawImage(bg, 0, 0, offsetX, offsetY, offsetX + gc.getWidth(), offsetY + gc.getHeight()); } public void translateGraphics() { gc.getGraphics().translate(-camX, -camY); } public void untranslateGraphics() { gc.getGraphics().translate(camX, camY); } } |
I use the Graphics.draw() method that lets you specify The top left corner and the bottom right corner of the area of the image you want to draw. It specifically says in the API: Draw a section of an image at a particular location and scale on the screen So, I guess my main thing is, how do I do what I'm already doing, just without the image being scaled?
|
|
|
|
|
21
|
Game Development / Newbie & Debugging Questions / Re: Algorithms for Image Shapes
|
on: 2013-04-19 03:36:34
|
Just thought I'd update this with my findings: I was able to write a method that created a shape from the outline of an image. Here are a couple screen shots:   The method to create this has a parameter for "precision", which basically just means it only adds a point to the polygon once every x number of pixel hits. So, for a precision of 2, every second border pixel is added to the polygon. There is also a parameter for the value of the alpha to check against. For this image the time to create the shape was: Image size: 384x384 Precision Time (in ms) -------- ---- 1 87 2 66 4 55 8 42 16 33 These are all on separate run times, so there is no optimization between each. The image above uses a precision of 2. One part of my algorithm that I know plays a big part in the creation time is converting the image to an array of Pix (inner class). I do this for convenience, so I'm sure by just accessing the image pixels directly, that time can be lowered more. A couple limitations I haven't fixed: If there is an edge of the non-transparent pixels on any border of the whole image, an out of bounds exception occurs. It doesn't account for transparent pixels within the non-transparent pixels. So, anyway, that's what I've found that I think will suite my needs. I'm sure there is still a better way to do this, but I'm satisfied. Here is the pastebin link http://pastebin.com/Wvatq5Bk. It is in the form of a singleton class. When you create a shape, you also pass in a name, so that you can access the shape again without having to re-create it. It's done this way for personal need. Also, this was done using the Slick2D Image, Shape, and Polygon classes. I'm sure converting it to Java2D would require minimal changes. Further more, it's written to quit the program if the user tries to use an image that isn't a png. Feel free to use the code, abuse it, criticize, or whatever. Hopefully this helps someone. Update: Redid method to cut out all the code duplication, and fixed typo indicated by SHC.
|
|
|
|
|
22
|
Game Development / Newbie & Debugging Questions / Re: Algorithms for Image Shapes
|
on: 2013-04-18 16:59:02
|
|
The thought on using the pixel colors for the actual collision checking was just a query about the more excepted method of achieving pixel perfect collision. Doing some research, there isn't all that much information on the topic, and there really isn't a consensus on an accepted method for it.
To me, using the pixels to test for overlap doesn't seem efficient at all. That's why I'm opting for building a polygon to represent the non-transparent pixels of the image. Though, scanning through every single pixel and adding all non-transparent pixels to the polygon is also very cumbersome. So, if I can develop a method of collecting just the bordering pixels of the image, or something like that, maybe this would be efficient enough to be practical. Maybe adding an options for an offset, so that it only gets every other border pixel, or so.
SHC's link seems to be something like what I'm looking for. I'll mess with that and see if it proves useful.
|
|
|
|
|
23
|
Game Development / Newbie & Debugging Questions / Algorithms for Image Shapes
|
on: 2013-04-18 06:39:47
|
|
I'm exploring the idea of converting images into bounding shapes, using a transparency color (or alpha for png's), as a method for doing pixel perfect collision.
Of course, this can quickly turn into a CPU taxing problem. I could just hit every pixel, and add all non-transparent ones to a polygon. But, that's far too many points, and it's just a slow process to go through every pixel in an image.
Another though would be to check every pixel, but only add the bordering pixels to create an outline. This reduces the point count, but is still checking every pixel.
A third thought was scanning until I found the first non-transparent pixel, as this would definitely be on an edge, and then only checking pixels around it for other border pixels, And just making my way around the image. I could use a scalar to reduce the number of points actually added.
Finally, my question is if this is an accepted approach to pixel perfect collision. Or, do people generally just use the pixel colors directly to check for overlap?
|
|
|
|
|
24
|
Java Game APIs & Engines / Java 2D / Re: Slick2D, play sound at location
|
on: 2013-04-05 15:06:33
|
So, what is the issue? Unless I'm mistaken, you want the volume of audio to be proportional to the distance from the audio source. Couldn't you just use the distance formula?  As for using the distance to change the volume, just choose a maximum distance, say 100. Any further than that and the volume is 0. So, you divide the distance by 100, and that gives you a percentage which you can use as the volume. So, if the distance is 50, then the math would give you .5, which would be what you need. Is that right?
|
|
|
|
|
25
|
Game Development / Newbie & Debugging Questions / Re: Camera/Movement Starting Point
|
on: 2013-04-03 03:24:33
|
Welp. Turns out it wasn't as hard as I thought. I found a simple Camera class for use with TileMaps, and modified it to work with a background image instead. Here it is for anyone that wants to use it: 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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
| import org.newdawn.slick.GameContainer; import org.newdawn.slick.Image;
public class Camera { protected Image bg;
protected float camX, camY;
protected float bgWidth, bgHeight;
protected GameContainer gc;
public Camera(GameContainer gc, Image bg) { this.bg = bg;
bgWidth = bg.getWidth(); bgHeight = bg.getHeight();
camX = camY = 0;
this.gc = gc; }
public void centerOn(float x, float y) { camX = x - gc.getWidth() / 2; camY = y - gc.getHeight() / 2;
if(camX < 0) camX = 0; if(camX + gc.getWidth() > bgWidth) camX = bgWidth - gc.getWidth();
if(camY < 0) camY = 0; if(camY + gc.getHeight() > bgHeight) camY = bgHeight - gc.getHeight(); } public void centerOnX(float x) { camX = x - gc.getWidth() / 2;
if(camX < 0) camX = 0; if(camX + gc.getWidth() > bgWidth) camX = bgWidth - gc.getWidth();
} public void centerOnY(float y) { camY = y - gc.getHeight() / 2;
if(camY < 0) camY = 0; if(camY + gc.getHeight() > bgHeight) camY = bgHeight - gc.getHeight(); } public void draw() { this.draw(camX, camY); } public void draw(float offsetX, float offsetY) { gc.getGraphics().drawImage(bg, 0, 0, offsetX, offsetY, offsetX + gc.getWidth(), offsetY + gc.getHeight()); } public void translateGraphics() { gc.getGraphics().translate(-camX, -camY); } public void untranslateGraphics() { gc.getGraphics().translate(camX, camY); } } |
An example of using it in the render() method: 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
| Camera cam; Image bg; Image player; float px, py; public void init(GameContainer gc) { bg = new Image("Image path"); player = new Image("Image path"); cam = new Camera(gc, bg);
px = py = 0; }
public void render(GameContainer gc, Graphics g) { cam.centerOn(x, py); cam.draw(); cam.translateGraphics();
g.drawImage(player, x, y); }
public void update(GameContainer gc, int delta) { } |
|
|
|
|
|
26
|
Game Development / Newbie & Debugging Questions / Camera/Movement Starting Point
|
on: 2013-04-03 00:03:35
|
|
I hate being that guy starting a thread that's been started a million times, but none of the threads seem to have very good answers.
Anyway, I'm looking for some sort of learning materials, so I can understand and implement the camera/movement systems needed for a side scrolling game. I'm using slick2D, though, for general purpose learning, I guess it doesn't have to be slick2D material (Not that I could find any, regardless).
The biggest thing is that I'm not using tiles. That seems to be where the search attempts fail. If I ever do find examples or tutorials, it's for tile based games.
Any references would be greatly appreciated. Thanks!
|
|
|
|
|
27
|
Game Development / Game Play & Game Design / Game Engine Object logic/design
|
on: 2013-02-23 21:56:01
|
|
This isn't really about game design, but more of engine design. I feel this is still the best place for it.
My issue is the organization of the object class with my engine. The basic premise is something like this:
Entity --> ShapeEntity --> Object |-> ImageEntity -|
So, Entity holds a bunch of base attributes of any object. Namely, things like position, velocity, facing angle, etc.
The ShapeEntity and ImageEntity extend this to include functionality specific to each (ie, handling movement/transformations of shapes and images).
The idea is the Object (my own Object class, not Java's Object) will be able to use either the exact same way, while abstracting the underlying Class specific orientation. So, even though the code is different for rotating an Image versus rotating a Shape, Object can simply call rotate() and it work regardless of which Entity subclass it is using.
My approach so far have been an abstract Entity class, the ImageEntity and ShapeEntity subclasses, and the Object class which has an Entity field. This allows for Object to hold either Entity subclasses. But, I'm having trouble actually using this method without having to constantly cast the Entity field to one of the subclasses. That's just messy and over complicates things.
Am I even on the right track with this? Does anyone have any advice or suggestions? Bear in mind this engine is strictly 2D. Thanks in advance.
|
|
|
|
|
29
|
Java Game APIs & Engines / Engines, Libraries and Tools / Using Slick without GameContainer
|
on: 2012-12-01 21:33:28
|
I've decided to implement slick as it has many features that Java2D lacks, and is simpler to use than straight up lwjgl. My issue is, I really only want to access it's Graphics and Geom utilities (at the moment). Using the Graphics class to draw is straight foward (drawing on a Canvas), but I do this to update the image: 1 2
| graphics = buffer.getDrawGraphics(); graphics.drawImage (bi, 0, 0, null); |
here graphics is Java's Graphics class. Does anyone know how to do this using slick? Do I need to? Am I thinking about this wrong?
|
|
|
|
|
30
|
Game Development / Game Play & Game Design / Re: Game Design Resources
|
on: 2012-11-28 18:25:35
|
|
There are certain aspects of video games that are an "art" (story, theme, graphics, style, etc), but after that, you need to apply these things to other aspects (gameplay, story flow, interface layout, etc), that have a more standard way of doing them. It doesn't matter how great your story is, if your user base is so frustrated by the bad control scheme that they rage quit the game.
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|