Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411284 Posts in 69325 Topics- by 58380 Members - Latest Member: bob1029

March 29, 2024, 02:44:06 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
  Show Posts
Pages: [1] 2 3 ... 26
1  Player / Games / Re: Cuphead isn't really racist on: July 12, 2015, 04:19:28 PM
"This game is based off of 80 year old cartoons and in this scene the characters are dancing and in a racist cartoon that came out 80 years ago the characters are dancing therefore this game is evoking racism and is thus problematic please give me money"

They're beating a dead horse, and it's getting somewhat hidden away because they're doing it through the context of Cuphead.  Nothing to see here.
2  Developer / Technical / Re: The happy programmer room on: July 07, 2015, 01:02:31 PM
Sublime Text is the perfect mix between the two extremes (Vim-like and VS-like) for me.  Plus, Cabal (the Haskell build system) is smart enough that I don't need to fiddle around with any sort of makefile or build scripts.
3  Player / General / Re: What are you listening to at the moment? on: July 06, 2015, 12:51:49 PM


4  Developer / Technical / Re: The grumpy old programmer room on: July 06, 2015, 12:24:09 PM
Basically, what happens is that IEEE instructions running on strictly-IEEE compliant (configured to use no extensions like 80-bit FPU registers) hardware should be consistent.  The hard part is making sure that you limit not only yourself, but also the compiler, to emitting that subset of possible FPU instructions.  For example, although the addition/multiplication instructions are IEEE and thus consistent, the combined multiply/add instruction (which optimizers will try to use) is not.

http://yosefk.com/blog/consistency-how-to-defeat-the-purpose-of-ieee-floating-point.html

Differences between OSes are probably coming from optimization differences (i.e. different instruction usage) between compilers/interpreters for each platform.
5  Developer / Technical / Re: Glue b/t differently sorted arrays in data-oriented prog. for optimal locality? on: July 02, 2015, 02:14:45 PM
Edit: Also I would bet that your statement about branch mispredictions being as expensive as a cache miss to be wildly uninformed, roughly an order of magnitude off. Mispredictions are generally way cheaper than cache misses.

L2 CACHE hit, ~10 cycles   (i.e. L1 cache miss)
https://software.intel.com/sites/products/collateral/hpc/vtune/performance_analysis_guide.pdf

On a modern machine, an L1 miss will typically cost around 10 cycles, an LL miss can cost as much as 200 cycles, and a mispredicted branch costs in the region of 10 to 30 cycles. Detailed cache and branch profiling can be very useful for understanding how your program interacts with the machine and thus how to make it faster.
http://valgrind.org/docs/manual/cg-manual.html

Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns  (i.e. L1 cache miss)

https://gist.github.com/hellerbarde/2843375

An L1 cache miss is not what people mean when they say, generically, "cache miss".  They mean that the data was not in any level of cache, and thus is a main memory hit, which is typically a few hundred cycles.
6  Developer / Business / Re: Advice on making and marketing a good erotic game on: June 23, 2015, 12:27:09 PM
HuniePop managed to skirt around Steam's anti-H policies by "forgetting to disallow" users to disable the censoring with an easy INI hack.
7  Player / Games / Game recommendations thread on: June 21, 2015, 02:40:12 PM
If you can get the multiplayer to work, E.Y.E

So yeah, it's not really proper as it breaks all the time and is a pain to get working, but the upside is that when you do it allows up to 32 (!) players in co-op mode
8  Player / General / Re: RIP Tale of Tales? on: June 21, 2015, 02:33:35 PM
Rational or not, if that's what your market thinks you have to deal with it.
9  Developer / Technical / Re: Is there an advantage to using the Quadtree datastructure in gridded games? on: June 17, 2015, 12:07:18 PM
Spatial partitioning isn't only useful for collision detection.  It can be used to cut down storage costs, in what is called a "sparse" representation.

There's not much out there on sparse quadtrees, but sparse (voxel) octrees are quite popular in 3D rendering, especially with regard to global illumination.

Hopefully this image should illustrate the concept:
10  Developer / Technical / Re: Drawing order - Sorting or layers? on: June 17, 2015, 10:30:13 AM
I would just take advantage of the GPU and use the Z-buffer.  I would also consider doing it in layers/buckets if you're not using the GPU at all for some reason - this is how old hardware tile/sprite renderers would have worked.
11  Player / General / Re: female protagonist? yes/no? on: June 16, 2015, 02:45:16 PM
E.Y.E (22 hours): I have no fucking idea

iirc you're male in EYE (this is established in the intro) but i could be wrong

Actually, given the big plot twist, you are definitely male.  My mistake.
12  Player / General / Re: E3 on: June 16, 2015, 02:20:28 PM
I'm not mad because they made a game I won't like, I'm mad because I've been waiting almost eight years for a proper Metroid game and they pretty much confirmed that they're not going to touch the IP for a few more years now.
13  Player / General / Re: female protagonist? yes/no? on: June 16, 2015, 02:14:25 PM
Dark Souls (334 hours): choice
Skyrim (214 hours): choice
Binding of Isaac (61 hours): choice
Besiege (42 hours): N/A
BF2 (29 hours on Steam, hundreds with CD): the soldiers are all male
GMod (29 hours): choice
SWBF2 (25 hours on Steam, hundreds on PS2): the soldiers are mostly male
Delver (23 hours): sounds male to me
Dark Souls II (23 hours): choice
E.Y.E (22 hours): male

