I believe the solution is one of a mathematical nature, and to be quite honest, I'm not so good at anything more complicated than multiplication. So all you Mathematicians and Number Manipulation Wizards out there, I need you!
Lets say there's 3 rows of oranges (19 oranges total), and in the first row there are 4 oranges, in the second row there are 6 oranges, and in the third row there are 9 oranges. What is the mathematical formula which will split them in such a manner? And once that is found, how can that formula become alterable so that any amount of oranges can be put in whatever row you want without spilling the oranges from one row into another? Do you see what I'm saying?
I believe that changing the number which it is spread by (or maybe even spreading by a variable ever changeable number) could have something to do with getting it to work, but I have no clue how to get it all working mathematically, let alone implementing it into the code.
I have MSN messenger, for hotmail ... But I'm probably going to need someone who's heavily into math to help me.
Do you know much about mathematics? I vaguely remember something similar to this problem in an Algebra class when I was in school, but I don't know what the term for those kind of problems is or how they were solved.
Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?
Also take a look at my other Spread Value posts, because they mostly have to do with this problem in my code.
It's a major annoyance, as building levels for a game with the 2.5d coding will take 10x as long if it can't be fixed.
It'll also be easier to messup a level and have to restart making it from scratch because of not knowing where you messed up at.
So, yea ... anyone know of a good Math problem helper site or something?
I'm gonna be googling math sites ... hopefully I can eventually find someone who can help.
GamesterXIII has been trying really hard to help me out, and I am still trying myself, but alas to no avail, as this problem seems to have a fortress of impenetrable, impervious, stone and metal built around it, being mysteriously inscrutable to all in the land, none being capable of gaining entrance to its nearly insurmountable golden bounty of usefulness hiddin within, much resembling Fort Knox and its massive treasure contained therein.
Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?
or something similar. You'd never get anything over 8 for the first two in the last example, but there are other ways to spread it out. You could put 17 in the first one, for instance, which would mean the other two would each have at least one. It depends on whether you want a limit on how high each one can go.
It can't be random OMC, just variable in the sense that if you put a stack of 1 wall over one platforms shadow to form a higher wall
or tower (if you'd rather think of it that way) until you add the green platform on top ...
Then if you put 2 walls in the next column (shadow and platform pairing), and 3 walls in the third column,
(walls being added in the frame editor, not during runtime), I need a way to make the wall instances line up in the columns no matter their number or order of placement.
Right now, the only way that the walls are not misplaced when stacking them (for the above example in this posting) is if you add a wall to the first column, add a wall to the second column, add a wall to the third column, add a wall offscreen (to keep the steady number balance), add a 2nd wall to the second column, add a 2nd wall to the third column, add another wall offscreen to keep first column numerically balanced with the other columns (3 walls 2 are offscreen), add 3rd wall to second column, and finally add the 3rd wall for the third column.
Is anyone getting this yet? ... and what I really need, is a way to set stacks (of any amount of walls) in any column, and still have everything line up correctly. By correctly I mean if I place 3 walls in the editor in the first column only, (but I have 3 columns) they should remain in the first column instead of getting moved over to the other columns, but I still need the x placement code at start of level because it is used throughout other sections of my code.
Hmm, I think I've just thought of a way without much math ... (if it works without ruining the code already in place that is)
Tell me if you think this would work: measure the x distance between wall placements and the platforms' shadow (the column), and if shadow is closer to wall, than the other shadow instances (columns) are, set wall to that closest shadow..... CRAP! THAT WON'T WORK!
That won't work cause it'll mis-interpret which shadow to pick to consider the distance between it and the wall instance!
This problem is insanity itself! What am I to do?
@OMC, YES, I need a variable limitation on each column.
Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?
Sorry ... my brain is fried too ... this is so difficult to explain!
But if I could just set position to the location of a specific instance of an object, I'd be able to avoid all this mess.
Is there some way to do that?
If there is, then that'd make life ALOT easier with all my code.
I'd be flying through it then!
Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?
I'm not sure, but create a hidden counter and increase it every iteration, while setting another counter to the amount of objects and then adding them? Just a thought. If you want something completely different, sorry but I can't understand your explanation...
I'm not sure, but create a hidden counter and increase it every iteration, while setting another counter to the amount of objects and then adding them? Just a thought. If you want something completely different, sorry but I can't understand your explanation...
Lets say there's 3 rows of oranges (19 oranges total), and in the first row there are 4 oranges, in the second row there are 6 oranges, and in the third row there are 9 oranges. What is the mathematical formula which will split them in such a manner?
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.
Lets say there's 3 rows of oranges (19 oranges total), and in the first row there are 4 oranges, in the second row there are 6 oranges, and in the third row there are 9 oranges. What is the mathematical formula which will split them in such a manner?
That's completely ridiculous and not even a formula.
This is what your post amounts to: R1 = 4, R2 = 6, R3 = 9
That's just restating the values we already know. And it's not even funny as a joke.
Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?
What I want to know, is a formula that allows for Variation in Rows, Variation in amount within each seperate row, and Variation in the total of everything ... a balancing act. If one value changes, then they all should change.
Okay, I believe this is the formula for 3 rows: Total = 3(A+B+C) But...
... What is the formula for a variable number of Rows with a variable count of Instances within each Row?
How would I write that mathematically? Is it even possible?
See, if every Instance count within each Row were the same number, then it's easy: Total = RA
But I have no clue what to write for an ever-changing amount of another ever-changing ammount.
Total = R(AV) ??? ..
I think I know the question to ask now ... maybe ..
How can the alterable value of an instance be counted for the amount of instances with that same value?
Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?
"How can the alterable value of an instance be counted for the amount of instances with that same value?"
pick one of object
+ object value x = 1
+ Object Flag 0 is off
set Flag 0 on
add one to counter/value/whatever (which would be number of objects in that row)
If you need to place objects in rows based on their values (4 6 9) I believe you would have to code that manually.
You would need one more line for EACH row you plan to have.
Start of level Spread 1 into value x of oranges
Value X <= 4
set value X to 1
Value X >4 + Value X <=10
set Value X to 2
Value X >10 + Value X <=19
set Value X to 3
Are you planning on adding "oranges" at runtime?
How many are there going to be total?
It is still kind of vague as to what you are trying to do, so sorry if the answers I have given are inaccurate =s.
n/a
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
9th July, 2009 at 08:18:55 -
MBK - You need to give us an example of what you are actually trying to achieve - What do you want displayed on screen? You're assuming that the answer lies with maths but there are undoubtedly multiple ways of solving the problem. There may be a much simpler way to achieve what you want, not involving any maths, but you need to tell us what it is you actually want to do.
Looking at your first example, I just whipped this up:
It is still kind of vague as to what you are trying to do, so sorry if the answers I have given are inaccurate =s.
GamesterXIII, I'm pretty sure that you've solved this problem with your awesome example in the post, "Spread Value Selection: how to get more control"
(I have yet to add it to my own code to make sure it works there though),
*-- BUT I'm still curious about the mathematics behind it all. --*
It seems like what you've managed to do with limited basic math and real time event code interactions is impossible to recreate in a single formula with a nearly unlimited complex mathematical stockpile of numerical persuasion.
So, there's no way to have it act variably with pure mathematics? .. and no way to write it in a formula?
Basic Math + Workaround > Advanced Math + Formula?
Strategic placement with Simple Math troops = Win the battle, while Head on attack with Advanced Math troops = Lose the Battle?
Is there no way to charge straight forward and win the war? Or is guerrilla tactics the only way to obtain victory?
Edit: @Assault Andy, Thank You Andy! ... I just looked at your example (why post on CT Forums when question was here?) .. and it seems to solve the problem as well, but how do I change the values now? Need to be able to change the numbers of oranges in each row (preferably automatically) when I place new instances so that everything will still line up. How do I change the values in the example of yours?
Nevermind, just found it. Gotta change the list values eh? ... ok, now --- How do I change the amount of rows in your example?
Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?
I believe that it might be possible to write a formula for this(?_?), but I also believe it would be way too complex to be worth it - if it were possible.
I don't think my method a workaround since you don't really have to manipulate the code because of an actual flaw in tgf/mmf etc. You just have to code one line in a specific order because of the way the code is run.
It is probably best to stick with well known formulas.
Originally Posted by GamesterXIII K i understand now .
I don't think my method a workaround since you don't really have to manipulate the code because of an actual flaw in tgf/mmf etc. You just have to code one line in a specific order because of the way the code is run.
@GamesterXIII
Yea, you're right, it's a workaround to our flawed mathematics system though if there's no formula for it
It's very good work, whatever ya call it, no doubts about that.
I'm gonna go see if I can figure out how to place it into the 2.5d code now.
@Andy, I can't seem to find any way to change the rows in your example ...
Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?
if you have any trouble adding it just lemme know =p.
n/a
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
10th July, 2009 at 03:30:17 -
MBK - I posted the example on CT forums because it's a reliable place to host files and it might help someone else in the future.
I made the example completely automatic so all you need to do is edit the list file.
If it says:
4
6
9
It will generate rows of 4, 6 and 9 oranges respectively. You simply need to change the values to change the amount of oranges in each row. To add more oranges you simply need to add more rows. EG:
<puts face to palm> ... of course! .. omg ... now I feel even more stupid .. heh ..
@AssaultAndy
Well, Thank You very much indeed Andy!
It works quite nicely and may be just what I need. So far I can't seem to get GamesterXIII's fix to work with my code. I believe it's because of all the spread values that I'm already using, it must just be too much for TGF1 to handle, or most likely I'm screwing something up. Since yours doesn't even use Alt Values or Spreads, hopefully it won't have that problem. Maybe GamesterXIII can get his version working in my code, but I currently can't.
@GamesterXIII
I've tried putting it into my code, and it ALMOST works .. but I must be doing something wrong, because it keeps creating instances and then some of the instances follow with the camera as you scroll, and it also doesn't position them close enough to the top (I've tried playing round with the values, but I'm stumped) ... so, I'm gonna have to ask if you can attempt to figure it out for me.
Guess now I'll try out Andy's method and hope like hell that it behaves with the 2.5d code, I'd be happy as long as one of them works.
Thank You for helping me so much guys. I really do appreciate it.
Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?
Andy, I can't get your example to work with my code either. GamesterXIII's version is closer to what I need because the spacing between shadows can be any distance.
Sadly, I can't get either one working within my 2.5d code, so I'm either gonna have to build the levels the hard way and make a ton of extra instances to keep the balance as I go (quite a pain in the arse), or figure out a third method (a daunting task indeed).
I've been trying for the third method option by using you guy's examples for reference, but I still haven't succeeded.
Could one of you attempt to put it into the 2.5d code for me?
I know that sounds rather like a noob statement an' all, but I've been trying everything, and I still can't get it to work in my code.
Your examples work perfectly on their own, but when adding them into the 2.5d code, weird things happen (like instances following the screen).
If you guys get the time to try putting your examples into the 2.5d coding, please give it a shot.
It'd be nice to know if it's just me or if TGF doesn't like the way the codes mix together.
I'm gonna keep trying for awhile longer, but pretty soon I'm going to need to move on whether I can figure it out or not.
I'd hate to just leave it at that and move on, but I need to get back to adding slopes to the 2.5d project soon.
Btw, I recently added a landing shadow, which is quite nice, cause now you know whether you're above the platform or not, even when you can't see the ground shadow. I should probably add some sort of visual aid to help determine whether ya need to jump toward the background or toward the screen as well. Maybe I'll just add a way to look down so you can see where the ground shadow of the platform is in relation to where the ground shadow of the platform you are currently standing on is. (a type of camera movement)
Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?
Blood of the Ancient One, Seen only as Shadow, Faster than Lightning, Fierce as the Greatest Dragon, Nearly Invisible, Floating in a Dream, Entered through the Demon Door, Destroyer of Evil in a Realm with a Red Sky Scarred, Who could I be ?