« first day (2661 days earlier)      last day (2363 days later) » 

1:13 AM
Hey @Jimmy, just wanted to say I really like the comment you wrote here. :)
Hi there. You're observing that when a object cannot instantaneously turn, then the naive approach can result in it circling around the target. You may want to read through existing answers Avoiding Orbiting in Pursuit Steering Behavior and How does One Prevent Homing Missiles from Orbiting their TargetsJimmy 1 hour ago
 
aww blushes
the main reason I wrote that comment was because the closevote only allows you to specify one question
 
Yeah. I also find the default message a bit brusque. This gives some very constructive advice in a friendly tone, so I think it's much more likely to be taken to heart. :)
 
 
7 hours later…
8:49 AM
How would you guys expplain a dark fantasy action adventure game infront of a audience that are not gamers ?
 
Dark fantasy makes sense to non gamers
If they know of that type of fiction
If not maybe compare to "dungeons and dragons"
Action adventure means you fight creatures and you explore the world
 
@JImmy lets asume for a moment the audience does not know that type of fiction and definetly does not know DnD
 
It's like lord of the rings but the entire game is in Mordor
 
damn thats good
 
 
3 hours later…
11:41 AM
And my knowledge of random formulas paid off
 
user92578
 
user92578
I made a basic menu system for a school project
 
user92578
Feels kinda weird to do simple stuff like this after working on more complex systems for years
 
@Tyyppi_77 It might be my bias, coming from a background in interaction design, but that question seems to me to be well-formed enough to be answerable. (Of course, I wouldn't object to more specificity)
 
user92578
11:53 AM
well I haven't made the actual game yet, that's actually the responsibility of the rest of the group
 
user92578
I'm the only one with previous programming experience, so I'll probably have to do a lot of helping and "lead" stuff
 
@Bálint Do tell. ;) I love random formulas
 
user92578
wow
 
user92578
the framework we have to use for the project doesn't allow things to go off-screen
 
user92578
so if the bottom coordinate of something exceeds the height of the window, it won't render the thing at all
 
12:02 PM
Oh that's going to make sliding transitions a nightmare. :(
 
user92578
yeah that's exactly what I was doing lol
 
user92578
12:18 PM
hmm now I got it to work, not sure what was happening earlier
 
user92578
the renderer is a really slow software renderer, our lecturer said that it's supposed to be used just for generating static images with code
 
user92578
yet that's what he also wants us to use for our minigames
 
nwp
Are you really worrying about the performance of pong?
 
user92578
lol the menus are already lagging when I slide stuff in and out
 
user92578
but since my team mates aren't that experienced I don't want to start adding in weird hacks to optimize the rendering
 
user92578
12:27 PM
and no, I'm not calculating factorials or whatever every frame
 
1:05 PM
@DMGregory I used the shoelace formula to answer one of the questions
Very few people know about it, but it's very simple
 
Ahhh, assorted formulas, not formulas for randomness. Got it!
Yeah, great answer. I was about to go look that one up when I saw you'd already provided it. :D
 
1:30 PM
Yeah, a list of formulas for no specific topic
 
2:03 PM
@Jimmy that's beautifully effective
 
user92578
2:31 PM
ugh I'm having way too much trouble figuring out where to place an instance of my helper class
 
user92578
it reads animation data for tiles from an XML file
 
user92578
and it can't be just a static instance anywhere because XML file reading happens through the content loader which is not yet created when static variables are created
 
user92578
but I also don't want to place it to every class that uses the data, since that's excessive disk access for one-time uses in a class
 
2:59 PM
Can you make it a content pipeline component?
 
You create it on first use and then leave it there.
It's the singleton pattern.
 
@Tyyppi_77 :D
 
In software engineering, the singleton pattern is a software design pattern that restricts the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system. The concept is sometimes generalized to systems that operate more efficiently when only one object exists, or that restrict the instantiation to a certain number of objects. The term comes from the mathematical concept of a singleton. There are some who are critical of the singleton pattern and consider it to be an anti-pattern in that it is frequently used in scenarios where...
 
