GithubHelp home page GithubHelp logo

sandruski / rts-group-movement Goto Github PK

View Code? Open in Web Editor NEW
28.0 2.0 6.0 4.47 MB

This is a research in how to implement group movement in RTS games

Home Page: https://sandruski.github.io/rts-group-movement/

License: MIT License

C++ 27.98% C 71.63% Objective-C 0.39%

rts-group-movement's Introduction

RTS Group Movement

I am Sandra Alvarez, student of the Bachelor’s Degree in Video Games by UPC at CITM. This content is generated for the second year’s subject Project 2, under supervision of lecturer Ricard Pillosu.

• My GitHub account: Sandruski

About the Research

This application is the result of a research in how to implement group movement for RTS games. It has been done following the tile-based algorithm A* (A-Star) and creating a collision determination and avoidance system.

It is not recommended to move simultaneously more than 16 units.

• Website: RTS Group Movement Website
• GitHub repository: RTS Group Movement Repository

Inputs

Keyboard

1: spawn a unit of priority 1 on the current mouse tile
2: spawn a unit of priority 2 on the current mouse tile

F1: debug draw units' movement calculations
F2: debug draw units' path
F3: debug draw map collisions

ESC: close the application

Mouse

Left click on a unit: select the unit
Left click and drag: draw a rectangle. Units within the rectangle will be selected
Left click on a tile without a unit on it: unselect all the selected units
Right click: if units selected, set their group goal

Tools

  • IDE: Microsoft Visual Studio 2017 (language C++)
  • SDL 2.0, STL, pugixml 1.8
  • Profiler: Brofiler
  • Map edition: Tiled
  • Graphics edition: Adobe Photoshop

Assets

All the sprites used belong to the game Warcraft II: Tides of Darkness, hence are property of Blizzard Entertainment.

Known Bugs

BUG 1. When the user sets a new goal to a group of units, each unit searches for its own goal, which is found by running a BFS algorithm. Since BFS only expands from a given node (tile), the new tile found may be located on the other side of a wall. This leads to moving half of the group of units towards the side of the wall the user has clicked and one or two units to the opposite side.
BUG 1 PENDING TO SOLVE. The BFS search algorithm will be repalced for a Dijkstra algorithm, which also considers the cost of the nodes, preferring the low cost nodes. This way, Dijkstra will prefer to expand on the side of the wall the user has clicked and avoid jumping on the opposite side.

BUG 2. If many groups are moving at the same time and the user spam-clicks new goals for the units, the application either slows down or stops for a fraction of second, due to the high computational demand.

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.