Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 04 Jan 2013
Offline Last Active Private

#5238257 Text adventure design in C

Posted by wintertime on 03 July 2015 - 03:17 PM

The trick is to have a single game loop.
Inside you get input in a generic way, process it in a way which depends on the game's state, then output the current status to the screen.
This avoids repeating the loop, input and output code everywhere (possibly obfuscated by being slightly different each time).

#5235634 Problem with average calculator, help me out?

Posted by wintertime on 19 June 2015 - 02:29 AM

Why are you even using an array, when those values are never used again after adding them to the sum you misnamed quo?

#5235057 Why do you need the .h .cpp AND .lib files?

Posted by wintertime on 16 June 2015 - 03:15 AM

The lib is a collection of compiled object files for easier reuse, such that you dont need to recompile dozens of libraries with hundreds of cpp files each time you use them.
You could probably get the source files for the lib somewhere, its only for convenience.

#5234296 Why didn't somebody tell me?

Posted by wintertime on 11 June 2015 - 08:31 AM

No, its not that ordinary people in Germany have the inclination to invent wrong Denglisch. Its marketing departments of big German corporations inventing and pushing these through advertising, because hey, English sounding words must be more fancy.
And that way the moonshine tarif gets invented for cheaper phone calls at night, as they dont know the words they are misusing.
In reality people often dont understand them. Ads are mostly ignored, though some of the words eventually get wider use.
Later politicians and journalists felt the urge to pretend being modern people and did same. They are also inventing stupid contractions like Grexit for the (irrational) fear of Greek government intentionally bankrupting their own tiny economy by switching from € to a new currency.

#5233110 What should I do now that I implemented a game mechanic that is not popular a...

Posted by wintertime on 06 June 2015 - 04:13 AM

The question is formulated so abstract that its near impossible to answer.
Who knows if they just need some time to adapt, if they dont hate the new mechanic but dont know how to explain that and there is just some quirk you need to fix, if its just a few complainers and the silent majority likes it, or if its really bad?

#5232944 Client side hit detection vs server side with prediction

Posted by wintertime on 05 June 2015 - 08:10 AM

Isn't it shortsighted to invite cheaters when you know many of them exist? I'd think requiring people to aim a little ahead would be less damaging than having people suffer from being cheated?
If they needed to add server checks anyway they gained nothing from avoiding them?

#5232378 Replacing Adapter Interface with abstract classes

Posted by wintertime on 02 June 2015 - 08:15 AM

Calling everything pattern will not make your code any better, especially when there are established better names already.
If you write a for loop you just say so, no need to call it loop pattern.
If you write a wrapper class for some library, there is no need to call it adapter pattern.
If you use a global variable, it does not get better if you obfuscate it by wrapping it in a class and calling it use of the singleton pattern, when it would be better to have no global variable in first place.
If you feel like calling a method, it does not get bettter if you obfuscate it by adding code to subscribe to calls first and then doing indirect calls where you cant easily see what is called, even if you call it observer pattern (essentially its just some form of spaghetti code).
If you construct an object, it does not get better if you hide that and call it factory pattern.
I never before saw anyone call a programming paradigm design pattern and that is needless obfuscation, too.
The stack is the stack, which is a data structure, not a design pattern.

#5232000 Replacing Adapter Interface with abstract classes

Posted by wintertime on 31 May 2015 - 12:12 PM

I guess the problem is: OP swallowing "Design Patterns", then trying to find nails for the shiny new hammer and misapplying it to some screws.
To try balancing that out a bit: http://realtimecollisiondetection.net/blog/?p=44, http://realtimecollisiondetection.net/blog/?p=81

#5231752 Error link the library GLFW

Posted by wintertime on 29 May 2015 - 04:31 PM

You need to learn to distinguish the compiler from the linker. The compiler finding the header is irrelevant when the error is that you did not tell the linker to correctly link the library you use.


#5231350 Help - getting input form windows

Posted by wintertime on 27 May 2015 - 04:06 PM


I would not exit from inside the window procedure. Usually, you would check for WM_QUIT after calling PeekMessage or the return value of GetMessage.

#5231348 Entity/Component System - Understanding Event Priority

Posted by wintertime on 27 May 2015 - 03:47 PM

I think the simplest solution is to not use events, as they encourage creating spaghetti code.

Just have each system get input from each component of the associated component type, then write the calculated data to another component type for each affected entity. Then other systems can easily read this data when its their turn to get updated.

#5229420 no Vsync? why should you

Posted by wintertime on 17 May 2015 - 03:14 AM

IIRC I read somewhere Assassin's Creed would run single threaded (dont remember which version). So this might be the classic single-threaded gameloop causing the problem, as the rendering can delay processing of new input and game simulation for different lengths of time depending on vsync.

#5229416 Another basic array C problem

Posted by wintertime on 17 May 2015 - 02:27 AM

You read more into it than was intended (me writing a few more words would have been better). Its just an unnecessary annoyance built in there, which I thought was worth mentioning upfront, so he would not be surprised later, in case he cares.

#5229302 Another basic array C problem

Posted by wintertime on 16 May 2015 - 08:12 AM

... and it will deactivate a month after installing it and tell you to get a MS account.
Though you could also try out code::blocks or one of the many other compilers, IDEs and text editors, which are available.

#5229287 Another basic array C problem

Posted by wintertime on 16 May 2015 - 02:59 AM

Is that your homework? You learn more if you debug it yourself. Open the debugger, step through the program and check the values of the variables, which get changed.


Btw, the forum got code tags to make sourcecode more readable, you can click the "<>" button to get these.