« first day (1341 days earlier)      last day (3613 days later) » 

12:00 AM
ffs
 
I don't know how non-const works
I assumed it was const because you're throwing a temporary
 
is chat acting up for anyone else?
 
and you can only bind temporaries with T&& or const T&
 
@Rapptz what? no..
 
shrug
Still, I never modify the exception object so iunno.
 
12:02 AM
15.3/6: If the exception-declaration specifies a name, it declares a variable which is copy-initialized (8.5) from the exception object
gonna head off
 
bb
 
chat is being really really difficult now.. have to keep sending messages like seven times
that copy is safe in special exception memory; making it a ref just means you're not copying it again in not special exception memory
ARGH WRONG ORDER MESSAGES!
 
@LightnessRacesinOrbit It's just you. Reboot.
 
@Jefffrey except for the whole chain thing, unless he's into that
 
he is, he is
 
12:09 AM
@LightnessRacesinOrbit So who do we get to blame? BT?
 
@JerryCoffin if they are anything like US telecom... as good as anything to blame
 
tunnnnnne
@JerryCoffin nope
in fact I think I'll blame Chrome
don't use BT
 
bt?
 
@LightnessRacesinOrbit did you install the 64bit chrome?
 
@Mgetz I switched to dev so I could have my SO userscripts back; I don't think dev would have such specific JS issues though. It would just like crash or whatever.
 
12:14 AM
@LightnessRacesinOrbit I've been on Dev for a long time but the x64 chrome seems to have issues... they've gotten mostly better over the last week though
 
@Mgetz well it is 64-bit
Firefox seems okay so far (just giving it a quick test to rule out routing issues)
 
@LightnessRacesinOrbit tbh I suspect it's just chrome dev being dev
 
maybe I shouldn't have updated Chrome earlier. thing is I've seen these kind of bugs on chat before
e.g. after i post a message the entry box will have precisely one blank line in it for me to delete
 
I've never seen that
and I'm using chrome dev at work for chat
 
right, really nn now. 01:17 again grr
 
12:21 AM
sleep well
 
lol I had to get this important unit to be in a particular spot in AoE 2, so I got a shitton of dummy units to attract the attention of the defenders while I was getting that unit there
quality strategy
quality AI
 
sharing on coliru isn't working for me
well now it is
but I had to try twice
 
I wonder why the AI was never programmed to attack that particular unit while defending, especially
 
so stupid
I didn't ask for this garbage :(
why doesn't std::to_string have a "precision" parameter? it's not really hard to add since it just delegates to std::sprintf
 
12:39 AM
> The most well-known book on this topic is probably the “Gang of Four” book [17].
Here are a few examples of common general-purpose design patterns.

- Singleton. This pattern ensures that a particular class has only one in- stance (the singleton instance) and provides a global point of access to it.
@AlexM. Nice book. :P
 
you'll see the singleton used more and more as you read more about game development
whether it's good or bad, is up to you
I can think of one use of it, off the top of my head
if you remember my example of the strategy pattern where I encapsulate each behavior of a particular entity in its own class, and each entity has its own field for the current behavior
 
@AlexM. IMO, the answer to most questions like this is: "to keep the game playable". I'm pretty sure the AI could nearly always be made good enough to ensure nobody could ever win the game, but then what's the point in playing? The point is to make it difficult enough to be fun, not to make the AI as good as possible.
 
class Entity { Behavior behavior; }
if the behavior does not have its own state, then you can use a singleton for each type of behavior
behavior = SomeConcreteBehavior.Instance;
for 500.000 entities, this saves up 500.000 * sizeof(SomeConcreteBehavior)
you'd have wasted if instantiating a new behavior for each entity
ideally, the behavior should never have its own state
it should modify the Entity according to its publicly viewable state
@JerryCoffin yeah I definitely had fun and felt like I fooled the AI
but still, that trade cart getting there made me win the mission
I basically cheated, leaving all of the base untouched while marching with my dummy troops inside
because the AI was targeting the troops, not the cart
there are definitely bad uses for the singleton, and one of the libraries I work with in Unity fucked me up because of its use of singletons
 
@AlexM. if behavior does not have "state", why is it a class in the first place?
 
it rendered me unable to change scenes and keep old sprites in the new scene
@Jefffrey C#
 
12:48 AM
that's not an answer
those are two characters
 
yours is also not a question
 
> why is it a class in the first place?
seems a question to me :/
 
my answer was also an answer, in C# you can only make it a class
 
wat
 
4
Q: Can there be stand alone functions in C# without a Class?

bob packerIn C/C++, I have a bunch of functions that I call from main(), and I want to rewrite this in C#. Can I have stand alone functions(methods) or do I have to put them in another class? I know I can have methods within the same class, but I want to have a file for each function/method. Like this wo...