waits for Josh to descend
 
You don't have to keep the entire instance in memory, you can have the first instance load the XML file into a private static variable and then have all the successive instances reuse that cached data.
 
3:07 PM
Are IOC containers popular these days?
 
I think they create an untraceable nightmare of a data-driven mess.
I'd rather deal with a goto-spaghetti code mess than an IOC mess again.
Strictly speaking I use IOC for some definitions of IOC in my code but people tend to go nuts on it and create a bigger untraceable mess than I've ever seen. And then I end up tasked with fixing the mess.
 
I haven't been writing code in environments where IOC is popular but I be been realizing that a lot of "config file loading" is IOC in disguise
 
user92578
Aight I guess lazy initialization for a singleton is the way to go
 
Nah. that's not exactly what IOC is. IOC is where a reusable library (framework) calls custom code (app code), where previously it's custom code (app code) that called the libraries.
 
user92578
It's just annoying since I'll get a leak report unless I figure out a good place to delete it
 
3:16 PM
@Tyyppi_77 atexit
 
nwp
@Tyyppi_77 C++ right?
 
user92578
yes
 
nwp
If you use new/malloc in C++ you are doing it wrong.
 
user92578
oh yes please educate me on that
 
3:17 PM
yeaaa.. sure...
 
user92578
could I also get a lecture on singletons, and a monolithic entity structure?
 
user92578
also what were the reasons why I needed to use boost again?
 
nwp
Sure.
 
user92578
also why should I abandon STL containers, I'd like to get a clarification on that too
 
@Tyyppi_77 how else are you going to bloat your executable to twice its size and increase build time by 10x
 
user92578
3:18 PM
Oh and actually could you explain why I should just stop using classes and use structs and functions instead?
 
The people who avoid STL would also probably not use Boost...
 
nwp
This would solve the delete issue. It might cause a static initialization order fiasco though, but you would run into that with the new/delete approach too, so I'm fairly sure it is strictly better.
@Tyyppi_77 Can't do that. structs and classes are the same thing in C++.
 
user92578
oh yes, I'll just do a search and replace on struct then, since they're the same, thanks!
 
user92578
that's actually an awesome tip on how to make my codebase neater
 
Can't tell if sarcasm
 
nwp
3:20 PM
Just because they are the same doesn't mean you can search and replace.
 
user92578
yes. sarcasm.
 
@Tyyppi_77 Actually, they are. Only difference is that class defaults to private while struct defaults to public.
 
user92578
EXACTLY
 
nwp
But I see you are trying hard to misunderstand, so I'll stop here.
 
user92578
they're not the same
 
user92578
3:21 PM
I'm just not a huge fan of the "if you use X you're doing it wrong" attitude
 
If you put public: as the first line of your class, it's a struct :P
 
They're almost exactly the same
 
user92578
Yes, I'm aware that smart pointers are the way to go in modern C++ where they're available in the standard
 
user92578
Yes I know how struct/class works
 
nwp
56
A: When should you use a class vs a struct in C++?

Lightness Races in OrbitThere are lots of misconceptions in the existing answers. Both class and struct declare a class. Yes, you may have to rearrange your access modifying keywords inside the class definition, depending on which keyword you used to declare the class. But, beyond syntax, the only reason to choose on...

 
3:22 PM
I cant I'm sharing a test render from the teaser youtube.com/watch?v=qYm8SRSOncM&feature=youtu.be
 
user92578
Looks like I was wrong to assume that "same" meant actually same, not "similar"
 
user92578
Or even "almost same"
 
@Tyyppi_77 But the not using new/malloc thing is BS.
You can use some ref-counted smart pointer or some static object that will delete the global object when the app terminates to delete it.
 
user92578
It's not too simple to port a whole codebase to use smart pointers anyways, but that's on my tasklist, but it's not a priority
 
user92578
I really can't see how using new here hurts anybody?
 
3:24 PM
me neither
 
Well it doesn't ... but also having that memory leak doesn't hurt anyone either?
 
