Code Monkey home page Code Monkey logo

micro-racing's Introduction

micro-racing

multiplayer 3D isometric racing game written in WebGL 2.x. Steering(both): WSAD / Arrows.

Live demo: https://micro-racing.herokuapp.com/ (it uses free server so it can be really slow)

Gameplay

GIF
Screen
Screen 3
Screen 2

Todo

  • Improve client side prediction
  • Improve overall performance of server
  • Improve controls

Installation

Development mode (running at http://lvh.me:3000):

yarn install
yarn run develop

Production:

yarn install
yarn run build:production

Features

  • Client side prediction
  • High performance isometric engine using WebGL 2.x
  • Neural networks trained using evolution algorithms
  • Function precompilation in stuct-pack deserializers
  • Physics engine
  • Optimistic forms

Goals

  • Use monorepo, separated logic
  • Create tiny matrix math library
  • Create 3D isometric WebGL 2.0 functional wrapper(it should handle depth sorting and other stuff)
  • Car steering logic (using Marco Monster approach)
  • Procedural generated racetrack
  • Bots using Neural Network for AI(see neural-cars)
  • Multiplayer

Parts

Neural Network Implementation

forward propagation: https://github.com/Mati365/micro-racing/blob/master/src/packages/neural-network/src/unsafe/forwardPropagate.js

backward propagation: https://github.com/Mati365/micro-racing/blob/master/src/packages/neural-network/src/unsafe/backwardPropagate.js

evolution population train generation: https://github.com/Mati365/micro-racing/blob/master/src/packages/neural-network/src/genetic/forkPopulation.js#L70

ai car driver: https://github.com/Mati365/micro-racing/blob/master/src/network/shared/logic/drivers/neural/CarNeuralAI.js

ai cars trainer: https://github.com/Mati365/micro-racing/blob/master/src/network/shared/logic/drivers/neural/CarNeuralTrainer.js

cars intersection rays: https://github.com/Mati365/micro-racing/blob/master/src/network/shared/logic/drivers/neural/CarIntersectRays.js

Quad Tree

implementation: https://github.com/Mati365/micro-racing/blob/master/src/packages/quad-tree/src/index.js

Quad Tree handles multiple moving objects as list, stores only static objects

CSS in JS implementation

https://github.com/Mati365/micro-racing/tree/master/src/packages/fast-stylesheet

Bezier lines and de Castelja algorithm implementation

https://github.com/Mati365/micro-racing/blob/master/src/packages/beizer-lines/src/index.js

Car steering logic based on Marco Monster docs

https://github.com/Mati365/micro-racing/blob/master/src/network/shared/logic/physics/CarPhysicsBody.js#L43

Server update loop

https://github.com/Mati365/micro-racing/blob/master/src/network/server/RoomRacing.js#L148

See also

https://webcache.googleusercontent.com/search?q=cache%3A5cH3UfBvb2YJ%3Avodacek.zvb.cz%2Farchiv%2F681.html&hl=en&gl=us&strip=1&vwsrc=0&fbclid=IwAR2jxD6EayJZqvcOSNOBHgww35indUbC6pAeVA_3XtTCckCVeabjnbEuJvI
http://buildnewgames.com/real-time-multiplayer/
https://codea.io/talk/discussion/6648/port-of-marco-monsters-2d-car-physics-now-with-video
https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking
http://www.asawicki.info/Mirror/Car%20Physics%20for%20Games/Car%20Physics%20for%20Games.html
https://github.com/nadako/cars/blob/gh-pages/Car.hx
https://github.com/spacejack/carphysics2d/blob/master/marco/Cardemo.c
https://www.sevenson.com.au/actionscript/sat
http://www.dyn4j.org/2010/01/sat
HTML UI in AAA games:
https://www.gdcvault.com/play/1022055/How-to-Implement-AAA-Game

License

MIT

Resources

Icons: https://png.is/f/chatbot-robot-internet-bot-artificial-intelligence-icon-vector-robot/6051723894325248-201812161840.html https://icons8.com/icon/38824/meat https://www.kisscc0.com/clipart/u-turn-traffic-sign-turnaround-computer-icons-caut-y4h8ur/ https://dryicons.com/icon/zombie-brains-icon-11516 https://fontawesome.com/icons/car

Cars: https://opengameart.org/content/low-poly-cars https://free3d.com/3d-model/cartoon-low-poly-city-cars-pack-32084.html

Elements: https://free3d.com/3d-model/road-elements-40062.html

Map Elements: https://sketchfab.com/3d-models/muro-hormigon-981c60ea68ce4fcfa168d56ff8ee59ca by talekliaran

https://sketchfab.com/3d-models/cactus-low-poly-8027a1cceedb4d8189592f316b0c4704 by kaltyiontrish

micro-racing's People

Contributors

mati365 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

micro-racing's Issues

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.