I do not know enough C++ to find a good way to achieve the same thing with free standing functions
my behaviors always implement particular interfaces, and I pass implementers of those interfaces around
I do not know how to find such a common point for free standing functions in C++
 
12:53 AM
Instead of class Entity { Behavior behavior; } you would have class Entity { ... }; and then define a free standing function that moves Entity around or whatever you mean by "behavior". But I'm sure I'm not understanding what you mean by "behavior".
 
think that you have this random orc, and he has a talking behavior that can be either angry talking behavior and neutral talking behavior
when he's hit, if he uses the angry talking behavior, he says "YOU'RE GOING TO DIE YOU PIECE OF SHIT"
if he uses the neutral talking behavior he says "Ow. That hurt."
you can change between these however you want, whenever you want
at runtime
by saying this.talkingBehavior = new AngryTalkingBehavior(); //w/o singletons
then in the Update method for this entity, you call
 
define std::string phrase(const orc&) which reads the enum class value of the orc struct/class and make it return what you want
 
this.talkingBehavior.Update(this);
if you feel that's best, do that :)
I don't think my solution is the best or anything
if I used and knew C++ I'd probably think of better solutions too
 
I've never completed a game, so I know I'm a noob. I just find this "everything must be a class, everything must be virtual, interfaces OMG" kind of behavior in almost every game dev book. And I believe you are using that too.
I just saying it's bad from my point of view, but then again, my point of view never lead to any actual game
 
I just find interfaces to be great at making sure what I pass over has what I expect it to have, so I try to find commonalities between stuff like concrete behaviors, and build interfaces for them
everything must be a class in my case because I'm always using C#
both at home and at work
 
1:03 AM
yeah, I don't think I like C#
> because a common design pattern for im- plementing major subsystems such as the ones that make up a game engine is to define a singleton class (often called a manager) for each subsystem.
 
 error: too many arguments to function 'int vsnprintf(char*, size_t, const char*, char*)'
what the hell
int vsnprintf( char* buffer, std::size_t buf_size, const char* format, va_list vlist );
 
@Jefffrey I've seen that everywhere, yes
I mean, in practice
 
it's "Game Engine Architecture "
oh
 
I wonder if you can make a game without classes
 
I never had to singletonize managers because of how Unity lays out the scenes
 
1:06 AM
sounds painful
 
and this would be bad anyway
 
singletons sounds like a bad idea
 
because then I'd have to work hard to keep data between scenes
 
just create a single instance
I don't see the problem
 
I've never written a singleton in my life
 
1:06 AM
I wish the guys who did that library also knew this
 
@Rapptz I did unfortunately... in PHP.
 
@Rapptz I've done it.
 
@Rapptz yes
 
@Rapptz I wrote only a single singleton.
 
user3010322
There's a lot of games written without any classes.
 
1:08 AM
global state, and functions working over it
 
inb4 quake 3
 
@AlexM. You sure? struct Point { int x; int y; }; is already a class :v
sounds annoying to do
 
@Mysticial that is considered O(n). (unless you are kidding, in which case carry on!) — Cyber 2 mins ago
 
the first game that I worked with that did not use any OOP concepts was Gothic
 
^^ lol
 
1:09 AM
@Rapptz it's a POD
 
it's a class m8
 
@Mysticial Such levels of ignorance scare me.
 
the usage of classes in Arx Fatalis was also minimal, or maybe there was no usage at all
 
not in the OOP sense dude
 
1:10 AM
I only joined AF through Arx Libertatis
 
what do I care about the OOP sense?
 
go fok
 
@Rapptz is that still a class in C?
 
C doesn't have the concept of a class
 
then you can write a game in C and it won't use classes
 
1:11 AM
Maybe so.
 
idTechs were written in plain C
 
I was more so thinking without structs or records
 
hmm
I guess you could have something like
 
then you are a masochist, I believe
 
