Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (531)
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
1  Game Development / Newbie & Debugging Questions / Re: Finding the nearest point to a curve on: 2014-05-23 07:37:47
Exactly what I'm talking about can be found here http://www.red3d.com/cwr/steer/Containment.html
And more specifically this section
"When a probe point touches an obstacle, it is projected (indicated by a black line) to the nearest point on the surface of the obstacle".
What I don't understand is how the nearest point on the surface of the obstacle is found.
2  Game Development / Newbie & Debugging Questions / Re: Finding the nearest point to a curve on: 2014-05-23 06:01:46
The curve would simply be a shape with a curved edge like so, and what I need is to find the closest point from the center of the circle to the closest x,y on the curved line.
3  Game Development / Newbie & Debugging Questions / Finding the nearest point to a curve on: 2014-05-23 00:28:50
Hello, I'm having trouble with something that would seem rather simple, basically I have a sprite and I wish to find the point closest to the sprite from a curved line, I have created an image to show you exactly what I mean. Is there any maths that could do this for me or could I use pixel collision and find the nearest pixel and then find the pixels coordinates that way?

4  Game Development / Newbie & Debugging Questions / Re: A* Pathfinding, multiple paths with equal lengths. on: 2014-05-03 05:08:28
Ok, so in the below image what is stopping the red square from moving horizontally to the right until it hits the wall? Since the F costs of the squares will be the same up until that point.


5  Game Development / Newbie & Debugging Questions / A* Pathfinding, multiple paths with equal lengths. on: 2014-05-02 18:02:25
Hello, I have been working on A star pathfinding algoritham, and I've got it working for the most part but I was wondering if anyone could give me any advice as to what to do when I am faced with 2 or more paths that have the same movement cost, I was thinking of just picking one of the paths (that are of equal length) at random, but is there a quicker to do this?

 I have included an image below, if the player was the red square and the goal was the green square, you can see there are two paths the player could take.

6  Game Development / Newbie & Debugging Questions / Re: Curved shape collision detection? on: 2013-12-09 03:17:43
I am using only Java2D, I see no reason why I would need a libary for what I want to achieve.
7  Game Development / Newbie & Debugging Questions / Curved shape collision detection? on: 2013-12-08 18:40:19
Hello, I've been experimenting lately with different types of collision detection, however I am a little puzzled when it comes to shapes with curves, particulary shapes such as curved slopes and hills, I am curious how I would go about testing these shapes against an AABB object. I understand how SAT works but it doesn't look like it would work in this case, there is an example on the link below (curved shapes vs AABB section) but I am having trouble on figuring out how to actually solve it.

http://www.metanetsoftware.com/technique/tutorialA.html

All I am looking for is a way to test AABB objects against curved shapes, specifically the ones I mentioned above, I am not interested in collision response, simply how to detect the collision, thanks!
8  Game Development / Newbie & Debugging Questions / Re: Where to start with 3D? on: 2013-09-26 22:15:44
Ok, I have no idea what you guys are even talking about but thanks for the links  Tongue
9  Game Development / Newbie & Debugging Questions / Where to start with 3D? on: 2013-09-23 20:47:13
Hello, I have a fair amount of experience in 2D game programming and have created several games of my own but I want to get into 3D programming, but I have no idea where to start. I understand the basics of how 3D points are projected onto a screen and such but I'm not really sure where the best place to start is when applying it to game programming. I do have an old game programming book I brought a while back but It uses Java3D which I heard isn't the best for games :/ and it doesn't really do a good job of explaining some of the methods. Any help is appreciated, thanks!

 Cool
10  Game Development / Newbie & Debugging Questions / Re: Vectors! on: 2013-09-04 04:51:07
Lol, that made me chuckle, and that is a pretty cool way of implementing them, thanks for the help Smiley
11  Game Development / Newbie & Debugging Questions / Re: Vectors! on: 2013-09-03 18:02:21
Yeah I just wanted to make sure, and I find vectors really interesting so I'll be sure to check that article out, thanks!
12  Game Development / Newbie & Debugging Questions / Re: Vectors! on: 2013-09-03 14:57:34
Thanks but that was pretty much what I said, I was adding the resultant direction vector components (from the vector subtraction of the two points) to the sprite that I wanted to move, I mean I tested it before and it worked I just wanted some clarification that I was going the right way about things.
13  Game Development / Newbie & Debugging Questions / Vectors! on: 2013-09-03 07:01:13
Hello, I've been learning how to implement vectors into game programming recently but I'm having some trouble with a couple of things. Mainly if I want an object to go from one point to another, would I create a vector where the components are as followed

