Jump to content

Putting sleep back into multiplayer?


chronicpayne

Recommended Posts

It's actually very simple.

The trouble is that there's currently no way that I know of to sync GameTime between clients and the server, so you'll just accelerate and no one else will.

RobertJohnson will likely be looking at this Soon.

 

Go RJ Go!

 

As an alternate plan of attack, would it be possible to modify sleeping itself so it doesn't alter the GameTime speed?

Link to comment
Share on other sites

No, you can't use the built in game function for sleep in that case. It always accelerates time. Instead, you'd have to mimic it: if you want to black out the world, you'd draw a black texture across the screen, take away player control, and then restore health .etc manually, breaking out of it after a certain amount of time.

The only difficulty then would be trying to sync it with other people. TorboTuTone has a nice helper library for sending commands to other players, though as part of his ApCom mod.

Unfortunately, I can't seem to find my old code that tried to replicate this a few months ago. RoboMat has put out a small sleeping overhaul from a much older version of the game, however. You may find some answers there. I'd also recommend getting a copy of JD-GUI and decompiling the game's code. That way you can see how sleep is implemented natively, then duplicate it in Lua.

Link to comment
Share on other sites

just my 2 cents.

 

Was playing with some friends, and one said: "I miss sleeping in MP. I don't care if I have to wait normal time till I wake up. But this feels just unrealistic and kinda kills the mood."

 

And I have to add: Yes, a server based option of "sleeping" would be good. No time acceleration in MP, though.

Link to comment
Share on other sites

I've always been fond of the If everyone is asleep then time goes forward like +8 Hours or something (perhaps server.ini sleeptime = 8 to set a desired universal sleep time.) I hate to reference minecraft but it seems to have the most effective and least problematic and most sensical way of dealing with it.

I prefer it much more than doing wallpushups in my safehouse all nite because its too dark and risky to go out.

Link to comment
Share on other sites

  • 2 weeks later...

No, you can't use the built in game function for sleep in that case. It always accelerates time. Instead, you'd have to mimic it: if you want to black out the world, you'd draw a black texture across the screen, take away player control, and then restore health .etc manually, breaking out of it after a certain amount of time.

The only difficulty then would be trying to sync it with other people. TorboTuTone has a nice helper library for sending commands to other players, though as part of his ApCom mod.

Unfortunately, I can't seem to find my old code that tried to replicate this a few months ago. RoboMat has put out a small sleeping overhaul from a much older version of the game, however. You may find some answers there. I'd also recommend getting a copy of JD-GUI and decompiling the game's code. That way you can see how sleep is implemented natively, then duplicate it in Lua.

 

There's a lot of good info in RoboMat's old code, and I may be interested in trying to re-vamp this. My main question is though, is there some way to re-enable fatigue in general via modding right now? It's completely disabled as far as I know, and I just assumed that was probably done in the Java somewhere.

Link to comment
Share on other sites

  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...