Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (495)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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  
  Racing Game  (Read 2112 times)
0 Members and 1 Guest are viewing this topic.
Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Posted 2004-01-11 14:45:11 »

Since everything piece of code I've touched seems to have exploded recently I was considering writing a racing game.

I'd like it to be multiplayer but started thinking about networking for racing games and it seems pretty difficult. It seems like the collision has to be close to perfect and the speed of movement has to really high. Across a network this would seem pretty difficult to achieve.

However, I note a lot of the console games that have just gone online (racing games) have quite happily become network enabled.

Anyone know of any resources or have any experience in this area?

Kev

Offline Herkules

Senior Member




Friendly fire isn't friendly!


« Reply #1 - Posted 2004-01-12 03:54:46 »

Just a thought.....

For car racing, lots of movement computation has to done even for the remote cars in any case. This is due to the fact that car motion is heavily contrained (e.g. by the road Smiley ). So 'normal' extrapolation of 3D motion data doesn't take you anywhere at all. You have to make sure that the car stays on the ground.

The same way you always have to do local collision detection and response. Let your cars collide locally and even perform the bounce locally and then let a smoothing of motion care for the consistency with the information from the network.

If damage data has to be handled, I'd prefer to calc that only for your own car. A collision might not even take place on each machine involved than, but if you encounter a collision on your machine, you also get the damage.

Thats pretty much how JPilot works (concerning collision with bullets).

I have another sample that could help to keep cars on track, which I thought was a nice idea but I'm not sure wether it holds for a true game: as most track consist of flat triangles or quads anyway, just work with 2D coordinates [0...1;0...1] that just describe the position on a certain triangle. So position [9.2,0.5] places your car at the beginning of the 9th quad just in the middle of the road.
You will have to use non-orthogonal coordinate systems for that. I have a small sample showing that:

http://www.hardcode.de/applets/hqDriver.html

The 'cars' positions are just computed as [t,sin(t)] and see how it moves....

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #2 - Posted 2004-01-12 05:47:45 »

So what actually gets sent across the network.. just positions? just controls?

Kev

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

Senior Member




Friendly fire isn't friendly!


« Reply #3 - Posted 2004-01-12 07:15:01 »

Whatever you need to describe motion.

The corresponding HeadQuarter subsystem 'locations' sends positions and optionally speed, ang. velocity, force and torque. Together with a timestamp this works together for dead-reckoning.

Forces often are very close to 'controls'.

But this is not the point. Whatever you send, you cannot do a 'free' extrapolation of motion due to the contraints caused by the track and collisions.

I think that the extrapolation of motion has to take these contraints into account and to perform e.g. collision response whereever it is encountered. This way it makes you not depend so much on good latencies to achieve a believable(!) gameplay.

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline Jeff

JGO Coder




Got any cats?


« Reply #4 - Posted 2004-01-12 07:24:21 »

We did NASCAR Online at TEN.

Driving games oer the internet are fundementally extremely difficult.  They are ALMOSt as bad as contact sports games and fighters, the only savign garce being that motio nis slightly more predictable.

You are talking about bumper to bumper accuracy requriements at speeds of 100mph plus. About the only way to do it is with local logic as has already been mentioend.

The problm is that local logic is highly hackable.

As long as you dont think people will have a reason to cheat or you don't care about peopel cehating your okay. IF that isnt true however you have a real job on your hands.  Abotu the only way to detect cheating is by statistical analysis of the driving patterns of the players.  Ofcourse once the players figure out what you are lookign for in your analysis they can modify their cheats (typially in this case driving robots) to compensate.  In the end, its a pretty expensive cold-war.


Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline Herkules

Senior Member




Friendly fire isn't friendly!


« Reply #5 - Posted 2004-01-12 07:32:12 »

Cheesy

I always think that first you have to come so far to develop a game that has SO much exposure and public recognition that cheaters show up at all!

So I'd go for the best technical solution first to create a good game and care for cheaters second order only.....

Most gaming efforts grow that far....



HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #6 - Posted 2004-01-12 07:38:43 »

Right, I'll have a go then.. see what happens.

Kev

Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #7 - Posted 2004-01-13 05:17:36 »

So how exactly did JPilot work?

Every now and again you recieve an update from the server that specifies say

a) Timestamp
b) Position
c) Forces

You assign these to the player thats being update and extrapolate (including collisions) until you recieve a new update?

When you recieve the new update do you just reset the players position or do try to tend towards it or something?

Kev

Offline Jeff

JGO Coder




Got any cats?


« Reply #8 - Posted 2004-01-13 23:49:34 »

Simply resetting the position can be done but it results in what players call "warping".

Look at it as a point sampling problem, much like dithering.  You have an error term that you want to average back in over subsequent frames.  You can do this by interpolating  between the "current" and "right" values.  Some games wil cheat and give you some extra speed to get back into the right position.  If you do though you want to ease that in and out to avodi it beign obvious, effectively a second order derivative interpolation.


Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #9 - Posted 2004-01-14 04:50:21 »

Well, I've played about with what Jeff has just mentioned and trivially it seems to work ok, however having just touched the tip of the iceberg where racing games are concerned (AI next) I have a feeling that its not going to be a good hobby project Sad Too much focused time required.

Kev

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

Senior Member




Friendly fire isn't friendly!


« Reply #10 - Posted 2004-01-14 05:07:22 »

Quote
So how exactly did JPilot work?


Huh? I've written a long answer yesterday!!!

Where is it gone?


HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #11 - Posted 2004-01-15 23:09:58 »

Quote
We did NASCAR Online at TEN.

Driving games oer the internet are fundementally extremely difficult.  They are ALMOSt as bad as contact sports games and fighters, the only savign garce being that motio nis slightly more predictable.



Nice! Nascar online is currently one of the projects within the group that I work with. Very interesting problems that had to be solved. Some of our other interesting problems involve massive UDP based multicast (which not actually being multicast). Very interesting solutions there as well. Again kudos - I've seen the Nascar thing and appreciate the technical issues that would be entailed having had to solve very similar problems Smiley

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline Jeff

JGO Coder




Got any cats?


« Reply #12 - Posted 2004-01-16 02:48:33 »

Thanks but I need to give credit where credit was due.  That wasn't one of my projects, Bill Lipa (our senior game networking guru) worked on it directly along with the guys from Papyrus who really did most of the heavy lifting Smiley


Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
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.

Dwinin (23 views)
2014-09-12 09:08:26

Norakomi (56 views)
2014-09-10 13:57:51

TehJavaDev (69 views)
2014-09-10 06:39:09

Tekkerue (35 views)
2014-09-09 02:24:56

mitcheeb (56 views)
2014-09-08 06:06:29

BurntPizza (40 views)
2014-09-07 01:13:42

Longarmx (26 views)
2014-09-07 01:12:14

Longarmx (33 views)
2014-09-07 01:11:22

Longarmx (31 views)
2014-09-07 01:10:19

mitcheeb (39 views)
2014-09-04 23:08:59
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!