Jump to content


Photo

How OCD are you with your projects?


  • Please log in to reply
29 replies to this topic

#1 time-killer-games

time-killer-games

    GMC Member

  • Banned Users
  • 539 posts
  • Version:GM:Studio

Posted 19 April 2012 - 12:36 PM

Discuss here what area of GM you struggle most with being a perfectionist.

I'm a perfectionist when it comes to variables and custom functions/scripts. I always have to use the right words in the right order, no caps, no spaces, and only use lowercase with underscores. trying to make it look like the game was programed by Mark O. or YoYo but not just some 17 year old who needs a life. If I don't have the vars and scripts just right, and can't figure out the perfect name for each, I'll keep on renaming them until I get it right.

Edited by time-killer-games, 19 April 2012 - 12:37 PM.


#2 Fihrilkamal

Fihrilkamal

    GMC Member

  • GMC Member
  • 348 posts

Posted 19 April 2012 - 01:47 PM

I'm always being a perfectionist when it comes to debugging, I can't sleep well when my game still has bugs and glitches.
  • 0

#3 teej

teej

    The PIXEL'er

  • GMC Member
  • 840 posts
  • Version:GM8

Posted 19 April 2012 - 01:59 PM

I really like using tabs rather than spaces for putting indention in my codes, but it seems not all people thinks the same. I go so far that with some open source gmk scripts (that I like) I have I always can't help but re-indent them using tabs all over again.

i always turn this:
{
  maxid = -1;
  maxpower = 0;
  for (i=0; i<instance_count; i+=1){
    iii = instance_id[i];
    if (instance_exists(iii))
      if (iii.object_index == unit){
        if (iii.power > maxpower){
          maxid = iii; maxpower = iii.power;}
      }
   }
}

into this:
{
    maxid = -1;
    maxpower = 0;
    for (i=0; i<instance_count; i+=1)
    {
        iii = instance_id[i];
        if (instance_exists(iii))
        {
            if (iii.object_index == unit)
            {
                if (iii.power > maxpower)
                {
                    maxid = iii; maxpower = iii.power;
                }
            }
        }
    }
}

It looks longer, but i extremely prefer it that way.

Edited by teej, 19 April 2012 - 02:04 PM.

  • 0

#4 Futhark

Futhark

  • GMC Member
  • 682 posts
  • Version:GM8.1

Posted 19 April 2012 - 04:39 PM

{
    maxid = -1;
    maxpower = 0;
    for (i=0; i<instance_count; i+=1)
    {
        iii = instance_id[i];
        if (instance_exists(iii))
        {
            if (iii.object_index == unit)
            {
                if (iii.power > maxpower)
                {
                    maxid = iii; maxpower = iii.power;
                }
            }
        }
    }
}

It looks longer, but i extremely prefer it that way.


:thumbsup:

I completely agree with that one. It's how I learned to format it when I took a course on Pascal "back in the day"

It's just easier to follow, plus it's also cleaner overall, in my opinion. It's visually more logical to read through.

Edited by Futhark, 19 April 2012 - 04:41 PM.

  • 0

#5 Saijee

Saijee

    GMC Member

  • GMC Member
  • 2256 posts
  • Version:Unknown

Posted 20 April 2012 - 04:12 AM

I like to use as few lines as as possible that would make chronological sense.
if I_am_cool{awesome+=1; lame-=1;radicalness+=1; if has_sunglasses_on play_awsome_theme=true;}
if I_am_smart{time-=1; vocabulary+=4; learning_ability+=1; if needs_glasses vision=-3;}
if I_am_random{surpise+=9; sillyness+=1; predictablity-=99; energy=max_energy;}

  • 0

#6 chance

chance

    GMC Member

  • Reviewer
  • 5770 posts
  • Version:GM:Studio

Posted 20 April 2012 - 11:20 AM

I'm always being a perfectionist when it comes to debugging, I can't sleep well when my game still has bugs and glitches.

This (above) is time well spent.

This (below) is less so.

If I don't have the vars and scripts just right, and can't figure out the perfect name for each, I'll keep on renaming them until I get it right.



