CodeWalrus

General => Tech, Science, IT discussion & News => Topic started by: Dream of Omnimaga on March 15, 2016, 11:21:51 PM

Title: Weird decisions you have taken during game programming
Post by: Dream of Omnimaga on March 15, 2016, 11:21:51 PM
I forgot if we had a topic about this but I couldn't find one that wasn't specific to Mana Force, so here is a more general one.

We all know that some commercial games had weird things in them that made us think "What were they thinking?". But I'm sure this happened at least once to all of you during game development, such as weird decisions that you would have not taken if you had made the game many years later or absolutely strange oddities in some of your game releases. I thought it would be fun to share them. And perhaps share other oddities that you found in other games.

-Spinball (Omnipack SE)
To erase the highscore in this game you must type a password. The password is ""Spinball est le meilleur jeu que j'ai jamais joue!!!". I don't know why I required typing a password this long, plus anyone can open the source in TI-Connect or something else to see the password anyway.

-Hinkel 2 (Omnipack)
Using lbl/goto for arrow keypresses. While they can result into a minor speed gain if used in specific ways, the problem is that games using them in the Omnipack collection were originally standalone games. When compiled into a big pack, the result is that the Lbl/goto branching became abysmally slow, resulting into 0.5 seconds delay when pressing arrow keys. It mainly happens in Hinkel 2.

-Pong (Omnipack)
Probably the slowest-paced pong game in existence. I still don't get why I bothered including it in the game pack instead of banning it from existence.

-Cartemon (Omnipack)
Probably the most unbalanced trading card game in existence. Not that you can customize your deck anyway. There is no trap/effect card either. All you have to do is spam the card that has the highest HP+Atk combined every round and unless you play in hard difficulty, you are guaranteed to win, while in hard difficulty it's entirely luck-based.

-Poulet en Fuite (Omnipack)
Yes, there is a video game based on the movie "Chicken Run", and just like Hong Kong 97, it has nothing to do with the movie. Not that the game is bad, but for whatever reasons, of all the movies in existence, I decided to choose Chicken Run.

-Illusiat 7, 10, 11 & 12
In some cases, the game title logo was rendered by BASIC code, often from a string or matrix. The problem, though, is that sometimes the result took more RAM than if I had used a picture, and it was much slower to render. In my defense, though, I often ran out of picture files when making those games. :P

-Illusiat 7, 9, 11, 12 & Mystique
Having multiple save file support. While this sounds like a nice addition, it's not very useful to have that many on a calc that only 1 person will ever use, it caused many problems (ERR:MEMORY) and they did not keep track of which game chapter you were in. If you switched to an older save file but forgot which chapter files had to be unarchived, then you were screwed. This was fixed in Illusiat 7 and 9 by making switching between chapters automatic, though, at the cost of making both games no longer pure-BASIC.

