Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
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
1  Game Development / Newbie & Debugging Questions / Re: Physics- Something that's been holding back me for a while on: 2014-02-01 21:29:18
Culling is when we only run updates (or in this case physics checks) upon things that we know matter.
So if youve got a box thats off camera and isnt moving, why bother slowing your algorithm with it.
So basically just skip the entities that aren't moving or offscreen?
Sounds simple enough I guess.
2  Game Development / Newbie & Debugging Questions / Re: Physics- Something that's been holding back me for a while on: 2014-02-01 19:54:45
Did you consider using a physics engine, like box2d?
Yes but I thought these provide too much for something that should be apparently simple.
Also, I'd like to resort to the less external engine as possible.

I mean, it is possible to check all these entities, but you'll really have to make sure you have a really good algorithm, and perform culling correctly in order for it to work quickly enough.
Although I ommited on the algorithm, the entities wouldn't iterate with the whole world, there would be array-grids holding the entities so they only iterate with those who matter. Also I don't know what culling is  Undecided
3  Game Development / Newbie & Debugging Questions / Physics- Something that's been holding back me for a while on: 2014-02-01 19:42:39
It's been quite some time that I've been trying to get something done, but I am getting stuck on a pretty ridiculous obstacle.
All I wanted to do was a plataformer, with physics similar to Terraria (not the building/break part, just the physics). i.e 2D grid-like world with moving entities.

I think the part I'm messing up is the algorithm, can you guys help me get past this?
Here's what I thought while writing this thread:
On each game loop:

- Iterate through all entities
-- Update their positions based on their current motions (posX += motionX and posY += motionY)
-- Check if they collide with the grid-world (blocks) and update their positions so they don't overlap with the blocks
- Iterate through all entities a second time
-- Inside the current entity iteration, iterate with all entities that are not the current one
--- Check if they collided, if they do, do the following:
---- Teleport the entity to where the collision happened [¹]
---- Give damage or something, basically call some onCollidedWith method, make it invencible for 1 second or 2

I just improvised this algorithm, because I don't have anything else in mind? What should I do to have a properly functional 2d grid world?
Btw this part: [¹] - Brings me some confusion because, since there are many entities, I think it would cause some physical bugs in case 3 entities were moving and 2 collided where there shouldn't have a collision due to another collision that should have taken place before the previous collision.
This is very hard to explain but basically, what confuses me is the order in which the collision responses are to be executed.
Besides, my algorithm also looks very slow (iterate through all entities 3 times?).

My last resort is to humbly ask for a less poor algorithm, that would be responsive but at the same time not overwhelmingly hard to implement, this all must be very simple and the fact that I've been stuck past this point has been bugging me so much. Any input is appreciated.
4  Discussions / Miscellaneous Topics / Re: Starbound on: 2013-12-08 02:01:37
Looks fine, too bad it crashes all the time for me.
5  Game Development / Newbie & Debugging Questions / Re: Image excluded when exporting into a jar? on: 2013-11-09 01:18:52
Seems way too simple and trivial but did you try removing the "/" before "src"?
1  
image[i] = ImageIO.read(Foo.class.getClassLoader().getResourceAsStream("/src/" + i + ".png"));

to
1  
image[i] = ImageIO.read(Foo.class.getClassLoader().getResourceAsStream("src/" + i + ".png"));
6  Java Game APIs & Engines / OpenGL Development / Re: Repeating infinite-like background on: 2013-10-24 16:18:56
If the road is a single image and it doesn't change, you can look up for parallax scrolling (not sure if that's the correct name for it)
7  Game Development / Newbie & Debugging Questions / Re: Using ArrayList<> adding and removing objects on: 2013-10-21 19:39:21
I don't understand the problem.
Why isn't iterating through the list working?
Btw if your list contains only Rockets you can use Generics so you don't need to do type casting.
8  Discussions / Miscellaneous Topics / Re: How to cheapen the Java brand! on: 2013-10-21 17:39:29
Stupid question but how exactly do they make money out of bundles & toolbars?
9  Discussions / Miscellaneous Topics / Re: How to cheapen the Java brand! on: 2013-10-21 16:19:10
Is this shit for real? I thought it was fake before reading the full post  Emo
10  Game Development / Game Mechanics / Re: Collisions between Planets on: 2013-09-09 20:59:05
Not sure if I got the question right but... maybe add the colors and divide by two?

