Monday, January 26, 2015

Game: Save My Cheese


GitHub repository
Concept document
Class diagram
Sequence diagram

Royalty free mouse clipart

Description: Mice try to reach cheese. User prevents mice from reaching cheese by blocking their path with puzzle pieces. End condition: A mouse reaches the cheese (FAIL) OR all pieces are in place (SUCCESS).

Welcome screen:
* Start game button --> Game screen
** Exit button --> Quits game
** Pause button (after mice are added)
** 3-2-1 counter (after mice are added)
* Help button --> Help screen
** Help text and image
** Back button
* Settings button (after mice are added)
** Back button
** Mouse number
** Mouse speed
** Map size
* About button --> About screen
** About text: Şamil Korkmaz, copyright 2015, link to blog
** Back button
* Advert banner on top
** Third party library
** Bank account --> PayPal account?

* Puzzle:
** Piece = Filled polygon
** Construct pieces
** Breakdown of pieces into cells.
*** The smaller the cells, the closer the mice can get to the piece but the slower the pathfinding.
*** For each cell on grid check if piece contains the center of that cell. If it contains, mark the cell as belonging to that piece.
** Move pieces with mouse:
*** On mouse left click, detect piece that contains mouse cursor location.
*** On mouse drag: Update detected piece location with mouse location.
*** On mouse release, calculate distance between piece and its snap location.
**** If distance is smaller than tolerance AND there is no mice inside that snap area
***** Set piece location = snap location
***** Set cells that belong to this piece as blocking

* Pathfinding:
** Use A* algorithm
** Do we need two separate threads (one for GUI, one for calculations)
** Must be able to find path within one game loop cycle.
** Draw mouse and cheese. Mouse orientation = movement direction. Make orientation changes smooth using linear interpolation.
** Create game loop:
*** Mice are moving at preset time intervals along their path with preset distance intervals (speed).
*** End condition: A mouse reaches the cheese OR all pieces are in place.
** The screen is a two dimensional grid with each cell being a node.
** Mice cannot pass through blocking cells.
** Mice update their path to cheese each time the user adds a new piece.

* Android & Google Play Store
** Download development environment, code puzzle with Nexus 10 screen size in mind. Mapping of mouser press/drag/release to touch controls. End condition: All pieces are in place.
** How do you claim copyright and handle disputes?
** Subscribe (25?)
** Upload puzzle with one level (v1) to Play Store, verify that you can find it and install it on tablet and phone.
** Update (v2-)


Test Cases:
* Puzzle: Three pieces
* Pathfinding:
** One mouse, no blocking cells.
** One mouse, simple wall.
** One mouse, dead end case (path has to U turn after initial trial).
** Two mice start from
*** top/bottom.
*** left/right.
* Is advert banner working? Does it deposit money to my account?

"Save my cheese" version plan:
v0.1: Puzzle level1 with Java on Windows8
v0.2: Mice with pathfinding on win8 attacking cheese + Level2
v0.3: sound effects (Argun'un sesleri - "buudan gidiyoo") music (midi of classical pieces, VogelHochzeit)
v0.4: Flash bomb causes mice to go in random directions for a couple of seconds.
v1: Nexus 10,  Samsung Galaxy S4 screen size
v2: Advertorial integration (small banner on top of welcome screen)
v3: New levels + blog dedicated to game (update link in About screen)
v6: dificulty settings:
* mice number
* mice speed
* mice intelligence: Stupid mice will mimic the path algorithm exactly, smart mice use the final path.
* map size
v7: blinding flash (causes mice to move on last direction) & stun bomb (causes mice to stay in place for dt)
v8: new levels
v9: better graphics/soundFX/music (mice move their tails, squeeking increases as they get closer to cheese)
v10: Mice wander randomly until they detect cheese smell and home in on smell. Pieces prevent smell from escaping
v11: Support other screen sizes/resolutions
v12: Cats that hunt mice. Proportional control.
v13: Mice avoid cat.

UML Diagrams: Initial design must be easily extensible to cover the capabilities outlined in version plan. Discuss how that will be done with examples.

Wednesday, November 26, 2014

Efficient video saving for stationary cameras

Our stationary IP camera's image has most of time no action (I did not activate motion detection trigger). Even when there is movement it covers about 5% of the image:


To conserve space, develop an algorithm that only saves the changing portions of the video frames and plays them back smoothly. Write a web application that at prespecified time periods (e.g. every 0.25 seconds) grabs frames from camera's ip address and saves filtered data to a cloud storage.

Tuesday, November 18, 2014

Active noise cancellation project

Just phase shift original noise or characterize signal and invert it. FFT?

Update 13th Dec 2016:
Use smartphone mic and processing power to send noise cancelling signal to headphone. See reddit on why there are no noise cancelling apps:
...biggest one is that your cell phone microphone is monaural while noise cancelling headphone have to have two independent pickup channels to effectively cancel out the outside noise
App on Google Play: Noise Canceller

Tuesday, September 16, 2014

Why build robots?

I am interested in the following:
Building robots combines all these topics, so it is a fun way to learn about them.

A road map for incremental knowledge improvement (could evolve into a knowledge map such as the one in Khan Academy):
  1. Use LEGO (Technix/Mindstorms) to build a ground vehicle that 
    • does open loop control to drive around the basketball court in our park.
    • follows a white line drawn on the court.
  2. ...
  3. Advanced: Write an auto routing algorithm that allows the quadrocopter to navigate autonomously around obstacles in our park.


Wednesday, August 27, 2014

Monday, August 11, 2014

Simulation of real aircraft accidents/crashes/disasters

Use an available flight simulator to simulate real aircraft accidents. Example: TK 1951 crash in Shiphol / Amsterdam. To simulate this case, you need to be able to have a auto-throttle model that gets AGL altitude data from aircraft altitude radar. Then you have to make the radar fail so that it shows -8 ft while the aircraft is at 2000 ft. And finally the auto throttle model should put the engines into retard mode and decrease the speed to stall values which in turn results in the crash of aircraft short of the runway (controlled flight into terrain).