2 registered members (OptimusPrime, AndrewAMD),
14,580
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: minv don't work correct
[Re: HeelX]
#391691
01/15/12 00:46
01/15/12 00:46
|
Joined: Jun 2004
Posts: 2,234 Wisconsin USA
FoxHound
Expert
|
Expert
Joined: Jun 2004
Posts: 2,234
Wisconsin USA
|
There is no logical reason to call someone a beginner when responding to their post unless that person asks what level they are perceived at.
--------------------- There is no signature here.
QUIT LOOKING FOR ONE!
|
|
|
Re: minv don't work correct
[Re: FoxHound]
#391694
01/15/12 02:17
01/15/12 02:17
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
The fact that var 22.6 and constant 22.6 are converted to different floats seems odd, considering neither var nor constant form have any ambiguity with this many digits. Also, since neither var nor other forms of fixed-point math are native to C, "one of the first things to learn in C courses" is not intuitively applicable. It's also not a reasonable expectation to have of anyone here, since this is the Lite-C forum, and not only are they different, but the Lite-C documentation is usually sufficient for Lite-C. Whether or not someone's a beginner in that context has nothing to do with this question. The var 22.6 is always slightly less than the float 22.6 because some decimals are cut off. While in a general sense you are correct about the problem, this sentence appears incorrect to me. As 22.6 fits well within the precision of a var, and with this small a number a float has much more precision than a var, no decimal places are being cut off. Rather, they're being approximated differently. Again, I find that peculiar, but I guess there's a good reason for it -- perhaps an on-the-fly conversion is sloppily done while a conversion performed during compilation can take more time and is thus performed differently. I'd love a knowledgeable explanation, minus the patronising, please. Finally, @jcl:
As fun as it is to play "Who can figure out this guy's problem?", I think this is either a "blame the manual" situation or a bug, and does not belong in this forum. The documentation doesn't address this issue appropriately -- where it says that constants with decimal points are treated as floats, it also says that floats are reliably accurate to about 6 decimal places, so preparation for this issue is not a reasonable expectation for any Lite-C programmer. -- retracted. The manual is clear in "Comparisons" about not using the equivalence test for any non-integer variables, and while this isn't done directly, it's reasonable to say it's the same issue.
Last edited by JibbSmart; 01/15/12 02:48.
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
Re: minv don't work correct
[Re: JibbSmart]
#391698
01/15/12 04:15
01/15/12 04:15
|
Joined: Jan 2002
Posts: 4,225 Germany / Essen
Uhrwerk
Expert
|
Expert
Joined: Jan 2002
Posts: 4,225
Germany / Essen
|
As 22.6 fits well within the precision of a var That is not the case and the root of the problem here. The closest you can get to 22.6 with a 22.10 fixed point type (i.e. var) is 22.599609375, that is in binary form 10110.1001100110. (Calculated very fast on a piece of paper, may not be precise) But 22.6 fits very well within a float, resulting in binary form to 01000001101101001100110011001101 or in a human readable form it is 2^4 * 1.4125. In general if you have a number in decimal format with only few after decimal places you cannot draw any conclusions on the after decimal places of the binary representation of that number in fixed format.
while(gv_dist<22.6){
gv_dist=minv(gv_dist+time_step, 22.6);
}
If you have a look at the body of the loop 22.6 is interpreted as a float constant, hence it has to be casted to fixed so that minv can accept is as a parameter. In this conversion the float constant looses precision and becomes 22.599609375. So the maximum minv can now return and the maximum gv_dist can reach is exactly that number, 22.599609375. Hence the comparison in the while loops condition can never become true and the loop will never terminate.
Always learn from history, to be sure you make the same mistakes again...
|
|
|
Re: minv don't work correct
[Re: Uhrwerk]
#391705
01/15/12 07:59
01/15/12 07:59
|
mercuryus
OP
Unregistered
|
mercuryus
OP
Unregistered
|
*hahaha*The time of "An excellent tool to quickly proto...Dobb's Journal) meight be gone since lite-c! The new slogan of this toolset seems to be "An old-fashioned (still DX9, only windows plattform*1) toolset for C/C++ programmer - with a lot of limitations, bugs and a sketchy documentation"@JCL: you have to understand GS is a toolset for beginners. Just a few projects (over years) with nice graphics and easy programming become professional with GS. The major number of projects get stuck or are just VERY simple games (like mine). I never would choose GS for a big project (there are much better/all-embracing engines available on the market). There are too many problems/restrictions with GS for a RAD-toolkit you advertise it. Even it's not a bug (var<22.6) and a trained c programmer can see this instantly, your main audience/customers are BEGINNERS (and thay don't need to be deride by the producer of this "engine" - not just in this thread). I know you love your little old-fashioned engine project and you definitly think everyone else (except your //apple-polisher// *put your name here*)) having troubles with it - is an idiot. But i'm shure you are on the wrong way with your behaviour and you're too blind to deliberate your own unfair practices... so ban me for the affronts i made or just for you pleasure - apathetically for me. *1) why should i use open-gl or a wrapper with GS (and get even more problems)?mercuryus out PS: for a better understanding, read this thread from my first post (and consider: i found a problem and extra wrote an example script to ask the producer (Forum bugs))
Last edited by mercuryus; 01/15/12 09:30.
|
|
|
Re: minv don't work correct
[Re: ]
#391710
01/15/12 09:28
01/15/12 09:28
|
Joined: Jul 2001
Posts: 6,904
HeelX
Senior Expert
|
Senior Expert
Joined: Jul 2001
Posts: 6,904
|
And still I don't get it why this thread became so. Mercuryus, you got competent answers by Superku and Petra, why do you now attack the developers of the engine now? You could attack me for my attempt to nicely point out some arguments against Pappenheimer reasoning, and that would be perfectly fine. If you have some bad feelings about the engine either make a decent posts in the rant forum or keep it yourself, but don't act silly. I think it is kinda unfair to blame a developer for switching to a better programming language for the sake of new powers; and that is what most users asked at that time, or better: they complained about the lacks of C-Script.
Last edited by HeelX; 01/15/12 09:28.
|
|
|
Re: minv don't work correct
[Re: HeelX]
#391716
01/15/12 10:36
01/15/12 10:36
|
Joined: Jul 2007
Posts: 620 Turkey, Izmir
Emre
User
|
User
Joined: Jul 2007
Posts: 620
Turkey, Izmir
|
As far as i understand, mercuryus thought that Jcl had humiliated him with that post.. @Mercuryus; Jcl is a businessman. I think he doesn't want to offends any clients. I think there is a misunderstanding.
|
|
|
Re: minv don't work correct
[Re: Emre]
#391721
01/15/12 11:38
01/15/12 11:38
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
Woah, everyone, hold on a second. This thread was perfectly fine, Mercuryus asked, JCL gave a funny answer and then two competent answers arised. Nothing to be offended of, not a single bit. Mercuryus, you are treated by JCL like all other members here, he has done this several times and I remember that he did the same thing to me once. Then Pappenheimer threw some merely on topic post in, and everything went off topic, not really related to Mercuryus and his problem anymore but about how a very limited language was better for Gamestudio. Okay, that was a bit biased and I don't want to discuss this any further, but please keep in mind that Gamestudio can't stand still for a thousand years just for the sake of the old people  Your signature indicates that everything here seriously offended you but you really shouldn't be. In this thread, no one was mean to you, and in the other thread: Well, if you post something, you need to handle the critique, at least when you ask for it. The game really isn't that good, HeelX pointed pretty much everything out, but why don't you sit down for a week or two and build the missing things? I know how exciting it is to have something running and I know the feeling to share it with the world, but keep in mind that your view of the things is highly biased! I and probably many other people made the same mistake, we posted things to early and in the best case no one cared about this and the thread died. But, a few weeks or even days more of polishing had helped the projects a lot! Usually that happens in the second post, with a second version! We don't say "hey, your new game is much better but you still suck cause of what you did the last time", you get a new chance every post  The best advice that you could post in the signature is "Before posting, think about how other people see my work".
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: minv don't work correct
[Re: WretchedSid]
#391723
01/15/12 11:56
01/15/12 11:56
|
Joined: Jul 2002
Posts: 3,208 Germany
Error014
Expert
|
Expert
Joined: Jul 2002
Posts: 3,208
Germany
|
While I think JustSid has given a perfect possible ending statement for this thread, I just want to note that I really, really doubt that Petra's post was ever intended to be interpreted this way. Here we have a guy who took time out of his day to help someone figure out whats wrong with the code, and even adding a relatively easy to understand explanation to it, and then, everything goes to hell because in his final "cheer up, this is easy to miss and it happened to everyone"-statement, he used the word "beginner". I, for one, say that he deserves a honest "Thank you" for the help he's given (and please let's consider this sentence to be exactly that) , and not two pages of bitter complains about the usage of the word "beginner".EDIT: Well, reading through this again, those "complains" aren't really that hostile. I'll leave this here for completeness, but I admit that "two pages of bitter complains" are a bit exaggerated hyperbole. End of Edit. As far as jcl's reply goes, well, I guess that's just his style. This has happened so often by now that I don't think anyone believes someone receiving a reply like this in return is stupid or a bad programmer. Plus, I believe even the most experienced coders can tell stories on how it took them hours to find a stupid beginner-type mistake (This, come to think of it, would also make an entertaining Morbius-thread). Also, I really don't understand the fixation on "var".  Why does str_setchr require a var as the last parameter (even named "char")? It is a mystery (Or, perhaps, compatability).
Last edited by Error014; 01/15/12 12:04.
Perhaps this post will get me points for originality at least.
Check out Dungeon Deities! It's amazing and will make you happy, successful and almost certainly more attractive! It might be true!
|
|
|
Re: minv don't work correct
[Re: Error014]
#391734
01/15/12 13:54
01/15/12 13:54
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
That is not the case and the root of the problem here. The closest you can get to 22.6 with a 22.10 fixed point type (i.e. var) is 22.599609375, that is in binary form 10110.1001100110. (Calculated very fast on a piece of paper, may not be precise) Thanks Uhrwerk, that's what I was missing. I mean, I knew it was 22.10 fixed point type, but since it's always described here as "accurate to 3 decimal places" I assumed it was so, and didn't consider the limitations of the 10 bits at the end. EDIT: I'd like to apologise for my reaction to Petra's response. It was mostly a well-worded and helpful response. Calling an experienced user a beginner is, however, insulting, so I can totally understand mercuryus's reaction (his post-count and date registered should've been the first and most obvious clue that "beginner" would not be an appropriate thing to say).
Last edited by JibbSmart; 01/15/12 14:20.
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
|