nwp
It hurts you, right now, because you have to think about delete. That is unnecessary.
 
user92578
I don't have to, I choose to.
 
user92578
Explicit object lifetime isn't a bad thing
 
user92578
3:26 PM
@UriPopov The camera turn looks weird, but I'm not sure why.
 
user92578
It might be too fast, but I'm not sure
 
user92578
Or too linear or something.
 
it's not linear its a curve
could be too fast
 
user92578
Just feels unnatural
 
it needs some wobble and overshoot-correction so it feels more someone holding a camera.
 
user92578
3:29 PM
^ that might do the trick
 
Maybe not to the point of CSI tv shows tho ;)
 
user92578
all though...
 
user92578
m_Tileset = new CLevelTileset("Tileset.xml");
std::atexit([]() { delete m_Tileset; });
 
user92578
This does seem a little stupid since I assume a smart pointer would be destroyed at the same time
 
user4704
Not exactly the same time, necessarily, if you want to be real picky about it.
 
user92578
3:36 PM
oh yeah I need to be picky since I went really pedantic with the word "same" earlier
 
user4704
I dunno what we're talking about.
 
user92578
19 mins ago, by nwp
If you use new/malloc in C++ you are doing it wrong.
 
user92578
Oh I got really pissed off by this and turned on a very passive agressive mode
 
user92578
I'm sorry @nwp
 
user4704
Oh, shrug.
 
nwp
3:38 PM
It's ok. We both got over it before saying something really inappropriate.
 
user92578
So I want a unique_ptr here, right?
 
nwp
I'll try to phrase it better next time.
 
user92578
I guess this triggers me since I know I should be using smart pointers but I have a ton of code that doesn't have smart pointers and I just don't feel like putting the work in to neither learn smart pointers nor port the codebase to use them all around.
 
user92578
I guess new code could use those easily, but then the first point arises.
 
nwp
I would try to just go with static CLevelTileset m_Tileset{"Tileset.xml"}; possibly in a function.
 
user92578
3:40 PM
And if it's in a function, it won't initialize until the function gets called, right?
 
nwp
If you have C++11 or above and no MSVC compiler bug, yes.
I forgot since which MSVC version magic statics work as intended.
If you hardcore care about performance you should know that accessing those function local statics means a branch.
 
user92578
Oh so what's the deal with the curly braces? I've been using them for struct member initialization (my structs are often times PODs) but not for calling constructors
 
@Tyyppi_77 I guess that if you don't mind having 2 ways of doing things in your code base, it could be a nice moment to learn how to use them. If you don't have leaks with the current way you're doing things, it does not matter either you can keep the old way only.
That's your project :)
 
user92578
 
nwp
@Tyyppi_77 It's a style thing. They made uniform initializers which solve the problem of accidentally declaring a function (T t();) while creating issues with initializer lists (std::vector<int> v{1, 2}; creates {1, 2} whereas std::vector<int> v(1, 2); creates {2} and people don't agree which one is correct). I also feel curly braces make code more readable because you can distinguish functions from object creation, but that isn't super valuable.
Over all the community is torn about which one to use and there are strong opinions on both sides. Pick your religion, you will piss off half the world either way.
 
3:49 PM
No, use both and piss off everyone.
 
nwp
There is a little bit of hope in the form of clang-tidy which I think can convert between the styles safely, but that makes people without clang-tidy angry.
 
And invent a 3rd
> An integer value cannot be converted to a floating-point type.
> float to double is allowed, but not double to float.
 
user92578
arbitrary rules ftw
 
ugh, what a pain.
 
nwp
They disallow narrowing conversions. If you could lose information it doesn't compile, you need to explicitly consent to throwing away information.
That's the idea anyway.
 
3:53 PM
That means I can't put double values to initialise a template that may be float or double depending on build options.
Well, I can, but not without a clutter of explicit casts and decltype(x)
making the code very hard to read.
 
nwp
@StephaneHockenhull Initializing with floats is not good enough?
 
user92578
yet another random comment that I don't understand, like again, what was I thinking here?
 
