OINC community project: Dead Reckoning
The one main problem people have with extensions like OINC or moo or what not is creating online games. Sure, we can get them to work, but not smoothly. For example, DizzyDoo's movement tutorial works great, other then the lagony(heh, puns are fun).
So, together, we should work on something, a tutorial or engine or something, to help people (like me :P) put there games on the internet. Unlimited possibilities, what could we do? Lets start discussing!
Re: OINC community project: Dead Reckoning
When you make a custom engine, think about how you put input into the game to control it. You don't keep tapping right to make the player keep going right. You just make it so that it goes right as long as the button is held. Well as long as you don't hit any other buttons, he'll keep going right until you let go of right.
So when making an online game, think of it like controlling a remote control car. Don't keep sending information, just send it whenever input changes. Once whenever they press the button, once when they let go. Let the other clients assume what's happening, because if your engine is solid, they'll usually be good at it. And theres nothing wrong with sending the players position when sending any of this information, just to make sure that before the game actually sends a remote command, that the players position is in sync with the real player. Again, as long as your engine is solid (clean), they should be very close in sync. It's at that point, the only thing really causing de-sync is ping.
Re: OINC community project: Dead Reckoning
You underestimate OINC as UDP is now an option. you can smooth out the movement issues without causing huge latency as you don't need to confirm the data being sent. I'm pretty sure Jamie will cater for latency issues in the server as this would save you a lot of hassle calculating where the objects are supposed to be when sending recieving data.
Re: OINC community project: Dead Reckoning
I have a good method of smoothing out, which works for more than one objects, and I have tested it myself and it looks the same as what you see on your screen to what other people see; aslong as you blast the X,Y every 1-15 MS.
Re: OINC community project: Dead Reckoning
the problem with community projects is that people are different programming-wise. It's hard to adjust to another person's code
Re: OINC community project: Dead Reckoning
Quote:
Originally Posted by izac
I have a good method of smoothing out, which works for more than one objects, and I have tested it myself and it looks the same as what you see on your screen to what other people see; aslong as you blast the X,Y every 1-15 MS.
I don't mean to be rude here, but that's perhaps the worst way to create an online game. You need a dead reckoning system to make an online game even remotely possible, especially with more than 2 or 3 people. Sending information every <insert time here> is horrible inefficient and not even all that accurate, and will cause major lag in the future, especially once you have more than 2 people on.
Re: OINC community project: Dead Reckoning
Good suggestion GF202.
I need to learn this and have little clue on how to do it even though I've read miles of theories about it. I always fall on the math since I'm an absolute no-math person (was sick the day we had math). :whistle:
Re: OINC community project: Dead Reckoning
Quote:
You need a dead reckoning system to make an online game even remotely possible, especially with more than 2 or 3 people.
Can you elaborate on what would be the "right way" to handle dead reckoning? I'm doing pretty close to the same thing, as it's the only way I can think of to handle this.
I see people say it's "wrong" or not efficient, but I've yet to see anyone tell what is the right way. I for one would really like to learn, since I fully intend to have dozens of players in my game at any given time, if not far more.
Thanks!
I should be more specific about how I'm doing movement in my game.
Player starts at a certain position, all players in the same sector of space see the player in that same spot.
Player presses the up arrow key to thrust in whatever direction they are pointing.
A message is sent to the channel and all players on that channel (in the same sector) apply the same amount of thrust to that player. it is pretty accurate, so far I've had about 6 players in the same sector in my tests.
but, once in a while, it does get a bit out of sync, not sure why. I'm using time based movement, not frame based, so computer speed should be less of an issue.
every so often (i forget the interval) I do send position, angle, direction and speed corrections, and on rare occasions, I do notice the correction moving a players ship to the right place, but for the most part, i've been happy with it.
I have been using "SEND" rather than UDP (blast) because i have had some experience in winsock (vb) and UDP messages being missed.
Re: OINC community project: Dead Reckoning
Quote:
Originally Posted by BrandonC
Quote:
Originally Posted by izac
I have a good method of smoothing out, which works for more than one objects, and I have tested it myself and it looks the same as what you see on your screen to what other people see; aslong as you blast the X,Y every 1-15 MS.
I don't mean to be rude here, but that's perhaps the worst way to create an online game. You need a dead reckoning system to make an online game even remotely possible, especially with more than 2 or 3 people. Sending information every <insert time here> is horrible inefficient and not even all that accurate, and will cause major lag in the future, especially once you have more than 2 people on.
Uhh? I have already tested my way with 4 people in it and the server only uses 5kb/s upstream with 4 people in it? dang
Dead reckoning is different for every game..
Re: OINC community project: Dead Reckoning
Quote:
Originally Posted by izac
Quote:
Originally Posted by BrandonC
Quote:
Originally Posted by izac
I have a good method of smoothing out, which works for more than one objects, and I have tested it myself and it looks the same as what you see on your screen to what other people see; aslong as you blast the X,Y every 1-15 MS.
I don't mean to be rude here, but that's perhaps the worst way to create an online game. You need a dead reckoning system to make an online game even remotely possible, especially with more than 2 or 3 people. Sending information every <insert time here> is horrible inefficient and not even all that accurate, and will cause major lag in the future, especially once you have more than 2 people on.
Uhh? I have already tested my way with 4 people in it and the server only uses 5kb/s upstream with 4 people in it? dang
Dead reckoning is different for every game..
Yeah, but that's not dead reckoning... at all, and is a horrible way to create an online engine.
Dead reckoning usually starts with the system that I mentioned in an above post, with the whole remote control thing. Usually you build off of that and then you work off of that and make it more complex as the game progresses. Never let either the online engine or especially the offline game, get too far ahead of the construction of the opposite though. The second you let either one get too far ahead of the other, the game immediately becomes overwhelming and that's how most online projects die out.
It is possible to break an online project down, especially if you do a lot of pre-planning ahead, but remember... if it starts to feel overwhelming or overcomplicated, chances are you're doing it right. xD
Re: OINC community project: Dead Reckoning
as djfeugo hinted, it comes moreso down to the way you code your engine for online play.
planning beforehand at how little and infrequent you can send data to achieve the same results will make the biggest difference.
eg: rather than send data for player positionx, pos y, direction, etc, you could put all that info in a string or integer, and then send the 1 number or string. decrypting it at the clients end is more work but is ultimately a LOT faster for online gaming,; ands only send it when you absolutely have to, NOT every x milliseconds!
Re: OINC community project: Dead Reckoning
Quote:
Dead reckoning usually starts with the system that I mentioned in an above post
Where? I'm looking everywhere for the system/post, and don't see it. I'm not trying to be rude, I really want this information, and if you have a valid method, PLEASE point me to the post.
I've got space ships moving in a frame that is 10,000 x 10,000, and the action is quite fast. If I don't send position (x/y), speed and direction periodically, it gets out of sync.
My ships use VECTOR movement using the click team movement controller to do Newtonian(ish) movement (ie Thrusting/drifting in space).
I'm REALLY looking for a better way (if this really is bad), because as I said before, I know I'll have dozens or more players at once, and I want it to be smooth and efficient.
THANKS!
Re: OINC community project: Dead Reckoning
Quote:
Originally Posted by danjo
eg: rather than send data for player positionx, pos y, direction, etc, you could put all that info in a string or integer, and then send the 1 number or string.
Or an OINC stack!
Re: OINC community project: Dead Reckoning
How do you parse an OINC stack?
Re: OINC community project: Dead Reckoning
You can get a byte/short/int etc. at a byte index.
Each data type has a different size - byte = 1, short = 2, int = 4, float = 4, string = dynamic.
So if you pushed a short with value 1234, and a float with value 3.14159, you can get both values using ShortAt(0) and FloatAt(2).
Re: OINC community project: Dead Reckoning
I'm writing some documentation for the extension as we speak :)
Re: OINC community project: Dead Reckoning
Quote:
Originally Posted by Jamie
I'm writing some documentation for the extension as we speak :)
This would help me out a lot! :D
stephen1980
Re: OINC community project: Dead Reckoning
Here is an example paper on a dead reckoning system at work. With pictures.
http://www.gamedev.net/reference/articles/article1370.asp
Re: OINC community project: Dead Reckoning
Nice find DJFuego :) It does explain lag compensation pretty well!
I usually do some research when I start on an online game by finding games that match my genre, and find out how they deal with their issues. In regards to client-side prediction, I'm quite inspired by the Source engine's (related to games like Quake also) way to deal with it.
Re: OINC community project: Dead Reckoning
IMO counterstrikes (1.6) netcode is second to none. even with a 56k modem it was still perfectly playable.