-Metranor (dice-pen RPG comic book)
Not a video game, but this one has an enemy monster called Metallicca-Afghanistan (sic).
Title: Re: Weird decisions you have taken during game programming
Post by: JWinslow23 on March 16, 2016, 04:50:21 AM
Mad Libs (http://www.ticalc.org/archives/files/fileinfo/457/45714.html) had no check to see if your word was too many pixels wide (it only checked for character count).
Shutdown (the version I released) (http://www.ticalc.org/archives/files/fileinfo/457/45751.html) has a fatal bug in it that exits with an error if you move your cursor to certain places while making a custom board.
Cookie Clicker Axe (http://tibasicdev.wikidot.com/archive:cookie-clicker-axe) had one giant screen buffer entirely for clickable hotspots, instead of something like a different buffer for each clickable things, or hardcoding everything.
Mastermind (http://bit.ly/1M4KcCf) used to check for answers before submitting them, so you could win without even submitting one answer (it works fine now).
Title: Re: Weird decisions you have taken during game programming
Post by: Yuki on March 16, 2016, 05:18:02 AM
Most of the thing I did contain weird stuff that I might or might not ever address in the future. But in the software I wrote in 2016:

Yukibot-Discord: You can see I began writing the strings in French, then switched over to English, so it ends up being a weird mixture of French and English. The license is also in French (with an English translation), but all the docs are in English, save for the !help command in French.
Twitch plays Undertale: There was separate commands to press and release directional buttons on the keyboard, so Frisk just ended up spazzing out and the users asking why they're going in the wrong direction. I removed that and replaced it by a timer that releases the button 500ms after having pressed it. That was way too long so Frisk was walking for too long (imagine walking 2 cases at a time and you have to position yourself between those 2 cases in order to do an action) so I reduced it to 200ms. The game crashed after a battle anyway.
This Pathfinder game I'm playing with a bunch of friends: Not a software but I'm playing a wizard and I haven't chosen any spell for her yet, since we switched from the D&D 3.5 rules on Christmas. Might be problematic for the next scheduled battle next Thursday.
Title: Re: Weird decisions you have taken during game programming
Post by: c4ooo on March 16, 2016, 06:58:51 PM
Flappy walrus:
The game uses 3 different graphics buffers :P
Lazer (basic)
All the level titles are weird, and some are basicly inside jokes that no one will get :P
V2 also has a rickroll aftr level 50.
Lazer II (Axe)
Level packs arnt realy like level packs. My original idea was to have them be sharable, like in mario83. However, the idea was scrapped for technical issues, and 3 packs are built in. Traces of my original idea are still there as every built in 'level pack' is a separate file in memory.
Title: Re: Weird decisions you have taken during game programming
Post by: Hayleia on March 18, 2016, 09:29:47 AM
SSBO:
That's only a coding decision, invisible to the user. But basically, there is a "structure" for the menu and one of the attributes has to be declared before the pointer to the structure :P
Basically, it's as if instead of having a list of attributes like this

MyList:
-- toaster
-- the game
-- lolno


you had that

-- toaster
MyList:
-- the game
-- lolno


The reason for this is that the menu is the only part of the code that wasn't written with readability and maintenability in mind, so when I wanted to add a feature to it (button to get to the previous sub menu), I didn't manage to add an attribute at a more logical place :P
Title: Re: Weird decisions you have taken during game programming
Post by: JWinslow23 on March 18, 2016, 01:48:33 PM
If I could add some more...

The source of Flappy Bird (http://www.ticalc.org/archives/files/fileinfo/459/45945.html) has all the text in it replaced with its equivalent hexadecimal, making it hard for me to figure out what it was I actually wanted to output without playing the game myself :P

Pretty much every Axe game I've made until now (except for Cookie Clicker Axe) was kept in one source file, with graphics before everything else. This caused me so much frustration when I would get so impatient scrolling through everything to change one little section of code that I'd accidentally press CLEAR and get rid of one of my main graphics data sections >:(

The barebones game engine of This is the Only Level (https://codewalr.us/index.php?topic=1184) was 3.2KB, and hard-coding the "tricks" to each of the stages took >5KB to put in (not counting anything else like menus or an ending :P ), and it drove me nuts. It absolutely required a function of the stage number every few lines of code :banghead:
Title: Re: Weird decisions you have taken during game programming
Post by: Dream of Omnimaga on March 28, 2016, 03:03:53 AM
@c4ooo what are each of the 3 buffers used for in Flappy Walrus, by the way?

@JWinslow23 I never, ever pressed PRGM after an error in Axe. Back in the days, there were rumors that this could randomly crash the calc or corrupt my source code when it was archived, so I took no chance. Also I think it's fine if the TITOL engine is this large, considering how the entire game is centered around one level and most stuff had to be hard-coded.


Also there are other things that are weird that I made:

-In The Reign of Legends 1, 2 and Mana Force 2, the world map is artificially slowed down near the top, because strings are slower to read from near the bottom, otherwise the map would have scrolled over twice faster in the North than the South. But the problem is that the slowdown was poorly implemented and the result is that even the bottom ended up with slowdowns.

-In many games I made, I also went the lazy route of erasing the entire screen and redrawing everything every frame, even static stuff, instead of erasing movable objects then redrawing only them.

-Illusiat 6: When I translated the Illusiat series to English, I forgot that I already had translated Illusiat 6 two years before, under the name Nemesiat. As a result, there are now two different English translations of Illusiat 6 and the older one is the one with the fewest typos (and is 82 Stats-compatible due to being all-caps and stuff).

-There is also at least one or two games I made in the past that drew string-based maps character by character, but I forgot which game. Perhaps I did that in an RPG to keep the map drawing speed/animation consistent with dungeons, which used different map format, but regardless, it resulted into unnecessary wait times.
Title: Re: Weird decisions you have taken during game programming
Post by: Dudeman313 on April 02, 2016, 09:26:55 PM
I decided to make the main character in Mr. Bob's Bad Day live in North Dakota, U.S.A. so that he could be arrested for sleeping in bed with his shoes on.
Title: Re: Weird decisions you have taken during game programming
Post by: Dream of Omnimaga on April 02, 2016, 11:29:52 PM
Wait what? Is there some law in North Dakota about wearing shoes in bed O.O
Title: Re: Weird decisions you have taken during game programming
Post by: Dudeman313 on April 02, 2016, 11:54:51 PM
Quote from: DJ Omnimaga on April 02, 2016, 11:29:52 PM
Wait what? Is there some law in North Dakota about wearing shoes in bed O.O
Believe it or not, there is.
Title: Re: Weird decisions you have taken during game programming
Post by: Dream of Omnimaga on April 10, 2016, 04:33:33 AM
Oh wow. I lost fait in humanity by an extra 0.1% now. O.O

Also, some people might like it and I'm still kinda proud of the animation that resulted from it, but one weird decision I took by programming was to include a 2 minutes long cinematic in one of my games: Zelda Dark Link Quest.

The problem is that the animation is not only 30% of the entire game size in kilobytes, but also it makes it a major PITA to send the game to calculators with any modern linking softwares, due to using hacked pic vars (I still need to check if we can send those with TI-Connect CE, though). I bet that a lot of people probably didn't make it to that animation, because the game controls are slow and weird (imagine if in a Link to the past, the A, B, X and Y buttons acted like a second d-pad to attack enemies with your sword in the direction you want) and the game is a major hassle to install.

I really need to re-record that animation in better quality at some point, because while there is a Youtube video showcasing it, it's quite blurry

https://www.youtube.com/watch?v=ITlzO3UNqCw (it starts later in the video)
Title: Re: Weird decisions you have taken during game programming
Post by: Dudeman313 on April 11, 2016, 09:56:17 PM
You'd be surprised how many stupid laws there are in America.
Maybe that's why one of the ways to win in the CE game Adventur (https://www.cemetech.net/programs/index.php?mode=file&id=1419) was to move to Canada.

The video isn't too blurry.
Title: Re: Weird decisions you have taken during game programming
Post by: Dream of Omnimaga on April 11, 2016, 10:07:17 PM
There are a lot of jokes about moving to Canada. Usually when the economy is bad, when a president is doing questionable stuff or something like that.

Also even in Canada we have weird laws, but usually the problem is how hard some gets enforced, while others don't. But that's not really the topic (maybe we should make a topic about strange country/city laws and ways to enforce them) :P
Title: Re: Weird decisions you have taken during game programming
Post by: Dudeman313 on April 11, 2016, 10:32:23 PM
There aren't enough people in the country here that know about the dumb laws to enforce/avoid them.
Not all people know on certain days you can't yell "Ar-Kansas" or mispronounce Arkansas in Arkansas without disobeying the law.

And the real question about making a topic for this discussion is what to name it. :P
Title: Re: Weird decisions you have taken during game programming
Post by: Dream of Omnimaga on April 12, 2016, 04:35:12 AM
"Weird country/city laws" would be a good name.
Title: Re: Weird decisions you have taken during game programming
Post by: Dudeman313 on April 12, 2016, 06:48:10 PM
Thanks for the suggestion. :)
Title: Re: Weird decisions you have taken during game programming
Post by: Dream of Omnimaga on July 23, 2016, 01:50:53 AM
Bump: This time we will examine the weird ideas I got for Omnimaga Pack 25 Games in 1 and Omnimaga Pack SE 5 games in 1, especifically the game names that I have chosen. If you ever played those Chinese bootleg SNES/NES pirate games or those 160 in 1 NES carts, then it's basically the same thing:

I'll skip the games that had no issue or flickered every frame as mentioned in the OP, but here are the wacky decisions I took for each game in the packages:

Omnimaga Pack 25 in 1:

Game 2: Basically, a Breakout game made in Québec is flipped sideways and depends on your luck rather than skills (the ball bounces in random directions)

3: This is a movie-based game (the problem is that it's based on the movie Chicken Run).

4: Mad Max style game, but for some reasons it's called Excite Bike Rage Attack and your motorcycle looks like a snowmobile.

7: Nothing wrong there, but  with all those stories about steroids in pro sports the name sounds a little misleading nowadays. :P

9: Based on Galaxian, but for some reasons it was called Space Invaders. (hence why it was renamed to GalagACE on color calcs)

10: Trading card game that managed to be even worse than Crazybus and Big Rigs, and by far. You have 5 cards with HP and attack stats that you can re-use over and over, while the enemy can choose between 10. The problem, however, is that all you have to do in order to win a round is choosing the card with the highest amount of HP and atk combined. There is no special attribute, weaknesses nor support cards. Basically, use Tarneda and you are 100% guaranteed to win every round. The only reason why this game was included is for posterity (the worst part is that it's an updated version. The first one ERR:MEM'ed after a few rounds). By the way Cartemon name was inspired from Pokémon and Digimon and stands for card and monsters.

13: Who needs to drop a cable inside a manhole with no one at the bottom to plug it somewhere?

17: There is no way a Pong game can be worse than this. It's still better than Cartemon, though.

19: Atari Racing has absolutely nothing to do with Atari, yet still has Atari in the name. I chose that name because of the graphics, I guess, but even then they look nowhere close to Atari material.

24: You know Starcraft and Star Fox? Well... I figured that if they had a game called Warcraft, then why shouldn't we have one called War Fox? Also despite the original War Fox having never been close to finished, I decided that the 2nd game would still be called War Fox 2 anyway.


Omnimaga Pack SE:

1: Name was inspired from some of the strange names found in Dragon Lance and Forgotten Realms novels, but the game is definitively not the hardest TI-83+SE game ever, despite what it claims. :P

3: Not sure why I called it Nibbles 2, considering how many Snake clones are called Nibbles without a number at the end. I know it had multiplayer on the same calc, but still...

5: Chose the most irrelevant city name possible but I guess it was in response to some school friend talking all the time about how nice Pintendre is. :P

(http://www.ticalc.org/archives/files/ss/843/84317.gif)
http://www.ticalc.org/archives/files/fileinfo/453/45373.html
Title: Re: Weird decisions you have taken during game programming
Post by: 123outerme on July 23, 2016, 02:31:40 AM
Various things, such as:

*For some reason, the "Box and Switch" puzzles I made for Source Seekers would have you picking up an L from a "^" (Which was supposed to represent the Box and the Box Dispenser) and drop it off at the V.
*Also in Source Seekers, To have the final boss be an easy "press the button to win" type of boss (where the "mini-boss" before this final boss was the real challenge)
*In Sorcery of Uvutu, I decided that each world should contain exactly 3 unique tiles (ground, unwalkable, ground with loot laying on it) and 3 enemies ("grunt" 1, "grunt" 2, and then the boss), and there should be an upgrade of each move in the game except for Block (which technically displays with the same code as a move), a currently unused (and I don't have any plans for it) spell, and the two "mega" attacks.
*I dunno, to recreate one of those fighting games I did into one of those "all-compatible" games, changing mostly nothing.

I don't really have anything off the top of my head other than those.
Title: Re: Weird decisions you have taken during game programming
Post by: Dream of Omnimaga on July 23, 2016, 04:12:49 AM
Oh wow, the final boss being easier than others thing, I had this happen quite a lot in my games, although often it was on purpose. For example, in The Reign of Legends 2, after the long mini final boss, there is a plot twist that results into a real final battle, except that to beat him you need special powers. Once you get the powers, it basically becomes impossible to lose since all you have to do is spam the special attack.

In Illusiat 11, the final boss has to be beaten twice, except that the second fight is much shorter than the first.


Nowadays what I prefer doing sometimes is add an optional secret boss that is much harder than the final boss, but with another optional event that increases the final boss strength to be much higher than said secret boss. The first ROL game had this happening and I had plans to add that to Illusiat 13 if it would have been finished.


Which reminds me something: Sometimes I added hard difficulty modes to my games, but often I wouldn't test them completely, so I am unsure if they are too hard lol. I also had the issue where I added an easy mode, but due to the game being easier it resulted into glitches or exploits letting you skip half of the game. Metroid II: The Last Chozo had this problem.
Title: Re: Weird decisions you have taken during game programming
Post by: Yuki on July 23, 2016, 04:17:38 AM
I lost at Pintendre 3002, lol
Title: Re: Weird decisions you have taken during game programming
Post by: Dream of Omnimaga on July 23, 2016, 05:04:23 PM
It's impossible to win in almost any of the games included in the package. The only goal is to get the highest possible score. :P
Title: Re: Weird decisions you have taken during game programming
Post by: Travis on August 15, 2016, 02:30:38 AM
Quote from: DJ Omnimaga on July 23, 2016, 04:12:49 AM
Which reminds me something: Sometimes I added hard difficulty modes to my games, but often I wouldn't test them completely, so I am unsure if they are too hard lol. I also had the issue where I added an easy mode, but due to the game being easier it resulted into glitches or exploits letting you skip half of the game. Metroid II: The Last Chozo had this problem.

Fascinating! What was the nature of the glitches exactly? As someone who's always been fascinated by glitches and exploits in classic games, I've always wanted to make a game complex enough that interesting/funny quirks could be found in my own game. There's a game in particular that I've wanted to make for most of my life and had planned out extensively but as of today have yet to get around to. I intended to design the code specifically so that if someone somehow went out of bounds, it would get garbage data yet have enough validity-checking not to actually crash, just so the glitchy screens would be easier to explore. :P

Unfortunately, it seems that for some reason so far, most of the programming projects I've done over the years has ended up being stuff other than games....
Title: Re: Weird decisions you have taken during game programming
Post by: Dream of Omnimaga on August 25, 2016, 05:08:31 AM
There is an Omnimaga thread about it, but it's invisible to guests since I posted it in the walkthroughs section. I might eventually make it public to guests here since it's not like many people are still playing those games anyway.

But basically, in Metroid II: The Last Chozo, if you're good enough (which is hard considering the unresponsive key detection) then it's possible to skip the entire 2nd boss area near the beginning off the game map in Easy mode if you have the special armor. I believe it's possible in normal mode with the armor or in easy mode without the armor, but I never tried it. Basically, in Inferna section of the map, there is a deep lava tunnel that is too long to survive through without the varia suit that is given by boss 2. However, in the aforementioned modes/circumstances you can survive long enough to survive through the entire tunnel and make it to the other side, where you can eventually fight boss 3. Due to how events are coded in the game, beating boss 3 acts as if you had beaten boss 2 and gotten the varia suit as well, so the item appears instantly in your HUD after boss 3 dies.

There's also another exploit that works similarly, during the final escape sequence. Unlike other Metroid games where there's a timer counting down and most rooms locked down, this calc game simply has acid lava rising through the entire map faster and faster and the entire map remains open for exploration during the process. But in easy mode with the armor you can survive long enough in the acid to reach the other game room that triggers acid rising. Reaching that room causes the acid level to reset, but it doesn't reset the speed at which it rises, so it doesn't take long before it fills the screen again. But the turning point of that exploit is when you exit that room on the other side, which disables the acid rising flag. This results into the entire game map being explorable again, but save points will not work (the ship one ends the game).


As for Illusiat 6, it was originally too difficult so I added a normal mode, but the normal mode still turned out to be very hard due to how long it takes to level up. This brings up another weird decision I took: Illusiat 7 is even harder than the normal Illusiat 6 mode, yet I somehow decided not to add an easy/normal mode to the game.

I wish you could finish a project @Travis , I would definitively love to see something from you :3=
Title: Re: Weird decisions you have taken during game programming
Post by: Travis on August 26, 2016, 09:12:14 PM
Cool, so it's just like the kinds of exploits seen in speedruns of commercial games.

QuoteI wish you could finish a project @Travis , I would definitively love to see something from you :3=

Me too. ;) I'm hoping that the next few years will see a turnaround. I had been buried for a long time, but starting this year I seem to be getting to a point where I'm slowly beginning to actually finish things faster than I start new ones. If I can somehow manage to get my open projects down from about 20+ to just 3 or 4 in the next few years, I'll be in great shape. ;)
Title: Re: Weird decisions you have taken during game programming
Post by: Dream of Omnimaga on August 26, 2016, 11:26:49 PM
Lol I was gonna say, if you keep all 20 projects alive but finish them in starting order, then that would mean a lot of TI-81 games O.O
Title: Re: Weird decisions you have taken during game programming
Post by: Travis on August 27, 2016, 12:42:53 AM
Haha. My problem is that it's the opposite: The list is like a stack, and I tend to only work on the latest things I started (because they're the most exciting at the time), so if I keep starting things, nothing ever finishes. :P So I'm trying to take a handful of the most important things (rather than necessarily the newest) and cycle through them at regular intervals until something gets done, then stick the next-higher priority project in the open slot, and so on.
Title: Re: Weird decisions you have taken during game programming
Post by: Dream of Omnimaga on September 02, 2016, 05:48:44 AM
Generally, I used to finish my projects in order, but I rarely had more than two at a time back then. But the problem is that when I got new ideas I rushed the previous project. Although Illusiat endings had lower quality due to running out of RAM near the end of project development, part of it was due to me being too impatient to wait before starting the next game.

Nowadays I usually start a bunch of projects but only finish 10% of them. Some gets finished years later, though, such as Supersonic Ball 83+. I guess this is what happens once you move out of hi school.
Title: Re: Weird decisions you have taken during game programming
Post by: Dream of Omnimaga on September 26, 2016, 07:30:47 AM
This isn't programming-related, but still RPg-related: In one of my custom-made choose-your-own-adventure comic gamebooks, there is a status aliment called Flower of Defecation and a magic spell called Defecation O.O

(https://tg.lolis-in.space/file_121.jpg)
Title: Re: Weird decisions you have taken during game programming
Post by: princetonlion.tibd on October 10, 2016, 04:51:01 AM
*bump*

Dodge V1 is so strangely written I can't even optimize it without breaking it :P
The weird decision: the high score system apparently assumes that you got a high score, randomly inserts it into the high score list, and sorts the list. I'm also pretty sure I wrote that part, so it isn't T.Wang's code.
Title: Re: Weird decisions you have taken during game programming
Post by: p2 on October 10, 2016, 08:25:57 AM
reading other people's code is sometimes hard as they do strange things.
But reading your own code like a year later is even worse xD
Title: Re: Weird decisions you have taken during game programming
Post by: Dream of Omnimaga on October 24, 2016, 04:34:30 PM
Yeah I can't read people code, same for very old code I wrote >.<

Also when I optimized in the past, I often broke my code beyond any possibility of repairing. This sucked when I forgot to backup.
Title: Re: Weird decisions you have taken during game programming
Post by: p2 on October 24, 2016, 05:21:20 PM
Thats why I always put lots of comments in my code.
I also always add a section at the bottom of my main file where I put a list of all my thoughts and stuff I want to change later.
Also using this as some kind of changelog for myself so when reading it agian, I remember what I did and why ^^
Maybe doing something similar can help you ;)
Title: Re: Weird decisions you have taken during game programming
Post by: Yuki on October 24, 2016, 06:55:37 PM
Quote from: DJ Omnimaga on September 26, 2016, 07:30:47 AM
This isn't programming-related, but still RPg-related: In one of my custom-made choose-your-own-adventure comic gamebooks, there is a status aliment called Flower of Defecation and a magic spell called Defecation O.O
"(Very stupid status)"

At least you were assuming it.

Quote from: DJ Omnimaga on October 24, 2016, 04:34:30 PM
Also when I optimized in the past, I often broke my code beyond any possibility of repairing. This sucked when I forgot to backup.
This is one of the reasons why version control software such as Git is very useful nowadays.
Title: Re: Weird decisions you have taken during game programming
Post by: Scipi on October 24, 2016, 07:09:53 PM
It wasn't for a serious program, but i had some really weird C code written for the old code golf competitions.

Back in the Game Of Life one, I decided I would write my entry for the GBA. Normally in the GoL, you'd have to implement a swap buffer. The front buffer would hold the previous GoL state while the program used it to build the next state in the back buffer. Then at the end of the frame, the buffers would be flipped and the new front buffer copied to the screen. This all ends up being a good chunk of code. And for Code Golf, that's obviously bad.

However, the GBA has a screen mode which splits video memory into two segments. On any one frame, one segment would be used for drawing the next frame while the other segment is displayed... Sound familiar? So in my GoL entry, I [ab]used video memory to serve as my GoL buffer. I read directly from pixels on the screen for my previous GoL state and read directly to the video backbuffer to generate my next state. Than I simply swap the buffers to increment the GoL sim and to display all in one.

Another weird thing I did was in a previous Code Golf where you had to read your own source file. As part of the program, I needed a concise way to check if I hit the end of the file. Normally, you'd do a comparrison against EOF like so:

i = getc(f);
while(i != EOF){
  //...
  i = getc(f);
}


This is waaay too verbose, though. For starters you have to duplicate i = getc(f);!
You can cut it down if you remember that in C, assignments have an implicit return value (so you can do things like a = b = c)
This turned the code into:

while((i = getc(f)) != EOF)
//...


Pretty good, right? But still not enough. Precedence rules make it so you have to waste two characters on parenthesis. I also wanted to get rid of the EOF comparison wholesale.
In the C standard, EOF is always -1. So by that, you can always add one to get 0, which is the value for false in C. Unfortunately, because we're changing every character that gets read, we have to revert it when we want to use it.

while(i = getc(f)+1) a[i-1]++;

However, this is still an extra 4 characters. I wanted to cut that down even further. It just so happens that -1 is 0xFFFFFFFF. Or all 1's in binary. So all I really needed to do was flip all bits and if the value was -1, it'll become 0. Fortunately, C has a bitwise operator for that: ~. So my final code became:

while(i=~getc(f))a[~i]++;