thejoshwolfe / snakefall

snakebird clone
http://wolfesoftware.com/snakefall/
33 stars 6 forks source link

Shorter URL Encoding #51

Open XeroOl opened 4 years ago

XeroOl commented 4 years ago

I've recently created a large level, and it's hard to share with others because the URL is 2500+ characters long. It would be nice if the URL was encoded in base64 or something that can store data in a way that is more dense.

jmdiamond3 commented 4 years ago

On a similar note, holding Y to run through a solution is slow and sometimes doesn't show every move as the graphics can skip. However, holding BACKSPACE to undo moves is always lightning quick. I'm not sure there's an easy solution, but if there is it would be great to have.

XeroOl commented 4 years ago

I'm looking at lz-string and some sort of base-64 encoding as a potential strategy.

XeroOl commented 4 years ago

looks like lzstring has an encodeToBase64 and decodeFromBase64. It's licensed under MIT. I can do some tests to see if it would make sense to put in the effort

eff96 commented 4 years ago

maybe list each entity in one coordinate as a number/letter/symbol, then list it, like in this level, simply name the level id as 123 instead of HyRr4JK1&1&3?124, but if you cant name it 123, there are many other characters right in your keyboard to use for probably each individual connected texture for walls, blocks and snakes, you can use these characters:

`1234567890-=~!@#$%^&*()_+abcdefghijklmnopqrstuvwyxzABCDEFGHIJKLMNOPQRSTUVWXYZ[]\;',./{}|:"<>?

you can also use superscript and subscript if these characters above are still not sufficient.

XeroOl commented 4 years ago

I think the current implementation already uses a similar strategy.

eff96 commented 4 years ago

yes it does, but i think it uses this format:

id/coordinate

but you don’t need to list the coords, just list the entity ids, left to right, up to down.