Have you had a coding headache?

Started by DrewCCU, Sat 08/05/2010 03:46:12

Previous topic - Next topic

DrewCCU

Let it be known that i've been working on this one particular piece of my game for just about all day.

And i have realized that coding an NPC to have artificial intelligence (while very possible) is harder than I thought. LoL. I needed a break fro the world of If's, else's, integers, operators, and bools so I thought I would just vent a little bit here on the forums.

I'm trying to create a realistic AI and it's coming along nicely but slowly.  However, I'm almost done and I can't wait to finally be through with this!!!!!

So, with that being said, I'd like to ask all of you a question:

Is there one section of coding in your current (or a previous) game that you imagined would be much easier than it actually was?  If so, what were you coding that gave you the biggest headache and took longer than expected?
"So much of what we do is ephemeral and quickly forgotten, even by ourselves, so it's gratifying to have something you have done linger in people's memories."
-John Williams

Dualnames

The CatLady Interface. Personally I blame Grim. Every time I went to code that thing, I had the biggest headache ever. It was like a curse.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Calin Leafshade

#2
One word... Pigeons

EDIT: actually also my modulus function for floats.. that was a brain teaser despite only being about 3 lines of code in the end.

tzachs

Yes! For AGS Footballer I made a terrible design error. Basically I thought to set up all the gameplay for the first half, and each footballer had a flag telling it if it attacks up or down. After finishing that, it was time to set up the second half, and I thought it would be pretty simple, just switching the directions to all the players, I actually thought it would take me less than 5 minutes to set it up. The problem was, All the methods of "who touched the ball last" etc were built upon of whether it was team up or team down, instead of team1 or team2, so basically everything stopped working in the second half. By the time I figured out I didn't make this distinction, I already wasted some precious testing time, and then I had to refactor the whole code.
What I thought would take 5 minutes took me in fact ~3 days...   >:(

abstauber

Ramps in my upcoming platform engine, I've planned a few hours and it took about a week to make it bugfree.
It's still not 100% (argh!)

Calin Leafshade

ya know, my platformer did already have ramps in it.. did you change them?

and if so, what improvements did you make and how?

abstauber

Almost everything? :D

Unfortunately your method didn't work with tiles.

    []
  []
[]

My biggest problem was to stop the player falling through the gaps between the stair tiles. But now we come to mention ist, movable platforms that lets the screen scroll were a pain too ;) Thanks to this official cry-thread I can finally tell you people :D

GarageGothic

Anything that involves trigonometry usually ends with me fiddling around so much that I break the script and have to redo it from scratch because I no longer have any idea what each part of the code does. Countless times I've had a script working 90% but glitching severely in some boundary cases, so I more or less at random add a minus or Abs() that seems to fix the issue, and before I know it there's divide-by-zero bugs all over the place, or the game crashes failing to allocate memory to absurdly huge DynamicSprites.

I can't believe it took me until now to implement generic utility functions like DrawRotatedAroundCoord instead of struggling with Pythagoras every time it was needed. I was young an foolish. In much the same way that I based the original version of my ShadowBox module on 2D trig with some patched on perspective deformation factor that I barely understood. Not to claim that adding a proper z-dimension has made the code any simpler, but at least I now know that it works (and more importantly, WHY it works) instead of just crossing my fingers and pressing F5.

Pixelton

Well I'm working on my first little game which is more of an excercise in learning AGS than in actually creating a an amazing game (and in all honesty it isn't that great). I'm not a programmer although I have scripted in many other game engines. I've always found it tough.

