Homesource Forums

Homeworld Source Editing Talk
It is currently Mon Apr 24, 2017 4:01 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 17 posts ] 
Author Message
PostPosted: Sat Jan 22, 2005 7:32 am 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
Every now and then when working on source code written by other people you come across something that makes you laugh. A comment, a variable or function name, something gives you a small insight into the mind of the developer at the time. Here are some of the things that have made me laugh:

The hexadecimal equivalent of upside-down calculator words:

Code:
#define TR_BadCRC 0xdeadb00b

Knowingly writing crap code just to fix the current problem and get on with something else:

Code:
//fix later:  this is bad because this 'formation' is
//only a pseudo formation...it will fuck up other sub formations
//FUCK!

This variable exists in the code that makes mines home in on their target:

Code:
Ship *ShiptoRecieveShitPounding = NULL;

You may recall when Homeworld was originally released there were players who chose their player colours to be all-black in order to make it harder for the opposition to see their ships in multiplayer games. They called it "stealth mode"; Relic called them something else:

Code:
#define TE_DorkyCheaterBaseColor    colRGB(255, 62, 164)

This forced their all-black ships to render as a lurid pink on their opponent's computer.

Any other examples?

_________________
MacHomeworld | HomeworldSDL.org


Last edited by lmop on Thu Dec 07, 2006 4:44 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 22, 2005 4:51 pm 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
Checking if a selection of objects are all within a blue sphere of influence shown in the Sensors Manager:

Code:
//all objects inside the blob cool like ice cubes baby

Sometimes programmers make even the most fundamental of mistakes, like how to reference arrays:

Code:
#define FrickinForgotToStartAtZero 0

Needless to say, "fuck" gets used a lot. Mistakes:

Code:
bool FalkosFuckedUpTutorialFlag = FALSE;

opinions:

Code:
// crappy fucking construction manager, no longer a task

running out of ideas for names for the mission states:

Code:
kasGrowSelectionPtr("CapsFuckingStupid")
kasfTimerCreateSetStart("FuckOffTimer", 300)
kasfVarCreateSet("OnceTheFuck", 1)
kasVectorPtr("FuckOffToHere")
kasPathPtr("CarrierFuckOffRoute1")

and finally:

Code:
// Don't Fuck With The Bentusi

//First Bentusi Warning
IF (VarGet("G_FuckingStupid")=1)
    Jump FirstWarning;
ENDIF

//Second Bentusi Warning
IFONCE (VarGet("G_FuckingStupid2")=TRUE)
    Jump YoureMeat;
ENDIFONCE

STATE YoureMeat
    SpeechEvent(M04_Traders_KickAss, 0);
ENDSTATE

Now I've never tried attacking the Bentusi and it does not sound like a good idea but if you are bored then load up mission four and have a go...

_________________
MacHomeworld | HomeworldSDL.org


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 5:29 pm 
Offline

Joined: Fri Feb 25, 2005 5:35 am
Posts: 8
In FEFlow.c as part of the front end processor test:
Quote:
feScreensLoad("testicle.fib");

Stack checking, in task.h, a variant on the 0xdeadb00b:

Quote:
#define TSK_StackValidation 0xdeadbeef //for verifying stack integrety


I'll keep exploring the code...I've only had it for two days after all...and cannot even get it to work with my homeworld demo.[/b]

_________________
Why is that frigate pointed our way?
-- Final words


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 01, 2006 4:55 pm 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
I came across this in the computer player's code which determines an enemy ship's threat potential:

Code:
case CLASS_HEAVY_CRUISER:
    //oh yeah... this one's dangerous
case CLASS_CARRIER:
    //take out this one
case CLASS_DESTROYER:
    //dangerous as hell
    dangerous = TRUE;
    break;

and

Code:
//only select dangerous ships, not puny girly ships
if (aiuIsShipDangerous(combatreserves->ShipPtr[i]))

_________________
MacHomeworld | HomeworldSDL.org


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 03, 2006 5:05 am 
Offline
coder

