Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (581)
games submitted by our members
Games in WIP (500)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Duel, Tribes clone  (Read 3869 times)
0 Members and 1 Guest are viewing this topic.
Offline Nate

JGO Kernel


Medals: 129
Projects: 3
Exp: 14 years


Esoteric Software


« Posted 2012-06-11 10:43:42 »

I've been working full time on a pretty big project for myself, but I've lost interest lately. Street Fighter doesn't help. Neither does Tribes Ascend, which is a new Tribes game. It is pretty sweet, but has lots of balance and other issues. I decided to try my hand at making a FPS similar to Tribes. This will keep me busy enough that I can ignore feeling bad about neglecting my much more important project. Smiley For those unfamiliar, Tribes is a FPS with jetpacks. You can hold jump to "ski", which is where you slide frictionless over terrain. The main weapon is a medium speed projectile that inherits some of your speed. This makes it different that most FPS, as it becomes about maneuvering and taking carefully aimed shots, and less about twitch. Tribes Ascend adds a bunch of "hitscan" instant hit type weapons, like those in most FPS, and these ruin the game IMO because Tribes is wide open so you can ski and fly around.

I started with Ardor3D, because it has nice clipmap terrain. It has some interesting APIs. Some of it seems pretty clean, other parts don't, such as using the Google collections predicate rubbish for input event handling. I tried rolling the physics myself and got the basics working, but I kept occasionally having a problem where my ray cast wouldn't hit the terrain and I'd fall through. This reaaaally pissed me off, and I couldn't figure it out. I verified the terrain was morphing, at least during the first couple frames. A ray cast straight down from a static position would read different values after a few frames! I'm not quite sure this was also happening later as that is hard to verify. I posted on the Ardor3D forums but my post was moderated. It's been 2 days and still hasn't gone through. I give up on Ardor3D!

So, I moved to jMonkeyEngine. The terrain stuff isn't as nice, but the examples are cleaner. It seems to have lots of... framework. It does lots for you, which is good, but it has a number of pretty thick layers, I'm sure at some point you are at their mercy. This is a lot different from the libgdx I'm used to, but then I don't have time to write a whole terrain system. Smiley jME has support for Bullet, so I decided to use that. I was up and running pretty quickly.

Once I had my guy flying around like I wanted, I used KryoNet to slap on some networking. The server is ~100 lines of code and is a passthru for events. It trusts the clients 100%. The networked client is ~150 lines. The events are: add player, remove player, update player, shoot, respawn, and damage. The client sends update player 30 times/sec and the server sends update player to all clients 30 times/sec. If a client registers a hit, it tells the server, who broadcasts to the others. This is all kind of ghetto, but it works and it was quick. Start to finish, including the Ardor3D mishap, it took me probably ~20 hours of coding over 2.5 days.

I know that no one wants to download a JAR, but it's late and I'm tired. Smiley Get it here:
http://n4te.com/temp/duel.jar
Sorry it is 11.9M, but jME, LWJGL, Bullet, etc adds up, especially the natives. To run it double click or:
java -jar duel.jar
I have a server is running, so just click ok. Or you can run your own server and connect to localhost:
java -cp duel.jar duel.DuelServer
Controls are WSAD, space is jump/ski, left click shoots, right click jets. Escape exits, K suicides.

To make up for the JAR, you get a screenshot! Cheesy


Offline kappa
« League of Dukes »

JGO Kernel


Medals: 70
Projects: 15


★★★★★


« Reply #1 - Posted 2012-06-11 13:03:14 »

oh very nice work for such a short time, do you plan to develop it further?

Also coincidentally the 7dfps challenge is on at the moment, as there is still time remaining maybe you can enter the game there too (challenge seems to have tons of entries already, even MarkusPersson has one in the works).
Offline ReBirth
« Reply #2 - Posted 2012-06-11 13:27:52 »

Go go for #7DFPS! Although you have to be very unique.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ra4king

JGO Kernel


Medals: 322
Projects: 2
Exp: 4 years


I'm the King!


