Projects I have done

VoogaSalad Game Engine

This is the final project for Duke Compsci 308 Software Design and Implementation in 2017 Spring. The project was finished in a team of 8 students.

In the project, we were required to implement a game authoring environment and a game engine supporting one or more specific game genres in Java. Our group chose the tower-defense genre as the basic goal and kept real-time strategies as the final goal.

In the project, I focused on the game engine part. Personally I regard the design and implementation of the game engine pretty awesome. There are several shining points in it:

  • The game engine is a event-based one. The idea is studied from this project. The event system is more suitable for a complex system such as game engine than MVC systems. In the event system, the central component is a EventBus which takes specific types of events and sends them to whoever listens for these events. Each part of the engine (front end view, camera, models, sprite, sprite components, managers, etc) contains a reference to the same EventBus instance. These parts communicate with each other by emitting and receiving BusEvent.

    • In this way, we are able to avoid tons of dependencies between different parts. Imagine without the event system, if we would like to move a selected sprite on key press, we can do nothing but holding a reference of the input manager in the sprite class, which is actually a disaster for such a game engine.
    • Another advantage of the event system is that we can add new features to the game engine during the development process flexibly. To do this, we only need to create new BusEvent types (in Java, this is a subclass of the BusEvent class) and add new listeners for the specific event in corresponding engine parts. For example, if we want to add a feature to ask a selected sprite to move to a point on which the user clicks mouse, we can add a new MoveEvent to be emitted by the input manager and handled by the sprite position component, without affecting any other parts.
  • Everything occuring in the game are named as “sprite”. To make sprites flexible to different functions, Sprite is designed as a list of different Components. Sprites know what components they have, and components know what functions they are responsible for.

    • The composition design of sprite class is able to avoid direct modifications to the Sprite class itself, and place modifications in specific components. Sprite offers an API addComponent(Component component) to add components. In this way, sprites are close to future updates during the development process. When sprites are being created, all required components can be added into it together.
  • In terms of implementation results, the engine is able to support features including:

    • select sprite on mouse left click
    • deselect sprite on mouse right click in the game world
    • select skill on mouse left click
    • deselect skill on mouse right click in the game world
    • use skill on mouse left click in the game world
    • collision detection with square bounds
    • sprite move skill
    • sprite attack skill
    • sprite spawn skill
    • camera to move, zoom, focus, and lock

I have made a video record (Youtube, youku) to show how the moving features, the collision detection, the keyboard inputs, and the camera can be used creatively to create many different games, even a car racing game.

GitHub link: to be post later

Ames Housing Price Prediction

GitHub link: ames

Natural Language Parser for Relational Databases

GitHub link: NLIDB