I main Jolyne in ASB and Zelda in Smash so there's that too
14  Player / General / Re: All Purpose Animu Discussion on: June 12, 2015, 11:09:58 AM


15  Player / General / Re: Short narrative-focused indie games... do they have a place? on: June 10, 2015, 09:09:13 AM
Steam isn't saying "no more short narrative games allowed".

It's saying "don't misrepresent short, simple games as something that they are not".  The fact is that they take less effort to make.  This doesn't make them invalid, it just makes them an easy way to scam people (like one guy who made an 11 minute "trailer" that is actually a full playthrough of the game).

EDIT: I may have jumped to conclusions thinking that you were indirectly referencing Steam's new refund policy.  Since you say that you're able to make a living I doubt that it's a problem for you.
16  Developer / Technical / Re: C++ exceptions discussion thread on: June 10, 2015, 08:45:43 AM
I think there's a better way around it by simulating pattern matching.

Code:
template<typename T>
class Maybe {
public:
// Nothing
Maybe() : m_hasValue(false) {}

// Just x
Maybe(T x) : m_hasValue(true), m_value(x) {}

// simulate pattern matching
using NothingVisitor = std::function<void(void)>;
using JustVisitor = std::function<void(T)>;
void visit(NothingVisitor ifNothing, JustVisitor ifJust) {
if(m_hasValue) {
ifJust(m_value);
} else {
ifNothing();
}
}

private:
bool m_hasValue;
T m_value;
};



auto unreliable(int x)->Maybe<int> {
if((std::rand() % 100) < 50) {
return {x}; // Just x
} else {
return {}; // Nothing
}
}



void main() {
auto maybe42 = unreliable(42);
maybe42.visit([]() {
std::cout << "Nothing\n";
}, [](int x) {
std::cout << "Just " << x << "\n";
});
}

You could easily extend this to be more like the Haskell `Maybe` by providing methods like `fmap`, which applies a function to the value if there is one:

Code:
template<typename U>
auto fmap(std::function<U(T)> f)->Maybe<U> {
if(m_hasValue) {
return {f(m_value)};
} else {
return {};
}
}

The important part here is that there is no direct way to dereference the value encapsulated in a `Maybe`.  You can only extract it through pattern matching.

You can even extend the notion of using this kind of structure for a function that can fail by adding a second value that describes the error that occurred.  In Haskell this is called an `Either`, and instead of `Nothing` and `Just x` you have `Left error` and `Right x` (Right = correct!).  Functions like `fmap` preserve the error value, essentially short-circuiting a chain of "unreliable computations".

Now, you may just say that I've reinvented exceptions anyways, but I'm a firm believer in making your side effects explicit.  If something returns a `Maybe` I instantly know about and am forced to safely handle the lack of a value.  I can also easily chain multiple `Maybe`-returning functions together without having to write a mess of `if(x)` flow control.  Then you can save exceptions for really critical system errors like running out of memory (although if you wrap everything that could possibly allocate anything in a `Maybe` I suppose you wouldn't really have to Tongue)
17  Developer / Technical / Re: The happy programmer room on: June 10, 2015, 08:24:57 AM
Is it possible with some sort of similar syntax in modern C++ to create a function that might return a different type depending on some factor so that the return value of that function has to be caught in with an auto variable and then used somehow?

No, but if you think about it for a second that's just polymorphism.
18  Developer / Technical / Re: The happy programmer room on: June 10, 2015, 07:47:47 AM
Interesting. I had no idea that function declaration syntax was a feature of C++11. I find it kind of ugly, but as I understand it, at least it solves this problem:

<snip>

Another big reason for it is, as I said before, `decltype`.  It's not as elegant as true return type inference (which lambdas already support to some extent) but it goes a long way.

Code:
template<typename T, typename U>
auto add(T x, U y)->decltype(x+y) {
return x + y;
}
19  Developer / Technical / Re: C++ exceptions discussion thread on: June 10, 2015, 07:42:35 AM
I wouldn't even make "lost connection" an exception.  Networking is reliably unreliable, so dealing with issues like that should be part of your normal code.

A good example of an exception, IMO, is an "out of memory" error.  There isn't any clean way to solve this - in a game, for example, you have to shut down all non-critical systems to free any memory you can use to save the state of the game and then exit.
20  Developer / Technical / Re: The happy programmer room on: June 09, 2015, 08:14:39 PM
It is recommended, by Herb Sutter himself.  If you're not keeping up with the language standard then that's your problem, not mine.

I'm not saying that you should refactor an old codebase to do this, obviously.  But what reason (other than potential portability issues for embedded systems or, god forbid, MSVC) is there to not adhere to at LEAST C++14 when starting something new nowadays?
Pages: [1] 2 3 ... 26
Theme orange-lt created by panic