Jump to content
Banner by ~ Ice Princess Silky

The WPCC Lounge


PinkieShadow

Recommended Posts

15 minutes ago, CypherHoof said:

Glimmy can ALWAYS boop a Sunny, she is one of the most magically gifted unicorns in Equestria :)

Little moments of silliness puts a smile on my face; perhaps Glimmy is offering some Sunny-coloured balloons over to Sunny.

On the other hand, perhaps it's feasible to port my JS game over to C#, but the ultra-long-term goal is to evolve it beyond its incremental game status.

On the other other hand, I found a really big Minecraft modpack.

Link to comment
Share on other sites

2 hours ago, Ganaram Inukshuk said:

Little moments of silliness puts a smile on my face; perhaps Glimmy is offering some Sunny-coloured balloons over to Sunny. 

Now I have this weird scene in my head where Sunset comes to Equestria and both she and Sunburst argue about who gets the nickname "sunny" from GlimGlam....

Link to comment
Share on other sites

9 hours ago, CypherHoof said:

Now I have this weird scene in my head where Sunset comes to Equestria and both she and Sunburst argue about who gets the nickname "sunny" from GlimGlam....

Worse: they have to share that nickname with a sun conure also named Sunny.

Link to comment
Share on other sites

15 minutes ago, Olly said:

God-King Xerxes

I think you said that before.

Also, for no good reason, Princess Applejack.

Also, Pseudo-Princess Gemmy, but she has those red and amber lights that big trucks usually have.

Link to comment
Share on other sites

On 6/18/2019 at 6:47 AM, CypherHoof said:

Would she have to share the crown with Big Mac's dream form? :)

Well, now I dreamt that all the princesses were kidnapped or something. Now where have I heard that before...?

Link to comment
Share on other sites

7 minutes ago, Ganaram Inukshuk said:

Well, now I dreamt that all the princesses were kidnapped or something. Now where have I heard that before...?

Pretty much once per season? I know they gave an excuse for that in S9, but they ARE pretty useless in a fight.

Link to comment
Share on other sites

40 minutes ago, CypherHoof said:

So finish it then? Will never get done if you don't work on it...

"...Hi, Sunburst."

mlpfim_glimmy_float.thumb.png.1e632ba8b8184bb0b15166baa6dadc62.png

(I was literally one detail from finishing, so I finished it. No background, no problem.)

Link to comment
Share on other sites

Oh my goodness, I can't believe this worked:

// This is a counter whose range is [0, some_arbitrary_max]
// Setting the max really high mimics a range of [0, infinity); this is also the default
// This can be used for all sorts of applications, including a healthbar
public class Counter {

    private int _count;
    private int _max;

    // Constructor with a preset max
    public Counter(int presetMax) {
        Max = presetMax;
        _count = 0;
    }

    // Default constructor
    public Counter() {
        _max = int.MaxValue;
        _count = 0;
    }

    // Increment the count by an arbitrary value; decrement using a negative value
    public void IncrementCount(int amt) {
        int newCount = _count + amt;
        if (newCount < 0) _count = 0;
        else if (newCount > _max) _count = _max;
        else _count = newCount;
    }

    // Additional functions for zeroing or maxing out the counter
    public void ZeroOutCount() { Count = 0;   }
    public void MaxOutCount()  { Count = Max; }

    // Increment the max by an arbitrary value; decrement using a negative value
    // If the max ever becomes less than the count, the count should be reassigned
    // to be the same as the max; this ensures the count stays within [0, max]
    public void IncrementMax(int amt) {
        if (_max + amt < 0) _count = 0;
        else _max += amt;
        if (_max <= _count) _count = _max;
    }

    // Setter-getter for the max; this can also force the count to be any value, but
    // will readjust the count if the max falls below the count to keep the count within
    // the range [0, max]
    public int Max {
        set {
            if (value >= 0) _max = value;
            if (_max < _count) _count = _max;
        }
        get { return _max; }
    }

    // Setter-getter for the count; this can also force the count to be any value
    public int Count {
        set { if (value >= 0) _count = value; }
        get { return _count; }
    }
          
// This is the same as the regular counter but instead of having a count
// within the range [0, max], there are two counts (count1 and count2) such that
// 0 >= count1 >= count2 >= max; since this class encapsulates two instances of
// a counter, any and all calculations are handled by the individual counters
public class Bicounter {

    Counter _ctr2;       // Effective range of [0, max]
    Counter _ctr1;       // Effective range of [0, ctr2.Count]

    public Bicounter(int presetMax) {
        _ctr2 = new Counter(presetMax);
        _ctr1 = new Counter(_ctr2.Count);
    }

    public Bicounter() {
        _ctr2 = new Counter();
        _ctr1 = new Counter(_ctr2.Count);
    }

    public void IncrementCount1(int amt) {
        _ctr1.IncrementCount(amt);
    }

    public void IncrementCount2(int amt) {
        _ctr2.IncrementCount(amt);
        _ctr1.Max = _ctr2.Count;
    }

    public void ZeroOutCount() {
        _ctr2.ZeroOutCount();
        _ctr1.ZeroOutCount();
    }

    public void MaxOutCount() {
        _ctr2.MaxOutCount();
        _ctr1.Max = _ctr2.Max;
        _ctr1.MaxOutCount();
    }

    public int Max {
        set { _ctr2.Max = value; }
        get { return _ctr2.Max; }
    }

    public int Count2 {
        set { _ctr2.Count = value; _ctr1.Max = _ctr2.Count; }
        get { return _ctr2.Count; }
    }

    public int Count1 {
        set { _ctr1.Count = value; }
        get { return _ctr1.Count; }
    }
}

I may need more tests, but this is the healthbar-inside-of-a-healthbar thing I was talking about a few weeks ago such that 0 >= count_1 >= count_2 >= max, and I achieved it by encapsulating two separate counters inside of a bicounter class.

No, I'm not gonna think about making a tricounter or an ncounter; even though the code can be generalised, I don't have a use for anything beyond a bicounter. No, I have no idea how this would be done using ECS since the counter is an overly generalized healthbar. I can't justify using Unity's data oriented tech stack when I have a fairly puny project where everything would be represented by a UI.

If this was a healthbar, then the counter works fine. However, I have a situation where I may need the bicounter instead; EG, instead of distinguishing between occupied buildings and unoccupied buildings, I have to distinguish between unused plots of land, plots of land with an unoccupied building, and plots of land with an occupied building.

Now that I think about it, a bicounter may not be needed if a plot of land can contain more than one building; instead, it'd have to be two separate counters, one for used and unused plots of land, with a means of getting the number of individual buildings, and another for occupied and unoccupied buildings.

  • Brohoof 1
Link to comment
Share on other sites

1 hour ago, Ganaram Inukshuk said:

I just drove 200 miles today.

Now I feel like I wanna sleep for 200 years.

So you would drive one hundred miles, and you would drive one hundred more?

Link to comment
Share on other sites

On 6/28/2019 at 9:44 AM, Ganaram Inukshuk said:

No joke, but that was going through my head at one point.

Well, that's gotta make the drive more hellish. should have tried singing the smile song instead :)

Link to comment
Share on other sites

3 hours ago, CypherHoof said:

Well, that's gotta make the drive more hellish. should have tried singing the smile song instead :)

Driving's already tiresome if I have to drive more than 120 miles in one day.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Join the herd!

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...