Git Product home page Git Product logo

disease's Introduction

Disease

This is a game that simulates virus spreading among people in a city or cities. It is written in Python with Pygame. I wish the game can help people understand how virus can spread and be controlled.

The initial thought will be to visualize some people in a city and one of them get sick, the virus spread among the population. The program will show how every man moves in the city, and how the virus infects different people. With the help of doctors and hospitals, the disease can be controlled. We can use the game to understand how the virus can be totally controlled, that is not coursing too many people dying and be diminished gradually.

Mat Buckland's Programming Game AI by Example( Publication Date: September 30, 2004 | ISBN-10: 1556220782 | ISBN-13: 978-1556220784 | Edition: 1 ) will be very helpful to understand the steering behavior and finite state machines. You can find the book HERE

The UML diagram can be found in HERE. You may need Umlet, which can be downloaded HERE, to open the .uxf file.

As is implied, the project is written in Python, so you may need to install Python 2.7.4 first. And I also included Pygame package, which can be downloaded HERE, and installed easily. Btw, there is a nice tutorial of Pygame HERE.

Wish you like it.

disease's People

Contributors

ianzhang1990 avatar

Watchers

James Cloos avatar  avatar

disease's Issues

Check a bug in Man.py line 126, where the velocity cannot be truncated.

self.Velocity.Truncate( self.MaxSpeed )      # make the velocity not exceed max speed

Truncate method is defined as:

def Truncate( self, max ):
    """Truncates a vector so that its length does not exceed max"""
    if self.get_length() > max:
        self = self.normalized()
        self  = (self * max)

When self.Velocity call truncate method, its value doesn't change! WHY??????

Velocity is a Vector2D class which defines a 2d vector. It contains two values, x and y. the computing result inside the Truncate method is totally correct. However, after Velocity calling the Truncate value, Velocity doesn't change at all!

check all other similair methods!!!!!!!

Finishe coding wandering behavior for man, and make it visible in the screen.

It is very important to make behavior visible quickly. This will help to ajust some parameters of a man, and to better understand how pygame works. To achive that, we should:

  1. Finish coding man's update function.
  2. Finish coding SteeringBehavior.Calculate() and Wander() functions.
  3. Finish coding GameWorld class.

Finish the Matrix related classes

Finish Matrix related classes and some other math classes, for they are the base of a game.

The next four lines are for testing Task List features:

  • @mentions, #refs, links, formatting, and tags supported
  • list syntax required (any unordered or ordered list supported)
  • this is a complete item
  • this is an incomplete item

Task List

Here are some tasks we need to do to improve game performance and enhance software features.

Multi-threading

  • Create a multi-threading class to handle multi-thread related works.
  • The class should be able to define any number of threads we want to creat.
  • The class should allow programmers to fork threads easily and change its status at any moment.
  • The class should handle synchronization issues, and provide a method that will be called after all threads finish their jobs in a frame.
  • The class should be compatable with cell-space-partition-realated classes, since that is where multi-threading strategy will be called most frequently.

Graphics User Inerface

  • Create a GUI class to handle graphics user interface related works.
  • The class shoule be able to draw GUI components in the screen.
  • GUI should be transparent in the screen, so users can see more about the game world.
  • The most important thing for GUI class is to build hospitals or other buildings in the world.
  • Texture can be attached to each cell of a GUI components.

Steering Behavior

There are still many features unfinished in the steering bahavior class The following features have the highest priorities:

  • Evade
  • Pursuit
  • Cohesion
  • Seek
  • Flee
  • Arrive
  • Alignment
  • Test Evade
  • Test Pursuit
  • Test Cohesion
  • Test Seek
  • Test Flee
  • Test Arrive
  • Test Alignment

Man State Machines

  • Create Two State Machines for a man: Position-related state machine and Health-related state machine

Position-Related State Machine includes:

  • Wander State
  • Pursuit State: Pursuit a target
  • Evade State: Evade a pursuer
  • Arrive State: Arrive at some place: such as a building or an area.
  • Alignment State
  • Cohesion State

Health Related State Machine includes:

  • Healthy State
  • Infected State: the man got infected by a virus
  • Infected-Incubate State: the virus is incubating
  • Infected-Onset State: the virus breaks out and attacks the man
  • Infected-Curing: The infected man is under medicine care
  • Dead State: The man is dead

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.