Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
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 3 [4]
  ignore  |  Print  
  Xtreme Space War - Online multiplayer space shooter!  (Read 27211 times)
0 Members and 1 Guest are viewing this topic.
Offline CommanderKeith
« Reply #90 - Posted 2007-05-02 08:10:44 »

Yeah nice game!  The smoothness in the network sync'ing is amazing.  Later I'd like to ask you how you did it  Cool (but don't bother yet, I'm stilll working on my network-game framework and I haven't come across all the issues I would like to ask yet).

About the stuttering, I recently bought a 3Ghz pentium 4 single core (with HyperThreading, 500m RAM) which doesn't have a video card and noticed stuttering on my game when I had music playing.  I think it's because all of the graphics memory processing is done by the CPU rather than the video card's GPU, so when the CPU is busy doing something else (like playing music or whatever) then the graphics just don't update.  Does this sound right?

Keith


Offline Jamison

Junior Member




We're all idiots in one way or another.


« Reply #91 - Posted 2007-05-03 12:24:11 »

Your almost correct. However, you can't not have a video card (yes, that's a very incorrect sentence, but how else can I say it). When you have a video card with a very low RAM built-in, the GPU "transfers" the required video memory to the regular RAM, which is much slower to access than what a good video card can handle.

I don't like you. Check out my site Smiley www.gamedevforums.com
Offline Aramaz

Junior Member




Java Games Rock!


« Reply #92 - Posted 2007-05-03 21:18:57 »

It must be something with the graphics card that makes it stutter, though I'm not sure why it would, since between the stutterings it runs smooth... I've profiled it to see if it's gc, but the gc seems to be very fast only a few ms.

CommanderKeith> glad you like it, if you need any networking advice just ask Smiley. I spent some time tuning it, though I wouldn't say it's perfect yet...

Had several games running with 7 - 11 players today, it was lots of fun. Saw that I had some bugs at some rare instances. Those ugly ones that turn up when alot of people have been playing for awhile, hard to track down...

Aramaz (Emperor in game)

Play XSW: www.xsw.se
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Aramaz

Junior Member




Java Games Rock!


« Reply #93 - Posted 2008-02-23 13:50:03 »

Hi everyone!

It's been a very long time since I've posted on this forum. Working fulltime and having a family to take care of doesn't leave much room for game development. Anyways now I'm happy to announce that a new version of XSW is available!

XSW version 0.45
www.xsw.se

* A new game mode has been added, Base Attack, where the purpose is to destroy the other team's powercore. (pretty much the same as onslaught in UT).
* A new weapon has been added Tnt
* Many bugfixes and small improvements (proper installer for windows etc, etc)

Have fun,

cheers
-Aramaz (The Emperor in xsw)

Play XSW: www.xsw.se
Offline irrisor

Junior Member





« Reply #94 - Posted 2008-02-23 17:34:02 »

I was not able to connect to any server (there were the "Emperor" servers) Sad - the app just hung up
Offline gouessej
« Reply #95 - Posted 2008-02-23 17:56:21 »

Your game seems to be interesting. Why did you choose not to use Java Web Start?

Offline Aramaz

Junior Member




Java Games Rock!


« Reply #96 - Posted 2008-02-23 20:46:33 »

irrisor> Too bad. My cousin had problems connecting, but then it started working again for him before we found out why he couldnt connect. Most people seem to be able to connect without problem. Maybe it's a firewall issue? It's strange that you can connect and see the servers, but not connect to the servers, I'm using the same connection method for both...

goessej> Mainly it's my time constraints, I actually haven't investigated that option at all. I'm not really fond of java web start myself for other applications (don't have any JWS apps installed at the moment). I think most windows users prefer a standar exe installer to JWS, but I could be wrong...

Maybe if I get some spare time I will investigate JWS, but it's not on my high priority list, so it probably wont be anytime soon...

Play XSW: www.xsw.se
Offline irrisor

Junior Member





« Reply #97 - Posted 2008-02-23 21:00:50 »

Starting an own server and connecting to that one results in:
1  
2  
3  
4  
5  
6  
7  
02-23 18:25:11  S: level initialized
02-23 18:25:12  S: ServerId: 1003537438
02-23 18:25:40  S: Connection request!
02-23 18:25:40  S: nimrod entered the game!
02-23 18:25:40  S: RESETTING SERVER!
02-23 18:25:55  S: Connection timed out: nimrod
02-23 18:25:55  S: nimrod has disconnected... (Connection timed out)

No useful information in the client log, tough (neither with local nor inet server).
Anything I can do to help debugging that? Switching off personal firewall does not help, but I'm in a NATed home network...
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2
Exp: 14 years


Make it work; make it better.


« Reply #98 - Posted 2008-02-24 01:29:35 »