user92578
// TODO: Is this the line that makes the menu appear?
 
// TODO-update [2017/11/17]: The answer still eludes me
 
user92578
I have no idea what I meant by "makes the menu appear"
 
user92578
4:07 PM
I just removed the TODO, I don't think my settings menu was broken
 
4:21 PM
@nwp Then there's only a minimal benefit to switching to doubles if the initial values have the same precision as floats.
I do that for values I know fit fine (eg: 1.0f / 8.0f) but PI and others don't
It's not mission critical but it's still an issue.
 
4:53 PM
better ?
 
That looks nice
BTW, zero effort answers seem to produce the most reputation
9
A: How to compute the area of an irregular shape?

BálintYou can use Gauss' shoelace formula: You need to take the x coordinate of every point, multiply them by the next point's y coordinate, then subtract the current point's y coordinate multiplied by the next point's x coordinate from the result and add them to the total area. After you did this for...

I wrote this on my phone in around 5 minutes
While this took me about a day
2
A: How to clip 3D object in projection (octants)?

BálintFirst of all, you need to check if the line intersects the octant. You have 3 cases: The line is completely contained within the octant (the x, y, and z coordinates of the endpoints are positive). This is the easiest one to solve, you simply draw the line as it is. One of the endpoints is outsi...

 
user92578
@UriPopov yeah a lot better, the zoom towards the hole feels a little too stiff still, and in the beginning when the character falls I feel like the camera stops too quickly
 
user92578
Maybe turn the camera a little towards the hole as it zooms in
 
user92578
and apply a small idle wave while the camera is looking at the player
 
@Bálint You hit the HNQ :P
 
5:16 PM
@Tyyppi_77 how about now
 
@AlexandreVaillancourt You're right
 
user92578
@UriPopov awesome! only nitpick left would be to center on the hole, now it's a little too the left
 
yep but i'm doing another render for that :D
 
Looking niiice! :D
 
@Bálint from what i can determine, it's not that it's zero effort -- it's how readily other people can understand what's going on, and whether it's interesting or stimulating.
if we've got a hundred active users, a specific deeply technical question will make 95 of them go glassy-eyed. they won't keep reading, won't try to understand the question or answers, and won't vote because they don't know whether the answer is any good. maybe the remaining 5 will read, care, and even consider voting; the answer gets maybe 2-3 votes.
 
5:29 PM
@DMGregory thanks man. This means a lot I cant focus on the good things and see tiny mistakes and stuff :D
 
meanwhile a more high-level question that's simple, relevant to lots of people, and easy to follow and grasp, will let all 100 of those active users read through it, and maybe only 5 of them will stop caring / exit out. the other 95 can understand what's going on, enjoy reading the answers (they're stimulating and educational), and having understood and read, find themselves in a position to vote -- so they do so. that answer might get 90 votes.
those answers take effort to make good, but they'll often take less effort than the deeply technical questions because of the degree of difficulty of diving into them & understanding & figuring through them & articulating the answer.
which is an unfortunate kind of paradox: the harder stuff that needs answers more badly and takes more effort to resolve, is the first type of question & answer and often winds up producing less of a reward than answering the second kind, which is comparatively easier.
 
Solution: badly drawn horsies.
It's finally gone back to normal :P
 
@StephaneHockenhull correk
 
@Bálint darn, and I was catching up to you on the year chart :P
 
5:56 PM
ok I honestly have no idea how to work with Depth of Field
 
user92578
it's okay, we love you anyways
 
either everything is out of focus or in focus or it breaks the volumetric light
:D
 
user92578
I'm turning my xmacro enum constant arrays into maps, super exciting stuff but it'll allow for nicer access, constants.at(enum) vs constants[static_cast<size_t>(enum)]
 
6:26 PM
Is the static_cast necessary? I thought enum would auto cast to int.
it's int to enum that needs an explicit cast IIRC
 
from previous discussions, it's a enum class
 
7:29 PM
oh, I missed that bit
 
 
1 hour later…
8:30 PM
Based on the way my rep has been increasing in the last couple of hours
i'm going to lose some rep
 
8:50 PM
what does that mean?
 
@Jimmy there's a cap on how much rep you can accumulate in a singe day for a given stack
 
oh, I didn't realize it retroactively capped
 
I'd have almost doubled my total rep if it wasn't for the cap with just ONE viral answer. It's good it's there :P
 
All the stacks I'm active on, getting rep is like pulling teeth, so I never have that problem to contend with
 
9:06 PM
The trick is to answer questions with simple sounding titles that get on HNQ :)
Like, uh, that one one that just popped up
 