Joined: Tue Nov 07, 2006 4:40 am
Posts: 236
As I've been through the Memory stuff tring to find the crash with the equaliser I found:-

Code:
#define MEM_ClearSetting        0x4e7a110c
#define MEM_FreeSetting         0xf4eeda7a


:)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 3:34 pm 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
Code:
Description : Adds a missile to the world.  This missile will have no
              owner, no target and it's velocity, position and coordsys
              must be set up by the owner.  Some missile this is!

_________________
MacHomeworld | HomeworldSDL.org


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 7:26 pm 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
Code:
#define SOF_BitForSaleCheap     0x00004000

which is just as well because immediately before it a bit-mask is duplicated...

Code:
#define SOF_Selected            0x00002000      //ship selection shite
#define SOF_DontCreateBlob      0x00002000      //this object's blob is fine as it is

_________________
MacHomeworld | HomeworldSDL.org


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 08, 2006 2:08 pm 
Offline
coder

Joined: Tue Nov 07, 2006 4:40 am
Posts: 236
Code:
/* TC 2003-10-01:
 * Ever so silently, we replace AVI functions with dummy functions when
 * compiling on platforms other than Windows.  Shh...don't tell the game what
 * we're doing...
 */


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 14, 2006 7:03 am 
Offline
Site Admin
User avatar

Joined: Tue Dec 14, 2004 12:41 am
Posts: 326
Everything you ever needed to know about the philosophy of coding....

from Game/Nebulae.c
Code:
#if 0
    //FIXME: dammit, this is buggy.  holy moley it's fast, though
    real32 r = 1.5f * tendril->radius;
    return rglIsClipped((GLfloat*)&tendril->midpoint, r, r, r);


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 15, 2006 4:23 pm 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
Code:
// why are there no comments below?
void writeGameStatsToFile(char *filename)

to which someone has helpfully added 19 comments... of which 18 are:

Code:
// check stats
verifyGameStats...()

Thanks, that's made things so much clearer...

_________________
MacHomeworld | HomeworldSDL.org


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 17, 2006 10:21 am 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
Code:
dbgMessagef("\nTRIED TO DOCK WITH SHIPS ASS!! REPORT TO BRYCE.");

_________________
MacHomeworld | HomeworldSDL.org


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 21, 2007 8:01 am 
Offline
coder

Joined: Tue Nov 07, 2006 4:40 am
Posts: 236
Well, this is my 100th post, and rather conveniently Just found this from mission 3.
Code:
        (void*)Init_Mission03_ImNotHere_AckTheyreAttackingCryos,
        (void*)Init_Mission03_ImNotHere_KillThosePoopyHeads,


        (void*)Init_Mission03_ImNotHere_OhMyGodTheyveKilledKenny,
        (void*)Init_Mission03_ImNotHere_YouBastards,


:)

Aunxx


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 26, 2007 6:29 pm 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
FEReg.c:
Code:
Name   : ferDrawCheckbox
Outputs: draws uh buh-ton on da skreen

_________________
MacHomeworld | HomeworldSDL.org


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 01, 2007 4:33 am 
Offline
coder

Joined: Tue Nov 07, 2006 4:40 am
Posts: 236
from Key.h
Code:
/* Been having some problems using sizes < 4 in variable argument lists.
   (segfault core dump AUGH MY NARDS!@$#1) */


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 02, 2007 2:12 am 
Offline
Site Admin
User avatar

Joined: Tue Dec 14, 2004 12:41 am
Posts: 326
aunxx wrote:
from Key.h
Code:
/*(segfault core dump AUGH MY NARDS!@$#1) */


They should have spent their time contemplating the serene joys of KP_MINUS... 8)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 29, 2007 5:58 am 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
Code:
taskRename(handle, "Task this you commie bastards!");

_________________
MacHomeworld | HomeworldSDL.org


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 30, 2007 6:24 am 
Offline
coder

Joined: Mon Jan 29, 2007 2:45 pm
Posts: 61
From rndRenderTask:
Code:
        if (universePause)
        {
            rndShamelessPlug();
        }


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group