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 (533)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  Private FPS challenge  (Read 10714 times)
0 Members and 1 Guest are viewing this topic.
Offline tom
« Posted 2011-12-20 15:41:32 »

This is a private competition to create the best multiplayer fps before the end of January. We will use this thread to post progress and try to keep motivation up. The 3 contenders are: tom, tensei and enjoyLuke.

The rules are:
1) It must be multiplayer and will be tested on LAN
2) It must be first person 3D
3) It must be a shooter of some kind (range no melee)

It can be coded in any language and use any library. No game editors allowed.

The competition will be judged by a poll on this and other forums (If we can get anyone to actually test it).


Offline enjoyLuke

Senior Newbie


Medals: 1



« Reply #1 - Posted 2011-12-20 22:20:22 »

 Cool
Offline Alan_W

JGO Knight


Medals: 8
Projects: 3


Java tames rock!


« Reply #2 - Posted 2011-12-24 11:08:11 »

It's nice to see a multiplayer comp.  Are you doing peer-peer with distributed collision detection, or client-server?
Good thing it's a private comp, as I'm busy on lwjgl16k and haven't even started a java4k entry yet :sigh:
(I did a 4 player peer-peer LAN 3D FPS for java4k last year, using multicast.)

Good luck, I look forward to seeing the results (and hearing about your multiplayer implementations)

Alan

Time flies like a bird. Fruit flies like a banana.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline gouessej
« Reply #3 - Posted 2011-12-24 11:24:37 »

Hi

bobjob worked on a blueprint of an online FPS, maybe suggest him to participate.

In my humble opinion, the dead line is far enough to make a working blue print with a single arena but not a full game. I remind you that I have seen only a very few first person shooters on JavaGaming.org (Jake 2, Megacorps Online, Flesh Snatcher, Tesseract, Night Squad 2, JWolfenstein, Undead Arena, JavaIsDoomed, Wolkenstein, TUER, etc...). Don't expect having a lot of competitors and I think it is not achievable for complete newbies (not as a first step).

Offline theagentd
« Reply #4 - Posted 2011-12-24 16:21:55 »

With LAN you can probably get away with TCP and a client-server model without any noticeable delay as long as you make some small input prediction.

I wouldn't mind at all if you could provide some basic 3D models and a simple loader for the model type they use to get me starded, as I have no experience loading models.

Myomyomyo.
Offline tom
« Reply #5 - Posted 2011-12-29 13:05:58 »

Only worked on this a few hours. Started on the networking and got something very basic up and running. I'm using TCP for now. Clients sends input to server. The server does the simulation and sends the world state to all clients. I'm using KryoNet for networking which is pleasant. Rendered in ortho mode from above where each player is a line showing position and direction.

Want to do client prediction and world state interpolation next. However it would be better to start adding bullets to make it an actual game.

For graphics I'm planning on doing what I intended for SquareHeads, using only boxes. That was before I got sidetracked by creating a Quake3 renderer and it ended up as Undead Arena. My avatar picture is a screenshot of the player model I used back then. So no modelling required. The world will start as a one big box for the floor. Might add more boxes if I get the time.

The motivation for doing this is to actually finish a game. Making it a competition between friends will hopefully increase the chances of it being successful.

None of us are complete newbies, so I think it is possible to complete it.

Offline tom
« Reply #6 - Posted 2012-01-01 21:05:17 »

Got 3d rendering up and running. Have a simple hud with deaths, kills and health of all the players.

I've fulfilled the rules so it is time to improve the game. Think the next thing will be to have a level geometry of some sort. Now it's just one infinite big plane for the ground. I'll generate random boxes and use JBullet for the collision response. I really don't want to write my own collision detection.

Offline enjoyLuke

Senior Newbie


Medals: 1



« Reply #7 - Posted 2012-01-04 10:15:45 »

Ok, first update.

Got some of the 3D rendering up and running. Just some basic geometry, a crate.
And as you obviously _don't_ see on the screenshots; very basic, and not, finetuned fps controller and movement.

The crate is textured and illuminated with some shader code with a directional light.

Two screenshots; since pictures are much better than my words! (Usually).



(I have no clue if you have any rules about screenshots. Size, upload places, and so on. If something is wrong, just mention it in the replies.)
Offline tom
« Reply #8 - Posted 2012-01-04 15:26:47 »

That is some sweet looking box Smiley Keep up the good work.

I wrote a little test for doing client side prediction:
http://www.java-gaming.org/topics/client-side-prediction-and-delayed-interpolation/25446/view.html

Feel free to use it when you start on the networking part.

Offline enjoyLuke

