Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 09 Dec 2005
Offline Last Active Yesterday, 10:08 AM

#5288630 GPL wtf?

Posted by Bregma on 25 April 2016 - 12:48 PM

The controversy is not because Ubuntu is shipping the GPL-incompatible ZFS on the same ISO image as GPL software, it's because they're shipping an OS image with ZFS linked into the Linux kernel.  The GPL expressly forbids linking GPL-licensed and GPL-incompatible software in the same binary in cloud images.


Ubuntu has never shipped GPL-incompatible software like binary-blob drivers from nVidia or certain multimedia codecs as a part of their default installation, it's always required the user to install it on their own initiative (derivatives like Mint have their own lawyers and can do what they want).  Even on the phones and tablets shipping with Ubuntu, it's been the hardware manufacturers adding 3rd-party incompatible blobs to their images, not Canonical.  The ZFS stuff is different.  I don't know what's changed since last I spoke with all the central players at Canonical who were still fanatically pro-GPL.

#5285795 Typing skills

Posted by Bregma on 08 April 2016 - 07:58 AM

I think 30 mistakes per minute is good.

#5284243 Should I start with fixed-function-pipeline OpenGL or the newest possible?

Posted by Bregma on 30 March 2016 - 06:22 AM

Is it possible to do game-related stuff with Computer Science degree, or should I find some major in Computer Graphics or something? There are some articles on the internet, but are kind of outdated, that's why I ask here.

A proper university undergraduate degree is not job training.  A degree in computer science will give you the foundation to do many things once you enter the vocational world, and remember, you are not a career, and jobs change radically faster than you realize.


You can devote your spare energy to doing game development and building your own portfolio without getting formal vocational training in a post-secondary institution. Once you graduate, you can then either choose specialization in grad school (which is sort of like vocational training for academia), attend a vocational school or college for formal job training in game development, or start marketing your skills and talent using your hobby portfolio.  Your computer science degree will still serve you well in 20 years while robots program all the quantum biocomputer implants we will rely on as we relax in our autonomous flying cars.


But I'd recommend starting with OpenGL 2 and the Red Book because first you need to learn about the graphics pipeline, basic 3D game program structure and dataflow, vertexes drawing and transforms, colour, textures, and all the basics before you open up the engine and see how the buffers and shaders work inside.  Consider what you write using OpenGL 2 as throwaway, but what you learn is not throwaway.  Your target will be to learn OpenGL 3.5 and OpenGL ES 2 and use that for writing games that are not throwway.

#5283710 Can memory leaks only caused by using the new keyword?

Posted by Bregma on 27 March 2016 - 07:32 AM

In C++ the main ways to allocate raw memory are the new operator, the new[] operator, and ::operator new(), each with a nothrow overload.  Replacing only one of those will not overload any of the other 5.  Chances are good that if you're using the standard library, you using one of the methods other than the one new operator.

#5283158 How can I locate a memory leak?

Posted by Bregma on 24 March 2016 - 09:30 AM

There might even be problems where you honestly cannot apply RAII in a reasonable manner.

The classic example of a problem in which RAII is inappropriate is transactions with commit/rollback semantics.  Otherwise, it is Best Practice™.

#5282954 How can I locate a memory leak?

Posted by Bregma on 23 March 2016 - 01:48 PM

Where I work we rely on a tool called 'valgrind' that tells you how much is leaking and where it was allocated. Also reports use-after-free and double-deletion. And other stuff. Very useful. We run all our CI tests under valgrind.

#5282878 Local hash

Posted by Bregma on 23 March 2016 - 08:24 AM

i took my first programming class in 1977 as a sophomore in high school.  i eventually went on to take software engineering at OSU. and now, 39 years later, i still have yet to use a hash table in a real world app.

Seriously? I find this bizzare, have you never used a dynamic language like python, ruby, or lua? These use hash tables idiomatically lots.

I don't find it bizarre. I've been a professional developer since the early 1980s and I have never explicitly used a hash table outside of academic exercises. I've never used Lua or Ruby, and if Python uses hashtables to implement its dictionaries, it's completely invisible and that's OK.

I've used a *lot* of std::map<> in C++. It's usually faster than a hash table for most things I need and has the strict weak ordering property, which I also usually need.

#5282466 Naming conventions, software documentation and version control

Posted by Bregma on 21 March 2016 - 05:18 PM

What naming conventions to follow? Is this all opinion based? Is there a/an common/industry standard style?

Yes, it's all opinion based.  Follow the one(s) you are comfortable with.  There is no industry style.  It might be informative to look at the naming conventions used in the standard library (defined through an ISO standards document) or through your favourite or most commonly-used toolkit.

How to keep proper backups?

Github, or even just a local git repo, or both, is perfect for single-developer projects.

#5281180 how could unlimited speed and ram simplify game code?

Posted by Bregma on 14 March 2016 - 05:52 AM

Yeah, we already have seemingly unlimited speed and memory.  What has it got us so far?


