bit-engine | A BitTorrent client built with Ruby and EventMachine | Stream Processing library

 by   bpot Ruby Version: Current License: MIT

kandi X-RAY | bit-engine Summary

kandi X-RAY | bit-engine Summary

bit-engine is a Ruby library typically used in Data Processing, Stream Processing applications. bit-engine has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

A BitTorrent client built with Ruby and EventMachine. Bit-Engine is still experimental. It is just at the point where you can download torrents with it.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              bit-engine has a low active ecosystem.
              It has 8 star(s) with 0 fork(s). There are 3 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              bit-engine has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of bit-engine is current.

            kandi-Quality Quality

              bit-engine has no bugs reported.

            kandi-Security Security

              bit-engine has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              bit-engine is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              bit-engine releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi has reviewed bit-engine and discovered the below as its top functions. This is intended to give you an instant insight into bit-engine implemented functionality, and help decide if they suit your requirements.
            • Processes a message .
            • Add a block to the block .
            • Called when a torrent is received .
            • Register a new peer .
            • Request a new block .
            • Open a peer .
            • Updates the counter with a given key
            • Add a new peer to the peers .
            • Send the request to the block
            • Start the torrent .
            Get all kandi verified functions for this library.

            bit-engine Key Features

            No Key Features are available at this moment for bit-engine.

            bit-engine Examples and Code Snippets

            No Code Snippets are available at this moment for bit-engine.

            Community Discussions

            QUESTION

            Loading game tile data from XML and using jQuery to render new tiles
            Asked 2019-May-24 at 11:56

            As a fun project I decided to try and create a top down 2D game engine in HTML, CSS and JavaScript. I have the basics down, generating a grid and moving that grid when using the arrow keys to simulate walking. As a test I just used a single sprite as background, when walking up for example the bottom row height is animated from 50 to 0px, simultaneously it adds a row to the top whose height is animated from 0 to 50px. Up to there it works well and is pretty responsive.

            I decided on storing all tile data in a database, then using PHP to generate an XML file on page load, store that in a javascript variable and then use find() to get the data I need. Every tile has a latitude and longitude so I can search for the tile that matches both those values and pull other relevant information like if the player can walk there, which texture it needs to have, etc.

            My XML: http://www.nickbetting.nl/bit-engine/test3/createxml.php?id=1

            The problem is, it's incredibly slow. I decided on a 25x15 grid of 50x50px tiles. So on initial page load it has to find the starting 375 tiles, get their data and replace the images in the tiles for the ones from the data. This initial load takes maybe 10-20 seconds.

            When I then use the arrow keys to walk, it will calculate which tiles need to be rendered, then uses find() to get the data for those tiles, creates a new row and appends the tile elements with the image corresponding to that tile's texture. That also takes 1-2 seconds, which is many times slower than walking without parsing the data and finding the information.

            In short:

            • I pull up the XML through ajax
            • I save that XML as an XMLdocument to a variable
            • I calculate which tiles need to be loaded based on the spawn location
            • I use find() to get those tiles from the XML stored in the var
            • When walking I add a row or column of tiles in the direction you're walking and removed a row or column tiles on the opposite direction
            • When walking those new tiles will also use find() to get the data for each tile from the XML stored in the var

            This is my JS: http://www.nickbetting.nl/bit-engine/test3/js/functions.js

            This is the test I have up: http://www.nickbetting.nl/bit-engine/test3/

            Note for this test:

            • I'm not making a zelda clone, that's just some placeholder art
            • Walking up will get the tile data from the XML
            • Walking any other direction will just load empty grass squares without consulting the XML data
            • Walking up is how it should work, the other directions are just to compare how much time it takes to load the data

            So, my question. How can I make this faster? Is there a better way to store and find data like this or is there a better way to render the new tiles in the DOM? Is jQuery just too slow for things like this?

            Any other tips are also appreciated. I know that there are free and ready to download 2D JS game engines but I'm doing this as a learning experience. I generally do projects like these to see how far I can get without help and to learn new things by running into new problems.

            ...

            ANSWER

            Answered 2019-May-24 at 11:56

            It's tough to make any recommendations on this without the advice basically boiling down to "rewrite your engine". However, there are a couple of things you're doing that could be optimised;

            1. Use a spritesheet instead of individual images (this only has to load once)
            2. Use Canvas. Manipulating the DOM is slower when editing many elements at once
            3. Store only the data you need in the database. The x, y, and sprite reference of a tile, for example.
            4. Use JSON instead of xml.

            Here's a useful link to MDN regarding tile engines, tilemaps and canvas.

            To address your actual query about find being slow, there's a small discussion about this here.

            Update:

            In regards to detecting which tiles can be walked on, you have a few choices. A couple of the popular ones are;

            1. Do as you're already doing and store a flag for this in the database
            2. Use two layers in your tilemap. One layer to render the sprites, the second to indicate which tiles can/can't be walked on. A reference that discusses this. This is useful if you want to do other things with the titles, such as slow a player down (water) or hurt a player (lava) when walked on.

            Source https://stackoverflow.com/questions/56291526

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install bit-engine

            You can download it from GitHub.
            On a UNIX-like operating system, using your system’s package manager is easiest. However, the packaged Ruby version may not be the newest one. There is also an installer for Windows. Managers help you to switch between multiple Ruby versions on your system. Installers can be used to install a specific or multiple Ruby versions. Please refer ruby-lang.org for more information.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/bpot/bit-engine.git

          • CLI

            gh repo clone bpot/bit-engine

          • sshUrl

            git@github.com:bpot/bit-engine.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Stream Processing Libraries

            gulp

            by gulpjs

            webtorrent

            by webtorrent

            aria2

            by aria2

            ZeroNet

            by HelloZeroNet

            qBittorrent

            by qbittorrent

            Try Top Libraries by bpot

            poseidon

            by bpotRuby

            node-gossip

            by bpotJavaScript

            node-msgpack-rpc

            by bpotJavaScript

            gmail-oauth

            by bpotRuby

            mbws

            by bpotRuby