Senior Newbie


Medals: 1



« Reply #9 - Posted 2012-01-08 10:55:45 »

Newest updates!

(It's all very basic, so nothing exciting here :\)

I've made a box method, so I can easily make different size of boxes with different textures and so on.
I made this method first with vertex and index buffer arrays, but changed it recently to make meshes directly.
This since I will use the mesh for easy checking against AABB for frustum culling and for picking.

I've also made a simple HUD with no fancy graphics whatsoever (the way I like it).
With the HUD there is also a countdown clock.

And last for the HUD I have made a crosshair. This is at the moment just simple rectangles drawn on top of the screen, no sprites.
I also locked the mouse to the center of the screen and hid the mouse cursor.

On the screenshot you can see a very simple "arena" map made with the box method.
You can also see the HUD.




About the networking part.. I'll look at that when almost everything else is done I guess.. (probably not smart, but hey).
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline tom
« Reply #10 - Posted 2012-01-09 13:08:21 »

Nice Smiley

How did you create/generate the arena? I assume you didn't position each box by hand.

What are you using for collision detection & response?

My experience is that the networking has a lot of influence in how the data structure ends up. And changing the data structure late is difficult. But it is always possible to hack something together.

Offline tensei

Senior Newbie


Medals: 3



« Reply #11 - Posted 2012-01-11 17:45:12 »

Here's a small update from me.

So far I've got the networking up and running, using KryoNet like tom and it's really nice to work with. I'm using a dedicated server with clients connecting to it, no peer-to-peer. For now I'm using TCP, seems to suffice since I'm just running this on LAN. No client prediction yet, but it's what Im going to start on next - although it seems to run very smoothly at LAN, with updates from the server every 10 ms.

As for the renderer its just the bare minimum I needed in order to debug the networking, I've attached a screenshot where you can see three clients with a fourth one observing.



The player models are just for debugging, and the camera is located in the middle of the yellow box. The colored boxes just indicate directions (x,y,z) but looking at the picture now I think it is reminescent of a human (red/green arms, blue head, yellow body) kinda resembling a zombie (you know, doing the zombie walk) so I think I might end up using something similar for my player models.

So that's it so far, haven't really been able to spend as much time on this as I would like (damn you work and SWTOR!). The next steps will be to implement shooting, and then client prediction and then I can start working on the actual game!  Grin
Offline tom
« Reply #12 - Posted 2012-01-13 17:49:10 »

I guess its my turn to show a screenshot.



Client prediction and interpolation of other clients are in. Bullets are little buggy but it is possible to kill other players and deaths and kills are given out.

I'm using KinematicCharacterController from JBullet for player collision with world. It has not jumping implemented, so that is on the todo list. I use picking with JBullet for collision between bullet and world. Bullet-player detection is a line to sphere distance method I've written.

Got a bit distracted and wrote a deferred renderer using a scenegraph I wrote a while back. The world has one hemisphere and 100 point lights spread out in a grid. Still some work to fix all the bugs and make it good, but I think I'll leave it for now. Was really fun to implement though.

The most difficult thing now will be to create an actual level and make it somewhat playable. Don't want to be bogged down writing a level editor. But I need a way to quickly iterate on the level design. So I'm leaning toward having a separate window where I can edit the boxes somehow.

Offline tom
« Reply #13 - Posted 2012-01-21 23:07:45 »

My code is now checked in to google code.

Offline enjoyLuke

Senior Newbie


Medals: 1



« Reply #14 - Posted 2012-01-27 07:58:31 »

To start by replying to tom: I did position each box by hand. Cheesy
BUT, there are not so many boxes as you might think. I use texture repeating.
So e.g., the floor, is just one box.

So to the updates.

I've implemented a sky, using a sphere and cube mapping. (The sky on the screenshot is a star night, squint your eyes, it's there, I promise!)



On this next screenshot you can see a spotlight in effect. One. Not a hundred. Smiley



I've also implemented bullet physics, so that's working great, except for the jump function in the KinematicCharacterController (which c++ bullet has apparently).
I think it uses the look vector in its algorithm to determine the force of the jump, cause if I look down, I almost don't jump at all. But if I look up, I can suddenly jump higher than if I was looking straight forward. So have to _look_ into that, perhaps make my own jump method or something. We'll see. It's not prioritized.
On the screenshot you can also see the debug drawer. (The boxes hits the floor after falling from 100 meters).



