-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rebasing code to support data stacking and sprites #10
base: main
Are you sure you want to change the base?
Conversation
Hey! I pulled down the code to run locally. when I press d to enable directional sprites I'm not seeing the directions change, am I doing something wrong maybe? |
let texturesChars = []; | ||
let texturesCharsDirectional = []; | ||
|
||
for(let i = 0; i < 73; ++i){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
73 is the number of sprites in the spritesheet?
@@ -47,15 +49,64 @@ function smoothstep(min, max, value) { | |||
return x*x*(3 - 2*x); | |||
} | |||
|
|||
const createLock = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little confused why a lock is implemented/used? JS is single threaded so all operations are going to be atomic by default.
All good on your end, when at the end I added buttons for directional sprites, I introduced a pythonic typo and used self over this, so the comparison of an undefined field will always be false! :p |
Would be very cool to have this! with the current performance and the extra code though it's not ready for merge yet. |
Hi Peter!
This is a partially improved version of the stacking prototype I made few months ago.
Just like now, only username metadata is mandatory. Stacking happens on a parameter equal to envID if set, otherwise it's randomized, so it can still display agents without a declared envID.
Custom sprites are supported setting optional metadata sprite_id=0.
Automatic variable speed is supported and scales with packets sizes on a log2 scale. Default speed matches the current, which is kinda x8 from game. I added high hard-limits for a single batch of coordinates at 2048 and 10 packets. Everything above that limit will be discarded. Mostly for safety, without abuse or ultra fast environment, I don't think this is needed. I also maintained legacy low speeds for very small packets, mostly for debug.
Visual artifacts of warps are mitigated with two editing, disabling the sprite if coordinates delta is above 1 and Function clipping inside coordConversionFunc using map bounds.
Direction infering is still using global coordinates over local, but that's fixable later if necessary, also considering the feature is off by default.
Extra Hotkeys are added for:
I hope it's all good!