Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

HI! Sorry about the late increadibally late reply. i saw the first post of this topic when it came out but i decided to wait until you finished the the tf speed stuff. however i realised that i wasn't subscribed to this topic. so i never noticed the new replies (you see i thought that you are automatically subscribed to any topic created on your own game. but i was wrong). i only noticed them like 2 days ago.

Why am i replying now instead of 2 days ago? because i realised that i didn't have many comments on your code until i properly implemented it on my own. i already had the TF priority code working but i needed to implement the TF speed functions. i still don't have the Rank system done but i feel i should respond first. i'm going to share with you my written code first as i feel it's the easiest way to comment on your code and then respond to everything else in a new reply. This is also my revenge for making me look through octave code for hours, but in seriousness i hope you can understand it.


The main Thing with the first class is that i wanted to generalise any priority stuff for every enemy. so i don't have to hard code in new values every time i want to add a new enemy. keep in mind that even though english is my only language i am bad at it, so some things will probably be misspelled. 

public class Transformation {

    public Enimies enemy;

    //this value will represent the total transformation across all limbs.

    public float overall;

    //get;private set; basically means this value is read only outside of this class.

    public float priority { get; private set; } = 0;

    public List<float[]> decay { get; private set; } = new List<float[]>();

    

    public Limb transforming;

    public List<Limb> transformed = new List<Limb>();

    //you can think of Static values as "global" values that apply to every transformation 

    //this is our beginning setup, setting every value to our medium of 3.5f

    public static List<float> prevtransformations = new List<float>{3.5f,3.5f,3.5f,3.5f,3.5f,3.5f,3.5f,3.5f,3.5f,3.5f};

    public static List<Transformation> alltransformations { get; private set; } = new List<Transformation>();

    public static float allprioritys { get; private set; } = 0f;

    public Transformation(Enimies newenemy) {

        enemy= newenemy;

        alltransformations.Add(this);

    }

    public static void sortpriorities() {

        //This sorts every transformation by their prority. in the case of a tie it will break with the dangerlevel

        //usefull because we can look at the first value to see which has the highest prority. 

        alltransformations.Sort((b,a) => {

            

            return (a.priority*100+a.enemy.dangerlevel).CompareTo(b.priority * 100 + b.enemy.dangerlevel);

        });

    }

    public void changepriority(float amounttoadd,float amounttoreduce=0,bool decayval=true,float decayspeed=1) {

        //We will force a range of 0 to 700. in your code i noitced that the range is set from 0 to 100. but i also see that you added +200 to the value

        //i didn't see a way that you delt with it so im clamping it here. 

        float val= Mathf.Clamp(priority + amounttoadd, 0, 700);

        //if we want prorities to decay based on turn i needed a way to keep track of multiple diffrent sources of decay. so we'll add it to a list

        if(decayval)

            decay.Add(new float[]{val-priority,decayspeed});

        //usefull to keep track of the total prority of every enemy

        allprioritys += val - priority;

        priority = val;

       

        if (amounttoreduce == 0)

            return;

       //if we died we want to reduce every enemy prority so this code deals with that 

        foreach(Transformation transformation in alltransformations) {

            if (transformation == this)

                continue;

        //we'll resursavily call this funciton to change every other enemy prority 

            transformation.changepriority(amounttoreduce*-1, 0,decayval,decayspeed*(amounttoreduce/amounttoadd));

        }

    }

    public static void decayall() {

        //we want to apply all our decay values once per turn. 

        foreach (Transformation transformation in alltransformations) {

            for(int j=0;j<transformation.decay.Count;j++) {

                float[] thisdecay = transformation.decay[j];

                //our decay may be negitive so we want to deal with each case seperatily

                //fun fact: a decay speed that is negitive will never go away. 

                //So if i ever implement that wolfs bane weapon we can give you a constant wolf priority. 

                if (thisdecay[0] > 0) {

                    transformation.changepriority(thisdecay[1] * -1, 0, false);

                    thisdecay[0] -= thisdecay[1];

                    if (thisdecay[0] < 0) {

                        transformation.decay.RemoveAt(j);

                        j--;

                    }

                }

                else {

                    transformation.changepriority(thisdecay[1] * -1, 0, false);

                    thisdecay[0] += thisdecay[1];

                    if (thisdecay[0] > 0) {

                        transformation.decay.RemoveAt(j);

                        j--;

                    }

                }

            }

        }

        }

}

Here is the function that determines the TFspeed without the ranking. 