On the "eye candy" part, I now got some basic bullet impact decals. For the moment only for static objects, since dynamic objects change the rotation on the u/v texture coordinates, and I don't take that into consideration in my implementation for the time being. I also wanted the bullet impact decals to be shown on the other side of the object being shot at, to present the bullet exit position. I also make a decal on the next wall being hit by the bullet. This can easily be turned on/off.



And lastly a screenshot function, which I've used on all these screenshots (which are in 1680x1050 resolution, let me know if it's too big).
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #15 - Posted 2012-01-28 01:39:42 »

This is a cool thread! Smiley

FWIW, KryoNet has a DeltaCompressor. I always thought it would be fun to do a FPS with Quake style networking.

Offline tom
« Reply #16 - Posted 2012-01-30 16:27:57 »

This is a cool thread! Smiley

FWIW, KryoNet has a DeltaCompressor. I always thought it would be fun to do a FPS with Quake style networking.
First of all thank you for KryoNet! It really is a great lib.

I'll look into DeltaCompressor. Will probably work really well on my data, if it does what I think it does. But it does the compression on a byte array level, right? What would happen if my object contains something dynamic like a String that changes length?

Before you mentioned DeltaCompressor I had plans on doing something similar. By using a property system I can check each property individual and only send the data for the properties that change.

Offline tensei

Senior Newbie


Medals: 3



« Reply #17 - Posted 2012-01-31 18:21:48 »

Since today is the "deadline" we set for implementing at least the base features of the game, I though I'd post a little update.

Lately I have been working on my own scene graph for the engine, it's still pretty basic though, but it's taking shape. I've switched from immediate rendering, to sending the data as VBO's instead. Shaders have also been implemented, however I have not had time to write anything pretty with it yet, so it's still the same debugging graphics as last time.

Added collision detection using AABBs, as well as shooting using raycasting and AABB intersections.

Networking is working as it should, although I still need to implement a good form for prediction.

In terms of gameplay the game is all fully working. Players can move around in the world, and objects will block your path. You will fall if there is no solid ground beneath you, and if you fall too far you take damage. Jumping is also implemented. The jumping started out as a normal jump mechanic, but as I played with it I found it much more enjoying with a little more kick in it. Therefore I ended up implementing a jetpack system instead, sidetracking ftw! I think I will do a Tribes kind of gameplay.

Other players that are connected to the server is correctly rendered in the world. And yes, you can shoot them. Also implemented a scoreboard, that shows the players name, kills and deaths.

Following is a couple of screenshots.

Playermodel is rendered in brightly colors when alive, and dead players are rendered in darker colors, with the base block colored red instead of yellow:



Death/respawn screen:


The scoreboard, (and obviously PLAYER12 is cheating!):


Just a general picture of the level with some dead players in it:


So thats what I got so far. I think I will spend some time on the rendering side in the time to come, would like to add some more eye candy to it.
Offline tom
« Reply #18 - Posted 2012-01-31 23:07:47 »

I guess it is time for my update.

I've written a little editor where it is possible to create, remove and edit boxes, point lights and hemisphere lights. It is all done by swing components in a separate window. The changes are sent to all clients when the update button is pushed. So it will be possible to change the level while playing it. Although everyone will be killed and re spawned. Will use this functionality to make it possible to change level later. The whole thing is work in progress and a bit buggy at the moment.

The bullet collision detection bug is fixed. And there is a kill limit now. when it is reached the game ends. At the moment it is not possible to restart.

The renderer now supports textures (wow), normal mapping and specular intensity. And there is a skybox. But I haven't found any free textures with normal maps yet. I'll include some screenshots when I do.

There are so many things I want to do, I'm not sure where to start.

I want to improve the avatar a bit. It will look abit like my forum avatar. But with eyebrows and a mouth. The bullets will probably be shot from the nose or the mouth. The eyes will by synched so the look up and down as you move the mouse. Will add some arms that go back and forth and flap like cracy when falling. Must add some little feet that spin as well.

I want to make it possible to play on the internet as well as on a LAN. So I want to look into NAT punch-through to make it possible to play behind routers. This will probably mean using udp Sad

Would be fun to throw in some good old demo effects. Was thinking of creating a wormhole effect instead of using a skybox. Could animate textures using fire effect.

Or I will just realize it is to much work and give up.

Quote
Lately I have been working on my own scene graph

hehe, just what the world needs. Yet another scenegraph  Tongue

Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #19 - Posted 2012-02-01 10:47:52 »

First of all thank you for KryoNet! It really is a great lib.

I'll look into DeltaCompressor. Will probably work really well on my data, if it does what I think it does. But it does the compression on a byte array level, right? What would happen if my object contains something dynamic like a String that changes length?

