Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (754)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
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: Isometric Object Rendering on: 2015-07-19 17:04:39
I'm simply using a nested for loop which contains the following

 int tileX = (j * tileWidth / 2) + (i * tileWidth / 2);
 int tileY = (i * tileHeight / 2) - (j * tileHeight / 2);

and then im drawing the tiles using the tileX and tileY, no matrix is being used.

I'm also curious how I would render sprites, I've tried finding articles explaining the process but I can't seem to wrap my head around it.
2  Game Development / Newbie & Debugging Questions / Isometric Object Rendering on: 2015-07-19 04:44:31

I've recently begun experiementing with rendering tiles isometrically, currently I'm using 128 * 64 tiles however I'm running into some difficulty on how to render objects that span multiple tiles and are larger than 128 * 64, a pattern I've noticed is that when the objects width exceeds 192 it  begins to become offset from the terrain tiles. I thought prehaps breaking the larger objects down into 128 * 64 tiles but then wouldn't that requiring rendering the individual tiles in a specific order?

Any tips would be great!

3  Game Development / Newbie & Debugging Questions / Re: Finding the nearest point to a curve on: 2014-05-23 05:37:47
Exactly what I'm talking about can be found here
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.
4  Game Development / Newbie & Debugging Questions / Re: Finding the nearest point to a curve on: 2014-05-23 04: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.
5  Game Development / Newbie & Debugging Questions / Finding the nearest point to a curve on: 2014-05-22 22: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?

6  Game Development / Newbie & Debugging Questions / Re: A* Pathfinding, multiple paths with equal lengths. on: 2014-05-03 03: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.

7  Game Development / Newbie & Debugging Questions / A* Pathfinding, multiple paths with equal lengths. on: 2014-05-02 16: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.

8  Game Development / Newbie & Debugging Questions / Re: Curved shape collision detection? on: 2013-12-09 02:17:43
I am using only Java2D, I see no reason why I would need a libary for what I want to achieve.
9  Game Development / Newbie & Debugging Questions / Curved shape collision detection? on: 2013-12-08 17: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.

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!
10  Game Development / Newbie & Debugging Questions / Re: Where to start with 3D? on: 2013-09-26 20:15:44
Ok, I have no idea what you guys are even talking about but thanks for the links  Tongue
11  Game Development / Newbie & Debugging Questions / Where to start with 3D? on: 2013-09-23 18: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!

12  Game Development / Newbie & Debugging Questions / Re: Vectors! on: 2013-09-04 02:51:07
Lol, that made me chuckle, and that is a pretty cool way of implementing them, thanks for the help Smiley
13  Game Development / Newbie & Debugging Questions / Re: Vectors! on: 2013-09-03 16: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!
14  Game Development / Newbie & Debugging Questions / Re: Vectors! on: 2013-09-03 12: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.
15  Game Development / Newbie & Debugging Questions / Vectors! on: 2013-09-03 05: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
16  Game Development / Newbie & Debugging Questions / Re: A* Pathfinding on: 2013-07-20 01: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
17  Game Development / Networking & Multiplayer / Re: General networking questions on: 2013-07-16 00: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!
18  Game Development / Networking & Multiplayer / Re: General networking questions on: 2013-07-14 16: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!
19  Game Development / Networking & Multiplayer / General networking questions on: 2013-07-12 22: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

20  Game Development / Newbie & Debugging Questions / Re: Multiplayer Games on: 2013-07-12 20:05:23
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.
21  Game Development / Newbie & Debugging Questions / Re: Implementing Vector Maths on: 2013-07-10 12:06:45
Thanks a lot guys, particularly jonjava, that explanation really helped, and that blog post looks awesome as well.
22  Game Development / Newbie & Debugging Questions / Implementing Vector Maths on: 2013-07-09 19: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).
23  Game Development / Newbie & Debugging Questions / Re: Multiplayer Games on: 2013-07-07 18:13:50
Thanks! I'll have a read of that Cheesy
24  Game Development / Newbie & Debugging Questions / Re: Multiplayer Games on: 2013-07-07 05: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.
25  Game Development / Newbie & Debugging Questions / Multiplayer Games on: 2013-07-06 13: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

I've read the oracle tutorials/documentation and understand the basics of sockets/server sockets.
26  Game Development / Newbie & Debugging Questions / Re: Understanding the game loop on: 2013-07-06 08: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.
27  Game Development / Newbie & Debugging Questions / Understanding the game loop on: 2013-07-06 08: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.

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.

 long lastTime = System.nanoTime(); 
         final double nanos = 1000000000.0 / 60.0;
         double delta = 0;
         int frames = 0;
         int updates = 0;
            long now = System.nanoTime();
            delta += (now - lastTime) / nanos;
            lastTime = now;

             while(delta >= 1){

If anyone could help me by explaining whats happening on the line I pointed out, it would be very appreciated. Thanks!
28  Game Development / Newbie & Debugging Questions / Re: Tile coords on: 2013-06-24 03: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
29  Game Development / Newbie & Debugging Questions / Re: Tile coords on: 2013-06-23 21: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
30  Game Development / Newbie & Debugging Questions / Re: Tile coords on: 2013-06-23 20: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?
Pages: [1] 2
DesertCoockie (33 views)
2018-05-13 18:23:11

nelsongames (75 views)
2018-04-24 18:15:36

nelsongames (70 views)
2018-04-24 18:14:32

ivj94 (752 views)
2018-03-24 14:47:39

ivj94 (82 views)
2018-03-24 14:46:31

ivj94 (622 views)
2018-03-24 14:43:53

Solater (98 views)
2018-03-17 05:04:08

nelsongames (179 views)
2018-03-05 17:56:34

Gornova (405 views)
2018-03-02 22:15:33

buddyBro (1065 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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!