Skip to content

Semestral project in course of Advanced Databases

Notifications You must be signed in to change notification settings

TheTomasJ/geogame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GeoGame - simple strategic geographical game

Semestral project in course of Advanced Databases Technologies (PDT FIIT STU 2016)

Installation

  1. Create new directory for this project
  2. Download newest osm file from http://www.freemap.sk/index.php?c=core.download&filename=/slovakia.osm/
  3. Pull this repo
  4. Create new Posgtres db
  5. Modify db settings in settings.py
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': '<your db name>',
        'USER': '<your username>',
        'PASSWORD': '<your db password>',
        'HOST': '127.0.0.1',
        'PORT': '5432',
    }
}
  1. Load osm file to your db
  2. run raw SQL (INITIAL_MIGRATION) written in settings.py to init db
  3. Locate console to project
  4. Create project's virtual enviroment
  5. run pip install -r requirements.txt
  6. run python manage.py runserver
  7. locate to http://127.0.0.1:8000
  8. enjoy!

How to play

  1. This game is designed for two players (reds vs. blues)
  2. A player can do only one action in a single step
  • Manipulate population - assign population living in a city / town or village within the selected area on the map to increase a player's score
  • Invest - increases area of effect
  1. Player who controlls most of the country is the winner

Important scenarios

  1. Show three towns (cities) closest to the selected point (only towns (cities) with population higher than 10.000) - educative scenario
  2. Get portion from non-manipulated area
  3. Remove polygon from 2nd step from non-manipulated area
  4. Get population of towns (cities, villages) which are inside the selected polygon from step 2
  5. Delete non-manipulated area and copy a new polygon of the whole Slovakia as a new non-manipulated area on every refresh of the page (new game)

Api

Select 3 (bigger) towns closest to the selected point

url: /close_villages
method: GET
get_data: {lat: double, lng: double}

Manipulate population in area around click

url: /colonise
method: POST
post_data: {lat: double, lng: double, distance: integer}

Playing of the game

About

Semestral project in course of Advanced Databases

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published