Replies: 6 comments 3 replies
-
Do you have a pull request or a branch I can take a look at? Could be what
I need to jump back in hit some things on my to-do list.
…On Wed, Dec 13, 2023, 11:53 a.m. Austin ***@***.***> wrote:
Hello!
I super appreciate @nykwil <https://github.com/nykwil> and @robbgray
<https://github.com/robbgray>'s work on this repo: without the progress
you all made here I would have never gotten a game up and running in Unity
using GGPO!
I wanted to make a post here to let everyone know about the changes I
needed to make in order to solve all the various issues I was running into.
I'm planning on at some point creating a repo (crediting the work here of
course!) of my own that should hopefully work out of the box, but until
then here's a list of changes I recommend in order to get the UnityGGPO
repo working for your game:
- Game and player structs need to be changed to classes
- The structs weren’t maintaining their values after an update had
occurred, changing them to classes fixed this issue
- GameManager Update() needs to be changed to use FixedUpdate()
- Input needs to be polled so that it works with fixed update
(Rewired has an option for this)
- Code within IsRunning should run Runner.Idle(0) and
Runner.RunFrame(), so “now” and “next” related code can be removed -- we
want to run both of these every fixed update
- Parameter for ggpo.idle doesn’t get used from within GGPO
- Fixed update can be changed to from running at 50fps to 60 in
Unity's settings
- OnEventEventcodeTimesyncDelegate should record frames ahead and
then RunFrame should be skipped that many times
- During skipped frames, input needs to be captured so that it can
be used on the first available frame
- Thread.sleep doesn’t work in Unity: once the sleep ends Unity
will perform any missing Updates
- Game simulation needs to occur outside of Unity and not use floating
points in order to ensure determinism. Inputs from Unity to the game
simulation should only be device inputs and fixed update
These were the big things I changed, but it's not an exhaustive list and
there might be items I forgot to include. If anyone happens upon this repo
and needs more advice on how to get it running correctly, feel free to
contact me here on this discussion forum, I would love to help!
—
Reply to this email directly, view it on GitHub
<#15>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHU46A6HIHSSCZUHKMHFJLYJHTQVAVCNFSM6AAAAABATSFKDSVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZVHE2TONZQGA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
@nykwil I have a branch ready for you to look at! Could I grab permissions to push my branch to this repo? If not I can do a PR through our fork, it'll just take me a bit to get that ready |
Beta Was this translation helpful? Give feedback.
-
A pull request is best.
Thanks I'll have some time this week to take a look.
…On Tue, Dec 19, 2023, 12:00 p.m. Austin ***@***.***> wrote:
@nykwil <https://github.com/nykwil> I have a branch ready for you to look
at! Could I grab permissions to push my branch to this repo? If not I can
do a PR through our fork, it'll just take me a bit to get that ready
—
Reply to this email directly, view it on GitHub
<#15 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHU46G2AGJ4WVPB2H2TMELYKHI23AVCNFSM6AAAAABATSFKDSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TSMBQGU3DC>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Sounds good, I have the PR up! Wouldn't necessarily immediately merge this in as I haven't tested those changes outside of running locally just to make sure I haven't broken anything too much. Just wanted to give you an idea of what the changes I mentioned above would look like. Would still need the following to solve all the issues, though:
Just a note on the change from Update to FixedUpdate: I actually am thinking about modifying mine to use a game loop outside of Unity entirely, but FixedUpdate does a good job for now. I left FixedUpdate at running at 50 fps, but that can be changed in the settings via Fixed Timestep. Also, you can find my additional changes on our fork for adding sync test to the project, wasn't too bad. Would recommend using normal player inputs rather than random inputs however. Either way, good luck! If you need any help at all, don't hesitate to reach out. Thanks again for all the work you did on this repository, it really helped us get a good start at implementing GGPO in Unity! |
Beta Was this translation helpful? Give feedback.
-
Just for anyone coming across this forum post, I discussed the issues further and thought that a description of problems I was running into might be beneficial for anyone trying to use this repository, so here's a list of problems I had run into in the order I experienced them:
|
Beta Was this translation helpful? Give feedback.
-
@austinh1 it would be cool if you have a chance to look at my latest changes see how that works for you. |
Beta Was this translation helpful? Give feedback.
-
Hello!
I super appreciate @nykwil and @robbgray's work on this repo: without the progress you all made here I would have never gotten a game up and running in Unity using GGPO!
I wanted to make a post here to let everyone know about the changes I needed to make in order to solve all the various issues I was running into. I'm planning on at some point creating a repo (crediting the work here of course!) of my own that should hopefully work out of the box, but until then here's a list of changes I recommend in order to get the UnityGGPO repo working for your game:
These were the big things I changed, but it's not an exhaustive list and there might be items I forgot to include. If anyone happens upon this repo and needs more advice on how to get it running correctly, feel free to contact me here on this discussion forum, I would love to help!
Beta Was this translation helpful? Give feedback.
All reactions