Show Posts
|
|
Pages: [1] 2 3 ... 27
|
|
8
|
Discussions / General Discussions / 3D simple placement tool needed: Willing to put $50 towards one being made
|
on: 2013-01-24 21:44:11
|
Alright, so I happen to need a 3d placement tool that can load .obj files (I can supply a OBJ loader to you) and basically allows me to put like enemies, and other models on a level model. It needs to export into a xml file like this: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| <level bgm="data/audio/Promises_Delivered_full_mix.ogg" draw-distance="600" > <fog r="0" g="2" b="5" density="0.190" length="0.095" /> <scale x="30" y="23" z ="30" /> <model name="data/levels/models/ntest.obj" x="0" y="0" z="0"/> <model name="data/levels/models/stest.obj" x="25" y="0" z="25"/> <colmodel name="data/levels/models/ntest.obj" x="0" y="0" z="0"/> <colmodel name="data/levels/models/stest.obj" x="25" y="0.1" z="25"/> <light x="250" y="-200" z="250" ambr="1" ambg="0" ambb="0" difr="1" difg="0" difb="0" /> <light x="150" y="-200" z="150" ambr="0" ambg="1" ambb="0" difr="0" difg="1" difb="0" /> <light x="0" y="-200" z="0" ambr="0" ambg="0" ambb="1" difr="0" difg="0" difb="1" /> <player x="200" y="-200" z="200" a="0" /> <enemy x="0" y="-500" z="0" t="2" /> <enemy x="1000" y="-500" z="100" t="2" /> </level> |
I'm willing to help with development, and put $50 towards someone being a full time coder on this. I realize that $50 isn't the best amount, but I don't have a lot of money these days. So anyone interested?
|
|
|
|
|
9
|
Game Development / Shared Code / Re: ms3d animated model loader for LWJGL!
|
on: 2013-01-21 02:44:32
|
|
Thank you very much for your help.
I have some questions though:
1)To use the loader as a lib I'd just create a non-executable Jar for it, right? 2) which license should I use to get this effect?
"Models must have permission to be used anywhere except for test projects. If you publish any videos/screenshots with the models included in this project you must credit the model's creator: William Starkovich.
You can do anything with the rest of the project except charge for it, though you may include it in a project that you charge for."
|
|
|
|
|
11
|
Game Development / Newbie & Debugging Questions / How do I make and set a Ortho Matrix in OpenGL ES?
|
on: 2013-01-20 08:03:35
|
|
So I'm making a 3d game in Android, and I wanna overlay buttons to move the player.
My questions are:
1)How do I get the current matrix as a float array/buffer in OpenGL ES for Android (4.0).
2)How do I set said matrix into a Ortho Matrix?
3)How do I make my current matrix said Ortho matrix?
If this isn't clear, or there isn't enough info please post saying so.
|
|
|
|
|
14
|
Game Development / Newbie & Debugging Questions / Re: Collision Detection for tiled map via cross products?
|
on: 2013-01-16 09:39:22
|
Thanks for the replies, guys. I think I got 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
| package cypri.games.crosscol;
import org.newdawn.slick.AppGameContainer; import org.newdawn.slick.BasicGame; import org.newdawn.slick.Color; import org.newdawn.slick.GameContainer; import org.newdawn.slick.Graphics; import org.newdawn.slick.Input; import org.newdawn.slick.SlickException; import org.newdawn.slick.geom.Rectangle; import org.newdawn.slick.geom.Vector2f;
public class CrossCol extends BasicGame{
Vector2f playerPos; int size = 32; float speed = 2.5f; Rectangle tile; public CrossCol(String title) { super(title); } public void move(float val, boolean vertical){ Vector2f momentum = new Vector2f(0,0); if(!vertical) momentum.x = val; else momentum.y = val; System.out.println("momentum: " + momentum.x + " --- " + momentum.y); Vector2f npos = playerPos.copy(); npos.add(momentum); Rectangle r = new Rectangle(npos.x, npos.y, size, size); if(r.intersects(tile)){ Vector2f perp = momentum.getPerpendicular(); Vector2f oldMomentum = momentum.copy(); if(oldMomentum.x < 0) momentum.x = -perp.x; else if(oldMomentum.x > 0) momentum.x = perp.x; else momentum.x = 0; if(oldMomentum.y < 0) momentum.y = -perp.y; else if(oldMomentum.y > 0) momentum.y = perp.y; else momentum.y = 0; } playerPos.add(momentum); }
@Override public void render(GameContainer gc, Graphics g) throws SlickException { g.setColor(Color.white); g.fillRect(0, 0, 800, 600); g.setColor(Color.red); g.fill(tile); g.setColor(Color.cyan); g.fillRect(playerPos.x, playerPos.y, size, size); }
@Override public void init(GameContainer gc) throws SlickException { playerPos = new Vector2f(300,300); tile = new Rectangle(200,200,size, size); }
@Override public void update(GameContainer gc, int delta) throws SlickException { Input input = gc.getInput(); if(input.isKeyDown(Input.KEY_F4)) System.exit(0); if(input.isKeyDown(Input.KEY_UP)) move(-2.5f, true); if(input.isKeyDown(Input.KEY_DOWN)) move(2.5f, true); if(input.isKeyDown(Input.KEY_LEFT)) move(-2.5f, false); if(input.isKeyDown(Input.KEY_RIGHT)) move(2.5f, false); } public static void main(String[] args) throws SlickException { AppGameContainer app = new AppGameContainer(new CrossCol("Test")); app.setDisplayMode(800, 600, false); app.setTargetFrameRate(60); app.start(); }
} |
|
|
|
|
|
15
|
Game Development / Newbie & Debugging Questions / Collision Detection for tiled map via cross products?
|
on: 2013-01-16 08:04:36
|
Alright, so I'm having some trouble with collision for a top down Zelda-like game. So far I have a collision box on my player that has to change shape based on his direction or he gets stuck, and while I'm sure I could get this down after a while it would be really ugly, and baddly coded. I had a thought: What if I could use cross products to get my desired collision detection like I did that one time in my 3d game (Thanks to a JGO user who showed me how). So what I want is this. If the player is going up and left, and hits the bottom of a tile, he continues to go left. Same for right, Down/Left, and Down/Right. All the while using a collision box that is always the same size, and shape (a square). My question right now isn't HOW to do this, but rather where I should start, or if it's even possible/worth it. I found this tutorial, but it's based on poly to poly collision ( http://www.wildbunny.co.uk/blog/2011/04/20/collision-detection-for-dummies/) Should I use this? Or is there a simpler way to achieve what I want? edit:------------------------------------------------------------------------- Alright, so I tried something in Slick real quick, and it works kinda, but it only sends you one way, regardless of what your angle was (I.E. when hitting the bottom of a wall going Up/Left it sends you right). here is the source so far: 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
| package cypri.games.crosscol;
import org.newdawn.slick.AppGameContainer; import org.newdawn.slick.BasicGame; import org.newdawn.slick.Color; import org.newdawn.slick.GameContainer; import org.newdawn.slick.Graphics; import org.newdawn.slick.Input; import org.newdawn.slick.SlickException; import org.newdawn.slick.geom.Rectangle; import org.newdawn.slick.geom.Vector2f;
public class CrossCol extends BasicGame{
Vector2f playerPos; int size = 32; float speed = 2.5f; Rectangle tile; public CrossCol(String title) { super(title); } public void move(float angle){ Vector2f momentum = new Vector2f((float) (Math.sin(Math.toRadians(angle)) * speed),(float) -( Math.cos(Math.toRadians(angle)) * speed)); Vector2f npos = playerPos.copy(); npos.add(momentum); Rectangle r = new Rectangle(npos.x, npos.y, size, size); if(r.intersects(tile)){ momentum = momentum.getPerpendicular(); } playerPos.add(momentum); }
@Override public void render(GameContainer gc, Graphics g) throws SlickException { g.setColor(Color.white); g.fillRect(0, 0, 800, 600); g.setColor(Color.red); g.fill(tile); g.setColor(Color.cyan); g.fillRect(playerPos.x, playerPos.y, size, size); }
@Override public void init(GameContainer gc) throws SlickException { playerPos = new Vector2f(300,300); tile = new Rectangle(200,200,size, size); }
@Override public void update(GameContainer gc, int delta) throws SlickException { Input input = gc.getInput(); if(input.isKeyDown(Input.KEY_F4)) System.exit(0); if(input.isKeyDown(Input.KEY_UP)) move(0); if(input.isKeyDown(Input.KEY_DOWN)) move(180); if(input.isKeyDown(Input.KEY_LEFT)) move(270); if(input.isKeyDown(Input.KEY_RIGHT)) move(90); } public static void main(String[] args) throws SlickException { AppGameContainer app = new AppGameContainer(new CrossCol("Test")); app.setDisplayMode(800, 600, false); app.setTargetFrameRate(60); app.start(); }
} |
|
|
|
|
|
17
|
Discussions / General Discussions / Re: Kick Visual Studio in the face
|
on: 2012-07-18 01:41:57
|
I think the logic behind the delay is "if I pause for a second, I probably need help remembering what method/field/whatever I want to type. If I don't pause, I'm probably hammering out code by myself just fine, and popups would just obscure my view of other code in the editor."
Except that it doesn't obscure anything. And if you are typing code then you aren't reading some other part of the page. What do Java developers read code a couple of lines below while typing something new? http://www.youtube.com/v/jVEuINERKrs?version=3&hl=en_US&start=
|
|
|
|
|
18
|
Discussions / General Discussions / Java Virises and You!
|
on: 2012-07-18 01:38:21
|
|
I am dismayed, JGO. My PC was acting really strange, so I did my first virus scan of the year, and found 3 Java virsuses! I keep my Java up to date and everything! So, that really sucked. Good news is they're all gone now, but still. If people get viruses like that they'll blame Java. :<
|
|
|
|
|
19
|
Game Development / Newbie & Debugging Questions / Re: Client can connect to server on localhost, but not global IP?
|
on: 2012-07-16 03:49:53
|
I'll just have to take a wild guess then.
You're sending way too many packets, half of which get lost along the way. Send less, compensate with guesstimated positions. Do some additional reading about sockets and familiarize yourself with the TCP and UDP protocols some more.
Try and create a simple server (f.ex an echo server ) before jumping into real-time action servers.
That doesn't explain why it gets faster when I'm sending MORE packets though. 1
| socket.setTCPNoDelay(true); |
A good read, but I'm afraid I'm using UDP right now. I switched my protocol in hopes of it being faster. Nagle's algorithm.
|
|
|
|
|
21
|
Game Development / Newbie & Debugging Questions / Re: Client can connect to server on localhost, but not global IP?
|
on: 2012-07-15 20:18:33
|
The internet is quite a lively place. Node's are created and destroyed on the fly. Patterns emerge. Really, the internet is a crazy place. And that's the explanation. If you stick to local host you'd be oblivious to the erratic antics of the internet.
I suggest you just make it work over LAN first and worry about optimization over the internet (lag) later. In any case, real-time action is quite a handful.
What about trying to make a simple echo server first? Have you tried it? Should take only a handful of minutes and you can test it over telnet (command prompt).
It already works perfectly over lan, Why would I need to make a echo server? All the connections work, they're just laggy when not on localhost or 127, or LAN. The logic works, and the movement works.
|
|
|
|
|
22
|
Game Development / Newbie & Debugging Questions / Re: Client can connect to server on localhost, but not global IP?
|
on: 2012-07-15 20:02:03
|
I'll just have to take a wild guess then.
You're sending way too many packets, half of which get lost along the way. Send less, compensate with guesstimated positions. Do some additional reading about sockets and familiarize yourself with the TCP and UDP protocols some more.
Try and create a simple server (f.ex an echo server ) before jumping into real-time action servers.
That doesn't explain why it gets faster when I'm sending MORE packets though.
|
|
|
|
|
24
|
Game Development / Newbie & Debugging Questions / Re: Client can connect to server on localhost, but not global IP?
|
on: 2012-07-15 18:52:28
|
|
Alright, jumping into the next phase: I made a UDP version of my client/server, but the connection starts out slow, then speeds up if I hold down a movement button for a littlebit.
Copy pasted from my SO question:
Alright, so I got a game I'm working on (Right now just movement) and when I move the character it starts out slowly connecting to the server, but if I hold down a move button it speeds up to about half the localhost connection. I heard there's something in UDP Java that says the first 2000-20000 packets I send are going to be slow unless I send some JVM argument while running, like -X something?
Can someone tell me that JVM line argument? And/or why my connection starts out slow, and speeds up?
PS: should UDP be the same speed as TCP?
|
|
|
|
|
27
|
Game Development / Newbie & Debugging Questions / Re: Client can connect to server on localhost, but not global IP?
|
on: 2012-07-15 06:51:17
|
I think I am using blocking IO. 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
| if(parent.playerID != -1){ byte[] sentBytes = new byte[2]; sentBytes[0] = parent.playerID; sentBytes[1] = parent.myState; try { parent.toServer.write(sentBytes); } catch (IOException e) { e.printStackTrace(); } } byte[] recievedBytes = new byte[100]; try {parent.fromServer.read(recievedBytes); } catch (IOException e) { e.printStackTrace(); } ByteBuffer bb = ByteBuffer.wrap(recievedBytes); bb.order(ByteOrder.LITTLE_ENDIAN); byte[] header = new byte[4]; for(int i = 0; i < header.length; i++){ header[i] = bb.get(); } if(header[0] == 50 && header[1] == 100 && header[2] == 60 && header[3] == 90) parent.getPacket = true; if(parent.getPacket){ parent.playersConnected.clear(); byte numConnected = bb.get(); byte flag = bb.get(); byte packetPlayerID = bb.get(); int psize = (parent.packetSize * numConnected) + 10; while(bb.position() < psize){ byte tempID = bb.get(); byte tempState = bb.get(); float tempX = bb.getFloat(); float tempY = bb.getFloat(); parent.playersConnected.add(new Player(tempID, tempX, tempY, tempState)); } parent.playerID = packetPlayerID; Player me = parent.playersConnected.get(parent.playerID); parent.debugStr = parent.messages[flag] + " " + numConnected + " " + packetPlayerID + " " + me.pos.x + " " + me.pos.y + " " + me.state; parent.getPacket = false; firstLoop = false; } LockSupport.parkNanos(1); |
|
|
|
|
|
28
|
Game Development / Newbie & Debugging Questions / Re: Client can connect to server on localhost, but not global IP?
|
on: 2012-07-15 05:28:55
|
|
Well, I fixed it kinda, my VPS can run the server now, and my client can connect to my VPS. PS: Guess it wasn't a code problem after all
Now to deal with lag. I'm copy and pasting a question I had from SO because they all suck now days, and gave me no good answers, or even tried.
alright, so I have a client on my PC, and a server on a VPS I bought, and I'm getting quite a bit of lag, so I was wondering what are some simple tricks to reduce TCP lag in Java? And if thats not enough, what are some more advanced tricks I can use?
Notes: My server runs as a JFrame, and creates a new thread for each client connecting (needed for my client-server project is a simple game) and my client uses LWJGL, and has a different thread for sending/receiving data. My client's data thread, and my server's player thread are using LockSupport.parkNanos(1);, and TCPDelay is set to false on both sides of the player's connection.
|
|
|
|
|
30
|
Game Development / Newbie & Debugging Questions / Re: LWJGL how would i draw an image ???
|
on: 2012-07-13 23:58:57
|
hey there guys i am new to this forum, but im not new to java allthought im new to LWJGL, my question is bascily ... how would i load and draw a image in LWJGL ? i am not using slick and i am not going to use it either  umm that really sums it all up, thanks Slick, or Slick-Utils? Slick-Utils really is the best way to load a image, and the license isn't hindering if you wanna sell your product at all, so that's the only thing I can recommend.
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|