« Reply #3 - Posted 2012-06-11 14:51:44 »

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
SEVERE: Failed to create display
org.lwjgl.LWJGLException: No support for WGL_ARB_multisample
        at org.lwjgl.opengl.WindowsPeerInfo.nChoosePixelFormat(Native Method)
        at org.lwjgl.opengl.WindowsPeerInfo.choosePixelFormat(WindowsPeerInfo.ja
va:52)
        at org.lwjgl.opengl.WindowsDisplay.createWindow(WindowsDisplay.java:214)

        at org.lwjgl.opengl.Display.createWindow(Display.java:306)
        at org.lwjgl.opengl.Display.create(Display.java:873)
        at org.lwjgl.opengl.Display.create(Display.java:782)
        at com.jme3.system.lwjgl.LwjglDisplay.createContext(LwjglDisplay.java:13
7)
        at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstract
Display.java:113)
        at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.j
ava:205)
        at java.lang.Thread.run(Unknown Source)

What's the minimum OpenGL version required to run this? Sad

Offline Cero
« Reply #4 - Posted 2012-06-11 17:46:59 »

The server is ~100 lines of code and is a passthru for events. It trusts the clients 100%. The networked client is ~150 lines. The events are: add player, remove player, update player, shoot, respawn, and damage.

I'm really impressed that it's possible with that little code.
Would really be interested to see it - Have yet to use Kryonet

Offline sproingie
« Reply #5 - Posted 2012-06-11 17:50:03 »

1  
2  
SEVERE: Failed to create display
org.lwjgl.LWJGLException: No support for WGL_ARB_multisample

What's the minimum OpenGL version required to run this? Sad

It's a jME bug that's fixed in trunk, but if your driver doesn't fully implement GL2, it just means you're screwed with a different more informative error message instead.
Offline ra4king

JGO Kernel


Medals: 322
Projects: 2
Exp: 4 years


I'm the King!


« Reply #6 - Posted 2012-06-11 20:17:09 »

This crappy laptop supports up to OpenGL 2.0, so that's good Smiley

Offline Nate

JGO Kernel


Medals: 129
Projects: 3
Exp: 14 years


Esoteric Software


« Reply #7 - Posted 2012-06-11 23:19:01 »

oh very nice work for such a short time, do you plan to develop it further?

Also coincidentally the 7dfps challenge is on at the moment, as there is still time remaining maybe you can enter the game there too (challenge seems to have tons of entries already, even MarkusPersson has one in the works).
I probably won't do anything else with it. I got something working and that was my goal, but it isn't terrible pretty.

I had to use 500hz for the Bullet simulation to prevent falling through the terrain at high speed. I finally got a response over at Bullet, they said I could try setting ccdMotionThreshold and also that jME uses an old version of Bullet. I might try that just to see if it helps. Edit: it does seem to, though the problem doesn't go away completely.

The networking sending and receiving updates at 30hz pretty much only works on a LAN.

I think the game would be fun with just 1v1. I even had a game mode for my Havoc Tribes 1 mod called Duel, where you are on a 32 player server but it matches up players for 1v1. The Tribes gameplay has a lot more depth than other FPS, IMO. If I were to work on it more, it would be to do 1v1. But as-is I feel like it is cobbled together and the level of effort to clean it up properly is too high. If I were to do this game seriously, I'd probably dig into Unreal where I only have to implement physics and matching up players.

I'll put it in 7dfps if I can figure out how to submit it.

The server is ~100 lines of code and is a passthru for events. It trusts the clients 100%. The networked client is ~150 lines. The events are: add player, remove player, update player, shoot, respawn, and damage.

I'm really impressed that it's possible with that little code.
Would really be interested to see it - Have yet to use Kryonet
Sure, source is here:
http://n4te.com/temp/duel-source.zip
I didn't include jME or the resources, as they are 20MB. If you want to build and run it, take the duel.jar, delete the duel folder in the root, and use that JAR for the dependencies with the source.

What's the minimum OpenGL version required to run this? Sad
I had to set samples=2, else the skybox would not show up. This is true even with the simplest jME skybox app. I guess I should have just popped up a dialog and let the user choose the settings, sorry.

Pages: [1]
  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.

xsi3rr4x (54 views)
2014-04-15 18:08:23

BurntPizza (53 views)
2014-04-15 03:46:01

UprightPath (66 views)
2014-04-14 17:39:50

UprightPath (49 views)
2014-04-14 17:35:47

Porlus (66 views)
2014-04-14 15:48:38

tom_mai78101 (90 views)
2014-04-10 04:04:31

BurntPizza (151 views)
2014-04-08 23:06:04

tom_mai78101 (246 views)
2014-04-05 13:34:39

trollwarrior1 (204 views)
2014-04-04 12:06:45

CJLetsGame (211 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!