private float calculatetransformationspeed(Transformation trans) {

        //This is all saved prev transfortation speed values. we are getting the count just incase i want to change how many total values we are saving

        int count = Transformation.prevtransformations.Count;

        

        //Unity to my knowladge doesn't have a equivanlet of the sum function, so we need to make it with a for loop

        //we define all our varables that will use it here so we only have to loop through the prevtransformation array once

        float MoPV = 0;

        float D = 0;

        float d = 0;

        foreach (float number in Transformation.prevtransformations) {

            MoPV += number;

            D += Mathf.Pow(number - 3.5f, 2);

            d += number - 3.5f;

        }

        MoPV /= count;

        float SDoPV = Mathf.Sqrt(D / count) - Mathf.Pow(d / count, 2);

        float HpDiff = 2 - (2 * hp / hpmax);

        float MpDiff = 2 - (2 * mp / mpmax);

        float HungerDiff = 3 - (3.5f * Food_system.instance.hunger / Food_system.instance.maxhunger);

        float FHB = (HungerDiff > 0) ? HungerDiff * -1 : 0;

        HungerDiff*=(HungerDiff > 0) ? 0:1;

        float Pp;

        if (trans.priority / 700 > 0.95f)

            Pp = 5;

        else if (trans.priority / 700 > 0.90f)

            Pp = 4;

        else if (trans.priority / 700 > 0.80f)

            Pp = 3;

        else if (trans.priority / 700 > 0.60f)

            Pp = 1.5f;

        else if (trans.priority / 700 > 0.40f)

            Pp = .5f;

        else

            Pp = 0;

        //I don't have reduce curse stuff set up just yet so we'll skip it Same with Ss.

        //Random.value just gets a random value between 0 and 1

        float rand = Random.value - 0.5f;

        //i think this is the most important change. we wont save the effect of the avrage value to our saved values

        //if we did the value will drift towerds positive or negitive infinity. 

        float Tfspeed = ((Mathf.Sqrt(Mathf.Pow(HpDiff,2)+Mathf.Pow(MpDiff,2)+Mathf.Pow(Pp,2)+Mathf.Pow(HungerDiff,2))+rand)/2)-FHB;

        //we'll remove the first value and add to the end of the array to save it 

        Transformation.prevtransformations.RemoveAt(0);

        Transformation.prevtransformations.Add(Tfspeed);

        Tfspeed += MoPV + (SDoPV * -0.25f);

        print(Tfspeed);

        return Tfspeed;

    }

As for the other things. The body part system is being reworked as well and was thing i was working on when before i noticed these replies. Alot of the decisions  on it was made because of the old armor system. because armor used to only affect one body part having more of them would make each piece of armor more worthless. with the new coverage system we can experiment a lot more with new body parts. though i will probably keep the human total at 10 body parts. 

Unless you are up for the coding challenge all this is more than enough. This has honestly been a huge help. and yeah i'll probably end up tweaking the values a bunch until the end of time. so a simulation would probably get out of date.  and i have ways of testing these values.  

Again thank you for this! i can easily expand this to incorporate things like the environmental system and anything else i decide will influence transformation speed. something that i kinda been needing. 

No these opinions haven't been stressing me out at all. i think about this game constantly as it and i'm always looking to improve it. also don't worry about annoying me at all i always look forward to feedback on my game, as otherwise i feel like developing to no one. hell i directly asked for this. I'm glad that you like my game enough to tell me how to improve it.