@Rapptz Neither did Fortran 77 (and I've written a game in that too).
 
1:12 AM
int VecX[somevalue];
 
@Jefffrey I did say it sounds annoying.
 
and say, entity A finds its position's X at VecX[40]
 
@JerryCoffin It even got an upvote. Ahaha. Now I'm scared.
 
Are you guys not gonna correct him?
 
1:13 AM
@Rapptz I'm scared to even try.
@Mysticial Two up-boats. I may need to do some drinking to sleep tonight.
 
@Mysticial I think I'm ignorant.
I don't get it.
<insert awkward silence here>
 
@Jefffrey He specifies a loop running from 0 to sqrt(n), so it (pretty obviously) only runs sqrt(n) iterations, but three people are now agreeing that somehow it should have complexity proportional to n instead of sqrt(n).
 
@JerryCoffin Technically, he isn't wrong actually. O(sqrt(n)) is O(n).
 
@JerryCoffin if i run a for (int i = 0; i < 2n; i++) we are running 2n iterations, but the complexity is still O(n).
that's what I've been taught in uni at least
 
that's true yes
 
1:18 AM
That's correct. But sqrt(n) is different.
 
@Jefffrey Yes--in both those cases, the complexity is really "linear". Square root does not grow linearly.
@Mysticial Really? How does square root qualify as linear?
 
@JerryCoffin Big-O is an upper bound.
It isn't strict.
Even though everyone uses it as being strict.
 
The O with the line in the middle is strict IIRC
the greek letter I mean
 
I want to say stuff but I know it will most likely be incorrect
I'm at the level where I decide complexity based on the number of loops I see at first glance
and call it a day
@Jefffrey theta
 
@Mysticial Ah, good point.
 
1:21 AM
yeah that one
So that would be: Θ(sqrt(n))?
 
I found that "hmmm, I pass through this too many times" works in practice
 
@Jefffrey Right.
 
obviously I never worked on resource heavy stuff
 
The point is that casually when people say Big-O, what they really mean is Big-Omega.
But the fine-print is different. lol
 
dude you're hardcore
how do you not kill profs at your uni just with your spiritual pressure?
 
1:23 AM
@AlexM. They killed me. I dropped out of school.
 
wait what?
 
@Mysticial ...except when they don't--for one obvious example, many often refer to Quicksort as "O(n log n)", even though it's actually O(N^2).
 
@AlexM. almost everybody here is a drop out
 
@JerryCoffin Right. "most of the time"... hehe
 
@Jefffrey wait what?
am I the only one still in uni?
no wait @ThePhD is still there
I wonder if my parents will stop paying rent if I fail any exam this session
 
1:25 AM
@Jefffrey I'm not a dropout. I graduated with the highest GPA in the entire cave!
 
I'm sure they won't
 
I'm in uni too btw
 
if I have to pay rent myself I'll stop going to uni and just work full time instead
either way, I'm cool with it
 
I did well in uni, I was just horrible in primary school & junior high- you know the bottom 20%-30% kind
 
@Jefffrey Only DeadMG is.
 
1:27 AM
bartek and rightfold too, no?
 
Then life got boring & my marks went up ... sadness
 
nope
 
@Rapptz and Mysticial
 
Mysticial isn't a drop out either
 
didn't he say he dropped out?
 
1:28 AM
He dropped out of a master's program
iirc
 
@Rapptz Dropped out (tested out, really) of the PhD program. Has a masters.
 
that's just omega dropping out
if you use big o dropping out
it's still dropping out
 
I'd wager there are more PhD students than dropouts
 
so meta I'm going to puke
 
rubenvb, me, Konrad off the top of my head
 
1:29 AM
why people get so confused with means and ends, school system is a mean to get what you want - social connections, qualification for a good job
 
so, you're all studying @ThePhD?
 
once you have better means, ditch the worse one if there are conflicts between them
 
@Jefffrey Not a drop out =/
 
@AlexM. Psychiatrists study ThePhD.
2
 
lol
 
1:30 AM
although almost everyone misjudge situations every now and then
 
> A configurable option can be implemented trivially as a global variable or a member variable of a singleton class.
 
lol
 
this guy is obsessed with singletons
 
@Jefffrey Thus, trivial.
Good morning.
 
1:32 AM
I'm thinking about going back to freelancing
I also have the option to work with my current employer on a per-project basis
which basically means they become my client
I just find it very hard to go in a place where people are ultra-noisy and an AC is blowing in my face
 
@MarkGarcia I'm not going to talk to you until you bring my duck back.
 
and still work
I've worked from home for a few days last week and I did more than I did in half a month there
 
@Jefffrey lol. I miss that dino too. :)
 
ok, we are even
morning
 
@Jefffrey don't read this one
the singleton count is over 9000
 
1:35 AM
lol
 
you'll find it hard to find something about gamedev that does not use singletons
you can try exploring gd.se's questions and answers, the singleton hate there is big
 
that's because gamedevs are bad by nature :v
 
there is also this book about gamedev that says the singleton is bad and explains why
and still lists some pros
that's the best I've found, but I haven't read that much
 
oops
this was the only good resource wrt patterns and gamedev I've read
YMMV
 
yes
that's the one
 
1:38 AM
@AlexM. how are you able to design good games?
 
the one saying the singleton is bad
 
where did you get your experience?
 