Well I've hit many problems with my game...and I know it would have been ready for release a long long time ago if I was any good at scripting but as it stands I;ve had to do alot of inefficiant things to achieve the various effects I've implemented.......duplicating characters, duplicating objects and hiding and showing objects that either have an effect on them and don't. As you may have guessed I'm not doing anything complicated but my code has got quite messy :(

On a side note...I'm one bug away from actually releasing it but hit a brick wall...LOL
Please follow our progress on IndieDB!

<a href="http://www.indiedb.com/games/dustbowl-a-wasteland-adventure" title="View Dustbowl - A Wasteland Adventure on Indie DB" target="_blank">Dustbowl - A Wasteland Adventure</a>

Igor Hardy

At some point while coding Frantic Franko I noticed that, while the MovementLinkedToAnimation is on for the main character, the scrolling gets awfully choppy, especially the vertical one. I came up with a "brilliant" work-around that broke the game's whole interface. Nothing in the game worked properly, but I got so engrossed in my own idea that despite the pain I managed to make both the scrolling smooth and the controls working after several days. The only thing that is still not so cool is that "the camera" seems to be floating away from Franko somewhat in rare cases.

Ali

Ascovel, mightn't my scrolling module have done the job for you?

And since I'm no good at coding every aspect of that code caused me a headache, except the bit Steve McCrea wrote. Which is the bit that does all the work!

Igor Hardy

Quote from: Ali on Sat 08/05/2010 15:52:13
Ascovel, mightn't my scrolling module have done the job for you?

And since I'm no good at coding every aspect of that code caused me a headache, except the bit Steve McCrea wrote. Which is the bit that does all the work!

When I noticed the problem I tried your module (that was the older version then), but it didn't help or I was unable to take advantage of it. I think the reason was that I needed to be able to precisely control the ViewPort at times (and all of a sudden moving it smoothly to the desired position) and not have it always centered on the main character.

I think maybe in another game I will be able to use my technique for some real time camera-like reactions to what happens around the main character. Though it might give the player a sense of vertigo.

LRH

The 'what's your name' riddle in Cryptic... ugh.

Dualnames

Also how could I forget. The Babel Fish Puzzle. Solving it equals Coding it.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Radiant

I tried writing The Incredible Machine in AGS. Wow, that's tricky.

m0ds

#15
Quote from: Radiant on Sat 08/05/2010 19:34:38
I tried writing The Incredible Machine in AGS. Wow, that's tricky.

Oh man, I'd actually consider you a god if you did that!

Otherwise, crazy foreigner it is ;)

I don't want to be totally OT so two words: Games Galore. Writing a management sim in AGS gave me a headache. But not as much by any distance as the toothache I had at the time. And anyone who's had rotting tooth ache will know it's far worse than any AGS coding headache  :=

Jared

In the project I'm on there's a computer password sequence - the guy doing the graphics who dabbles in AGS gave me a keyboard sprite for the player to use on screen. When I went over what I'd done (which itself took a long while to set up) with the project leader he was unhappy and insisted that I set it up so it would all be done with the computer's actual keyboard. The state of the screen and various commands involved made it too impractical to do with a GUI so... a day of coding, hunting through the help file, guesswork and testing followed.

Wonkyth

This thread is proof that some peoples need to touch up their algorithm development skills.  :P

As for me, anything involving tiles is a pain, which is why I deal with Euclidean Polygons instead. Much easier that way.
"But with a ninja on your face, you live longer!"

Mr Flibble

The only thing I can think of is a puzzle I was coding which involved a lot of random events, running a loop until a certain number of random conditions were met. Obviously this caused a lot of crashes and was messy.

I thought about it for a while until I realised I should be shuffling a list of random states, rather than randomly setting each element in the list until I had a certain number. Spent about half an hour working out a pretty neat shuffling algorythm. Then I looked up "shuffling algorythm" on google to see if I was doing it right, and, well, I'd accidentally discovered the Knuth algorythm. I wish I'd been around 70 years ago to put my own name on it  :=
Ah! There is no emoticon for what I'm feeling!

Technocrat

In my lander game, it was the first time I'd been exposed to the wonderful world of things like floats and such. While the initial stage, making the spaceship go up and down, was easy it suddenly became a lot more complex than I expected when I had to make things collide. As it was, I just decided to scrap ship-ship collisions in the end and relegate it to the ever-growing pile of "deleted features".

SMF spam blocked by CleanTalk