Giter VIP home page Giter VIP logo

boids's Introduction

me . blog . projects . status

from life.species import Human
from skills import python, java, javascript, csharp, html, css, other
from datetime import date
from random import choices
from os import getenv

class RyanWalters(Human):
    def __init__(self, username='xevion'):
        self.name = f'Ryan {0} Walters'.format(choices([getenv('MIDDLE_NAME'), 'C', '']))
        self.pronouns = ['he' and 'they'],
        self.description = '''
            A full-stack software engineer navigating their way through the industry.
            With an attention to detail, I enjoy building projects that are elegant, robust, and impactful.
            Although I specialize in Web Development, my skill set is extensive, and I'm confident in my ability to learn anything.
        '''
        self.recent_projects = [
            "https://github.com/acmutsa/Portal",
            "https://github.com/Xevion/rdap",
            "https://github.com/Xevion/grain"
        ]
        self.endpoints = {
            "discord": ".xevion",
            "email": "[email protected]"
        }

boids's People

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

bubdm

boids's Issues

Mouse Controls

Currently most of the UI is controlled through the UI and keyboard shortcuts, exactly no direct mouse interaction exists with the Boids. To increase the overall functionality and control over the application, the ability to click to interact with Boids themselves should be added.

This is a pretty inclusive issue describing all mouse functionality I want to add to the application.

  • Click (Left, Right, Middle, Alt/Shift/Ctrl)
    • Temporarily scare or attract Boids
      • Closely related to #8
    • Spawn individual Boids
    • Spawn groups (flocks) of Boids at once
  • Click and Drag
    • Spawn individual boids as you drag
    • Draw points at which a Flock will be generated off of
      • Need to be careful as generation could add hundreds of boids with very few points.
      • Integrate with #12.
  • Hover
    • Scare or Attract Boids (#9)

This system should be default to a very organic and user friendly configuration, but be completely configurable through the UI via simple dropdowns. These systems should be modular and easy to work with, allowing the mouse input handling scripts to interface with the Boid Controller script very smoothly.

Boid Twitch/Forcefield Fix

This is most likely one of those problems that may never go away without deep investigation or violent changes to the code - or may go away with just a few lines of code.

Boids tend to bounce of other boids much too violently, they 'twitch' and hit what one could call invisible 'force fields' on other boids. Sometimes the separation range used is so small that the line between a simple physics collision and an actual separation rule is largely gone.

This fix could improve the quality of the base mechanism of the whole application. A method to 'smooth' Boid movements is needed.

Help/Tutorial Menu

Currently, the Boids flocking algorithm may be difficult to understand. The repository should shift it's weight into making sure new users can understand how the application works and how the algorithm works, too.

A tutorial menu should be made. It should be pre-prepared so that it will perform the same way most of the time. It should highlight different features of the adjustments menu, explain the concept of Boids and the three rules (Separation, Alignment, Cohesion), how Biases work, perhaps using pseudocode to do so. The tutorial should be offered on initial startup, and then on from another accessible button.

Contextual Color Shaders

Custom shaders applied to individual Boids that color their mesh based on contextual things like their Velocity (or Angle).

For example, a custom shader that colors individual Boids based on their angle in a linear gradient. A shader like this would make individual 'flocks' much easier to see, as flocks would have similar colors different from other flocks. Colliding flocks may be red and green before they collided, unleashing a sporadic wave of yellow with tendrils of red and green as they struggled to get past.

A shader like this would benefit from #4 as the twitching would likely cause noticeable flickering as they shifted back and forth and 'bounced' off each other.
This is definitely a experimental feature, but would likely be one of the most 'flashy' should I get it to work.

Add Assets to Repository

The assets in use in my project are currently not shown anywhere. I need to figure out how to add them to the repository without uploading all of the code/docs etc.

Perhaps there is some kind of manifest file I could edit for assets, like there is for packages.

Poisson Disc Placement

My work with the Poisson Disc algorithm could yield interesting results. I'm hoping that I could utilize it in this project.

Some ideas:

  • Placement at the beginning of the project
    • This may be overridden if I decide to have Boids 'fly-in' instead. The effect wouldn't be as noticeable as the Poisson Disc effect would most likely dissolve before
  • Multi-boid (flock) placement on click

Implementations like this could also benefit from running alignment operations a couple times rather than spawning the Boids with completely random angles.

LineRenderer Materials and Better Redraw

Currently LineRenderers are stored in Game Objects which are destroyed and recreated as needed. While in terms of performance, it's perfectly fine, I'm all about doing it 'correctly' and think the better course of action would be to store them in a LineRenderer array and reference them by index.

A simple array of LineRenderers with hard coded index manipulation should be fine. For example, the Group Range LineRenderer could be index 0, Separation Range index 1, FOV Cone index 2 and so on for anything else.

This would also get rid of the disgusting string childName argument I've been forced to include in all the Draw functions.

And finally, materials should be added to the LineRenderer. I'm not sure how or what they should be, but likely something white or blue, perhaps somewhat transparent. A shader might be an interesting concept, allowing overlapping Boids to showup behind the Lines.

This issue aligns with #7, focusing on code cleanup and optimization.

Dynamic Boundary Calculations

The Boid code should be revised to allow for dynamic specification of 'Boundaries'.
Boundaries are spaces where Boids should avoid or inversely, drawn into. Additionally, the code should support more than one boundary - with different options like the forces that are applied to Boids, the range, the bias, the type (draw in/out) and anything else needed.

This could create some very amusing and fun behaviour:

  • Boundaries around UI elements pushing Boids
  • Custom boundaries for the user

Fix "Hide Boids on Title Screen" Setting to use alpha-based tweens

I was able to get Tweens to modify the BoidController's alpha successfully and LeanTween was able to modify it properly, but the lowest available opacity seemed to only remove color from the Boid objects - they turned gray, two shades darker than the background.

Why this is occurring is still a mystery to me, but I should try testing new materials or shaders (perhaps a fix could be discovered while developing custom shaders later on) in order to fix this properly. The only other culprit would be the light, but it's probably not casting shadows as the light's shadow option is turned off.

Time Controls

Methods to adjust the speed of the game would likely help greatly. It's possible that a global bias or velocity effect multiplier would have the same effect, but I'm hoping that some kind of trick or easy logical operation is available to me.

The basic effect of this feature would be an adjustable time scaling, boids would move and react slower while still retaining their smooth movements (although the UI would be unaffected). This could be done through a slider or through mouse scrolling (see #14).

Screenshot Function

Adding in screenshot function might be a good idea.
In particular, adding two different buttons, one for capturing the entire app, and another for capturing just the Boids would be a good idea. I'm not sure how this would be done, but it might be possible using whatever screenshot functions available. If not, hiding the entire UI during that tick before restoring it would be the only way. This might be very difficult/annoying to implement as more and more UI elements appear in the application.

Add Exit Button

Currently the app has to be closed through less user friendly methods - a proper exit button is required.

Boid Code Cleanup/Documentation

Most of the code pertaining directly to the Boids is a little messy and undocumented. A dedicated effort to clean it up and document is in order.

Use MeshRenderer instead of LineRenderer

I think overhauling the LineRenderer based code to use MeshRenderer instead would be a good addition. Currently, the lines drawn are too jarring and would probably look better as a set of transparent circles. Additionally, the Arc's lines returning to the boid do not meet perfectly and have very jarring seams. A mesh would probably fix these problems.

Implementing this would be a bit of work, but it would be a chore and nothing more, as most of the code should be perfected with LineRenderer and the Mesh Renderer works in a similar way, really.

Boids follow/avoid cursor

Just that. Boids should follow or avoid the cursor, treating it like it's own Boid in reference to separation/cohesion/boundary rules.

Additionally, the code adding this behavior should be dynamic enough to allow click behavior for said boids, attracting or 'scaring' boids from points that the user clicks on. Doing so allows a lot more user interaction.

Dynamic Camera Reloading

Boundary rules, Edge wrapping and possibly some other Boid related operations rely on the Camera's viewport size/position, but these values are only calculated once at the start of the application.
In order to support things like a resizable space, resolution resizing, or moving/zooming/following behavior, the camera must signal the application to recalculate these values when it changes.
This should be pretty simple and won't require any big new systems for now.

Boid Configuration Loading/Saving

The ability to save/load configurations for the Boid Controller would be nice.
The likely format for storing it would be in raw JSON, though I'm not sure exactly where the data would be stored when it comes to Unity.

I don't believe there are any ways to easily load all of the attributes instantly, so I assume it'll just be a bunch of setter statements in a row.

Additionally, a UI will have to be developed for loading and saving them, as well as specifying/showing the different configurations available.

Some possible solutions:

  • Limited Slot-based UI
    • Small number of static slots that can be selected, loaded and saved. Soft-deletion which doesn't remove the slot, but just clears the configuration file.
    • Would be the most limited, but also least prone to buggyness. Not too hard on User Experience, but may make default configurations more annoying to use.
  • Add/Remove List Based UI
    • A scrollable list of configuration files in a specific folder with "Load", "Save" and "Delete" buttons available.
    • Similar to Slot-based UI, but save names reflect filenames, but may incur some strange errors due to it's openness.
    • Perhaps a large limit would be a good idea, like 25 or 100 configurations.
  • Pick File Dialog Based UI
    • Users would click on a Choose Configuration button and a file selection dialog box would open, asking them to choose a configuration file.
    • Would be the easiest to implement, most likely, but also the most chaotic implementation, poor user experience.

Build Time Markers

RimWorld (also built in Unity) has markers for the application build date. It includes a version, as well as the build date. Implementing a marker in the About screen might be an interesting feature.

Screenshot
image

Doing so might require some testing with compile time scripts to make a marker. The ideal method would be a simple file with the associated version and build epoch time.
I found this thread, it may offer some working examples.

This may also exhibit some new ideas for saving files for Unity to use at runtime, hooking in with #11's configuration files. I would also like to use this moment to start tracking proper (#.#.#) semantic versions with an about file.

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.