Giter Club home page Giter Club logo

isorts's Introduction

isoRTS

isomorphic RTS

The project goals that have been reached:

  • Create a custom game engine based upon an isomorphic projection.
  • Have actors move around in this world by issuing mouse commands.
  • For pathfinding use A-star and or bidirectional A-star.
  • Add collectable resources to the world
  • Make villagers gather the different resources and bring them to a ‘town center’
  • Use these resources to build different buildings
  • Require specific buildings to house new population
  • Make certain the buildings produce units
  • Implement Fog of war
  • Interact like an RTS game
  • Robust villager AI for doing a task
  • Show different animations for these resources
  • Generate random map on game startup
  • Make the units able fight each other using melee
  • Make the actors fight each other using ranged attacks
  • Make certain buildings able to perform a ranged attack
  • Working minimap
  • Buildable town centre, house, baracks, mill and lumbercamp
  • A basic Rock/Paper/Scissors for damage calculations during battle
  • Basic AI to play against

Attainable project goals for the near future:

  • Fighting animations
  • Different units
  • Different colors on units and buildings for the eight teams
  • Researchable upgrades for units and buildings
  • Flesh out the research with a tech tree
  • Add sounds

Aim for the moon project goal:

  • Working netcode to play against friends!

isorts's People

Contributors

ruckamongus avatar switchboy 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

Watchers

 avatar  avatar  avatar  avatar

isorts's Issues

Array initialization error in player.cpp

In "player.h" you declare "int friendOrFoo[8];" as a private member on line 71.

In "player.cpp" you initialize it as "this->friendOrFoo[8] ={0};" on line 15. This doesn't do what you think it does because C++ only fills the array on declaration with this syntax. What this actually does is set the 8th element (which is a overflow) to 0 leaving all the other indices with whatever garabage is in RAM.

A number of options are available to fix this:

  • In player.h do "int friendOrFoo[8] = {0};"
  • In player.cpp use std::fill, memset, a for loop, or manually set each array index to 0.

Crash after changing to vectors from lists in actors.cpp

In actors.cpp line 1603 I'm getting crashes when selecting troops and having them do things. I'm trying to determine how to replicate this easily. For reference, this is line 1603:

void actors::doNextStackedCommand()
{
    if (!this->listOfOrders.empty()) {
        switch (this->listOfOrders.front().orderType) { //crash here, maybe front is invalid?
...
}

Potential crash in simpleAI.cpp

The last return statement in the implementation of "int distanceToResource(int, cords)," currently line 135, has the potential to crash as it may dereference the front() of an empty list.

int distanceToResource(int kind, cords from)
{
	std::list <nearestBuildingTile> listOfResourceLocations;

	if (!listOfObjects.empty()) { ... }

	if (!listOfResourceLocations.empty()) { ... }

	return listOfResourceLocations.front().deltaDistance;
        //Crash here if both of the above if statements are false since listOfResourceLocations is empty
}

Two potential issues

In "randomMapGenerator.cpp" the while loop on line 120 might never break if the return statement condition is never met I think?

	bool foodFound = false;

	while (!foodFound) {
		int possibleFood = roll(0, static_cast<int>(listOfObjects.size()));
		if (listOfObjects[possibleFood].getTypeOfResource() == 1) {
			bool foodSourceOccupied = false;
			for (const int& foodOwned : occupiedFoodSources)
			{
				if (foodOwned == possibleFood) {
					foodSourceOccupied = true;
				}
			}
			if (!foodSourceOccupied) {
				return  listOfObjects[possibleFood].getLocation();
			}
		}
	}

In "main.cpp" line 111 I think this is meant to be a comparison and not assignment operator?
if (endProjectile = listOfProjectiles.size()) { ... }

New population can get stuck if there is no pathway after spawning from town hall

I spent some time playing today and noticed a few things that can be addressed:

  • If you box in the spawn area of a town hall the units will never be able to move. you can select them but never redirect them.
    image
  • When you select a large number of units the images in the bottom bar have odd orientation, sometimes outside of the bounds of the middle wooden rectangle texture (see bottom image).
  • The edge scrolling continues to happen when the mouse leaves the game window.
  • Sometimes the selection rectangle is... janky? It catches and misses some troops.
  • There are times where the game stutters or freezes really badly for no apparent reason. It may be related to pathfinding. I'll run a profiler and see if I can figure this out soon.
  • Pathfinding is sometimes unpredicatable. Troops may walk very long paths around obstacles that don't make much sense. I wonder if it's because troops refuse to walk on each other? I'll look more into this too.

This was fun though!
image

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.