The OFFICIAL Unofficial Achewood Message Board
Trivial Pursuits => Science & Nature => Topic started by: Arachno-capitalist on March 06, 2008, 05:09:11 am
-
In my nerdier high school days I studied things like Java, various HTML derivations, C++ and whatever. But I am still in complete ignorance as to what language real programs are written in. Like such as what is Internet explorer written in? Are real programs made in GUIs? Im... dumb.
-
Internet Explorer is almost certainly written in C++ using the Microsoft Foundation Class Library (MFC). All of the "display a window this big" and "use pretty graphics" code is written in C++ using their Visual C++ tools to help get it just right, compiled into the MFC library, and made available to programmers who want to make things that run very fast (unlike Java) but only run on Windows. These programmers get a copy of Microsoft's Visual Studio (or whatever they call their development environment these days), load in the MFC library, and write programs that call its "play the enterprise theme wav file" functions. If Microsoft were writing IE from scratch, they'd probably use their C# language, because well written C# programs run close to as fast as C++ programs on Windows, and because they want to pimp their new language as part of their .NET family of development tools and languages that no one really understands.
So 'real programs' are either written with C++ or with .NET, and they run really fast on Windows but don't run anywhere else. Java is used to build programs with graphical user interfaces (GUIs) that are meant to run on Windows and a ton of other kinds of computers. But Java is as slow as molasses that can't find its glasses, so people seldom do that. This is why web development is so much more fun. You build your web page with flashy AJAX magic, and bam, you've got a fast program available to a ton of people that can run on any computer. That's why Google maps rocks, and Google Earth ... umm, I don't know. Who's ever installed Google Earth?
Ruby rocks! For serious.
-
Ok, but what I dont get is that when I learned C++ it was all bullshit text stuff. How do all of these graphics get built in? Such as like Quake or WOW or whatever. Are those all written in really elaborate C++ that calls up graphic interfaces? I think maybe im missing the link between what I did in high school and the GUI I see in every other program.
And yes, I have downloaded google earth and it runs like butter on my MBP
-
they are programmed ONLY FOR KOMMENTING
-
Ruby rocks! For serious.
But where do you stand on Python?
-
Ok, but what I dont get is that when I learned C++ it was all bullshit text stuff. How do all of these graphics get built in? Such as like Quake or WOW or whatever. Are those all written in really elaborate C++ that calls up graphic interfaces? I think maybe im missing the link between what I did in high school and the GUI I see in every other program.
And yes, I have downloaded google earth and it runs like butter on my MBP
Quake is built in exactly the same way, except they use the GL libraries which were prewritten to display 3D graphics. Those 3D libraries are written in exactly the same way IE was built.
-
Ok, but what I dont get is that when I learned C++ it was all bullshit text stuff. How do all of these graphics get built in? Such as like Quake or WOW or whatever. Are those all written in really elaborate C++ that calls up graphic interfaces? I think maybe im missing the link between what I did in high school and the GUI I see in every other program.
And yes, I have downloaded google earth and it runs like butter on my MBP
Let's say you wanted to make a window with nothing in it. That would look like this:
#include <afxwin.h>
class MFC_Tutorial_Window :public CFrameWnd
{
public:
MFC_Tutorial_Window()
{
Create(NULL,"A-CAP'S EMPTY WINDOW OF USELESS FUN");
}
};
class MyApp :public CWinApp
{
MFC_Tutorial_Window *wnd;
public:
BOOL InitInstance()
{
wnd = new MFC_Tutorial_Window();
m_pMainWnd = wnd;
m_pMainWnd->ShowWindow(1);
return 1;
}
};
MyApp theApp;
You include the header for the afxwin library that Microsoft created to give you special commands to draw windows. You make a class that inherits from CFrameWnd so it's ready to receive those commands, and then you type the actual commands. Things like Create() and ShowWindow(). You hand them strings like "A-CAP'S WINDOW" to put in the title bar or on the file menu. You hand them numbers about how big the window should be and how far from the left hand side the "Cancel" button should be. You just import the commands found in the MFC book and call them the way we used to call our boring string functions in school.
If you know any Perl, you can use Tk to put GUIs together way easier than all this. Tk is a library like the ones in the MFC, but it's made by different people and it's commands make a lot more sense to me.
Like the wonderful smik mentioned, OpenGL is the library Quake was written with. It's got commands to draw things and place lights and cameras. Here's the code to draw a trapezoid:
//Trapezoid
glVertex3f(-0.7f, -1.5f, -5.0f);
glVertex3f(0.7f, -1.5f, -5.0f);
glVertex3f(0.4f, -0.5f, -5.0f);
glVertex3f(-0.4f, -0.5f, -5.0f);
I don't know what that means, but this set of video tutorials (http://www.videotutorialsrock.com/) seems to know what it's doing. Maybe you'll check it out some time.
Most modern games are built with something like C++ to run the graphics and sound, and set up the game world, and then they use a little cute scripting language that's easier to write in to actually say what each thing in the world does. When you make changes to the c++ engine (like how fog distorts everything in view), you have to recompile the whole thing and make sure you didn't break anything. When you change something (like how far a player can jump) in the scripting language, you can just run the game, and the engine reads the new scripts, and you get to play with your changes right then and there.
If you'd like to program your own games some day. I recommend a really expensive education and then a membership in Garage Games (http://garagegames.com). Their C++ engine is really cheap.
-
Mmm Garage Games!
I went to the first TribesCon in Seattle and some of the Devs that later spun off to Garage Games were there. They were really the nicest people ever. They seemed genuinely blown away that people had assembled in a college cafeteria to play this little game they put together.
-
Thanks. I have a better grip on the virtual reality.
-
Late to the party, but I have to write something or other here...
3D objects you see in games are just a big list of points, which link together to create meshes of triangles with various bits of info tacked on to them. The meshes are created in MAX, Maya, or some other editing program and then exported into a file that puts all those points and all the info into a format the engine can read. The exporter can be really complicated and written in C++, or really simple and just written in whatever scripting language comes with the editor.
The engine takes those points and projects the 3D volumes they represent onto a 2D image in memory. This is the most complex stuff that a game does, and what it spends the vast majority of its CPU time on. As such, engines are usually written mostly in C++ and some parts will be written in C for raw speed (This is less common than it used to be, but still happens). There's a whole lot that goes into it, from simply determining what should be drawn in the first place (What's not on the screen, what's hidden behind other stuff), which is surprisingly complex, to what order to draw things in (farthest to closest, unless something is transparent, then it needs to be drawn last, but also making sure not to switch between different textures too often, because texture swapping is slow). You have to basically think of everything when writing an engine, which is why so many companies are willing to pay someone else to do it.
The game mechanics (how fast you run, where the bad guys hide and what they react to) are written in files that aren't compiled in to the engine (internally, at least) and can range from comma-delimited tables from excel to a scripting language like Lua to a completely custom format. Some PC games will leave these unprotected and let you mess with them (Civ games are good about that) and others will compress them into a binary format and/or roll them into the game itself to prevent editing altogether.
While C# is awesome (ESPECIALLY for tools), and is definitely what I'd use if I were writing a smallish game myself, you won't see AAA titles made with it due to its slowness and the fact that it's pretty danged easy to decompile.
I have no idea if this was helpful or not, because I can't remember how all this stuff looked before I knew any of it. :)
-
Late to the party, but I have to write something or other here...
<<ENSUING SPECIFICITY>>
Hurray for specificity; it's spiff-cific!
Still we left out the best part. After all of this hojillion dollars of development goes into the game. A tiny gnome with a three foot chest-hair beard writes some dialogue based on words he found in UrbanDictionary to explain why whitey-mc-twentysomething is even in Mexico massacreing poor villagers and why some of them are zombies. He is paid a penny per word, and he only gets that much due to an accounting error.
C++, Java, Perl, and Ruby I'm familiar with, but I know nothing of Python or C#. I am predisposed against C# as it has always appeared to me to be solving a marketing problem more than a technical or organizational problem.
-
Still we left out the best part. After all of this hojillion dollars of development goes into the game. A tiny gnome with a three foot chest-hair beard writes some dialogue based on words he found in UrbanDictionary to explain why whitey-mc-twentysomething is even in Mexico massacreing poor villagers and why some of them are zombies. He is paid a penny per word, and he only gets that much due to an accounting error.
Careful going too far down this road.
To me this is turning into a 50's industrial film like we were shown in elementary school. The very end of this film has a Hugh Beaumont character closing the book he retrieved from the den on 3D games, taking his pipe from his mouth, turning to the camera and saying, "All that work, all those people, and all that time went into making it possible for a drunk fraternity student on the other side of the country to call you a faggot while he pretended to hump your on screen corpse."
-
I am predisposed against C# as it has always appeared to me to be solving a marketing problem more than a technical or organizational problem.
Would that problem be that the string of +'s after the C was getting long?
-
"All that work, all those people, and all that time went into making it possible for a drunk fraternity student on the other side of the country to call you a faggot while he pretended to hump your on screen corpse."
Your profile star was well earned today, sir.
-
Careful going too far down this road.
The caustic version: Video game writing is crap. It's terrible. Why do they use the spoken word at all? Wouldn't it be better if developers just forgot they ever took creative writing as a middle school elective and stick to making pretty things that explode when you shoot them?
The long version:
The last two games I've played were Portal then Resident Evil 4. That's a big come-down. It's left a bad taste in my mouth.
Most writing is crap, just by volume. But you filter. When you filter out all the crap writing in the world you're left with a ton of books, a lot of theatre, a good bit of movies, some television, and only about a half-dozen video games.
But I love video games. And a large part of that is that writing is not the point. The fact that Bowser kidnapped the princess is not really there to provide motivation. It's just there for explanation. It's just something to drop into: you must perform this set of ridiculous tasks so that <<SOMETHING HERE>>. But if you're going to spend a lot of time on the story itself, it should be pretty good. If your game's mission is to rescue the "president's daughter," understand that it's glaringly obvious that the mission is crap, and don't spend a lot of time building it up. Certainly don't mention the phrase "president's daughter" twelve times during one conversation. The phrase isn't magical. It's just <<SOMETHING HERE>>. The story from the original Doom was one page printed and terrible. But it was a great game. Resident Evil 4 has terrible terrible dialogue that makes you wish you hadn't heard it. It really ruins the fun for me. When the main character said, "I have a bad feeling about this." it took away from the game as a whole. Not because it's a cliche spoken by a paper cut-out character, but because he had already been attacked by pitch-fork wielding zombies. "The 'bad feeling' you have 'about this' is liquid dookie dribbling down your pant-leg!"
Games excel when they realize that the developer should spend a ton of effort on the writing, but the player shouldn't. You can play Portal with the sound off. There's nothing in Glados' dialogue that you really need to win, and you're almost never stopped so you can hear it. It's freaking GREAT, and you miss a lot if you don't hear it, but it never gets in your way.
Here's an exception to that: I enjoyed the living crap out of Deus Ex. I think it was a great game, and well written. But it didn't make you spend too much time on dialogue trees because it knew that as much work went into the game, it still didn't have the writing caliber of ... say ... the television show Alias which isn't exactly Shakespeare either.
Look at free little games like Passage (http://playthisthing.com/passage). It packs a punch artistically, and the only symbolic language of any kind is your 'score' in the top right. Youth, love, success, lonliness, aging, death, and sudden loss are all told in five minutes with no words.
So I says, if your game has a story, make it unbelieva-brilliant, and then never let it get in the player's way. Make sure they're experiencing the story, and not reading/listening to it as much as possible.
-
The caustic version: Video game writing is crap. It's terrible. Why do they use the spoken word at all? Wouldn't it be better if developers just forgot they ever took creative writing as a middle school elective and stick to making pretty things that explode when you shoot them?
...
So I says, if your game has a story, make it unbelieva-brilliant, and then never let it get in the player's way. Make sure they're experiencing the story, and not reading/listening to it as much as possible.
So much truth. Clicking (or space-barring) through reams of C-grade exposition in the middle of a game is almost unbearable. On the other hand, last night I played 6 hours of Civilization IV with the sound off so my gestating wife wouldn't make me turn off the laptop. It was alright though, I could still hear Leonard Nimoy's voice intoning, "And them that take the sword shall perish by the sword." from memory.
-
Pedro, have you ever tried the IF "game" Galetea? It has no goal, you just have a conversation with what may or may not be a statue that came to life. There are like 15 endings and I couldn't get to any of them without a walkthrough, but then I suck.
Also, Portal the Flash Version is awesome and has basically no plot whatsoever.
-
Certainly don't mention the phrase "president's daughter" twelve times during one conversation. The phrase isn't magical.
It will be if Hillary takes the White House. Chelsea's pretty hot. She had the misfortune of living the awkward teenage years in the most famous house in all the world, but if she'd spent the last few years tracking down every TV camera and saying, "You see this? Fuck you, world!" I'd be cool with it.
-
in the most famous house in all the world
She grew up in Santa's House?
-
She grew up in Santa's House?
Cinderella's Castle at Disney World, actually.
-
Writing in video games sucks for a lot of reasons.
Reason 1: They keep giving the writing job to "the guy who can spell."
Reason 2: People forget that games are a series of interactions, and dialog isn't interactive. Not even dialog trees are interactive, sorry. The game is the interactions, and making the player stop interacting in order to experience your story is doing a disservice to the game and to the story.
The best game writing is the stuff you discover as part of the game, because you want to find out more. The most recent experience I can think of came in the game Psychonauts, where I found a hidden door in the mind of a generally happy lady (Her theme is a dance party!) that contained a memory of the past -- and her nightmares. Suddenly I was able to discover my own context for her and come to a new understanding of the character, and it was done just through my poking around in a hidden part of the level. Not only did it enhance the story, it felt like something I did on my own. That's the cool thing.
Incidentally, Erik Wolpaw (who wrote most of Portal) was a writer on the excellent game Psychonauts. Every American has a duty to go purchase this excellent game from the XBox Live Marketplace.
-
I'm really enjoying this vibe I get from Twilight Princess where... the crazy Japanese mythology type stuff is a lot more prevalent in this game. I know it is stereotypical to be all "those Japanese, they are so crazy, look at the crazy stuff they come up with!"
But really, visually, this game is just not something that could have come out of my mind. A lot of it kind of reminds me of Hiyao Miyazaki's stuff, with all the cool nature-spirits with horns and translucent snakes made out of light and monsters whose faces are masks that look like faces upside down or right-side-up....
yeah, I guess it is the visuals I'm talking about, not the story. Oh well.
-
yeah, I guess it is the visuals I'm talking about, not the story. Oh well.
The visuals in that game are really neat. Two story things are also good. You get to know the kids in a happy-times setting before they're kidnapped, providing you an emotional need to rescue them. Also -- like HalfLife's Gordon Freeman -- Link has no dialogue. The mute protagonist helps the player project their own feelings about the character onto the game which intensifies your emotional connection.
-
on the other hand, it's frequently really confusing.
NOW YOU NEED THE TWILIGHT MIRROR, NOT THE LIGHT MIRROR! GO GET THAT MIRROR, BUT FIRST YOU HAVE TO BE A WOLF!
Maybe it's because I sometimes only skim the dialog, though.
-
on the other hand, it's frequently really confusing.
NOW YOU NEED THE TWILIGHT MIRROR, NOT THE LIGHT MIRROR! GO GET THAT MIRROR, BUT FIRST YOU HAVE TO BE A WOLF!
Maybe it's because I sometimes only skim the dialog, though.
Hey, if you don't like jumping through hoops to collect the jingle-janglies, maybe you should find another genre. Me, I've dropped into "let's pretend-you're playing music" games.
-
Hey, if you don't like jumping through hoops to collect the jingle-janglies, maybe you should find another genre. Me, I've dropped into "let's pretend-you're playing music" games.
Lately I'm into the "whatever one have badges on Kongregate" games. But I'm pretty bad so most of the Hard and Impossible ones will forever elude me. Hell, I just recently found out that "Why don't you try the harder difficulty level" isn't the "good" ending to Street Fighter 2.
-
Hey, if you don't like jumping through hoops to collect the jingle-janglies, maybe you should find another genre. Me, I've dropped into "let's pretend-you're playing music" games.
I got a hoop for your jingley-janglies right here.
-
Sounds like the episiotomy has healed.
-
Sounds like the episiotomy has healed.
Epesiotomies are for wimps.