V = <sprite1.x - sprite2.x, sprite1.y - sprite.y>

and then normalize, and then add the resulting x and y values onto a sprites x and y?

And would this be a Velocity vector since it's changing the sprites position every game cycle?

Thanks in advance!  Wink
14  Game Development / Newbie & Debugging Questions / Re: A* Pathfinding on: 2013-07-20 03:45:19
The way I managed to implement A* pathfinding into my game was, I would get the tile the player is currently on, have an array of tiles that contains all the tiles (not including un-walkable tiles)adjacent to the tile the player was current on. I then calculated (for each tile around the player) how many 'moves' it would take in total to move from the current tile to the target tile. From that I added the cost of moving from the current tile to the tile I'm currently looking at (I used a similar method to that of that article everyone always seems to link people to Tongue), once I found the tile with the lowest cost I simply moved the player/npc to that tile and simply repeated this process until I was on the target tile. It worked perfectly for what I wanted, just spend a bit of time on it, don't give up easily because that won't get you anywhere, keep working at it and suddenly something will click in your brain and you will figure it out Smiley
15  Game Development / Networking & Multiplayer / Re: General networking questions on: 2013-07-16 02:39:09
Thanks guys, Yeah I created a small chat program I actually know a fair bit but was struggling in applying it to game development. I have as of now implemented what I was trying to do and it worked, I have been able to let a player type in a port and the player gets connected to the server at that port and have been able to send objects and handle them on the server. Thanks!
16  Game Development / Networking & Multiplayer / Re: General networking questions on: 2013-07-14 18:45:17
So, I was thinking it would go like this, the first player would start a new game, this would then create a server at the port the user enters, the game would then wait for a connection from a client which would then start the game, so in turn although there would be 2 players, one is the actually the server and the other is the client. Am I on the right track for this? Thanks!
17  Game Development / Networking & Multiplayer / General networking questions on: 2013-07-13 00:05:40
So, the way I've been sending objects to a server is by creating the objects class in both the client project and the server project then just reading them in through a stream, is this the correct way to do so?

Another question I have is, If I were to create a simple multi-player game where a player would connect to a server and a new player object would be created, would I just create the server in a different project as usual, send the necessary data to the server, then have the server send back information that needs to be updated such as play positioning?

Last question is, for Peer-to-Peer where one player is the host, in terms of how the server and connections made, how exactly does it work, by which I mean when a new client joins where does it connect to?

Any help is appreciated!  Cool

18  Game Development / Newbie & Debugging Questions / Re: Multiplayer Games on: 2013-07-12 22:05:23
Quote
This is a ridiculous attitude to be taking as a programmer.  You're already using the Java standard library and it has hundreds of classes and features you didn't write, to say nothing of the big managed runtime it all sits on.  You can't make informed decisions about what libraries are appropriate and which you'd rather reimplement yourself if you don't get any experience in using them.

I understand where you are coming from but I didn't say I would NEVER use library I simply said I disliked the use of them, to further my point I should of said that I disliked the use of them when I don't understand the basics (not every single line of code). I guess it is just my attitude but I feel I should know a little about what is going on under the hood and not just blindly downloading a library without a single clue of what's going on.  Why shouldn't I learn a little bit of C before using something like OpenGl? It's my choice as a programmer, and besides how is gaining more knowledge in a subject a negative thing?

Back to the original topic, I was simply asking for advice for how Sockets can be used in game development, the library I was suggested to use is no where near what I will be needing any time soon. Like another poster said I am not looking to make some fancy MMORPG I was simply looking for advice.
19  Game Development / Newbie & Debugging Questions / Re: Implementing Vector Maths on: 2013-07-10 14:06:45
Thanks a lot guys, particularly jonjava, that explanation really helped, and that blog post looks awesome as well.
20  Game Development / Newbie & Debugging Questions / Implementing Vector Maths on: 2013-07-09 21:37:02
Hello, I recently started learning Vector maths and I'm find it really interesting. But I'm struggling trying to implement them into game programming (2D), specifically Vectors that require a direction and a speed, and how I would translate it into a game. For example, say I wanted to add something like wind or velocity, I would need the speed and the direction it is going, of course speed isn't an issue but what about the direction of the vector, how would I specify something like that within a game? 