Before you mentioned DeltaCompressor I had plans on doing something similar. By using a property system I can check each property individual and only send the data for the properties that change.
Thanks! Smiley

The DeltaCompressor on the sending side uses the last data sent to send only a diff. The diff is a series of copy (from the last data) or append (to add new data) commands, very similar to GDIFF (but isn't GDIFF). The DeltaCompressor on the receiving side uses the last received data and these commands to build the new data. This is all transparent to your app, which just sends and receives objects. The Delta class is used by DeltaCompressor to do the actual work. It takes two buffers and checksums chunks of data to automatically generate the diff commands. Eg, the first send would be something like "append 100 bytes: 100 bytes of data". The second send, if you added 10 bytes at offset 25, would be "copy 25 bytes at offset 0, append 10 bytes: 10 bytes of data, copy 75 bytes at offset 25".

If you had an object graph with a string somewhere in the middle that changed length, only the changed data would be sent (with a tiny bit of overhead for the copy/append command bytes).

Offline tom
« Reply #20 - Posted 2012-02-01 12:41:56 »

Quote
If you had an object graph with a string somewhere in the middle that changed length, only the changed data would be sent (with a tiny bit of overhead for the copy/append command bytes).
Cool, it's much smarter than I thought it was.

I tried the DeltaCompressor on the world state sent from the server to the clients. It went from around 750 to between 50 and 150 bytes Smiley Although it seems to be a bit buggy. I keep getting the following exception:
1  
2  
3  
4  
5  
Caused by: com.esotericsoftware.kryo.SerializationException: Invalid delta command: -105
        at com.esotericsoftware.kryo.compress.Delta.decompress(Delta.java:256)
        at com.esotericsoftware.kryo.compress.DeltaCompressor.decompress(DeltaCompressor.java:82)
        at com.esotericsoftware.kryo.Compressor.readObjectData(Compressor.java:101)
        at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:566)


Maybe I'm doing something wrong.

Offline tom
« Reply #21 - Posted 2012-02-01 12:43:41 »

Here is the screenshot that I promised:

Offline sproingie

JGO Kernel


Medals: 201



« Reply #22 - Posted 2012-02-01 17:44:53 »

That's a mighty pretty skybox.
Offline enjoyLuke

Senior Newbie


Medals: 1



« Reply #23 - Posted 2012-02-01 22:22:17 »

Deadline update!