My first electronic computer had 256 bytes of memory and a 1 MHz (approximately) clock.  At my high school computer club they debated whether you could ever fill 4 k of RAM.  In the mid-1990s the company I worked for had a client that had an art database with over 1 terabyte of data, which was more storage than existed in the world when I was an undergrad, and now I can go to the local Staples and pick up a couple of terabyte drives for my home.  At the same time we got a server with a CPU that ran at 770 MHz, almost an order of magnitude faster than  everything else in the office, and it was 64 bits at a time when most software was breaking because it couldn't make the 16-to-32-bit transition.


So what's being done now with what would appear to someone from 30 years ago to be infinite CPU speed and memory?  Well, each generation seems to be the first to rediscover all the problems experienced by their predecessors, and reinvent all the same solutions.  I've been reading about this new concept introduced on the computer people carry in their trouser pocket called "multitasking" in which more than one program can run at the same time...  brilliant idea.


One of the problems that I meet every day in my current job is that people want to run all kinds of modern software on their modern hardware ("this tablet sucks, I tried to run my pirated copy of Adobe Photoshop and it was too slow and the screen was too small!!!1!!").  Turns out all those techniques I learned decades ago for running on slow processors with limited storage are still applicable and are still being rediscovered.  Those m-way external tape sorting algorithms, for example, are now called map-reduce and apply nicely to "data cubes".  Still, most of the problems we have are the same, except bigger.


Enough curmudgeonly ranting.


What if we had infinite-speed CPUs?  Then infinite loops would run much faster.  What if we had infinite fast storage?  We'd store more useless crap and have more trouble finding it.

#5280765 Right way to handle people complaining about price?

Posted by Bregma on 11 March 2016 - 01:33 PM


Or $3million if you value them at a competitive game developer's salary of $80/hr...


I'm not in the industry myself, but I think $80/hr would be a pretty small minority of game programmers. $50/hr would be closer, and many indies without years of professional work experience would be much less. Game Industry Salary survey - 2014


As a project manager when I costed a project, I used the nice round figure of $200/manhour as the baseline.  That covers the developer's salary, plus benefits employment taxes, plus non-developer staff, plus heating and lights and server time and licenses and capital depreciation and...  well, you get the picture.


It's been 20 years since I did project costing, so I would assume the baseline rate has gone up.

#5280160 Use of UML in Game Design

Posted by Bregma on 08 March 2016 - 07:24 AM

UML is a tool.  It has its appropriate uses.  Only you can decide where you will benefit from its use or if it's wasting your time.


Remember, UML, like Agile, is a commercial product developed for commercial purposes and has been promoted to that end especially through the high-return-on-investment academic channel.  It's a pretty good tool for helping you organize your thoughts and communicate your ideas, but it's no silver bullet and end-users do not play UML diagrams.

#5279251 Cross-platform API design

Posted by Bregma on 03 March 2016 - 07:12 AM

I want to use C++ as if it's C, but I'd like to to reinvent C++ again. Any suggestions?

You're on the right track with putting the platform-specific source in a separate storage area ("folder"). To take advantage of that, the method that was developed in your granparents' day was  to define a platform-independent API (in the C language, this is a header file) and provide platform-specific implementations called "libraries." Each source storage area contains code that will generate a platform-specific library that implements the defined interface, no need for #ifdefs.  That way, your separate source area gets built into a separate binary module that can be tested separately and mocked easily, compiled only where appropriate, and linked in to your final program.


You can handle the platform-specific stuff in your platform-neutral code by using opaque objects.  That is, you pass them around by pointer, and use API calls to construct and destroy the objects and to perform operations on those objects.  For a classic example of using platform-independent opaque objects in the C programming language you need look no farther than the C standard library's stdio module and the FILE type.


You can use struct composition in C to reimplement C++-style inheritance by placing the "base" struct at the beginning of the "derived" struct.  The language does guarantee the order of member data, so a pointer to the "derived" structs will be a pointer to the "base" struct.  An excellent example of using the C programming language to reinvent C++ classes is the gobject library.


Good luck and enjoy your adventure.

#5278177 Trailing return type

Posted by Bregma on 25 February 2016 - 03:51 PM

I tried your code under GCC 4.8.4 (with -std=c++11) and it compiled cleanly.

#5277864 Manufacturing chain for paper

Posted by Bregma on 24 February 2016 - 05:28 AM

(1) hygiene product are an enormous paper end-product: toilet paper, disposable diapers, feminine products (see other thread on YA games), paper towels, medical supplies, etc ... I wouldn't dismiss those so quickly


(2) the newsprint industry used to account for over 70% of all paper produced:  it's still there and still legit in a game


(3) wood pulp is widely used to make rayon, so it can feed the textile/clothing industry

#5277285 operator overload fail

Posted by Bregma on 21 February 2016 - 07:55 AM

Is the problem due to ambiguity?  Your t4dpoint is a t3dpoint (which does not really make much sense, I don't think inheritance is the right trick to use here) so when the compiler goes to resolve which function to call, it can't.


I'm going to go ahead and guess that you're making these binary operators member functions.  I recommend you start by taking the widely-accepted advice of always making binary operators non-member functions.  Then, move on and avoid using inheritance when it does not model an is-a relationship.  Your problems may just magically get solved.