Code Monkey home page Code Monkey logo

dfe-blazor's Introduction

DopeFish Engine (Blazor)

dfe-blazor is a game engine written in C# and JavaScript, using Blazor to compile to WebAssembly.

The virtual 3D game view is created using a custom raycasting engine that supports loading textures and sprites from PNG files.The raycaster is written in C# and individual video frames are sent to the HTML canvas using JavaScript Interop functionality provided by Blazor.

The client-side render loop is handled by the JavaScript requestAnimationFrame method. On the server side, we use C# async Tasks and the Task.delay method to run a non-blocking game loop.

Multiplayer support and the client-server networking model use the SignalR protocol.

This project is no longer under active development, however the only major component missing from the current version is collision detection. At present, it could work as a sort of virtual chat room.

dfe-blazor's People

Contributors

slushfilter avatar msftgits avatar

Stargazers

Ben Holley avatar

Watchers

Anjack avatar  avatar

dfe-blazor's Issues

Network Communication Type 0 - Heartbeat

Implementation of a Server -> Client heartbeat conversation.

  • Used for determining if a client is still connected.
  • Used as a basic mechanism for syncing server and client game states

Network Communication Type 3 - Full Sync

Server -> Client communication to fully sync their current state and knowledge of the game state.

  • Used when loading into new maps.
  • Used when a Player has been detected as de-synced.

Network Communication Type 4 - Asset Sync

An asset sync occurs when a client needs a resource from the server that it doesn't currently have.

Typically, we'll want to be pushing these assets out as soon as the Client connects into the current zone.

Fix chat.

Chat "Send" button was disabled when code was moved to GameClient. Need to set up send button to check for connection to server before enabling.

Implement a proper GameServer.loadImage

Currently this converts from 24bit RGB images to 32bit RGBA images..

This should be updated to be converted on the Client side, as well as add in color keying for transparent pixel regions.

Floor Dragging in Render

The floor drags while moving and turning, causing it to misalignment with the base of walls.

Main theories here are :

  • Lack of a proper camera plane.
  • Column drawing errors.
  • Floor height misalignment.

Sometimes, the game doesn't appear to load.

Sometimes, when I open a second tab to test multiplayer, the page will load, but nothing is drawn on the canvas. No error messages. Reloading the page usually fixes the issue.

ServerGameState base framework

A Server Simulation instance to perform updates on a Server Game State, once per server frame.

  • One instance per game map and one Server Game State per game map.
  • Query-able for relevant data to send to connected player.
  • Update specific PC's based on incoming messages from a connected player.

ClientGameState base framework

A Client Simulation instance to perform updates on a Client Game State, once per client frame (60 fps)

  • Singleton class that updates local game state.
  • Performs interpolation on Entities and known Entity state.
  • Stages updates for transmission to the Server

Network Communication Type 1 - State Change

Used for communicating a state change on an Entity, Map or Zone

Example of a state change message (for scope illustration) :
Entity #42 changed velocity to vx, vy at location x, y
Map tile #64 changed blocking flag to false

State changes must refer to an already existing entity.

Refactor Tracer and PixelBuffer

Need to pull most of the rendering code out of PixelBuffer into some rendering class.
PixelBuffers should be just a pixel buffer without a ton of methods inside.

Tracer has too much state data, it should be rendering only what is sent to it and not holding onto a bunch of references, like Maps and Textures.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.