I suppose having clean code is analogous to what your mother always said: wear clean underwear. Usually, nobody ever sees it. But if you're really unlucky and have a car wreck.... or you get lucky on Saturday night... you want to look your best. :wink:
  • 0

#7 daniel_lemke

daniel_lemke

    GMC Member

  • GMC Member
  • 12 posts
  • Version:GM8.1

Posted 20 April 2012 - 03:34 PM

I always try to make my code as easy to read and logical to follow as possible. And 8 space wide tabs. I have a coding convention that I follow as closely as possible to keep things consistent.
  • 0

#8 Yal

Yal

    Gun Princess

  • Global Moderators
  • 5837 posts
  • Version:GM8.1

Posted 23 April 2012 - 10:39 AM

I personally think that your code gets easier to read with small tab distances; I code with a tabbing of 4 and usually use a tab of 2 spaces when sharing code at the forums.

When coding, I usually end up having messy code when I do something for the first time; if I reuse code for a later game I often try to clean it up more. It might have something to do with impatience or something, but when I write code for myself I often end up having quite gritty results. I'm not sure what causes it, because I'm really strict with tabbing and whitespace, so it's likely something about the way I structure up the flow of the code. That's perhaps why my code always look better the second time around; once you know exactly what you're trying to do the flow is much easier to get down in a good way.
  • 0

#9 Phantom107

Phantom107

    Engineer

  • GMC Member
  • 2597 posts
  • Version:GM:Studio

Posted 23 April 2012 - 03:16 PM

I think I'm pretty much the definition of being a perfectionist. That's why I can't anything released, I continuously improve on something and never know when to stop...

It's like my current project. I've rewritten it 5 times from scratch and it currently sports 3,500 lines of code. And I feel like I haven't even gotten started on it yet. So much more awesomeness to invent! So awesome infact, that I don't think anyone else in GMC has this kind of tech.

I think it's a curse.
  • 2

#10 MonkeyMaw

MonkeyMaw

    GMC Member

  • GMC Member
  • 263 posts
  • Version:GM:Studio

Posted 23 April 2012 - 07:00 PM

I think I'm pretty much the definition of being a perfectionist. That's why I can't anything released, I continuously improve on something and never know when to stop... It's like my current project. I've rewritten it 5 times from scratch and it currently sports 3,500 lines of code. And I feel like I haven't even gotten started on it yet. So much more awesomeness to invent! So awesome infact, that I don't think anyone else in GMC has this kind of tech. I think it's a curse.

We share qualities! You may be my long lost cousin of a cousin! I re-write projects like no tomorrow lol.

Discuss here what area of GM you struggle most with being a perfectionist.

I tend to line everything up, some may find that super annoying but it's like I just have to.

x           = 0;
y           = 0;
image_scale = 0;

Even in other languages I would do this. Let's say I wanted to create a graphics class in C++, it would be something like this but far worse ...

class CGraphics
{
public:
	CGraphics();
	~CGraphics();
	bool Initialize( HWND hwnd );
	void RenderBegin();
	void RenderEnd();
	void Shutdown();
	
	LPDIRECT3DDEVICE9 GetDevice()          { return( m_D3DDevice ); }
	LPD3DXSPRITE      GetSpriteInterface() { return( m_D3DSpriteInterface ); }
	LPD3DXFONT        GetFontInterface()   { return( m_D3DFontInterface ); }

private:
	HWND                  m_Hwnd;
	LPDIRECT3D9           m_D3DInterface;
	LPDIRECT3DDEVICE9     m_D3DDevice;
	D3DPRESENT_PARAMETERS m_D3DPP;
	LPD3DXSPRITE          m_D3DSpriteInterface;
	LPD3DXFONT            m_D3DFontInterface;
};

Edited by MonkeyMaw, 25 April 2012 - 10:02 PM.

  • 3

#11 Creativita

Creativita

    GMC Member

  • GMC Member
  • 172 posts
  • Version:GM:Studio

Posted 24 April 2012 - 08:38 AM

Does actually having OCD count?
  • 0

#12 Futhark

Futhark

  • GMC Member
  • 682 posts
  • Version:GM8.1