irrisor> Too bad. My cousin had problems connecting, but then it started working again for him before we found out why he couldnt connect. Most people seem to be able to connect without problem. Maybe it's a firewall issue? It's strange that you can connect and see the servers, but not connect to the servers, I'm using the same connection method for both...

goessej> Mainly it's my time constraints, I actually haven't investigated that option at all. I'm not really fond of java web start myself for other applications (don't have any JWS apps installed at the moment). I think most windows users prefer a standar exe installer to JWS, but I could be wrong...

Maybe if I get some spare time I will investigate JWS, but it's not on my high priority list, so it probably wont be anytime soon...

You are correct, most Window's users prefer an installed exe.  Most Java developers prefer webstart.  And right now if you are looking here for texters you will get a lot more people willing to try it if it is webstartable.  It is very easy to do, it should take less than half an hour to set up.

If you go to http://www.puppygames.net/ look at the Linux downloads.  They are webstart files(.jnlp).  Right click and save as and you can see how they are made.

Offline Aramaz

Junior Member




Java Games Rock!


« Reply #99 - Posted 2008-02-24 06:58:07 »

irrisor> Actually it does tell me something. You could connect to the server properly and both send and receive data. (I saw you connect to one of my server and then drop out also). For some reason the handshaking protocol must fail somehow. At least I know in what loop it times out. Unfortunately I don't have time to investigate this further today. I'll spend some time on it on monday. I would really appreciate help with resolving this issue.

CJ> Thanx for the suggestion, I'll take a look at it. Does it require some special server configuration? I'm limited in what I can do on the download server as I don't have full access to it...

Play XSW: www.xsw.se
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Aramaz

Junior Member




Java Games Rock!


« Reply #100 - Posted 2008-02-24 07:14:52 »

I made another version: XSW 0.46. It mainly corrects a few annoying bugs in the new Base Attack game mode.

Play XSW: www.xsw.se
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2
Exp: 14 years


Make it work; make it better.


« Reply #101 - Posted 2008-02-24 15:13:43 »

Very short webstart tutorial. http://www.autexier.de/jmau/dev/webstart/

Offline gouessej
« Reply #102 - Posted 2008-02-26 06:03:51 »

goessej> Mainly it's my time constraints, I actually haven't investigated that option at all. I'm not really fond of java web start myself for other applications (don't have any JWS apps installed at the moment). I think most windows users prefer a standar exe installer to JWS, but I could be wrong...

Maybe if I get some spare time I will investigate JWS, but it's not on my high priority list, so it probably wont be anytime soon...
But there aren't only Windows users! You program in Java! Try to think about the others who don't want to use Windows! A seven-year-old child succeeded in installing my game with Java Web Start. If he succeeded, many people under Windows could do it too. Professional game developers that use Java often told me that people prefer standard exe installer but if you use an .exe file, it won't be cross-platform! What is the interest of using Java if you don't do anything cross-platform? CaptainJester gave you a link of a tutorial about Java Web Start and if you need some help, I'm here too.

Offline irrisor

Junior Member





« Reply #103 - Posted 2008-02-26 07:24:03 »

But there aren't only Windows users!
For linux and mac he has non-exe releases Wink  (but those don't work on windows Tongue)
Offline Aramaz

Junior Member




Java Games Rock!


« Reply #104 - Posted 2008-02-27 20:30:52 »

sorry for not replying earlier, I've had a lot of OS trouble with Vista, and finally decided to seriously try switching to Ubuntu. I had a lot of trouble to create a partition for Ubuntu, finally used gparted, but then my Vista partition died. So now I'm only on Ubuntu, and I've decided not to reinstall vista until I absolutely need to. So I'm having a bit of work setting up Ubuntu (first time on linux).

goussej> There is a zip version for linux and mac, I haven't tried the mac version but I know the linux version works. It's not as userfriendly as you will have to type javaw -jar xsw.jar to get up and running...

Thanx for the turorial links and stuff. I will take a look on it soon, I have a lot on my plate right now, so I can't promise when I'll have a JWS version of it. If it truly took half an hour then I could have it soon... but I suppose there are restrictions on the program that I probably dont adhere to as I've never even looked at what needs to be done for JWS, and when you're new to somehing it never takes just half an hour, that's my experience at least Wink


Play XSW: www.xsw.se
Offline CommanderKeith
« Reply #105 - Posted 2008-03-01 13:43:48 »

Hi Aramaz,

I'm interested to know how you did the networking - specifically, how did you take latency into account? Do you add a delay between key presses and when they have an effect (it doesn't seem like it)?  Do you re-wind the world to when the lagged event first occurred and then fast-forward back?

I'd like to know because whatever method you've used, it looks pretty good. Also, is there something about the way that you structured the network code that you regret or that limits you or makes code changes or feature updates difficult?

