Jump to content

  • Log In with Google      Sign In   
  • Create Account


We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.

Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Member Since 07 Nov 2002
Offline Last Active Dec 24 2014 05:20 PM

#5188631 Does Valve have a good working methodology?

Posted by alnite on 22 October 2014 - 05:29 PM

Somewhat related:



There's also the part 2.  Check it out.


The whole idea of this loose structure is based off trust.  Without trust, this won't work.  So obviously, if you have an enormous company with poor management teams and where 50% of employees aren't happy, you can't just switch to this structure and expect everybody to get happy and get along.  This is something that has to be built from the ground up, starting from the core original employees, and the support from the management.


Managers of a Big Co sometimes want to keep that power.  Why?  They don't trust their employees will do the right thing.  They treat them like some kind of farm animals, resources that needs to be caged and directed to maintain order.  This is fine and well, but domesticated employees will do nothing but being told.  Without direction, they will refuse to work.  When there is no project to work on, nobody will come up with a new exciting project, people will simply sit and idle.  Not because they can't start one, because they don't want to.  Why should they?  They don't get paid extra for it, and perhaps if the project did end up successful, the managers or other people will try to steal the credit -- because there's no trust among the employees.


While a structure that's as loose as Valve's encourages employees to be independent, so they can have some 'ownership' or 'investment' to their projects, which ultimately benefit the company as a whole.  The idea is for employees to understand that the company trusts them to do the right thing, and that they should be the one turning the gears, not being the cog in the wheel.

#5182246 Fear of replacement

Posted by alnite on 22 September 2014 - 04:00 PM

Test, test, test your code.  Everyone makes mistakes, even professionals, even those with 1000 years of experience (exaggerated).  Your brain is so fragile that your thinking can be affected by the time you wake up/sleep, what you ate, what you drank, what your friend just told you, or a bug buzzing around your monitor.  Pretty much everything.  Any developer who refuses to write tests is only fooling himself.


Your coworker is immature.  Any senior engineer would've understood that everyone makes mistakes, and not make a big deal out of it.  He's not a team player, and plays the blame game.  If your manager is anywhere smart, he'd boot him instead of you.  Act professional, admit your mistakes, correct your mistakes, and don't play the blame game.  What you did was right.  If the company decided to boot you, it's their loss.  Really.  Keeping that coworker would damage the company more.

#5168691 Looking for feedback to add more of a 'point' to our game

Posted by alnite on 23 July 2014 - 11:33 AM

You need quests.  You need to direct people what to do when they first play the game.  I just tried your game, and found myself having to consult the manual a lot just to find out what I can do or cannot do.  And I have done a lot more reading than what most people would be willing to do.


As a level 1 thug, I can only pickpocket or punch, which only netted me ~$20/action.  When can I move on and do something else?  What commands should I enter to get to those?  I tried buying some drugs, and it tells me to get a container, and after consulting the manual (again), I can't find containers anywhere else in the shop.


Tell players exactly what to do:

"You are on your own and need some cash.  Type .crime pp or .crime punch"
> .crime pp
"You stole $100 from wandering tourists!  Awesome, let's buy some containers so we can get drugs later.  Type .shop buy container"
> .shop buy container
"You spent $10 on a container. Nice! Your buddy Joe asked you for some cash. Type .crime punch Joe to tell him to go away, or .debt add Joe to loan him some cash"
> .debt add Joe
"You loan $20 to Joe.  He said "I appreciate it" and left.  You now have $50. Go rob more tourists"
> .crime pp
"You stole $150 from wandering tourists!  Now let's try to trade some drugs"

You get the idea.  After players get a hang of the game with some commands, then you can let them go in the open world.

#5149515 Fastest way to get elements in one list but not in other and vice versa

Posted by alnite on 25 April 2014 - 05:35 PM

edit: ok. apparently I misread the question.