color.r = (color1.r + color2.r)/2
color.g = (color1.g + color2.g)/2
color.b = (color1.b+ color2.b)/2
11  Game Development / Newbie & Debugging Questions / Re: Do I need the stencil buffer for this? on: 2013-08-23 18:00:50
Give this a try:
1  
2  
3  
4  
5  
*draw background*
GL14.glBlendFuncSeparate(GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ZERO);
*draw both these fighters*
GL11.glBlendFunc(GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA);
*draw a white quad surrounding both these fighters*

Hope it works.
12  Games Center / WIP games, tools & toy projects / Re: Heroes of Umbra (2D Sidescrolling RPG) on: 2013-08-22 17:25:43
This looks wonderful, my favorite aspect of the game is the art, absolutely lovely.
Keep it up!  Smiley
13  Game Development / Newbie & Debugging Questions / Re: LWJGL Textureloader not working? on: 2013-08-19 17:10:04
This is what I do to get the texture "slice" of a character in a 256x256 image, where each character is 16x16
1  
2  
3  
4  
glCoord2f(x/256f,       y/256f);
      glCoord2f((x+16)/256f,    y/256f);
      glCoord2f((x+16)/256f,    (y+16)/256f);
      glCoord2f(x/256f,       (y+16)/256f);

Where x and y are the positions of the character.
14  Game Development / Newbie & Debugging Questions / Re: LWJGL Textureloader not working? on: 2013-08-19 16:49:17
First, afaik there is no "TextureLoader" class in LWJGL, are you using some external library?
Second, not related to the problem but I don't think it's a good idea to create textures in a loop, textures should be created only once then used multiple times after creation. Except that your drawString method is called only once, which I don't think is the case.
15  Discussions / General Discussions / Re: What would you modify in Swing if you had to rewrite it? on: 2013-08-16 20:27:52
<<---- BorderLayout master race
16  Java Game APIs & Engines / JInput / Re: On button release on: 2013-08-12 16:11:17
What are you using? LWJGL, etc...?
17  Game Development / Newbie & Debugging Questions / Re: My sprite animation goes faster if the FPS is higher on: 2013-08-06 19:08:47
But after some loops the time will turn to be smaller then the interval and will no longer enter the for loop?

Also, on that for-loop, the index might increment more than one time per update call.. making it skip some indices (sprite frames)

I use the update call to increment the index variable and use it to draw a sprite afterwards. If that for loop increments the index by "3" in a single update() call it will skip 3 frames..

I think we're thinking on different scenarios, or I'm just not getting your thought :/
18  Game Development / Newbie & Debugging Questions / Re: My sprite animation goes faster if the FPS is higher on: 2013-08-06 18:48:30
Do you use any engine? It could be because you use a constant delta value or you smooth the delta value.

Nope, I only use LWJGL, the delta I use is the one seen here

If time is 10*interval, you now have skipped 10 intervals.
Use a for loop
1  
2  
3  
4  
for(;time>=interval;time-=interval)
{
    index++;
}