But if you want to just have a conversation either game related or non game related. i have a discord. (I should probably make a server for this game but i haven't yet.). but you can DM me if you want to. Username Pathfinder @path_finder1

Keep in mind that i am not the most social person in the world and probably won't DM you first. but i'll gladly hold a conversation.

But either way Thank you so much for this! and i hope you have a nice day.

Ha! Yeah, I did warn you that, while technically C++, Matlab/Octave format, to my knowledge is pretty cursed and bizarre compared to most programing languages, due to the fact they are meant to be calculators first, and not... you know, things to build games with; and also, if my suspicions are correct, I think their formats have barely changed since THE EARLY 1990's!!! They have just been expanded massively over time. I mean, yeah, I am really glad I had to learn this for college, but, yeah, I dunno how helpful it will be in learning any other sort of programming. Over a week ago, when you said "Oh, sure, I think I will be able to figure out how to read Octave code easy peasy!", I genuinely did a double take. So here we are now, me just having to assume that your programming ability is  more sophisticated than mine, and just taking a blind guess that 'float' must be a data type akin to 'byte' and 'int'. ah well.

Anyway, the thing I am most curious about is what you actually think, on a purely objective level, about my suggestions for radically reworking priority, and using stuff like current HP and MP levels as factors for the TF speed calculations? I felt like the way the priority system worked currently with some enemies always having final say was actually at odds with the game's mechanics and overall spirit, which is why I wanted to make it much more about "What are you being exposed to currently? What is currently the thing you are having the most difficulty dealing with? Do you have a cursed item? If so, then they should have their way with you, even if they are 'weaker' than the other enemies." I think another justification is this: I don't know what your zoo looks like, but I have like three-five mice, bunnies, kobolds, and bats each, and at least five wolves. So far, so ok. And then... I have about twenty cats and it took about three hours of deliberate grinding to get a single snake. I still have a single snake, because wolves are just more omnipresent than snakes at all times. and cats just have zero chill in general and are really good at overwriting bunnies, mice, and kobolds. Cats also have zero chill, and have zero chill. Did I mention that cat's have zero chill and are impossible to deal with if you have no equipment?

I can say that with the priority, what I was trying to do, because this is Octave were talking about that is all about being a calculator first, was actually have it contain 1000 data points evenly distributed across a range from 0 to 100.  In layman's terms, in my code Mouse_priority(555) refers to the data point contained at the 555'th point on the vector... being 55.5. The actual effect of this is that I was originally going to model it as a percent so "+200 to Mouse_priority(555)" would mean that the priority of mice would change from the point (555) or 55.5% to (755), or 75.5%. So I don't think you would be surprised to learn that about three hours in I released, "You know what? That's dumb. Why did I make a number only to divide it by ten invisibly? I should fix that... But i'm already this far and i'm too lazy, so it shall stay." So, all I actually did was remove a comment about the percent and just ignored the fact I did it like that entirely. 

And at the end of the day, I did want to actually apply all my college training onto SOMETHING, which I admit is half the reason I made this so intricate, beyond just thinking it would make for a very dynamic system.

haha, yeah it just occurred to me that for someone who isn't familiar with C like programming languages my code would look like a foreign language. especially when im messing around with OOP stuff in my implantation.  your right that a float is a data type and basically means a number with a decimal. But yeah reading octave was still weird and not the most intuitive thing. but guessing and hoping that i am right usually works so that's what i went with. but like i said the fundamentals are the same. adding 2 numbers usually adds both values together. except apparently not with the vectors.

For my General opinion on the system i touched on it in my second post (i have a feeling you didn't see it, its posted as a reply to my own post. if you did disregard me entirely). but to reiterate i like the system in concept. i still need to implement the full system so i play around with the values to make sure it feels right but having multiple different factors affecting the transformation speed is neat. i hope that for player communication this system makes sense, hopefully we can just say (your general well being is affecting your transformation speed). but thats my only real concern with the system. again i might tweak the values a bunch but that is kinda my job. I've been wanting a more complicated TF system which is why i constantly say that i'll rework it, but never finding a good way to do it. so this gave me good motivation to change it.

Also i don't think you mentioned it but how did you feel about the cats and their level of chill? yeah fair enough i will see about toning them down. 

About the octave data point thing. that's weird. i suppose that makes sense but i feel that would be strange if you wanted to add 2 data sets together. but either way this mostly speaks to my unfamiliarity to this language.

But yeah, i am very glad that you wrote this. both for the help and seeing someone who seems generally interested in my game is pretty cool. So yeah thank you!  

First, I will try to keep this brief because I do have other things that I need to do today.

second, you probably don't have to respond to this. You are still welcome too if you want, of course.

So, I have gotten a bit more opportunity to play your game since the last patch, where you fixed the whole "You forgot to tell individual body parts to start transforming again." Well, I can confirm, it is fixed! So... now that your game is working as intended, I can confirm that a new problem has arisen, one that I am unsurprised to find. 

Now that your body parts are always transforming again,  the game is now way too difficult. You can spend all of your MP available on using reduce curse, and it will barely buy you any time at all. I am fine with a more difficult experience, even if high difficulty games and roguelikes are not my specialty, but once you start transforming it is pretty much impossible to not lose eventually.

Don't get me wrong.

I understand that this is the point of the game, I get that, I am just finding it really difficult to even stand a chance. 

So on one hand, I think the big Body part, priority, and TF speed system overhaul is coming at the perfect time to help mitigate that. hopefully, the end result of this is that the game is a bit easier, especially on the lower floors.

The minor suggestions that I have are this: You have the logic that has your transformation "infect" adjacent body parts, presumably as the first reaches higher overall values. You also, understandably, tell a body part to stop transforming once it is fully changed. Well, because I am pretty sure this is not the case already; What if similar logic was applied when a body part's level of transformation was dropped to 0? I think how the system currently works is that for a body part that has been infected with the transformation, the transformation will continue to progress for that body part even if it's own transformation has been reduced to zero, as long as your over all transformation has not been "cured". In  other words, while the game will infect you a body part at a time, it will only stop transforming you if you have been completely cured. What about allowing individual body parts to be cured? If you manage to completely cure a body part even if the overall transformation has not, that body part will need to get reinfected in order to progress again? I think cursed equipment in particular could make excellent use of this, to further the idea that they are the source of your current transformation, and that you are trying to contain their influence.

Next, I think you could consider having the game's intended difficulty paced out over a longer period of time. I think what you could do is have size of the next floor increase less than it currently does, and similarly have the enemy spawn odds spread out a bit more as well: like, mice and bunnies spawn on a couple more floors, cats can't spawn on the first floor but have a low chance of spawning even on higher floors, kobolds too, make it so that past floor six you have more to engage with beyond just bats and wolves. And, I think the first couple floors could be just a bit easier to survive in in-general.

As for cat's themselves, I really don't want to nerf them too much, but, they really are the cuase of 95% of game overs. So, I think they could be made like, a lot more rare on the first floor, and have their attack dropped by one or two points. I still think they should be threatening, but for an enemy that is basically the most common cuase of death in this game due to how far away they can see you and the fact they will never leave you alone.