I'm still on there
And...capped
 
Hurts doesn't it? :P
 
._.
It still surprises me how little speed runners know about the underlying mechanics of the games they're playing
0
Q: How can I move a 3d object to a known Cartesian point on the surface of a sphere?

J. DoveI'm trying to figure out how to move an object from one Cartesian point to another located on the surface of a 3D sphere. So that the object will follow the spherical coordinate system (Theta and Phi) I've a function that converts a Cartesian to Spherical but how can I make it work on the surfac...

I can probably answer this one, but I need to draw a bit
 
9:26 PM
I just put down an answer but without drawing. Isn't that question just "how does Slerp work"?
 
9:37 PM
Technically yes
 
9:49 PM
So - I'm not 100% on this - but the WOTC patent has expired right. It's been 20 years.
I wonder if they have any other patents I missed
 
@Noctrine I was recently reading about continuation claims they were filing, but the whole game patent landscape is still in chaos since the 2013 Alice ruling
@Noctrine but the original Magic patent would have expired
 
What's the Alice ruling - I've mostly not payed attention to anything in the space since I realized I couldn't make a card game back in HS
 
Oh this was dealing with "On a computer" though wasn't it?
 
Briefly, it was one of a chain of cases that came about because of rampant patent abuse (trolling) to make really abstract claims like "a mobile computing system" ineligible
 
9:56 PM
I'm referring to the trading card game patent that was stopping me from making - actual physical cards that had those Magic style mechanics
Or at least, you know, a deck
 
but an unintended consequence may be that game rules, which have traditionally had patent protection in the US, may be ineligible as well
@Noctrine The thing about the original Magic: The Gathering patent was that it didn't just protect that one game, but the entire trading card game mechanic system Garfield created
 
@DukeZhou Yep
 
but, as you've noted, that original patent would be expired.
 
@Noctrine I'm not familiar with the patents, but how could Pokemon/Yugi-Oh operate before the expiration?
 
@Jimmy Licensing
 
9:57 PM
hmm
 
I can take a look at recent filing by Garfield when I have some time, but my guess is they will only cover new mechanics they may have come up with, not the core system
That's actually one upside to patents, they don't last all that long compared to copyright (lifetime + 60 years)
 
Nintendo and WOTC got into some lawsuits with each other regarding it all though
 
Oh yeah, the big boys sue each other all the time
 
It all blew up when some WOTC executives went to work at Nintendo / The Pokemon Company
 
Patent trolls used to shake down companies for $2 million b/c that was the average cost of patent litigation
Wasn't it Nintendo who had a patent on loadscreen mini-games?
That type of claim definitely wouldn't fly post-Alice
 
10:02 PM
Namco Bandai
That expired back in 2015 though
 
The case no one wants to go near though, is the Yeti Town vs. Triple Town
sort of an IP "third rail"
@Noctrine btw- if you have specific patent questions, there are some very knowledgeable contributors on SE.Patents
they don't know games, but they do know the mechanics of patent law
so for general questions, it's a reliable info source
 
I have all kinds of patent questions!
 
10:18 PM
This is also a really good site for that: IP Watchdog
 
They aren't generally related to games
 
take a closer look--it covers everything from console hardware to board game mechanics
 
 
1 hour later…
11:24 PM
@Bálint instead of thinking of it as a pain, think of it as one step closer to that Epic badge! :D
 

« first day (2661 days earlier)      last day (2363 days later) »