Subj : Another Frame.js question
To   : All
From : Kirkman
Date : Tue Jun 09 2015 03:29 pm

To Deuce or echicken or whoever,

Lately I've been playing with using frames like tiles. In a 132x60 terminal, I
create an 8x3 grid of frames. Each frame is 16x16 characters. This dimension is
convenient because it lets me adapt 16x16 pixel RPG sprites and tiles into
ANSI.

Anyway, back to the point. I've got the tile map working. I can move a sprite
around it. But the latency when moving a sprite around the map is pretty high.

The routine works like this:

* Figure out where you are on the master map and store those coordinates.

* Using those coords, iterate over the frame grid and check tile types.

  - If a frame needs the same tile as it had before, don't update

  - If the frame needs a new tile, .load() it, then .draw()

* After iterating over all frames, .cycle() the parent frame


Checking to see if the tile is the same as before helps some with the latency,
but I have a feeling there's a way to reduce the latency much more.

Many of my tiles have repeated information. For example, there are a lot of
solid green blocks since they are grassy.

When I .load() a new ANS or BIN file into a frame, does Frame.js just replace
all data and redraw every character in the entire frame? Or does it check the
new data against the old data to see if there are characters it can skip
repainting?


--Josh


BTW - I posted a video showing an early version of this tile map idea here:

http://breakintochat.com/blog/2015/05/26/ansi-tile-map/

////--------------------------------------------------
BiC -=- http://breakintochat.com -=- bbs wiki and blog

---
� Synchronet