Jump to content


Photo

How OCD are you with your projects?


  • Please log in to reply
29 replies to this topic

#1 Samuel Venable

Samuel Venable

    GMC Member

  • Banned Users
  • 632 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
  • 383 posts
  • Version:GM:Studio

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
  • 841 posts
  • Version:GM8.1

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
  • 891 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
  • 2443 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

  • Global Moderators
  • 7345 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
  • 27 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
  • 8280 posts
  • Version:GM:Studio

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

    Graphics Enthusiast

  • GMC Member
  • 2665 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
  • 307 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
  • 891 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

  • Global Moderators
  • 7345 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

    Slayer of gingers

  • GMC Member
  • 3864 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

  • Global Moderators
  • 7345 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
  • 3003 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

  • Global Moderators
  • 7345 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

#21 JAk HAk

JAk HAk

    sepius fidelis

  • New Member
  • 713 posts
  • Version:GM:HTML5

Posted 26 April 2012 - 04:41 AM

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.

I don't trust my CPU, GPU and screen refresh rate to always sync up properly. So, instead of running at an excessively high frame rate, I use third party software to monitor how much of my processor is being taken up by the game running at normal speed, and then use some metric based off of how fast I think my equipment is compared to other people. :thumbsup:

OT: I won't proceed with something if I've encountered a bug. All progress halts until I'm sure I've solved it, and that often involves play-testing far more thoroughly than necessary to ensure eradication.
  • 0

#22 YellowAfterlife

YellowAfterlife

    GMC Member

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

Posted 26 April 2012 - 05:41 AM

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.

var i, p, iii;
maxid = -1;
maxpower = 0;
for (i = 0; i < instance_count; i += 1) {
    iii = instance_id[i];
    if (!instance_exists(iii)) continue;
    if (iii.object_index != unit) continue;
    p = iii.power;
    if (p <= maxpower) continue;
    maxid = iii;
    maxpower = p;
}
Mainly I'm only partially 'obsessed' with performance factor in GM games. Knowing how performance of arrays versus data structures compare for specific tasks, I may use one that will take more time to code but work better when done.

In other programming languages I'm often bothered about types of variables - from programming for phones with low CPU & RAM (via Java ME) I've learnt that it can actually matter to use integer types instead of floating-point ones.

Shared thing between all programming languages is having too many indentation levels - more than four of such normally mean that things are getting complicated, and likely hard to read. So 'continue', 'break', 'return' statements where applicable.
  • 0

#23 NukeTheCat

NukeTheCat

    Isaiah 11:6

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

Posted 28 April 2012 - 10:09 AM

The time Silver Scratch sent me PvZ alpha for my graphics. I was like: 'WTF! He doesn't call his sprites spr_? and what with the capitals?'
I had to calm myself down and put it his sprite names

His sprite names:
SprPltPeashooter

My sprite name:
spr_plant_peashooter

Oh, and I obsessed with semi-colons. I almost flipped when Silver didn't add a single one!

Edited by Jlm07, 28 April 2012 - 10:12 AM.

  • 0

#24 chance

chance

    GMC Member

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

Posted 29 April 2012 - 11:26 AM

Oh, and I obsessed with semi-colons. I almost flipped when Silver didn't add a single one!

Following the recommended coding syntax for a particular language doesn't seem obsessive. Just normal practice.
  • 0

#25 NukeTheCat

NukeTheCat

    Isaiah 11:6

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

Posted 29 April 2012 - 02:15 PM

Double semi-colon?
variable = 0;;

Bracket between semi-colons
if place_free(x,y){
variable = 0;};

^Are these really normal practices?
  • 0

#26 chance

chance

    GMC Member

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

Posted 30 April 2012 - 10:40 AM

Following the recommended coding syntax for a particular language doesn't seem obsessive. Just normal practice.

Double semi-colon?

variable = 0;;
...
^Are these really normal practices?

No, they aren't normal because they aren't recommended coding syntax. They're just dumb. :tongue:
  • 0

#27 razourik

razourik

    GMC Member

  • GMC Member
  • 1871 posts
  • Version:Unknown

Posted 30 May 2012 - 01:06 AM

I always use even numbers and simple calculations (e.g. when levelling up in an RPG I've created variables will just be increased by * 2) :medieval:
  • 0

#28 SEC

SEC

    'Alert Moderator'

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

Posted 30 May 2012 - 05:39 AM

I'm not a perfectionist at all when it comes to organization; I put my objects in folders, but the names don't really make sense. (e.g.: props, scenery, weather, sun). I'm also really bad at naming objects. I've had many an hour be wasted because my objects and sprites are named the same. :(

I am a perfectionist, however, when it comes to level design and graphics. I make sure that the jump distance is perfect, and that the color of the sky is perfect. If someone doesn't look really good, I delete it. I suppose it's better to make your game look good, even if the inner workings are quite messy.
  • 0

#29 Super Guy

Super Guy

    The Real Superman!

  • GMC Member
  • 549 posts
  • Version:GM8

Posted 30 May 2012 - 10:03 AM

I try to make the game itself ABSOLUTELY perfect, but do not care much about what the code looks like.
  • 0

#30 fluidic ice

fluidic ice

    GMC Member

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

Posted 30 May 2012 - 10:15 AM

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.


Hahahaha +1'd, so true.
I've probably re-written my game 6 or so times, each with at least 7000 lines of code and to generally the same extent each time(very underway and playable) until i'm like: This can be optimized even more... Then I start again.
But when I start again I don't copy and paste the code, no. That would be too easy. I have to re-type it cause I HAVE to, for it to be absolutely perfect with none of the "old" horrible code in it. Although I have typed it out so much it's stuck in my head now, which could be seen as a good thing. And the first version of the game ever was completely horrible to look at compared to the latest and greatest version. (Probably about 5 years since the first version ever, and the most recent is from january 2012)

There's also a certain coding etiquette I must abide by to have it looking perfect sitting there in that script that non-one will see. Although that's about the extent of it, I can sleep with (non-code) errors in it, I just have to make sure their fixed by the next "release". Like a tank that's supposed to be visible is invisible in bushes (Working on that now >.<)

Edited by fluidic ice, 30 May 2012 - 10:17 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users