Sorry If what I'm asking is a bit vague, I'm looking for more for guidance than a page of code (though an example is always nice).
Thanks!
21  Game Development / Newbie & Debugging Questions / Re: Multiplayer Games on: 2013-07-07 20:13:50
Thanks! I'll have a read of that Cheesy
22  Game Development / Newbie & Debugging Questions / Re: Multiplayer Games on: 2013-07-07 07:12:50
I'd rather not use a libary, I prefer to know whats going on fully, unless I know exactly whats happening I just don't like using libarys.
23  Game Development / Newbie & Debugging Questions / Multiplayer Games on: 2013-07-06 15:42:50
So I recently started learning about Sockets and network programming in Java as I hope to add it into a game but I'm unsure how I would implement it, I was thinking of having it so you would type in the IP of the player you wish to connect to and then you would appear in the players "world", is this even possible or are there easier/more efficient ways? I am also curious how I would send player data, would I just use Object streams?

Sorry If I'm not being clear and sound like a newbie but I'm kind of new to networking Tongue

P.S
I've read the oracle tutorials/documentation and understand the basics of sockets/server sockets.
24  Game Development / Newbie & Debugging Questions / Re: Understanding the game loop on: 2013-07-06 10:33:18
I understand how the loop works, It was just that one line I was confused by, I just don't get why we divide by 1/60th of a second.
25  Game Development / Newbie & Debugging Questions / Understanding the game loop on: 2013-07-06 10:09:57
So I've been using the game loop below for most of the games I've made and as I was just going through it I found there is one part I'm having trouble
trying to understand, specifically the line just below.

1  
delta += (now - lastTime) / nanos; 


I understand we are finding the time difference and adding it to the delta variable but I don't understand why we are then dividing it by the nanos variable  (1000000000 / 60). I pasted the full game loop below.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
 long lastTime = System.nanoTime(); 
         final double nanos = 1000000000.0 / 60.0;
         double delta = 0;
         int frames = 0;
         int updates = 0;
         requestFocus();
         while(running){
           
            long now = System.nanoTime();
            delta += (now - lastTime) / nanos;
            lastTime = now;

             while(delta >= 1){
               gameUpdate();
               delta--;
         
            }
               render();
           
      }
   }
    }


If anyone could help me by explaining whats happening on the line I pointed out, it would be very appreciated. Thanks!
26  Game Development / Newbie & Debugging Questions / Re: Tile coords on: 2013-06-24 05:15:20
Thanks for the help, I managed to sort out my tile problem and it now works as desired, as for the path finding you suggested, I am actually going to use a* path finding, thanks anyway that was a lot of code and I took note of it Smiley
27  Game Development / Newbie & Debugging Questions / Re: Tile coords on: 2013-06-23 23:16:22
hmm, I may change it to be like that, though I'm not sure, I just really like the idea of only have one instance, I just can't really think of any other way to implement path finding without being able to access specific tile coordinates, because without the coordinates there really isn't a way for me to access the tiles type etc.

Thanks for the help anyway, I'll wait and see if anyone else has any ideas, if not ill try your idea Smiley
28  Game Development / Newbie & Debugging Questions / Re: Tile coords on: 2013-06-23 22:44:10
The problem with that is, I am using a static Tile named grass, I saw no reason to create multiply instances of a tile, the way Im doing it, I'm not creating a new tile for every index in the array, if I did surely that would use a lot more resources considering each tile would have a buffered image assigned to it?
29  Game Development / Newbie & Debugging Questions / Tile coords on: 2013-06-23 21:09:47
Hello, i recently finished creating a tile map, I render it using a 2D array, the problem is the way I am rendering, I never really set an X/Y position of the individual tiles, instead I'm using the tiles render method and a loop for setting the X and Y, but of course this is only the drawing positioning and not the actual coordinates of the tile. So is there anyway I can set an x and y for a tile within a 2D array? The main reason is I'm thinking of implementing path finding and cant think of any other way to do it without knowing the specific x,y of the individual tiles. Thanks for any help!
30  Game Development / Newbie & Debugging Questions / Re: Continuous tile scrolling? on: 2013-06-15 13:56:37
hmm, that wasn't really what i was going for if I'm honest. I was going for more of an open world idea, kind of like no matter how far right the player traveled more tiles would just keep rendering. As you said similar to minecraft but not randomly generated.
Pages: [1] 2
 

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

The first screenshot will be displayed as a thumbnail.

pw (13 views)
2014-07-24 01:59:36

Riven (13 views)
2014-07-23 21:16:32

Riven (13 views)
2014-07-23 21:07:15

Riven (14 views)
2014-07-23 20:56:16

ctomni231 (43 views)
2014-07-18 06:55:21

Zero Volt (39 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (35 views)
2014-07-16 23:30:00

Cero (50 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!