Comments (10)
Note: I'd be very happy to use a simple-as-possible custom PRNG in C# to
make ports simpler. (But prob wouldn't have time to implement it myself,
but might be happy to back port if you started with a JS version?)
On 21 September 2016 at 21:03:38, Yannick Lohse ([email protected])
wrote:
Align the PRNG in inkjs with the C# version so the randomness is the same
on all platforms.
The C# version can be found here.
http://referencesource.microsoft.com/#mscorlib/system/random.cs,bb77e610694e64caIf someone with an up and running C# env wants to tackle this one, feel
free to grab it!—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#31, or mute the thread
https://github.com/notifications/unsubscribe-auth/AA0bVyCzrElU6UQXphkgpATGFUmDtqMdks5qsY2agaJpZM4KDODk
.
from inkjs.
Well, inkjs currently uses this one, if you want to have a look at it. They hardly come simpler than that :-)
from inkjs.
Yup, looks ideal! Let's do that then.
On 21 September 2016 at 21:17:14, Yannick Lohse ([email protected])
wrote:
Well, inkjs currently uses this one
https://gist.github.com/blixt/f17b47c62508be59987b, if you want to have
a look at it. They hardly come simpler than that :-)—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#31 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA0bVwRZQLg5G-AstnAdFDXzHNkkgaWCks5qsZDKgaJpZM4KDODk
.
from inkjs.
If you want a super simple PRNG then I'd recommend Xorshift. It usually scores better on tests than LCGs.
from inkjs.
@joethephish @y-lohse Is this feature still in any demand? It seems like something good I could tackle to learn more about RNG implementation.
from inkjs.
Not sure! I'm going to take a wild guess here and say that @joethephish would still like to switch the PRNG in ink, but is busy creating a game.
Switching inkjs to the C# implementation is still an option, but I'm not sure there's really a demand for it. But if you feel like working on it, the PR would be welcome :)
from inkjs.
I'm in favour of both having a super simple/lightweight (but effective!) implementation that's the same for both. But yeah, it's not a huge priority for me, but having consistency between CS#/JS would be cool!
from inkjs.
I used this in an Inform project when I wanted reproducible cross platform random seeds. The third one is called xorshift* and is extremely reliable for the code size - only one word of state and 7 operations!
https://gist.github.com/Marc-B-Reynolds/0b5f1db5ad7a3e453596
I'd be happy to do up PRs for both implementations if you'd be interested.
from inkjs.
Sounds good to me :)
from inkjs.
It doesn't appear that nextFloat
is ever used, do we need to keep it?
Hmm, could either of you help me by explaining briefly how NextSequenceShuffleIndex works?
Edit: I think I mostly understand. You're not storing the actually shuffled list, so you have to recreate it based on the hash of the container and the storyseed. That means the whole thing will change if SeedRandom is called, right?
from inkjs.
Related Issues (20)
- Error when calling Continue() when canContinue is true HOT 7
- How do I properly set up a PosixFileHandler? HOT 4
- Serverless template Uncaught Error: Failed to convert token to runtime object: "#", but working with ink-full.js HOT 4
- Calling EvaluateFunction() on functions with multiple arguments crashes HOT 5
- Choice tags are gone after state reloading HOT 1
- Bug in LIST_RANGE
- Missing commits in the port HOT 1
- Missing API: cannot bind callback to story.onError HOT 1
- export `JsonSerialisation` HOT 1
- Dynamic Tags are generated in reverse order HOT 2
- scrollDown malfunctions if it needs to scroll up instead HOT 1
- What's the correct syntax for Compiler with JSON file handler? HOT 2
- vite CommonJS error HOT 9
- Can't enumerate variables without accessing private attribute `_globalVariables`
- Compiler export is missing on the newest version HOT 5
- Typescript fails on `import { Story } from 'inkjs';` in 2.2.3 / 2.2.4 HOT 4
- Choice tags are not loaded from state HOT 1
- Couldnʻt get 2.2.3 or 2.2.4 working.. HOT 1
- [Help] How to use `PosixFileHandler` in conjunction with Webpack 5 HOT 2
- Compile crash HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from inkjs.