npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

swgpu

v1.6.4

Published

A complete, fast and fun web game engine

Downloads

15

Readme

Langage License Compatibility

SWGPU is a simple 2D/3D game library written in TypeScript and powered by the latest web APIs. It offers an easy and complete way to create classic games in a non-opinionated but recommanded coding style. From the start, we chose to embrace the future with pure WebGPU 3D rendering engine as the name suggests. Check what stack we've choices for this work: | API | Domain | Description | |:---------:|:----------:|:---------------------------------------------------------------------------------------------------------------------------| | WebGPU | 3D | A modern 3D graphics API designed to provide high-performance rendering and compute capabilities directly in web browsers. | | Canvas2D | 2D | A 2D graphics API designed to provide shapes, text, and images drawing. | | CSS3 | UI | The best way to build powerful and hightly maintenable user-interface. | | Web Audio | Sound | An Audio API for playing sounds. | | Rapier3D | 3D Physics | The fastest 3D physics engine for the web. | | Rapier2D | 2D Physics | The fastest 2D physics engine for the web. |

Table of content

Getting started

Clone and install the starter-kit from this repository:

# git clone https://github.com/jay19240/SWGPU-StarterKit.git
# cd SWGPU-StarterKit
# npm install
# npm run dev

Edit the ''src/game_screen'' and start writing your game. Go to http://localhost:5173.

Compatible tools

| Aseprite | Tilekit | Blender | |:-----------------------------------------------------------------------------------------------------:|:-------:|:--------| | | | |

Features

  • 🧱 Core

    • Maths
    • Tweening
    • Events
    • Curves
    • Quaternions
    • Object pooling
  • 👾 2D

    • Static sprite (jss)
    • Animated sprite (jas, aseprite)
    • Isometric animated tilemap (jtm, tilekit)
    • Orthographic animated tilemap (jtm)
    • Particles
    • Rendering filters
    • Motion lines (jlm)
  • 📐 2D Physics

    • BoundingRect
    • Tilemap box collider
    • Rapier2D
  • 🧊 3D

    • Binary format (bsm, bam, bwm, bnm, blm)
    • Debug shapes
    • Static mesh (jsm and obj)
    • Animated mesh (jam)
    • Static sprite (jss)
    • Animated sprite (jas, aseprite)
    • Motion lines (jlm)
    • Billboarding
    • Cubemap skybox
    • Particules
    • Flares
    • Fog
    • Vertex colorization
    • Decals
    • Shadow mapping
    • Shadow volume
    • Multi-viewport
    • Camera orbit
    • Camera WASD
    • Auto mipmap
    • Post rendering (gbuffers: depth/normal/ids)
    • Rendering filters
    • Customizable shaders
  • 📐 3D Physics

    • BoundingBox
    • BoundingCylinder
    • Walkmesh (jwm)
    • Hitmesh (jnm)
    • Ray-testing
    • Rapier3D
  • 💥 3D Material

    • Phong reflection model
    • Displacement texture map
    • Displacement texture scrolling
    • Diffuse map
    • Specular map
    • Emissive map
    • Normal map
    • Env map
    • Toon map
    • Texture scrolling
    • Animated UV
    • Specular shininess
    • Emissive intensity
    • Normal intensity
    • Facing blending
  • 🌞 3D Light

    • Directional light
    • Point lights (max : 64)
    • Spot lights (max: 16)
  • 🖼️ 3D Post-processing

    • Outline
    • Hardware dithering
    • Pixelation
    • Color depth limiting
  • 🎮 Input

    • Action mapping
    • Gamepad, keyboard and mouse support
  • 🧠 AI

    • A* for 2D/3D with graph and grid
    • Djikstra graph (grf)
    • Min-max with alpha-beta pruning
  • 📺 Screen

    • Navigate between different view of your game
    • Resources pre-loading
  • 📜 Scripts

    • Load script from json file
    • Register async command function and call-it from json file
    • Manual jump to part of the script
    • Command primitives like: WAITPAD, GOTO, GOTO_IF, EXEC_IF, VAR_SET, VAR_ADD, VAR_SUB, DELAY
  • 🔊 Sound

    • Handle sounds by groups
    • Play multiple sounds at same time
  • 🌳 Tree

    • 2D binary space partition
    • 3D binary space partition
  • 🎨 UI

    • Focus/unfocus widgets
    • Fade in/out
    • Widget architecture
  • 🖍️ UI Widgets

    • Dialog + choices
    • Dialog only
    • Print long text
    • Description list
    • Virtual keyboard
    • Slider
    • Menu base
    • Menu list view
    • Menu text
    • Prompt
    • Sprite
    • Text
  • 🌆 DNA

    • ECS architecture implementation

