Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1036929 Posts in 41877 Topics- by 33490 Members - Latest Member: SilentSheepGames

August 28, 2014, 07:26:17 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Post if you just laughed at your code.
Pages: 1 ... 26 27 [28] 29 30 ... 37
Print
Author Topic: Post if you just laughed at your code.  (Read 55058 times)
JobLeonard
Level 9
****



View Profile
« Reply #405 on: April 05, 2013, 08:08:10 AM »

I downloaded that source to look for a weird bug I had when I was younger and I had been playing JKA. It occured when you:
-Jumped up slightly
-In the air you had to kick in any direction with staff lightsaber
-Then, in the same moment you hit the ground, you had to jump & kick at the same time. That made you jump skyyyy high.

Didn't really find any answer to that  Sad
I guess it's just a dirty bug.
Sounds like a floating point divide by near-zero error.

EDIT: The paging, it burnssss!
Logged
kamac
Level 10
*****


Notorious posts editor


View Profile Email
« Reply #406 on: April 05, 2013, 08:42:57 AM »

I downloaded that source to look for a weird bug I had when I was younger and I had been playing JKA. It occured when you:
-Jumped up slightly
-In the air you had to kick in any direction with staff lightsaber
-Then, in the same moment you hit the ground, you had to jump & kick at the same time. That made you jump skyyyy high.

Didn't really find any answer to that  Sad
I guess it's just a dirty bug.
Sounds like a floating point divide by near-zero error.

EDIT: The paging, it burnssss!

Yeah, I thought that the cause might be some division fail.. Namely, there's a division by forceJumpCharge and a timer - by guess I think that when you land and jump right away, one of these is very, very little.
Logged

Nothing to do here
JobLeonard
Level 9
****



View Profile
« Reply #407 on: April 05, 2013, 12:37:08 PM »

So if you time it correctly you jump sky high, and the suspects are forceJumpCharge and a timer?

Book 'm Danno Noir
Logged
Postmita
Manbaby
*


View Profile
« Reply #408 on: April 05, 2013, 07:11:55 PM »

I have laughed at my own code a few time. Recently I discovered that "if" statements only seem to work if you are checking the right variables. Gave me a little relief that I wasn't losing my mind, but also planted some doubt that maybe I was.
Logged
Eigen
Level 10
*****


Jebus backups.


View Profile WWW
« Reply #409 on: April 11, 2013, 10:43:54 AM »

Code:
// Divide into 256 x 256 pieces

int pieceSize = 128;

Huh?
Logged

BleakProspects
Level 4
****



View Profile WWW Email
« Reply #410 on: April 15, 2013, 06:50:54 PM »

I just made the most retarded programming decision in my life.

here's the problem:
I have a bunch of different kind of ramps. Basically, each "ramp type" is a combination of whether or not each top vertex of a cube is lowered into a ramp. So there are ~16 ramp types.

Supposing I have a bunch of these ramps all next to each other, how can I efficiently render them without rendering any non-visible faces? Basically, I needed a function that, given two ramps next to each other and a face, returned whether or not the face should be drawn.

After spending a lot of time trying to derive the solution to this problem and running into a bunch of corner cases, I got frustrated, gave up and decided to do it all by brute force. It turns out that combinatorically, this blows up to 784 cases.

So I just made an array that was 784 large. Then I wrote a script to loop through all the cases and prompt me on whether or not to draw the face in that situation. Looks something like this:



The red face is the face in question, and I press "t" or "f" to decide whether or not to draw it. It then loops through every case. The program spits out C# code which then runs in my game and fills the giant array.

After a few runs of this program, I finally made no mistakes and the thing works perfectly.

WTF was I thinking?
« Last Edit: April 15, 2013, 07:07:36 PM by BleakProspects » Logged

Geti
Level 10
*****



View Profile WWW
« Reply #411 on: April 15, 2013, 10:54:30 PM »

Bahahaha awesome Coffee Hope it didn't take longer than an hour.
Logged

_Tommo_
Level 8
***


frn frn frn


View Profile WWW
« Reply #412 on: April 16, 2013, 02:05:58 AM »

WTF was I thinking?

I... I... Master, please teach us Hand ClapEpileptic

(but on the other hand it's better than wasting a day to have a "real" solution!)
Logged

JobLeonard
Level 9
****



View Profile
« Reply #413 on: April 16, 2013, 04:46:11 AM »

Quite often, "real" solutions are for when you need general solutions, which kind of misses the point of optimisations.

Like the name of the Processing sketch Tongue
Logged
Muz
Level 10
*****



View Profile Email
« Reply #414 on: April 18, 2013, 12:02:46 AM »

I was rushing through testing a file output function. Not wanting to bother finding the folder of my app, I just copied it from another function. Also copied the file name too.

Turns out that I just overriden my main database file with some dummy text. It killed the whole app, but thankfully, it's recoverable. Would've been more amusing if the database was located in the root directory, since I overrode all the root protection stuff to debug faster.
Logged
2DArray
Level 0
**


View Profile Email
« Reply #415 on: May 07, 2013, 08:23:10 AM »

My line ended with "List.<int[,]>();" and suddenly I feel like I'm typing in Wingdings.
Logged
Belimoth
Level 10
*****


high-heeled cyberbully


View Profile
« Reply #416 on: May 07, 2013, 11:41:00 AM »

If keyboards had wingdings instead of a numpad or something I would enjoy coding with them.
ZODIAC SYMBOLS EVERYWHERE
Logged

JobLeonard
Level 9
****



View Profile
« Reply #417 on: May 08, 2013, 02:39:23 AM »

Try APL
Logged
Belimoth
Level 10
*****


high-heeled cyberbully


View Profile
« Reply #418 on: May 08, 2013, 08:18:54 AM »

 Kiss
Logged

ThemsAllTook
Moderator
Level 10
******


Alex Diener


View Profile WWW
« Reply #419 on: May 08, 2013, 10:20:03 AM »

Try APL

What I experience watching this must be what it's like for my parents if I ever talk about programming around them.
Logged
Pages: 1 ... 26 27 [28] 29 30 ... 37
Print
Jump to:  

Theme orange-lt created by panic