School Specialization.

Specialization Summation:

I tried making a falling sand game in TGA2D and it did not go as planed but I worked with/around my problems to get a some what ok working game at the end, I hope to improve on this as i have extra free time and make it better, in a better engine.

My Falling sand game

Falling sand game footage found on YouTube.

During my specialization project:

I attempted to create a game akin to a Falling Sand game utilizing the TGA2D game engine, which can be found in the TGA2D forum. I meticulously arranged a sand world to govern all aspects, implemented a sand manager to oversee the entirety of the sand, and astutely employed IMGUI to gracefully handle all of the user interface components. For the rendering of the sand, I employed a sprite batch rendering technique. Seeking to optimize performance, I employed a Grid system and ingeniously threaded the sand manager to ameliorate its speed. The user interface, situated at the bottom of the screen, elegantly displays various elements. These include the current amount of sand gracing the world, the currently selected sand type, the precise position of the mouse, an assortment of buttons depicting the diverse sand types and their respective hues, a slider to modulate the brush size, and lastly, an innovative button to activate or deactivate the walls' "Collider" to ensure no particle of sand escapes the designated screen. To enable the efficient spawning of sand, I dutifully crafted a brush that caters to various brush sizes. Adding yet another element of marvel, I ingeniously devised an image-to-sand converter. This ingenious feature allows users to import an image into the game window either via a line of code or through a drag-and-drop action. Once the image is assimilated, the converter deftly converts each pixel to the nearest sand type and subsequently spawns it within the sand world. Yet, it must be acknowledged that during the course of my endeavor, a misstep occurred. After the conclusion of the second week, when I encountered difficulties with batch rendering, a more prudent approach would have entailed a reassessment and reconfiguration of my plan. However, beset by strain and duress, I persisted relentlessly in my attempts to overcome the rendering obstacle and consequently squandered valuable time. Reflecting upon this experience, were I afforded the opportunity to embark upon this venture anew, I would, given an abundance of time, construct a rudimentary engine myself or alternatively select a more comprehensively documented engine. The elegant rendering of the sand was executed by employing a miniature 1 by 1 image while simultaneously tracking the mouse's position and adroitly generating the corresponding sand particles.

    Plan:
  • Week:1: Research Falling sand game,Download TGA2D,Set up perforce, and get a base game working,
  • Week:2: Add SandWorld, Sand, Sand Type, SandManager.
  • Week:3: Add Grid/Chunks, Threading,ObjectPool.
  • Week:4: 3 days Optimization, 1 days Debugging.
  • Week:5: 4 days Polish/Debugging.

  • Each week Thursday was a debugging day and Friday i toke a step back and looked where i am and where i need to be and adjusted the plan from there so this did not hold for long.
    What actually happened:
  • Week:1: Research Falling sand game,Download TGA2D,Set up perforce, and get a base game working,
  • Week:2: Add SandWorld, Sand, Sand Type, SandManager.
  • Week:3: Add SpriteBatch,Threading,ObjectPool. Had problems with batch rendering.
  • Week:4: 1 days Optimization, 3 days Debugging. Had progress with batch rendering.
  • Week:5: 2 days Polish, 2 days Debugging. Got batch rendering working but it was a little to late. when into crisis management to save what i have and show what i had done.


    Classes i made in the process:
  • Sand.cpp, holds Collider,Sprite,Texture,Position,Velocity,Size,Acceleration,Density,Friction,Type,Name,ID,Gravity .
  • SandManager.cpp, keeps track off all the sand, spawning, removing, anything to do with sand manipulation.
  • SandType.cpp, holds sand type parameters like: Name,ToolTip and texturePath.
  • SandWorld.cpp, centralized control over game.
  • Object Pool.hpp, set up a basic object pool .
  • UI.cpp, handles all UI with help from IMGUI.
  • Utilities.hpp, holds functions for drag and drop.


    SandType:
  • Sand, sinks in water.
  • Water, eats salt.
  • Water Well, water source.
  • Stone, dose not move.
  • Fire, burns stuff.
  • Torch, fire source.
  • Plant, grows if gets water.
  • Oil, burns on contact with fire.
  • Oil Well, oil source.
  • Methane, steam but flammable
  • Eraser, removes other sands.
  • Salt, dissolves in water.
  • Acid, eats most things but all so delude it self in the process.
  • Steam, when fire meets water
  • Lava, a mix of fire and stone