CodeWalrus

Development => Web => Topic started by: Yuki on November 18, 2017, 05:44:45 AM

Title: asciiworld [ucc3]
Post by: Yuki on November 18, 2017, 05:44:45 AM
You are an ASCII character, in a grayscale 2D world, made up of other ASCII characters. You don't know what's up, but you can do things. There's no goal either. But it might be considered as a game.

You already can move a letter o around with the arrow keys (block by block in a top down view, of course) and move the camera.

(https://img.codewalr.us/Capture%20d%E2%80%99e%CC%81cran%202017-11-18%20a%CC%80%2003.05.57.png)

Planned features

- interact with other ASCII characters that may or may not be other people
- build things out of ASCII characters (that shouldn't be people)
- run into ASCII characters that are definitely not Unicode
- everything is a monospaced ASCII character
- Definitely no UTF-8

welcome to asciiworld.
Title: Re: asciiworld
Post by: _iPhoenix_ on November 18, 2017, 04:32:26 PM
This could be pretty cool! I like the concept, and you could almost make a rudimentary RPG with this.

I'm interested in seeing what comes out of this project.
Title: Re: asciiworld
Post by: Yuki on November 18, 2017, 11:44:03 PM
Updates!

- World-syncing in the cloud with Google Firebase (thanks @_iPhoenix_ this is definitely going in my web developer's toolbox, this is definitely better than writing some sort of node.js server as I initially planned)
- Your avatar is now one of < ^ > v depending of the direction you're facing
- Get some info about the thing in front of you

Many more features planned!
Title: Re: asciiworld [ucc3]
Post by: Ranman on November 19, 2017, 01:43:12 AM
Pretty nifty Juju.   :thumbsup:

I'm interested in seeing how this turns out.  :)
Title: Re: asciiworld
Post by: _iPhoenix_ on November 19, 2017, 01:54:33 AM
I love firebase. It's so easy to use, and frustrating in a rewarding way... (you'll understand when you use it)

It is also very vulnerable. I won't explain how, but I can, uhh, "forcibly take down" old versions of UniChat in < 30ms (assuming my bandwidth is 100% empty).
(But it's not too much of a worry in new versions. Just don't try)

It's really exciting to push something to the database, and watch it appear for the first time.
My reaction: "ooohhhhh" *puts on evil smile* *rubs hands together and stretches*
Title: Re: asciiworld
Post by: Yuki on November 19, 2017, 02:29:18 AM
Have you tried auth functions and database rules? You can prevent a few stuff from happening with that, if you structure your database correctly. In my case, a user can't mess with anyone else's stuff, although they can mess with things marked public.

On that, I'm working on that feature where users can see each other.

EDIT: It works!

(https://img.codewalr.us/Capture%20d%E2%80%99e%CC%81cran%202017-11-18%20a%CC%80%2022.11.05.png)

This is me (the left >), looking at something, the status bar says it's another player.
Title: Re: asciiworld
Post by: Yuki on November 19, 2017, 08:43:29 PM
More updates:

- Rooms (or more like, different worlds)
- Since only online users appear in the database, your position is saved offline in local storage
- Brand new help box when you press h
- Messing with the dev console (other than editing the Firebase database directly) should mess with mostly nothing but the consistent state of your local copy of the game, as updates from the database have the last say on it
- Command parser (type /help)
- Walls
Title: Re: asciiworld
Post by: Yuki on November 21, 2017, 02:30:35 AM
(https://img.codewalr.us/Capture%20d%E2%80%99e%CC%81cran%202017-11-20%20a%CC%80%2020.48.31.png)

You can now add blocks you can push around until there's something else! Or a wall!
Title: Re: asciiworld
Post by: Yuki on December 31, 2017, 10:48:52 PM
I'm going to leave this here since I won by default apparently

http://asciiworld.ga/
Title: Re: asciiworld [ucc3]
Post by: xMarminq_ on December 31, 2017, 11:01:03 PM
Awesome so far! Could it be possible to push multiple boxes at once, as  when they get really thick you cannot push them and they get stuck. Maybe a pulling mechanic?
Title: Re: asciiworld [ucc3]
Post by: mazhat on January 01, 2018, 03:17:58 AM
The concept is really simple, but I really like it.
I hope this won't be blocked on school systems!

It would be cool if you could "name" blocks,
like pressing info on it will display little messages or descriptions.
Title: Re: asciiworld
Post by: _iPhoenix_ on January 02, 2018, 08:24:55 PM
I am able to shrink down the size of the database by a ton.


Basically, we have a dictionary where the information for each type of block is stored. In stead of storing data for each individual block, we store it once, and use it many times later.


Here's an example:
(https://i.imgur.com/vV6KhEa.png)


We store the data for each type of block in the info branch.


We would want to download this branch to a local variable, because we will be using it a lot.
We also want to have an event listener listening for changes, and it would update the local variable accordingly.


Using some super cheaty methods, I downloaded your entire database and did some simple find and replace actions and got it down to roughly 1/4 of the original size.


When you push an array to firebase, it turns the array indices into keys. This is awesome, because a bunch of 1 or 2 digit keys is much smaller than a bunch of 16 digit keys.


All in all, I got the data down to 1/16 of the original size (not all of the methods were shown in the picture)
Title: Re: asciiworld [ucc3]
Post by: mazhat on January 03, 2018, 12:44:25 AM
Here, Juju.
I made a Codewalrus ad in asciiworld!
Title: Re: asciiworld
Post by: Yuki on January 03, 2018, 07:27:39 PM
Quote from: _iPhoenix_ on January 02, 2018, 08:24:55 PM
I am able to shrink down the size of the database by a ton.


Basically, we have a dictionary where the information for each type of block is stored. In stead of storing data for each individual block, we store it once, and use it many times later.


Here's an example:
(https://i.imgur.com/vV6KhEa.png)


We store the data for each type of block in the info branch.


We would want to download this branch to a local variable, because we will be using it a lot.
We also want to have an event listener listening for changes, and it would update the local variable accordingly.


Using some super cheaty methods, I downloaded your entire database and did some simple find and replace actions and got it down to roughly 1/4 of the original size.


When you push an array to firebase, it turns the array indices into keys. This is awesome, because a bunch of 1 or 2 digit keys is much smaller than a bunch of 16 digit keys.


All in all, I got the data down to 1/16 of the original size (not all of the methods were shown in the picture)
That's something I haven't thought of, but that's interesting. My goal was more the ability to customize each block individually, though.
Title: Re: asciiworld
Post by: _iPhoenix_ on January 04, 2018, 02:40:37 AM
Well, then you have a default setting, store that to info, and only store the things that have changed from the default. If there are ~10+ of the same changes (and the changes are to more than one attribute), then that is considered a class of blocks and an ID is added for the attributes, stored into info, and the changes stored in each individual block are deleted and the block type is of the ID generated.
Title: Re: asciiworld
Post by: Yuki on January 04, 2018, 05:09:52 AM
That's an idea.