Thanks,
Keith

Offline Aramaz

Junior Member




Java Games Rock!


« Reply #106 - Posted 2008-03-03 21:58:43 »

Hi,

I messed with a few techniques, but ended up giving the clients some authority. I figured the most important thing was to have good control over your ship, and good responsiveness when firing the weapon. So the client keeps it's position and whenever a key press or collision occurs it sends it's current position, velocity and pressed keys (to calculate acc) to the server and to all clients that are close by (which can see the ship). So for all clients in view there is no round trip to the server, they get the state directly (which in most cases are faster than a round trip to the server).
Along with the state is a time stamp, thus all clients and the server calculate the new estimated position of the ship by forwarding by the delay. This gets a new position for the ship, the current position of the ship that is kept at the receiving end (server or other clients) is then interpolated to the actual position over a short time (while updating with velocity and acceleration). Seems to work pretty decent... Collisions between ships is something that isn't working well atm.

Shots are spawned directly at the client, and sent to the server and all clients in view. These shots are temporary, and await authorization from the server (which checks for correct amount of ammo etc). The server acknowledges the shots (or invalidates them if the client is trying to cheat, then those shots will disappear). Shots are pretty easy because they have a determined motion, so it's just to update them by the send delay.

As for the code, it's a mess right now. I started out pretty good, with good encapsulating classes etc. Strived to keep a clean design to be able to reuse parts. But then I got less and less time to program, and just worked on putting features in and have taken many shortcuts. Which I'm paying for now, but I don't have time to clean up the code. There are many things I regret in the code structure, networking should have been encapsulated better, I would have a huge task if I were to change it in some fundamental way. The messages themselves (on byte level) are spread throughout the code... I wish I'd created a way to view in clear text what the contents of messages are, it would have helped me loads in debugging. I think I will do that soon since there are some rare occurring bugs that are very hard to figure out. I actually started out using tcpip, but I had problems with that and changed to udp (which was a big task).

This is the first game I've written in Java sofar (first application in java bigger than the coding assignments you do in school), I've made many mistakes, but have learned lots. I've written several other games in other languages before, but nothing as ambitious as xsw.

Play XSW: www.xsw.se
Offline CommanderKeith
« Reply #107 - Posted 2008-03-04 09:03:34 »

Thanks for the detailed explanation. It's a really interesting setup with how the players directly send their position, speed etc to the server and all nearby clients. In that way it's like a peer-to-peer setup. That must have been difficult to setup since every client needs a connection to every other client.

The way you honour the client's reality is great - it's what makes the game feel solid. If the client's ship had to wait for validation from the server then it would feel terrible.

About code messiness, that seems to be what happens to any game as it gains features.

So do you ever send the game world to clients from the server? I understand that players' ships never get out of synch for long since the players are always sending their new positiion, but what about the rocks and things that fly around? Do they get out of synch?

Also, do you use fixed or variable time-step updates?

Thanks,
Keith

Offline Aramaz

Junior Member




Java Games Rock!


« Reply #108 - Posted 2008-03-05 01:56:24 »

No prob.

Yep, it's a mixture of both client-server and p2p. It was a bit of a hazzle to set up, but not too difficult.

I've tried different approaches, I did try sending keystrokes to the server and then let the server send back position, velocity and such. Even with trying to predict the future on the client it had many problems. Only if you were very close to the server did it work well. The way I do it now will open up more possibilities for cheaters, but I don't worry too much about that. You can always ban people reported as cheating... and the server could validate that the ships are moving within reasonable limits.

Code messiness  - yep. I like to keep it clean, but with little time, and much you want to do it's easy to create a mess Wink.

Server continuously sends data about world state to clients. at every collision the position, and velocity of objects are sent. Also it sweeps over all world objects and sends data about a few of them in every message to the client - this way positions don't get out of sync for too long. Also the server sends ship positions as sometimes there might be problems sending data p2p.

In the server.ini file you can specify at what interval the server will send updates to the clients, currently I use 60 ms intervals...

The sent data could be optimized quite a bit I think. I have no compression right now, and I could tune several messages. A good huffman coding scheme could probably reduce the message size alot.

Play XSW: www.xsw.se
Offline CommanderKeith
« Reply #109 - Posted 2008-03-05 07:19:34 »

Cool, thanks for the description.  By the way, I made a networked game a little while ago similar-ish (but 100x worse  Wink) to yours:

http://www.java-gaming.org/forums/index.php?topic=18019.0

Something about it that worked out quite well is that the coding side of it turned out quite un-messy since I roll-back the world by reverting it to it's saved state and can also send the whole world to clients without having to write any of that code in the game objects themselves - it's all done automatically using java.lang.reflection.

