• Register
Forum Thread
  Posts  
Code Fatigue : When scripts become bloated and feel like a mess (Forums : Coding & Scripting : Code Fatigue : When scripts become bloated and feel like a mess) Locked
Thread Options
Jul 30 2014 Anchor

Hi guys,
Doing some scripting for a procedural based game I am making, and have come across what I am naming temporarily as code fatigue.
So its always nice when you start a fresh script and there is nothing there. Gradually though it becomes populated and thanks to good planning it feels like a sleek design thats well organised and is about 100 lines of code shared between two scripts that communicate with each other.

Then you realise there is a flaw in your original plan, you walk away and think about it for a while. Then an idea springs to mind.

You go straight to the computer and hammer it out.

You then discover that it requires slightly more implementation that previously thought, you hammer out a few more methods to deal with this unanticipated problem.

Sure enough within a couple of fixes your code it looks like a jungle as you scroll through, even though each individual method is nicely commented and laid out.

Any thoughts?
Hugo1005

Jul 30 2014 Anchor

Refactoring is a large part of the process.

Jul 31 2014 Anchor

Refactoring is development. I make good progress adding new features into my game, and then go through a process of refactoring and adjusting the general architecture of my solution. It is what holds me back and prevents progression onto new features, however it is always worthwhile and just a natural part of development.

It just so happens I am in the process of refactoring my AI movement in my game.

Also its not necessarily good to have 2 scripts dependant on each other as you have stated:
...100 lines of code shared between two scripts that communicate with each other...

Edited by: Glitch100

--

Hierarchy - Upcoming RTS/Strategy/Survival/RPG
HIERARCHY
Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.