hejia-v / rts

Real Time Strategy

Home Page:http://emh.lart.no/publish/rts-free.git/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Introduction (Legacy version)

Unfinished project. You can see a demo displaying only free 3D models, not from SC2. The SC2 demo is not working because SC2 file host is not hosting them anymore, but the live code is still up at github pages. If you want to play with the version as seen in demos you should check out the git "legacy" branch. The legacy version is written in JavaScript, while the new version is primarily in ClojureScript.

SC2 files were retrieved from viewer.hiveworkshop.com (not mine) through a heroku CORS proxy.

Works best in Firefox, also in Chrome, not in IE and not tested with Safari. Only tested on Windows.

If the demo doesn't work for you, you can watch videos of it at YouTube:

See also mdx-m3-viewer. All credits to flowtsohg for decoding the M3 format in JavaScript.

Getting started with development environment

  • First
git clone https://github.com/emnh/rts rts
cd rts
git submodule update --init
npm install
./scripts/compile.sh

You will need a mongodb instance running on the default port (27017).

  • Then open 2 terminals and run the following:
./scripts/dev.sh
node js/figwheel.js
  • Server figwheel runs on port 3450
  • Node (with ClojureScript connected to figwheel on 3450) runs on port 3451
  • Now you can open the dev page

Building for production

lein cljsbuild once prod
lein cljsbuild once prod-client
./scripts/docker-build.sh
./scripts/docker-run.sh

Instead of using docker you can just run js/prod.js.

Source folder layout

Web page layout

Not everything is linked up yet, so overview is here:

  • /: Redirect to /login.
  • /login: Login with auth providers.
  • /logout: Log out.
  • /#lobby: Game lobby for creating/joining games.
  • /#game: Client game testing.

Resources

TODO

  • Bug fix: speed when game (requestAnimationFrame) lags
  • Fix selection for alternative method 1 and 2 (use group position instead of mesh)
  • Enforce limits on new-game and join-game, 1 per user
  • Enforce unique nicknames inside game, make user type one
  • Improvements:
  • Make health bars the same size even if screen boxes change size when rotating view.
  • Register callbacks with on-render instead of direct
  • Add :start and :stop parameters to defcom2 macro instead of positional, expecting more parameters soon.
  • Reuse main renderer for health bars.
  • Performance: Use quads for health bars instead of points.
  • Features:
  • Tri-planar texture mapping for terrain
  • Fix shadows
  • Fog of war
  • FPS hero mode
  • Movement
  • Networking with peer.js
  • Construction
  • Attacking
  • Collisions
  • Minimap controls (click to view area)
  • Health bar occlusion / Z-order
  • Cache minimap terrain and water
  • Reduce MathBox shader compilations (20!)
  • Fix magic stars size
  • Weapons
  • Hide MathBox from minimap
  • Refactor unit spawning and synchronize unit UI elements
  • Fix explosion scaling (voxels do not hit ground anymore)

Component cleanup

  • Pure functions first! The point is to be composable and reusable.
  • Add a prefix to allow multiple components or nest systems (which is recommended against).
  • Pages: What to do? Lifecycle implementation with start-page and stop-page? But this requires keeping the system and calling on it, plus dependencies are not really needed. Perhaps register with router component. Yes. start-page and stop-page must be called from routing component.
  • Would be nice to have these features:
  • Dependencies specified only once at point of usage (can be taken care of via macro)
  • Array of component. Can use name prefix/suffix.
  • Promise based dependency resolution. Hard. May cause terrible error messages.
  • Differentiate between changing page (stop page1; start page2) and reload (stop page; start page).

Authentication

  • Remove authentication for everything except lobby and multiplayer

About

Real Time Strategy

http://emh.lart.no/publish/rts-free.git/

License:GNU General Public License v2.0


Languages

Language:JavaScript 92.2%Language:Clojure 6.9%Language:GLSL 0.8%Language:HTML 0.1%Language:CSS 0.1%Language:Shell 0.0%Language:Python 0.0%