This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Readme: In the following pseudo code, [] indicates a subroutine. | |
Sometimes I choose to write the subroutine inline under the [] in order to maintain context. | |
One important fact about the way rollbacks are handled here is that we are storing state for every frame. | |
In any real implementation you only need to store one game state at a time. Storing a game | |
state for every frame allows us to only rollback to the first frame where the predicted inputs don't match the true ones. | |
==Constants== | |
MAX_ROLLBACK_FRAMES := Any Positive Integer # Specifies the maximum number of frames that can be resimulated | |
FRAME_ADVANTAGE_LIMIT := Any Positive Integer # Specifies the number of frames the local client can progress ahead of the remote client before time synchronizing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Very quick overview of how this works: https://twitter.com/beepdavid/status/814869295524155392 | |
1) Custom path tool that supports line, quad and bezier sections | |
2) On path change, create a polygon (Vector3 array) by sampling points along the path | |
3) Curves are sampled evenly by estimating the curve length first, then sampling at the required curve resolution | |
4) Feed polygon into https://triangle.codeplex.com/ to get triangle data (this needs some work to use in Unity) | |
5) Create procedural mesh using output triangle data | |
6) Profit! | |
Any questions, comment or tweet me @beepdavid :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Filename: HttpServer.cs | |
// Author: Benjamin N. Summerton <define-private-public> | |
// License: Unlicense (http://unlicense.org/) | |
using System; | |
using System.IO; | |
using System.Text; | |
using System.Net; | |
using System.Threading.Tasks; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function unzip( _path:String, _dest:String, ignoreRootFolder:String = "" ) { | |
var _in_file = sys.io.File.read( _path ); | |
var _entries = haxe.zip.Reader.readZip( _in_file ); | |
_in_file.close(); | |
for(_entry in _entries) { | |
var fileName = _entry.fileName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ; | |
class FastSignalsExample { | |
static function main() { | |
var o = new Signal1<String>(); | |
o.add(function(v) trace(v)); | |
o.dispatch('Hello'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package worker; | |
import flash.display.Sprite; | |
import flash.system.*; | |
import haxe.io.*; | |
import format.swf.*; | |
/** | |
* usage: | |
* -lib format |