@Jefffrey you mean like in code?
I do not know if the design is good, I just know that it works for me and it doesn't hurt my productivity
 
also wow that site has changed
 
@AlexM. yeah, sorry I meant "architecture", not "design".
 
1:39 AM
my experience is really a lot gathered from a lot of sources with a lot of steps skipped, which backfires a lot today
I've worked on a lot of shit, however, I've never implemented a single pathfinding algorithm
 
how do you make a game without pathfinding?
o.o
 
when I went to gameloft one of the tests was something that could be easily solved through an A* combined with a greedy approach
needless to say, I was a sitting duck there
@Rapptz never worked on anything that needed me to implement one myself
 
this played on di.fm last night, i was so happy
 
the A* project for Unity is free and works great
far better than anything I could ever do, considering how mature it is
 
Oh you use Unity. Right.
I haven't used a single game engine I really like. Unity was okay I guess. I liked how easy it was but it felt weird. It feels like ECS is just not my thing.
 
1:41 AM
@Jefffrey here's a basic rule that I follow
 
@Rapptz All all-in-one game solutions feels weird.
 
@Rapptz this seem interesting
 
the code examples are bad
 
split things into as many logical components as possible, to make it easy to find the sources of bugs and any other things like that
 
it's not great but it's better than everything else
 
1:43 AM
it's probably why my biggest source file ever was 570 or something LOC in size
and my longest function was 20 lines or so
 
that's very good
 
also, the connection between components should be as one way as possible
 
user3010322
Lololol
 
I use events often, to notify higher components about stuff
 
user3010322
ThreadPool properly gives threads work
 
user3010322
1:44 AM
forgets to lock its own lock when queue-ing said work.
 
sort of like this, where lower level components notify higher level components
and higher level components can order the lower level components around if they cannot manage themselves
that's about it
 
@AlexM. Lord how I wish. Currently refactoring a function that's ~650 lines long (though, thankfully, most of our code base isn't like that).
 
my longest functions are typically ~100 LOC
 
components are grouped in that diagram by functionality
like...
this hammer gets picked by the player
it notifies things higher than it until the GUI finds out about what happened and shows a "You picked a hammer." message
like that
 
@JerryCoffin good lord
 
1:48 AM
this makes sure the tools don't stop working when the GUI is gone
and the most things that can break when the tools are gone, is the GUI not displaying anything
debugging is also easy: you just check why the event for tools being picked didn't get received by the GUI
the same event can obviously be received by multiple higher entities
until it gets to the GUI, it can get to the player's stats manager, that changes the strength stat to +5 because the player equipped a sword
etc.
so yeah, that's my architecture in a nutshell: small components communicating via the observer pattern
 
@AlexM. who notifies what?
 
@Jefffrey a component on a low level notifies whoever listens, usually those meant to manage the components on the lower level
like in that diagram
 
also what are "higher components" and "lower components"? higher and lower based on what?
 
say you have a bunch of orcs, and some stuff that needs to happen when their combined state has some value
like, when they all die, you set a variable to a value
each orc notifies some specialized object that takes care of that stuff that has to happen
the object keeps track of the orcs, and when they all die, it sets that variable
the object is on a higher level than the orcs
not sure what this is based on, it's higher than the orcs from my POV
 
@AlexM. and the higher object responsibility it to manage a group of orcs?
 
1:54 AM
yes, it supervises the orcs to check whether or not they're all dead
 
ok, makes sense
 
if you don't want to think in events and notifications, you can also just manually check the state of each orc in that object's update cycle
 
so, the object also creates this orcs meh, it's irrelevant
 
I'd probably have a separate object take care of spawning, and the orc death object find the appropriate orcs based on some criteria, at startup
 
how do you handle input?
do you send key events to each component?
 
1:56 AM
if the orcs' death object is part of, say, a minigame or mission, I can remove that object if I don't want the minigame to be in the game anymore and still have the orcs spawned by the specialized object
@Jefffrey no, in Unity I check for the global input state from whatever object works with the input
 
so there's an object that reads the input and manages the components entities?
 
in the update loop I do if (Input.GetKeyDown(KeyCode.LeftArrow)) { do something; }
for example
 
@Jefffrey EntityManager? D:
 
nope, I never send the input state down the chain
it would be impossible to cover all details, especially with Unity
 
50              const char* s = skip_white_space(str);
(gdb) print s
$1 = <optimized out>
 
1:59 AM
mouse input on particular objects depends a lot on the objects' colliders, and if I don't want to mess an otherwise clean architecture up, I have to check for mouse input in that object's script
 
=[
 
for example
 
this is on -O0
damn you gdb
 

« first day (1341 days earlier)      last day (3613 days later) »