Sorry, I didn't get it, wouldn't this for-loop happen only once per call (since the time doesn't reset to 0)?
19  Game Development / Newbie & Debugging Questions / My sprite animation goes faster if the FPS is higher on: 2013-08-06 18:29:37
Basically, what I do is:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
   public void update(int delta) {
     
      time += delta;

      if (time >= interval) {

         time = 0;
         index++;
      }
     
      //draws the sprite: someSpriteArray[index].draw();
   }


The higher the FPS is, the faster the index variable increments.

Haha, call me dumb, but I'm out of ideas, I tried a lot of things to get it right, like multiplying by the current fps, among other nonsenses..

When I use the delta variable to multiply on movement stuff, like moving something, it works right.

I thought I only had to use the delta and everything would be goody-neat to go :/

Turns out to be that my entire life was a big lie. Any help is appreciated =o
20  Discussions / General Discussions / Re: Java on PS4 Initiative on: 2013-07-31 20:10:31
So... anyone got a chance to get a DevKit?
My professors won't apply for one because there isn't really a reason for "Why the PS4 blabla is essential to your university course blabla" required for universities to apply.
21  Game Development / Newbie & Debugging Questions / Re: Uninitialized Objects on: 2013-07-29 21:34:26
Btw
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
public class Foo {

   protected String name;
   protected ArrayList<ObjectA> a;
   protected ArrayList<ObjectB> b;
   protected ArrayList<ObjectC> c;

   public Foo(String _name) {
      name = _name;
   }


I think it looks nicer:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
public class Foo {

   protected String name;
   protected ArrayList<ObjectA> a;
   protected ArrayList<ObjectB> b;
   protected ArrayList<ObjectC> c;

   public Foo(String name) {
      this.name = name;
   }
22  Games Center / WIP games, tools & toy projects / Re: HeroesGrave's 7dRTS Game on: 2013-07-27 22:02:54
Maybe 'S'? (Stop)
23  Discussions / General Discussions / Re: Java on PS4! on: 2013-07-26 14:24:36
[...]
by convincing a professor at my university to apply for one - which is possible but I don't know if I will be doing that... I'm kinda done with those kinda projects already.
But the same applies for all of you who are either students or have enough fame / quality to register.

Then when there is devkit available we would form the "task force" and then we should know if it may work or not.

This got my attention, any student of any university (related to computer programming) can get a free DevKit if a professor applies for it? In any country?
I should just google for it  persecutioncomplex
24  Java Game APIs & Engines / OpenGL Development / Re: Slick2D Problems on: 2013-07-25 20:57:49
The lines.. sorry, no idea Huh
25  Java Game APIs & Engines / OpenGL Development / Re: Slick2D Problems on: 2013-07-25 20:31:16
Did you use
1  
image.setFilter(Image.FILTER_NEAREST);

On the images so they don't get blurry?

(inb4 try libGDX.)
26  Games Center / WIP games, tools & toy projects / Re: HeroesGrave's 7dRTS Game on: 2013-07-25 00:56:23
Looks promising, as a RTS lover I hope you keep going with this project Roll Eyes
27  Discussions / Miscellaneous Topics / Re: Why do jar files not have icons? on: 2013-06-18 12:50:40
Try launch4j. Creates an universal exe for AFAIK all major plataforms.
28  Game Development / Newbie & Debugging Questions / Re: Does Lwjgl only use slick-util textures? on: 2013-06-15 18:00:04
http://lwjgl.org/wiki/index.php?title=Loading_PNG_images_with_TWL%27s_PNGDecoder
29  Discussions / Suggestions / Re: [bug] top bar being drawn oddly on: 2013-06-13 18:00:12
Bulls eyes, you must've been pretty bored to notice this out.
30  Game Development / Newbie & Debugging Questions / Re: Tilemap editing based on RGB? on: 2013-06-08 15:54:55
Why not just build a simple map editor and export it into a txt file for your game to read? Like mine =P
Or use TileD as others suggested..
Pages: [1] 2 3
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Mr.CodeIt (10 views)
2014-12-23 03:34:11

rwatson462 (38 views)
2014-12-15 09:26:44

Mr.CodeIt (31 views)
2014-12-14 19:50:38

BurntPizza (62 views)
2014-12-09 22:41:13

BurntPizza (99 views)
2014-12-08 04:46:31

JscottyBieshaar (60 views)
2014-12-05 12:39:02

SHC (74 views)
2014-12-03 16:27:13

CopyableCougar4 (77 views)
2014-11-29 21:32:03

toopeicgaming1999 (138 views)
2014-11-26 15:22:04

toopeicgaming1999 (127 views)
2014-11-26 15:20:36
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org 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‑gaming.org
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!