Everything is up and running, tho the networking is a bit over optimistic and naive for the moment (Read: It's letting the client decide a couple of things..).

I will post an update, with pictures, tomorrow.

Quote
Lately I have been working on my own scene graph
hehe, just what the world needs. Yet another scenegraph  Tongue
One more for tensei to validate for his master thesis. Cheesy

Btw, gotta love those normal maps! Looking good tom.

Also, looking forward to feel the freedom of jetpacks tensei!  Grin
Offline enjoyLuke

Senior Newbie


Medals: 1



« Reply #24 - Posted 2012-02-02 20:44:05 »

Well, here's the promised pictures update!

I've implemented dynamic shadows with an early version of shadow mapping. It only uses 2x2 PCF (percentage-closer filtering) and nothing more.
This can be seen by the rough edges on the shadows.



I've also made a very easy user interface. Just using sprites and text. No fancy window boxes etc.
I did plan on using Awesomium.. but since I code in VS2010 I had to use the C API instead of the C++ API.
I could have handled it, but the only example/sample/tutorial was a ported C++ example. Nothing more provided.

I did make the example work, by having a box in 3D which presented a website live. But I didn't get the interaction part to work. And for a menu, that is quite essential.
So I stopped pursuing that and instead just made it work with sprites and text.

(Right click and open image in new tab or view image, if the details are too small.)

This is the main menu.



This is the in-game menu.



And lastly the scoreboard. It sorts the players on score and team.



The networking is also up and running using RakNet. But still in a very early phase. The green box is a network player.
(Luke is the listen server and running on a 60 hz screen, hence the 60 fps. Anakin is the client and running on a 120 hz screen.)



I also mentioned in an earlier post that the bullet KinematicCharacterController used the look vector in the jump algorithm. I've also noticed that it seems to be using the walk direction as well in the algorithm.
So I have to see if I can find a fix for that. Or just make my own implementation.
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #25 - Posted 2012-02-02 21:32:28 »

I've also made a very easy user interface. Just using sprites and text. No fancy window boxes etc.
I did plan on using Awesomium.. but since I code in VS2010 I had to use the C API instead of the C++ API.
I could have handled it, but the only example/sample/tutorial was a ported C++ example. Nothing more provided.

I did make the example work, by having a box in 3D which presented a website live. But I didn't get the interaction part to work. And for a menu, that is quite essential.
So I stopped pursuing that and instead just made it work with sprites and text.

libgdx had an Awesomium wrapper (JNA) at one point, now deprecated. FWIW, it might be helpful as example code. Input:
https://code.google.com/p/libgdx/source/browse/deprecated/awesomium/gdx-awesomium-tests/src/com/badlogic/gdx/awesomium/GLTest.java#88
Wrapper (though not very interesting as it doesn't add much to the native API):
https://code.google.com/p/libgdx/source/browse/#svn%2Fdeprecated%2Fawesomium%2Fgdx-awesomium%2Fsrc%2Fcom%2Fbadlogic%2Fgdx%2Fawesomium
Why no Java? :p At any rate, looking very nice enjoyLuke!!  Cool

I tried the DeltaCompressor on the world state sent from the server to the clients. It went from around 750 to between 50 and 150 bytes Smiley Although it seems to be a bit buggy. I keep getting the following exception:

Hmm, it is possible that it is bugged. Sad Unit tests? What unit tests!? Wink

Offline tom
« Reply #26 - Posted 2012-02-02 23:03:30 »

Well, here's the promised pictures update!
Cool. I didn't know you were doing shadows. And the menus look nice.

I also mentioned in an earlier post that the bullet KinematicCharacterController used the look vector in the jump algorithm. I've also noticed that it seems to be using the walk direction as well in the algorithm.
So I have to see if I can find a fix for that. Or just make my own implementation.
I ported the latest KinematicCharacterController to JBullet. I did not see the look vector or walk direction bug, but I set the y component to 0. Although there are a couple of other problems. Walking off a ledge wont make it use the vertical velocity when falling. It will instead use the step height and it falls very fast. My other problem is that I'm using this on the server where I have to rewind and reapply the simulation. This means I will have to store away the internal state of the KinematicCharacterController. Hopefully wont be a big problem.

Hmm, it is possible that it is bugged. Sad Unit tests? What unit tests!? Wink
If I get around to it I will try to make a test case. I can try to write it to a separate kryo and somehow grab the bytebuffers and reproduce it somehow. Not on the top of the todo list though.

Offline pitbuller
« Reply #27 - Posted 2012-02-02 23:47:46 »

Well, here's the promised pictures update!

I've implemented dynamic shadows with an early version of shadow mapping. It only uses 2x2 PCF (percentage-closer filtering) and nothing more.
This can be seen by the rough edges on the shadows.


You should try variance shadow mapping. It's really easy to implement, good quality and faster than PCF with same quality. This also usually give you change to use smaller shadow map textures.
http://http.developer.nvidia.com/GPUGems3/gpugems3_ch08.html
http://fabiensanglard.net/shadowmappingVSM/index.php

I implemented it for open gl es and performance is great even with android. I use (256x256)^2 shadow map(128 look ok too) with 9x9 kernel gaussian blur pass.
Offline tensei

Senior Newbie


Medals: 3



« Reply #28 - Posted 2012-02-03 12:11:29 »

The visuals for both of your games look very impressive, I really feel like I'm presenting the short end of the stick here in terms of visual fidelity. I will definitely work more on the visuals, I am currently looking into deferred rendering.

Can definitely see the influence from CS on your score screen Luke Wink Are you planning on showing the fps for each player, or is it just for debugging?
Offline enjoyLuke

Senior Newbie


Medals: 1



« Reply #29 - Posted 2012-02-07 17:02:27 »

Why no Java? :p At any rate, looking very nice enjoyLuke!!  Cool

I know I know.. I'm the black sheep in this thread.. :|
And thanks! Smiley


You should try variance shadow mapping. It's really easy to implement, good quality and faster than PCF with same quality. This also usually give you change to use smaller shadow map textures.
http://http.developer.nvidia.com/GPUGems3/gpugems3_ch08.html
http://fabiensanglard.net/shadowmappingVSM/index.php

I implemented it for open gl es and performance is great even with android. I use (256x256)^2 shadow map(128 look ok too) with 9x9 kernel gaussian blur pass.

I will definitely take a look at that, thanks. It's not my priority for the moment, so I'll have to endure my shadows a bit longer.


Can definitely see the influence from CS on your score screen Luke Wink Are you planning on showing the fps for each player, or is it just for debugging?

You are very much correct sir! Grin
CS is my influence all over. And yes, I am actually planning on showing the fps for each player. Smiley
Pages: [1] 2
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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 (18 views)
2014-07-24 01:59:36

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

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

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

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

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

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

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

Cero (51 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!