Posted 24 April 2012 - 11:41 AM

Does actually having OCD count?


As long as you don't use it as an excuse for double-posting.
As long as you don't use it as an excuse for double-posting.
  • 0

#13 chance

chance

    GMC Member

  • Reviewer
  • 5770 posts
  • Version:GM:Studio

Posted 24 April 2012 - 11:44 AM

Does actually having OCD count?

Don't most of us have some symptoms, at one time or another? Obsessive behavior is one of those personality traits with a range from mild to severe. Sometimes it's hard to find the boundary between "personality trait" and "disorder".

Most of us have harmless bouts of perfectionism occasionally. Only a few people actually become so compulsive that they can't function -- and those people usually don't realize they have a problem.
  • 0

#14 Creativita

Creativita

    GMC Member

  • GMC Member
  • 172 posts
  • Version:GM:Studio

Posted 24 April 2012 - 12:04 PM

My behaviours are characteristic symptoms of OCD. I often find myself performing tasks over and over again to prevent a negative event occurring, amongst other things.

Edited by Creativita, 24 April 2012 - 12:04 PM.

  • 0

#15 slayer 64

slayer 64

    GMC Member

  • GMC Member
  • 3278 posts
  • Version:GM8.1

Posted 25 April 2012 - 03:33 AM

i really like to make things efficient. if the code is not as fast as possible i gotta improve it, even if it's fast enough for the situation.
  • 2

#16 Silver Scratch

Silver Scratch

    GMC Member

  • GMC Member
  • 166 posts
  • Version:GM8

Posted 25 April 2012 - 04:05 AM

Oh! When i go back to my old projects and add stuff. I usually make weird var names.
var AA, DL, FJ;
AA=this
DL=what
FJ=omg
So i am a messy coder :P . I am not yet good with GM but i will fix them.
  • 0

#17 Creativita

Creativita

    GMC Member

  • GMC Member
  • 172 posts
  • Version:GM:Studio

Posted 25 April 2012 - 04:58 AM

Oh! When i go back to my old projects and add stuff. I usually make weird var names.
var AA, DL, FJ;
AA=this
DL=what
FJ=omg
So i am a messy coder :P . I am not yet good with GM but i will fix them.


I wouldn't see that as perfectionism.
  • 0

#18 chance

chance

    GMC Member

  • Reviewer
  • 5770 posts
  • Version:GM:Studio

Posted 25 April 2012 - 04:24 PM

if the code is not as fast as possible i gotta improve it, even if it's fast enough for the situation.

I share that obsession habit. I usually set my game at 60 fps -- but I always test it "wide open" to make sure it runs at >200 fps (at least). That way, I'm confident it'll run 60 fps even on slow/old computers.

But I often spend too much time just tweaking the code to see how fast I can push it -- even if it's already fast enough. Just something I enjoy doing, but it can waste time.

Edited by chance, 25 April 2012 - 04:26 PM.

  • 1

#19 TheSnidr

TheSnidr

    That guy

  • Global Moderators
  • 2439 posts
  • Version:GM:Studio

Posted 25 April 2012 - 04:33 PM

It's always fun when complicated equations collapse and produce simple equations, but I often have to spend a whole day or two figuring out where the different variables, vectors and numbers go. The best feeling of all is when a big part of the equation simply turns out to be 0, and can be removed.
As an example, a pathfinding on a sphere algorithm I made (meh) needed lots of complex calculations to add each obstacle to the mp_grid. After two days I had shortened it down to a total of three dot products, an arcsin and an arctan2 for each object :D

So as a habit I always looks for ways to shorten code
  • 0

#20 chance

chance

    GMC Member

  • Reviewer
  • 5770 posts
  • Version:GM:Studio

Posted 25 April 2012 - 11:57 PM

The best feeling of all is when a big part of the equation simply turns out to be 0, and can be removed.

I agree. And the nice thing about game making, is that you can "cheat" -- i.e., you can remove terms that are just small, as long as the end result still looks OK. Approximation is your friend. :tongue:

Of course, you can get into trouble when you're integrating step-after-step. In that case, tossing out small(ish) terms can lead to instability or unrealistic behavior.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users