One thing that would be cool to add to mine is the peer-to-peer aspect of your game, since it minimises latency between clients.

About the time-step, I understand that the sevrer sends updates 60 times a second, but do the clients all run at 60FPS (so they update by 1/60s every frame)? Or do you use a variable time-step?


Offline Aramaz

Junior Member




Java Games Rock!


« Reply #110 - Posted 2008-03-05 12:12:58 »

Nice little game Smiley.

Actually I don't send 60 times a second, rather with 60 ms delay between sends: 1000/60  = 16.6 times a second.

It's a pretty long time between sends, but since the clients do p2p whenever an important event occurs it works fine.

The clients run as fast as they can, or as fast as the settings allow them to. In the settings you can set maximum frame rate (defaults to 200 fps).

Play XSW: www.xsw.se
Offline CommanderKeith
« Reply #111 - Posted 2008-03-05 12:46:10 »

Thanks.

Ok that's clear.

I hope you're not bored of my questions  Tongue but if you were to make another type of game, would you re-use the network code in xsw (obviously you'd re-use some, but would the same strategy fit for other games very well?) or start out all over again and do a different strategy?

 Smiley
Keith

Offline Aramaz

Junior Member




Java Games Rock!


« Reply #112 - Posted 2008-03-07 06:51:05 »

No, you're not boring me Smiley.  I think the strategy works pretty well for an action game. If I made another action game I think I'd use something similar but I'd probably rewrite most of the networking code. If it was an entirely different game type, such as a mmorg or a turn based game I'd do something different. Probably use tcp ip instead of udp .

Play XSW: www.xsw.se
Offline thijs

Junior Member




Lava games rock!


« Reply #113 - Posted 2008-03-08 09:40:45 »

Hi Amaraz,

Good to see there's still progress being made to XSW! It still is one of the most promising Java games in my opinion Smiley

About the client-server/peer-to-peer aproach, there was a good paper about that recently:
http://www.pap.vs.uni-due.de/MMVE08/papers/p11.pdf

They've also made modifcations to quake3 to implement their idea and showed it's possible to reduce latency compared to a pure CS (or a pure p2p) architecture that way.

<a href="http://www.dzzd.net">3DzzD!</a>
<a href="http://www.arcazoid.com">Arcazoid!</a>
Offline Aramaz

Junior Member




Java Games Rock!


« Reply #114 - Posted 2008-03-10 23:04:36 »

Hi thijs!

Thank you for your kind words Smiley.

Now version 0.47 is up! This fixes some bugs that caused the server to crash sometimes in Team Death Match. Also I solved a bug which which was the cause of some computers not to be able to connect.

irrisor> if you read this, you're welcome to try to connect again to see if it solved your problem...

Play XSW: www.xsw.se
Offline irrisor

Junior Member





« Reply #115 - Posted 2008-03-11 20:08:10 »

irrisor> if you read this, you're welcome to try to connect again to see if it solved your problem...
it's not solved Cry - the game does not lock up any more, but it shows an error dialog (could not connect). I tried to set the port to a fixed number and forward it through the nat, but that did not help.
Offline Aramaz

Junior Member




Java Games Rock!


« Reply #116 - Posted 2008-03-12 00:42:48 »

Bah, not good...

It's frustrating when people cannot connect to the server Sad. I posted a link on a swedish gamer's forum, and someone there also could not connect... I need to find a solution to this.

Play XSW: www.xsw.se
Offline gouessej
« Reply #117 - Posted 2008-05-23 18:07:09 »

Do you plan to provide a JNLP link? I would like to add your game on the Java(tm) Game Tome as soon as possible, it would help...

Offline Aramaz

Junior Member




Java Games Rock!


« Reply #118 - Posted 2008-06-03 22:06:19 »

goussej> That would be nice! Smiley. Life's been very busy for me the last couple of months, I'm in the middle of switching jobs, and alot of other things has kept me busy... So it's been awhile since I worked with xsw or visited this forum.

I would love to get some attention to xsw, and establish a steady player base, I just find I have very little time to work to get publicity... I'll try to find some time to make it webstartable soon.

Play XSW: www.xsw.se
Pages: 1 2 3 [4]
  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.

Pippogeek (39 views)
2014-09-24 16:13:29

Pippogeek (30 views)
2014-09-24 16:12:22

Pippogeek (19 views)
2014-09-24 16:12:06

Grunnt (45 views)
2014-09-23 14:38:19

radar3301 (27 views)
2014-09-21 23:33:17

BurntPizza (63 views)
2014-09-21 02:42:18

BurntPizza (33 views)
2014-09-21 01:30:30

moogie (41 views)
2014-09-21 00:26:15

UprightPath (50 views)
2014-09-20 20:14:06

BurntPizza (54 views)
2014-09-19 03:14:18
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!