std::vector<T> difference(const std::vector<T>& A, const std::vector<T>& B) {
  std::vector<T> result(std::max(A.size(), B.size());
  for (auto &e : A) {
    if (std::find(B.begin(), B.end(), e) == B.end()) {
  return result;
difference(A, B); // A - B
difference(B, A); // B - A


Possible optimizations:

  • Sorted A and B can use binary search.
  • Only perform this operation when A/B change.  If you can identify a part in your code where A and B change, you can minimize the recalculation.

#5136251 Moving away from the games industry

Posted by alnite on 03 March 2014 - 11:31 PM

I am not in the game industry right now.  I switched around 4 years ago, after working on a failed game startup with crazy long hours.


I do not regret switching away.  However, that does not mean that I hated or gave up game industry completely.  There are moments where I would like to make a game, but it'd be my own game, not someone else's.  So you do not have to give up your passion in games.


Switching away also allows you to see what everyone else has been doing in the enterprisey technology -- what technology, tools, and practices they use.  Gee, DB, enterprise solutions, cloud technology, Big Data, Hadoop.  Even though some people may find them boring, I don't.  It's really up to your personality.


My lifestyle since then has changed a bit.  I play less and less games, because my crowd at work are naturally more diverse.  When I moved away, I realized game industry is a very exclusive community.  They love playing games, they love seeing pretty graphics, and they discuss games.  It's a very adorable community, and I meant that in a good way.  There are also some that are on the extreme side.  Hearing stories that you have to be a serious player of LoL if you work at Riot Games sound ridiculous to me now.  Moving away from it, if anything, actually benefits my perspective of the industry, and I could reapproach it later, if I want to, with a fresh pair of eyes and knowledge.

#5127610 Why it is so hard?

Posted by alnite on 30 January 2014 - 05:44 PM

I am not sure how artists could be hard to find, but to tell you the truth, if I were an artist, I too would be skeptical of these "profit-sharing" projects.


It's much easier to pay things up front.  Profit sharing is what mostly inexperienced developers would promise.  They can't pay, so they promise they would share profit.  Is there even a profit to begin with?  How can you guarantee profit?

#5127103 C++ Interface Review

Posted by alnite on 28 January 2014 - 07:54 PM


void TextButton::HandleInput(Mouse mouse)
	// Don't accept input if the button is disabled.
	if(isEnabled == false)

	bool isMouseOver = IsMouseOver(mouse.mousePosition);

	//Set MouseOverState
		if(mouseOverState  == MouseOverState::None)
		else if(mouseOverState == MouseOverState::Begin)



		if(mouseOverState == MouseOverState::Stay)
		else if(mouseOverState == MouseOverState::End)
			mouseOverState = MouseOverState::None;


IMO, you should have handled this on GameObject.  That way all objects that inherit from GameObject will get mouse handling for free.


Having said that, considering that your MouseOverState is just an enum, and its values are Begin, Stay, End, I would collapse all those mouse events into just one:


class IMouseOver
    virtual void OnMouseOver(const MouseOverState::MouseOverState&) = 0;


Then, when you want to invoke a Begin/Stay/End event:


if (isMouseOver)
    if (currentMouseOver == MouseOverState::None)
        currentMouseOver = MouseOverState::Begin;
    // ... and so on


currentMouseOver is an instance variable that belongs to TextButton.  Again, If you do this on the GameObject level, this implementation would be in the GameObject, currentMouseOver would belong to GameObject.  TextButton, ImageButton, EtcButton would get it all for free, and they don't have to maintain the mouse over state.


You could also go another step.  Not all GameObjects should respond to mouse states.  Some GameObjects might be invisible, for example.  Then you can create another class, let's call it UIObject, which inherits from GameObject and implements the IMouseOver interface.  Then your TextButton/ImageButton would inherit from UIObject.


class GameObject { ... };
class UIObject : public GameObject, public virtual IMouseOver { ... /* implement your mouse stuff here */ };
class TextButton : public UIObject { ... };

#5126788 C++ Interface Review

Posted by alnite on 27 January 2014 - 02:01 PM


#pragma once

namespace MouseOverState
	enum MouseOverState
		None =0,

class IMouseOver
	virtual ~IMouseOver(void) {};
	virtual bool IsMouseOver(sf::Vector2i mousePosition) =0;
	virtual void OnMouseOverBegin(void) =0;
	virtual void OnMouseOverStay(void) = 0;
	virtual void OnMouseOverEnd(void) =0;
	virtual void SetMouseOverState(MouseOverState::MouseOverState mos) { mouseOverState = mos;};
	virtual MouseOverState::MouseOverState GetMouseOverState(void) const { return mouseOverState; };

	MouseOverState::MouseOverState mouseOverState;



Why don't you do this instead?


class IMouseOver



    virtual ~IMouseOver(void) {};

    virtual bool IsMouseOver(sf::Vector2i mousePosition) =0;

    virtual void OnMouseOverBegin(const MouseOverState::MouseOverState&) =0;

    virtual void OnMouseOverStay(const MouseOverState::MouseOverState&) = 0;

    virtual void OnMouseOverEnd(const MouseOverState::MouseOverState&) =0;


#5114236 Help please, :)

Posted by alnite on 04 December 2013 - 12:21 AM

I can't believe you linked me to google blink.png . I searched google in relation to qt but didn't get any answer that is why i asked.


Anyways, my question has been answered by qtcenter ( thankfully).biggrin.png


In the future, it's always a good thing if you spend some effort to your question before asking it.  Don't just expect us to solve your issues at your whim.  Always search your question first on major search engines, most likely someone else have the solutions and posted it somewhere.

#5082575 Why XML is all the rage now?

Posted by alnite on 02 August 2013 - 03:09 PM

And just to reinforce my point, in INI:


Just when I thought "maybe I should do the INI too!"  biggrin.png

#5077998 Is this project a good way to learn AI programming?

Posted by alnite on 15 July 2013 - 05:53 PM

I think it's a bit too much for beginners.  Deciding which skills to use, maintaining the right distance, when to fight and retreat, etc is actually quite complex.


Here's some few AI exercises I think can be good for beginners:


1. Tic Tac Toe - FSM and min-max tree.

2. Boss battles  - If you notice, boss battles typically have patterns that players must figure out.  Boss does A, then B, and if condition X is satisfied, then C.  The pattern repeats, and may adjust depending on player's condition.  This is good exercise for FSM.

3. Then, I think you would have enough experience necessary to start coding a LoL arena matchup :)

#5068990 Transforming the Young Blank Dull Slate into a sharp Genius In Math.

Posted by alnite on 11 June 2013 - 05:00 PM

ill tell you one thing the kid love's 3d modeling hes a blender addict and does some pretty good stuff as he's more visual but the logic just isn't coming in , and please don't say that lmao were trying to find way's to help him mainly in the math area.


Then he's probably better suited in art.  Maybe he should start pursuing in that direction?


You don't have to be a programmer to make games..

#5039818 POV for ship to ship combat in pirate RPG

Posted by alnite on 05 March 2013 - 07:52 PM

I'm familiar with Pirates, and other games that are based off of Pirates.  My 2 cents.


How do you want people to play your game? Do you want it to be tactical? Tactical games prefer a bird's eye view so you can see other ships and their locations.


If you are gearing toward more actions, then first person view might be better.  First-person captures the thrill of chasing, or being chased by, a ship.


Walking around on the deck has more role-playing elements.

#5036965 C++ Array

Posted by alnite on 26 February 2013 - 07:59 PM

Get the SHA of the array is usually the preferred choice of detecting changes.  You just compare the SHA of the array before and after.  If there's even a tiny bit of alteration, the SHA would completely change to something else.  It does not tell you, however, where the changes are.


I don't have a first-hand experience of using SHA in C++.  It seems some library are better suited than another depending on the type of your application (commercial/free).  This library, Crypto++ seems to be a good candidate.

#5036508 Multithreaded programming

Posted by alnite on 25 February 2013 - 05:13 PM

As people have said, multithreading needs to be threaded carefully (pun intended).


If you truly want to learn it, here's a fun thing you can do: make an audio player.  With SDL/SFML or whatever GUI lib you decide to use, create a Load, Play, Pause, Stop buttons.  Then there should be an audio playing in the background.  Try playing a really big audio file (100MB WAVs), without loading it all up at once.  Playing audio must be done on a separate thread.  Load/Play/Pause/Stop buttons must be able to signal that thread appropriately, and the audio thread must signal back to the main thread.