I am bad at writing blog posts regularly.
It is clear that I am unable to ever actually write about anything that I say I will follow up on, and also that I am bad at writing blog posts regularly, and probably in general.
Tonight, I will talk about the stuff I have been working on since the last blog post, and also things that I am doing.
Network Code
Yeah, I ended up going with an authority scheme as hinted in Glenn Fielder's post: http://gafferongames.com/game-physics/networked-physics/ and his presentation on authority schemes here. The authority scheme specifies who acts as the sever for an object as they are interacting with it. This is incredibly not cheat resistant. Anyone will be able to pretend they own an object at any time and teleport around and I hope that my game doesn't become player vs player at any point because then it will be a real problem, or I'll have to switch to a different network architecture.
Interpolation wise, I wrote up my own ~Hermite Spline Interpolation~ class, which takes the player's velocity as tangents for the interpolation, which makes everything look really smooth as it interpolates between network updates. Here's some bad multiplayer robots doing bad things in space:
The Fire
After getting networked wrenches to work, it was time to get the fire system synchronized. I was not particularly satisfied with the way fire was implemented in the game already, a basic 'this tile is on fire' kind of thing. I had a brilliant idea: use physics to simulate fire in a realistic way. That's easy... right?
Diagram courtesy of these guys |
Yeah! Super easy. Just implement a fluid solver. So I implemented a fluid solver.
Two weeks later, here are some videos of my fluid thing in action:
It looks like a fluid, especially in that last one. Writing a fluid simulation is hard. I drew this to illustrate:
And also, here are some more images I captured from the fluid development process:
Some kind of debug art. |
This velocity field looks rather tasty. |
Yep, this is definitely a fluid. |
And a mountain of blood sludge. |
Is it any good? Well, there's probably some kind of problem with floating point error in the diffusion process. When I try to heat up a volume, it kind of just heats up the center and the diffusion causes the overall temperature/density/whatever to dissipate over time. I'm not sure why this is; it could be floating point error, or that the diffusion is not inherently mass conserving (I need to look into this). And lastly, it probably won't be deterministic over the network, so I can't use it for mechanics anyways. BUT! I can probably use it for visualization of fire, and I also learned how fire works, so I can implement a much more realistic fire mechanic on the CPU.
Cool GUI bro.
I made a cool GUI for my game. It's broken, so here's some alien text:
It actually works fine in the editor, so I hope unity fixes this bug eventually. Not much of an update here because of secrets? Whatever.
Collaborations
I'm working on two projects with some people right now aside from Bad Things. First off is Seth Alter's No Pineapple Left Behind. It's a charter school management game where one day, an evil wizard turns all the kids into pineapples. If you leave the pineapples alone long enough, they turn into children, which are much worse than pineapples. I'll be helping Seth do all the hard programming things. Development on NPLB should really start to kick off in the next week or so, because CONTRACTS ARE BEING FINALIZED.
I'm also working on some VR stuff with James Andrew. James is a brilliant guy who knows all about all the stuff, and his ambition and enthusiasm are infectious. So far, we are putting together a multiplayer Rift game that we hope to have ready for the next Boston VR meetup. He's got some sick world generation stuff going on, and Image Based Lighting and Starfox meets Geometry Wars.
Last but not least, I leave you with voyeur cube.
Voyeur cube is watching you wield that wrench. No, don't stop. |
Comments
Post a Comment