Jump to content

  • Log In with Google      Sign In   
  • Create Account

frob

Member Since 12 Mar 2005
Online Last Active Today, 12:08 PM

Topics I've Started

Scotland independence: Yes or No?

16 September 2014 - 10:44 AM

I'm surprised I don't see a lounge topic on this already.

 

So two polling questions, one set for locals who get a referendum vote and another for everybody else.

 

I'm most interested in hearing from those actually living in Scotland and who actually get to vote. How do you feel about it? If yes, why? If no, why not?

 

 

The referendum discussion has been going on for some time. I'm in another continent living 7500 km away and still see it in the news. I've read discussions about assorted viewpoints and concerns: How will the budget work, how will healthcare work, how will currency work, how will taxes work, how will the oil revenues work, even discussion about how BBC will be affected by a potential split. 

 

I can certainly understand the desire for more local control of government services. It is a refrain we always hear. Local control is often better attuned to local needs, so results tend to be better. Yet national issues are expensive, and there are collective benefits. A nation of 5M breaking off from a nation of 64M, well, that's not a particularly large nation either by size or by population. 

 

For those in the region, what are your thoughts on the matter?


Private virtual functions, public virtual destructors, and protected non-virtual destru...

19 March 2014 - 10:16 PM

EDIT: Splitting this topic off to a new topic because it is too disruptive where it is. Earlier discussion here

 


"Public and virtual" -> Unnecessary if not inherited, necessary if inherited.
"Protected and non-virtual" -> What protection does that give?
 
Something seems to be going over my head here.  Would you mind elaborating?

(Perhaps my question + your explanation should be split into its own thread in the General Programming subforum if the answer is technical)

 

 

Herb Sutter (the chair of the C++ committee) described it well several times over the years. The reasons to use virtual functions and the proper place for them is something worth frequent reminding.

 

Most experienced c++ programmers should be familiar with all four of these detailed guidelines.

 

Item 4 on the list covers this specific case. Seeing all the protected functions means the class is meant for inheritance, therefore it seems public and virtual is the rule.

 

 

 

Item 1 on the list is especially painful, and I try to educate game programmers when I see it.  Back on one of my DS titles (remember: 66MHz, or 1 million cycles per frame) one of the leads decided to make some of the major classes have public virtual interfaces. Since he was fairly new to C++ coming from a C background and since the code sometimes did rely on polymorphic behavior, he was hard-pressed to be convinced differently. This seemed to be the C++ way of doing things: public virtual functions were found in a few libraries (not the C++ standard libraries, of course!) so he was convinced to use them.

 

Down the road a few weeks we were looking at profiles of the rapidly growing game.  A large percentage (we couldn't be certain yet) of our CPU time was being consumed by virtual dispatch in final-optimized builds. Evidence in hand, it was easy to test and verify. In my test I refactored only two or three of the simplest ones (the ones with no variation in leaf classes) and recovered several percent of each frame's compute cycles.

 

It wasn't too difficult to change once he saw the problem. We removed the virtual functions from the public interface of several major base classes, sometimes creating a member variable that was modified during constructor, other times creating functions for the bits that needed to be dynamically overrriden, and we powered through the major offenders in the code base in about a day. IIRC we recovered about 8% of our CPU time with that simple change.

 

Overuse of virtual functions can quickly ruin game performance. An obvious symptom (if you are actually concerned about it) are a large number of zero-byte or four-byte functions in the symbol table. Usually these are virtual functions that do nothing; in many cases it is possible to completely eliminate the function call overhead.

 

 

As for the complications, you can call "delete pFoo" when the object has a private destructor. What you cannot do is call the destructor directly, which can be an issue with classes like shared_ptr or a custom memory managers. The solution there is to provide a deleter function, which is an optional parameter on shared_ptr and many custom memory managers that defaults to a template value of Foo::~Foo but can be customized with whatever you need.


GameMaker:Studio free until March 2

24 February 2014 - 10:13 PM

The fine folks over at YoYo Games have announced that GameMaker:Studio standard edition is free for a limited time, and the professional version is deeply discounted.

If you were on the fence about picking it up, or just curious about using it, now may be a great time to pick it up.

Unity offers basic service for Android and iOS for free.

22 May 2013 - 10:45 AM

The full story is at their web site:

 

http://blogs.unity3d.com/2013/05/21/putting-the-power-of-unity-in-the-hands-of-every-mobile-developer/

 

In the past they have had offers of the Android and iOS licenses for free, looks like they are making it a permanent thing.

 

 


Ironic game gets pirates to feel the sting of piracy.

29 April 2013 - 11:35 AM

Over the years, I've been convinced that indie developers should not really focus on DRM, focusing on paying customers.   Also over the course of several years I've also suggested quite a few times in the business forums that indies should even consider intentionally releasing their games on piracy sites, possibly with added in-game ads or other incentives to legally purchase the game.  

 

Looks like somebody finally did that with an added ironic, and very beautiful, twist.

 

 

A game studio called GreenHeart Games developed "Game Dev Tycoon", a game where you run a virtual software development shop.  They released it DRM-free for legal purchases.

 

They also seeded a special build for pirates.  In the pirate-released build, the virtual game dev studio does well for a while and then starts to have their products get hit by piracy.

 

The studio's blog post is one of the best things I've read all year:   http://www.greenheartgames.com/2013/04/29/what-happens-when-pirates-play-a-game-development-simulator-and-then-go-bankrupt-because-of-piracy/

 

Reading the forum posts where game pirates complain about piracy and ask for new forms of DRM is just incredible.


PARTNERS