Examples

This framework come with 16 common game templates and 9 utils templates.
Each one is thinking to represent a common game style like platformer, fighting, fps or rpg.
Template are written in typescript/javascript and build to be clean and extensible.

List of templates that you can test here:

  • 3D Pre-rendered
  • 3D Isometric
  • 2D Visual Novel
  • 2D Tilemap
  • 2D Tilemap (with pathfinding)
  • 2D Checker (extendable)
  • 2D Trading Carding Game
  • 3D FPS
  • 3D Turn-based RPG
  • 2D Fight
  • 2D Triple Triad
  • 2D Tilemap Isometric
  • 2D Background Isometric
  • 2D Shoot'em up
  • 3D Third Person Camera
  • 2D Platformer

List of examples:

  • 3D Curve
  • 3D Particles
  • 3D Performance Test
  • 3D Rapier
  • 3D Shadow Map
  • UI Menu
  • 3D Viewer
  • 3D Menu Ring
  • 3D Pack

Contributors

  1. Crisxzu - Contribute to the Wiki, typedoc converter and Triple Triad demo.
  2. zuda - Contribute to Triple Triad demo.
  3. luciedefraiteur - Contribute to the fog.
  4. thetinyspark - Contribute to the binary space partition.
  5. Impre-visible - Contribute to 2D tutorial.
  6. Alina Morinokanata - Create the logo.

Some parts taken for this work

  • DOM for UI elements
  • CanvasRenderingContext2D for 2D stuffs
  • Rapier for both 2D and 3D physics engine
  • No glTF support, we don't want to support the rendering techniques used by this format (BSDF, Skinning, etc...)

Changelog

- [Ver. 1.6.0] Aseprite support added.
- [Ver. 1.6.0] Tilekit support added.
- [Ver. 1.5.0]  Pack archivage added.
- [Ver. 1.5.0]  New mesh shader hook added.
- [Ver. 1.5.0]  Engine manager added.
- [Ver. 1.5.0]  ECS Components check optimized with the use of Set.
- [Ver. 1.5.0]  ECS query is added.
- [Ver. 1.5.0]  ECS nice sugar methods is added.
- [Ver. 1.5.0]  Fix offset factor on all sprite classes.
- [Ver. 1.5.0]  Tile collision method added to Gfx2TileMap.
- [Ver. 1.5.0]  Platformer template added.
- [Ver. 1.2.0]  Binary format for 3D files added.
- [Ver. 1.1.14] Tilemap SpriteFusion format added.
- [Ver. 1.1.13] Cylinder collision class added.
- [Ver. 1.1.12] Fix and optimize jnm.
- [Ver. 1.1.10] Some added to fps demo.
- [Ver. 1.1.7]  Mipmap added.
- [Ver. 1.1.5]  Export as npm module added.
- [Ver. 1.1.1]  Outline post-process effect added.
- [Ver. 1.1.1]  Normals, id and depth rendering buffer added.
- [Ver. 1.1.1]  Object pooling added.
- [Ver. 1.1.0]  Move physics to dedicated folder and redesign JNM.
- [Ver. 1.1.0]  Rapier has been added.
- [Ver. 1.0.3]  Playstation one post-process effect has been added.
- [Ver. 1.0.3]  Post-processing effects has been added.
- [Ver. 1.0.3]  Camera WASD has been added.
- [Ver. 1.0.3]  Camera orbit has been added.

License

SWGPU is released under the MIT license.