Skip to main content

Programmers

Description

Programmers can talk all about their craft here

reading pixel depth in linux

Would anyone know how to read the current pixel depth in linux
(like 8 bpp 16 bpp or 32 etc). The XF86VidModeGetModeLine will
give you the x and y and frequency but how do you read the bits
per pixel?

Submitted by CombatWombat on Fri, 09/07/04 - 7:30 PMPermalink

Can't answer the question immediately, but can help you find the information you're after (xfree86 didn't exist the last time I was doing any serious X windows programming :)

Can I ask what you're wanting to do with the information? (ie is it for direct graphics access, for a utility program that tells you the bit depth, or is it for setting up a Pixmap with the same depth as a Window?)

One thing to look at may be the DGA extension (http://www.xfree86.org/current/XDGA.3.html)

You might find it useful to look at a slightly higher-level interface than using the X-extensions directly (eg the SDL media layer: http://www.libsdl.org/index.php)

Finally, a PDF of a book called "Programming Linux Games" is available at: http://unia.ual.es/docs/sdl/plg-final.pdf In terms of copyright of the PDF, AFAIK this has been made freely available by the author.

Cheers,

Mark

Programming and Chicks?

I was just wondering, as an offshoot to the last post of the "When did you start programming" thread, does being a programmer help or hinder people picking up chicks, and picking up guys for the women...

What about insights from people that have a significant other? Did you find that your occupation/hobby was a hinderance or a positive effect?

And would the inability of some programmers picking up be an offshoot of just the programming, or the whole "geeky" environment that they are stuck in?

Anyways just some questions that I am pondering...

Submitted by Blitz on Wed, 07/07/04 - 11:27 PMPermalink

I get nervous and start shaking uncontrollably whenever i get near a girl.
I don't think thats got anything to do with programming though, probably something to do with getting beaten up by girls when i was in grade 1 or something :P
CYer, Blitz

Submitted by CombatWombat on Thu, 08/07/04 - 2:36 AMPermalink

Hopefully this doesn't lead to us opening up a "Sumea Personals" forum ;->

I called in some expert assistance to answer this one (ie my wife). Her comment? "As long as you think of it as 'picking up chicks', you won't" :-)

Personally, I'd say drop the "chicks" tag and think about the actual implications of what you're saying when you label a woman as a "chick". Cute, small animal with barely a brain cell? The respect is just dripping off that description... Not :)

Occupation is irrelevant once you meet the right person, IMO. If you want a real relationship just toss out the crap that society feeds us, and be yourself :) People are much more interesting when they are passionate about things in their life rather than constantly trying to adapt themselves to what they imagine everyone else expects of them.

Cheers,

Mark

Submitted by arcane on Thu, 08/07/04 - 3:32 AMPermalink

Hinder IMHO.

Whenever I get asked what I'm studying, I say "Engineering" and crap-on from there :)

Submitted by Kalescent on Thu, 08/07/04 - 7:30 AMPermalink

Well my fiance and I are both gamers, were as bad as each other, fighting, pushing and shoving to see who can get to EB first etc, or be first to get the 'cumfy' chair when playing a bit of Champions of Norrath.

I dont really think being a gamer or interested in games really makes that much of a difference anymore, but it definately did in the beginning as I met her at uni whilst studying for my DIP.

I have had 3 previous girlfriends, and the first 2 basically said " ITS ME OR THE PLAYSTATION! " ... so ... i just curled up with my ps1 controller, and said " BAH! Dont make me choose !! you evil , EVIL being!! " the third however was a bit more recieving, even had a bit of a streak there where I thought I was onto a successful non-nerd to nerd conversion. But alas it was not meant to be.

I didnt have any gamer related problems attracting members of the opposite sex, it was more of a " Oh my god you play games ? you nerd ! Pffffffffff good bye " problem.

/end of of Hazard's 'This is your life' episode.

Submitted by palantir on Thu, 08/07/04 - 7:13 PMPermalink

HazarD, you?re a lucky man! Oh, to find a woman that understands?
My previous girlfriends/dates have mostly considered the games thing to be overly geeky, but then I consider the gay pop/dance music that some of them were into a million times worse.[:P]

As far a programming goes, I think it depends on the girl or ?chick?. If they are young and dumb (i.e. a chick) then you?ll probably be labelled a geek, but if they have a brain (like all the good ones) then I think it might help put you into the intelligent category ? but that?s only first impressions. Once a couple get to know each other, I don?t think it really matters what you study or work as.

Then again, that?s just my experience. I?m no romance guru! [:P]

Submitted by Daemin on Fri, 09/07/04 - 11:51 PMPermalink

Looking back onto this now it was a mistake to use the word 'chicks' :-

I have to mention that at University in Computer Science when I started there were maybe a couple of girls doing the subjects, compared to several hundred guys. However there seems to be a higher concentration of girls starting computer science subjects this year. This might seem to indicate that computers are becoming more mainstream?

Thought I doubt that it will help our chances of finding someone that is "compatible"...

Submitted by Kalescent on Sat, 10/07/04 - 3:29 AMPermalink

something really shocked me and my fiance both yesterday, we were in the city store of EB, and a couple of young girls, about 18 - 20 at a guess, dressed quite funky and fashionably entered the shop.

Things are definately on the change - these wernt the stereotypical glasses wearing nerd-girls either, they looked and appeared just ordinary averager teenager 'hip' sorta young woman.

It was quite the odd culture shock ( and very apparent ) for many of the young men in the store, to see 2 good looking young females talking and rummaging through the stacks of games, sounding exactly like any hardened gamer would, speaking of gameplay elements in the various RPGS and FPS's they were picking up etc.

Submitted by davidcoen on Sat, 10/07/04 - 4:54 AMPermalink

programming tends not to be a female friendly disipline (IMHO)

Unfortunatly a. you have mostly males b. the males tend to like to do things the 'interesting' way, rather than what may be correctly sugested by a female as a 'practical' way, so the males get pissed off, make the femalaes work less comfortable, and she leaves.... and c. most programmers smell, and females (and some males) may tend not to like that. //not to generalise/ start flame war, but that is my impression, and the impression given to me by several females, so of which where programmers.

Daemin, if you want chicks, take up salsa dancing or an arts course/ language... again, IMHO (or i should realy type, in my not so humble opinion)

DSC

Submitted by Kane on Sun, 11/07/04 - 12:40 AMPermalink

there is one girl doing the Bachelor of Computing this year, and she was asked why she was doing it and she just said, to get a job. she had never played a video game before she started the course!

as for picking up girls, I dont really think it matters, as long as you be yourself...

Submitted by redwyre on Sun, 11/07/04 - 1:16 AMPermalink

I totally disagree with you david!
Females can code fine, they just have to want to.
And I dunno what programmers you hang around, but I don't know any that smell.

Here's my take on all this:
Because programmers aren't so popular, you'll probably have to get to know a girl first before you get a chance to go out. The easiest way to get to know someone is to work with them, but as there are not many female programmers around, you will have to find some other way to meet women. So in that regard, it hurts your chances unless you get out an make an effort.

Submitted by Jacana on Sun, 11/07/04 - 10:21 PMPermalink

I took up programming to pick up chicks!

I agree with Redwyre about programming. It is not unfriendly to women and we can do it just fine. I think the major issue is that programming is not being presented as a career option to girls thus they do not realise it. Also, when I did my TAFE programming stuff half the course was female. So there is a big difference between specialised (games) and standard (business apps) in terms of women and career opportunities.

I do agree with Dave on actually getting out there to meet girls. You are not going to find them sitting in your house playing LAN games with your buddies at 3am (unless of course you start looking at mail order brides). You do actually need to get out and do things to meet people.

Submitted by davidcoen on Tue, 13/07/04 - 6:02 AMPermalink

well, you never know, playing LAN games at 3am, the girls might suddenly start falling out of the ceiling.

Hello Redwyre, good to know that you don't know any proggramers that smell, i know too many. (though my own 'do i pass the smell test?, oh, better have a shower before going to work' test in the morning is not fool proof, or at least not proof of this fool)

salsa dancing is fun though, helps a lot with animating :)

Submitted by Sorceror Bob on Tue, 13/07/04 - 8:38 AMPermalink

The fact I refer to all women as 'booth babes' may have something to do with my bachelor status.

That, and I'm not a programmer!!

Submitted by souri on Tue, 13/07/04 - 8:50 AMPermalink

You mean, carrying a C++ manual in my back pack won't increase my chances with the ladies! What the! [:(!]

Submitted by redwyre on Tue, 13/07/04 - 9:59 AMPermalink

Souri: Depends which ladies you are after.... (and damned if I'll let you keep 'em)

Just for the record ladies, I keep a copy of the C standard library reference in my bag at all times... for "emergencies".

Submitted by Maitrek on Tue, 20/07/04 - 1:32 AMPermalink

Daemin, daemin, daemin. I sure hope you haven't been using your 'games programming' status to try and impress the ladies :)

Personally, I think the only problem with being a games programmer is the fact that alot of your colleagues are also male...so unless you are gay (no can of worms intended here) you aren't exactly going to hook up with anyone from your workplace... :(

As for this whole 'chicks'-rage...women change their mind all the time, call 'em ladies and they reckon you are labelling them as old, call 'em girls and they think you are referring to a little kid, call 'em women and suddenly you are labelling them as some kind of middle-aged mum, call 'em females and you are some kind of odd-ball. SO yeah, you are all chicks/girls/ladies/women/females/lassies whatever. It's better than some other names people use for de women.

Lastly, my one and only relationship failed utterly so I'm not going to offer any advice for how to meet Ms/Miss/Mrs (hah! See can never make up their minds!) Right - because I can't say I've ever had any experience there myself.

Daemin - what's your advice for how to pick up chicks?

Aside from alcohol....(ahhhhh I am so mean in the afternoon) :P

Submitted by Kane on Tue, 20/07/04 - 4:34 AMPermalink

perhaps we should make a Sumea Singles forum for all us programmers? [;)]

Submitted by Daniel Rona on Wed, 21/07/04 - 4:45 AMPermalink

quote:Originally posted by Maitrek

As for this whole 'chicks'-rage...women change their mind all the time, call 'em ladies and they reckon you are labelling them as old, call 'em girls and they think you are referring to a little kid, call 'em women and suddenly you are labelling them as some kind of middle-aged mum, call 'em females and you are some kind of odd-ball. SO yeah, you are all chicks/girls/ladies/women/females/lassies whatever. It's better than some other names people use for de women.

HAHA! I'm sorry, it's just so funny that you mention that, as I have recently spoken to 2 separate guys from different companies that haven't known what to call me! Seriously, I really don't think too many girls worry what they are called as long as it isn't rude!

As for picking up chicks.... It really has nothing to do with being a programmer... Just try and be nice, natural, funny (in a non nerdy way!) and make friends with girls, we won't bite! (unless you want us to of course [:0])

Submitted by Blitz on Wed, 21/07/04 - 11:46 AMPermalink

I can only be funny in a nerdy way ^.-
CYer, Blitz

Submitted by Maitrek on Wed, 21/07/04 - 7:32 PMPermalink

quote:HAHA! I'm sorry, it's just so funny that you mention that, as I have recently spoken to 2 separate guys from different companies that haven't known what to call me! Seriously, I really don't think too many girls worry what they are called as long as it isn't rude!My sentiments exactly :)

quote: I can only be funny in a nerdy way ^.-Yeah, I'm stuck there too Blitz.

quote:Just try and be nice, natural, funny (in a non nerdy way!) and make friends with girls, we won't bite!lol - you'll brand me misogynistic for this but you should check out [url="http://www.intellectualwhores.com/masterladder.html"]this[/url] site -> it's not serious (I hope) but absolutely hilarious! (not for those offended by crude language)

Submitted by Daemin on Thu, 22/07/04 - 12:17 AMPermalink

I've had girls bite me, it hurts!

As for advice, I dunno, be yourself, but don't talk too much is about all I can come up with...

Reading the ladder article thing now...

Submitted by Stephen on Thu, 22/07/04 - 1:19 AMPermalink

I just thinks it's absolutely hilarious this is even a thread of discussion.

Submitted by davidcoen on Thu, 22/07/04 - 3:42 AMPermalink

daemin, the challenge is to get the girl to talk about herself, if you can get her to do that for and extended period of time, you get to be called a 'good listener'.... just add some 'un huns' and a few questions, just don't offer solutions to problems, she might just be looking for sympathy/ empathy

Submitted by palantir on Tue, 27/07/04 - 7:03 AMPermalink

Right then, when?s the Sumea dating challenge # 1 start??? [:D]

Submitted by Kane on Tue, 27/07/04 - 8:25 PMPermalink

Haha! Now thats a good idea! [;)]

Submitted by Maitrek on Tue, 27/07/04 - 9:15 PMPermalink

lol

that's the worst idea I've ever heard :P

Submitted by Daemin on Tue, 27/07/04 - 9:16 PMPermalink

I think some of the married developers on here would have won that one already :-P

Submitted by Kalescent on Tue, 27/07/04 - 10:48 PMPermalink

Aven might dress up as a girl and trick one of you fella's [:P] better watch out!

Submitted by palantir on Wed, 28/07/04 - 4:02 AMPermalink

quote: I think some of the married developers on here would have won that one already :-P
No, your not allowed to use any pre-existing work ? it must all be done originally for the challenge [:P]

Submitted by Daemin on Wed, 28/07/04 - 11:51 PMPermalink

So to start off from an equal footing we're all going to quit work, stop excercise, and bum around for two weeks growing beardy stubble and a pot belly while absorbing ourselves in programming knowledge?

Erhm, somehow I don't think so.

Visual Studio 2005 Express

Microsoft have release free beta versions of their visual studio 2005 products:
http://lab.msdn.microsoft.com/express/

You can download the .NET2 beta installer from here: http://www.microsoft.com/downloads/details.aspx?FamilyId=F1232C37-0FEE-…

If you like to keep backups of the installers, check your temp directory for a folder called something like VSSETUP and grab the .exe files from there after they are downloaded.

2D Platforms

I've finally managed to attempt my first game and i've been fiddling around over the last few days with an api called sdl[url]http://www.libsdl.org[/url]. I've managed to get sprites working and a scrolling background, also some basic collision with bmp's. However i've run into a problem with making a level, i can't think of a good way to get a 'ground' surface. I can get a big long bmp along the bottom to work, and also place little bmp's around the screen, but this makes level design dreadful. I was wondering if it's possible to do some sort of colour collision within a bmp, i can set a transparency colour so i figured it would be something to do with that? If anyone has used sdl before and knows how to help or any other solution, it would be appreciated.
~thanks [:D]

Submitted by CombatWombat on Wed, 30/06/04 - 6:31 PMPermalink

It sounds like you're working out your collisions through looking at the actual pixel data of the bitmaps. Reading between the lines I think you're using bitmaps to render and represent the platforms?

What I'd suggest is making 3 tiles for each platform - the left end, "middle" and the right end. These should all tile together ok - then you can define your platforms as being a line in space, and render the end tiles and as many middle tiles as you need to complete the line.

So instead of using bitmaps, you're doing rectangle calculations for collisions, which are much much faster.

You could extend this tile scheme to do your ground too - so that there's water along the ground in parts, then sand, then grass etc - you can do some nice transition tiles to link between the different terrain.

A quick hacky way to do your level design then might be having a text file that had various characters representing the tiles:

[code]

%%%%%%%%

**** ***** ******* *********

###############&&&&&&&&&&&&&&&&##############-----------#############
[/code]

Where say % = clouds, * = steel mesh catwalk # = grass & = water - = ice

And you could do nifty things like make your character slide on the ice, and do a swimming animation through the water etc.

Cheers,

Mark/CW

Game programming

Well, if some of you have read my one other post, you'd know I have just recently picked up C++. So far, its fairly simple, with a few hard things to remember here and there. But to the point... I havent found any source code for... let's say a game coded in C++. If anyone has source code (want to post some or link me to some), it would be astoundingly appreciated.

Also, do not call me a NOOB or tell me to LEARN IT BY MYSELF. I have tried to put my knowledge of C++ into the process of game producing, but it's so limited nothing happens. If someone has some source code to a small game (no text advents plz), GREATLY appreciated. [:D]

Submitted by palantir on Wed, 23/06/04 - 8:38 AMPermalink

There?s plenty of general information and tutorials around for games programming (check out the links in the coder section), but personally I think that nothing compares to a good textbook. Sure, you?ll have to fork out over $100 dollars, but there are many excellent texts around which pretty much all come with CD?s chock full of code samples and thorough explanations of that code in the text.

Check out [url]http://www.sumea.com.au/forum/topic.asp?TOPIC_ID=1242[/url] for what people around here reckon are good books. I guess it all depends on what level your at for what book is right for you.

Another thing I?d strongly recommend is looking for a well-documented, open source 3D games engine. There?s plenty around, just search around a bit. This thread [url]http://www.sumea.com.au/forum/topic.asp?TOPIC_ID=897[/url] lists a bunch of engines that people here have experience with. But there are plenty out there, you just have to look for them. Personally, I found that studying how game engines work greatly improved my games programming ability.

But personally, I think you just can?t beat a good games programming textbook!

PS ? Don?t worry about being new. Sumea is all about learning and developing after all. Not everyone here is an expert!

Submitted by DaMunkee on Wed, 23/06/04 - 1:15 PMPermalink

For source code, I recommend checking out gamedev.net Other then that, there's plenty of books out there that walk you through making your first game in c++.

Submitted by shiva on Wed, 23/06/04 - 6:39 PMPermalink

for source code, why dont you check out the last sumea programming challenge. everyone's entry was written in 48 hours, so the code might not be the neatest you've ever read, but it works [:)]

Submitted by Daemin on Wed, 23/06/04 - 11:16 PMPermalink

Private message me your email and I'll send you some stuff I've done if you want it... I've done an engine or two, granted the first was while learning to program large systems/engines, but it was a great learning experience.

Submitted by Grover on Sat, 07/08/04 - 10:39 AMPermalink

Hi, I remember trying to learn a language and build something that resembled a game.. back then it was all books and courses - now the internet is a brill resource for code.

As for C++ code, all depends what you are trying to do but looking at complete systems are always an excellent way to learn.
Try some free engines like:
Nebula/Nebula2 - http://nebuladevice.cubik.org/
This is a great well designed and _free_ engine (not GPL). With a huge community and excellent capabilities. Myself and quite a few others I know have used it to make games.

Ogre - http://www.ogre3d.org/
Another excellent source of C++ code - and gaming capabilties. Unlike Nebula Ogre is under LGPL which requires certain obligations if you wish to make a commercial product.

Other places to try for source:
www.flipcode.com
www.gamedev.net (already been suggested I think)
www.gamasutra.com and www.gdmag.com (associated sites)
and there are many more... google is your friend :-)

Also.. for really poor code try my site.. erg.. only if you dare..
users.senet.com.au/~dlannan/
there is just alot of oldish junk here - be warned, not C++ friendly!!

Cheers...

Submitted by arcane on Tue, 10/08/04 - 10:24 AMPermalink

I'd just like to point out that OGRE isn't a game engine, but a rendering engine. Whilst it has been successfully combined with other game related components (physics engines, sound engines etc), it is, in essence, a rendering engine (that is, it covers only the graphics aspect).

Submitted by Daemin on Tue, 10/08/04 - 11:34 AMPermalink

I'm trying to use OGRE now, because otherwise I'd be spending weeks on getting a nice base rendering system done.

Also LGPL licence means that if you modify the engine source code then you have to distribute your modifications. You don't have to do a thing if you just use the engine in a binary form. Although I believe that you also have to include the source code of the engine somewhere. But then again how many other game cd's (used to) contain "fun stuff" like developer images and such?

Gamecube shaders?

I got told that the gamecube doesnt support pixel shaders, and I've read some stuff that supports this, but I have seen a lot of great effects like, reflection and refraction, dynamic light and shadows, which as far as I know, are pixel shader effect.
So anybody thats programmed for the cube feel like clearing the air for me?

Submitted by redwyre on Tue, 22/06/04 - 12:52 AMPermalink

I don't know anything about the gamecube, but those things don't need pixel shaders to be done - but they do need pixel shaders to be done accurately :)

Reflection is done with cubemapping, refraction too I guess, light and shadows can be done via light mapping or per-vertex, and shadows can be done with the stencil buffer or projective textures, or before that, projecting a mesh onto a plane (very simple, kinda dodgy).

Pixel shaders allow those tasks to be done per-pixel instead of being done per-vertex and interpolated, so the visible result it much more accurate.

Don't have time to elaborate, but that should help you out.

Submitted by Daemin on Tue, 22/06/04 - 12:56 AMPermalink

There's a great article about building pixel shader like things for the gamecube up on Gamasutra (http://www.gamasutra.com/features/20021002/sauer_01.htm)...

Generally those effects don't require pixel shaders themselves, they can be done using conventional means too albeit they are far slower and take away processing power from the CPU that could be used for other things. This is all because shaders are just instructions executed on the GPU rather than the CPU...

The last hours of a Game Programmer

Hehe, wow, that subject sounds kind of morbid :)

Well, guys and gals, the day is quickly approaching. As of Tuesday (22nd) of next week, my stint as a Game programmer will be over. It's been a good few years, and through the job, I have had a chance to fulfill a few of my dreams.

From a million selling Expansion Pack, to a multimillion block buster, to even being credited on probably one of the worst games ever made (Renegade), to working on two games at once for a small independent company. I've had some good times and some great times, and occasionally, some really freak'n crappy times (Like 6 months worth for Generals :), but who's counting right). But the day is upon me to move on, to close this chapter in my life. To lock away the memories and hope they will never be forgotten.

Chances are, I will probably never set foot in a game studio again, will it be missed? I'm sure it will, but at the same time, I'm not sad to see it go. I've had a chance to live what other have only dreamed, it is now my time to hand the torch over to another enthusiastic youth so that he or she may be able to live out their dream. To you, my replacement, I wish you the best of luck, and to the rest of you who are still in the queue of gaming glory, "patientce" you too will get your chance to shine.

For those of you who are in Perth, or visiting Perth, I will be there as of July 14th. Feel free to drop me a message and the first cold one is on me :)

Chris

Credits:
C&C Yuri's Revenge
C&C Generals
C&C Renegade
Kohan 2: Kings of War
Axis and Allies

Submitted by MoonUnit on Sat, 19/06/04 - 8:35 PMPermalink

well good luck with the future then DaMunkee!

Submitted by bullet21 on Sat, 19/06/04 - 10:19 PMPermalink

What do you plan on doing now, whatever it is best wishes?

Submitted by Kalescent on Sun, 20/06/04 - 12:03 AMPermalink

Good luck Damunkee, without people like yourself, games that i like to play wouldnt exist. Hats off to you! [8D]

Let us know how that backpacking adventure goes! [:)]

Submitted by codyalday on Sun, 20/06/04 - 1:25 AMPermalink

Good luck with the rest of your life, maybe you should become a porn star or something like that.

Submitted by Aven on Sun, 20/06/04 - 2:05 AMPermalink

Have fun with whatever you do.

Don't feel too bad. Postal was a hell of a lot shitter then Renegade :D

Submitted by Leviron on Sun, 20/06/04 - 3:55 AMPermalink

So what's your new career (or job choice) going to be?

Submitted by Kane on Sun, 20/06/04 - 4:47 AMPermalink

Good luck, and all that! [:D]

Submitted by souri on Sun, 20/06/04 - 11:38 AMPermalink

.. and are you still gonna lurk here occasionally? : :)

Submitted by DaMunkee on Sun, 20/06/04 - 3:26 PMPermalink

Thanks Everyone!!!!!!!! :)

quote:Originally posted by Leviron

So what's your new career (or job choice) going to be?

Hehe, I'll figure it out as I go along :) I'm hoping to stay in the land of C/C++ but away from things like ASP/internet technologies. Then again, there's always codyalday's suggestion of becoming a porn star :) But somehow I doubt my girlfriend would be to happy in me doing that.

quote:Originally posted by Aven

Don't feel too bad. Postal was a hell of a lot shitter then Renegade :D

Hehe, that's good to hear there was at least one game worse then Renegade :)

quote:Originally posted by Souri

.. and are you still gonna lurk here occasionally? : :)

Definitely! I'm also interested in setting up some kind of once a month or so "STS" (shoot the sh*t) session in Perth if people are interested.

Submitted by shiva on Sun, 20/06/04 - 6:00 PMPermalink

quote:Originally posted by DaMunkee

quote:Originally posted by Aven

Don't feel too bad. Postal was a hell of a lot shitter then Renegade :D

Hehe, that's good to hear there was at least one game worse then Renegade :)

Daikatana... [;)]

Submitted by Aven on Sun, 20/06/04 - 7:43 PMPermalink

Damn. How could I have forgotten Mister Romero's bastard child :p There was also Phantasmagoria and pretty much every "Interactive Movie" that was ever released during the mid-nineties :) See DaMunkee. Although Renegade wasn't a very good game, it still isn't the worst :D

Submitted by GooberMan on Sun, 20/06/04 - 11:02 PMPermalink

Don't be too harsh to Renegade - after all it was better than C&C: Sole Survivor...

Submitted by Anti Gremlin on Mon, 21/06/04 - 12:51 AMPermalink

hehe, I go to Perth a fair bit, usually for NYE, I'll def have to catch up with you next time im over there, and ill be more honored to shout you the first cold one :D

Submitted by bullet21 on Mon, 21/06/04 - 4:19 AMPermalink

I thought renegade was quite good so did my bro.

Submitted by tbag on Tue, 22/06/04 - 10:48 PMPermalink

So now that your arent working for EA anymore, give us all the dirt! [;)]

Good luck man! Also, your going back packing around Australia arent you? If your in Canberra there are a few Sumea fans who would probably appreciate meeting you *Cough, me [:p]*. But then again there are a lot of Sumea fans and members [;)].

Oh and as for Renegade, the last i heard it wasnt to shabby. I might pick it up from the bargain bin sometime if i can find a copy.

Submitted by DaMunkee on Wed, 23/06/04 - 1:23 PMPermalink

Haha, actually, my backpacking trip was last year, that was when I left EA (hehe, wen't a little insane from the crazy work conditions) Then I came back to the US after 6 months and started working for a small game company "Timegate" so, that's where I'm at today (my last day :)) Anyway, I'm not sure when I'll make it through Canberra.

As for bargin bin prices on renegade, I saw it for 7 bucks the other day :)

Submitted by souri on Mon, 28/06/04 - 3:04 PMPermalink

Anyway, I'd be interested I hearing on why you've left the games industry. Did that IGDA Quality of Life paper have anything to do with it?

Submitted by DaMunkee on Mon, 28/06/04 - 3:46 PMPermalink

quote:Originally posted by Souri

Anyway, I'd be interested I hearing on why you've left the games industry. Did that IGDA Quality of Life paper have anything to do with it?

Haha, it was more like living the IGDA QoL paper that did it :) Actually, like I've said before, my last company, Timegate, they treated us good and we were able to have a life. So I guess my decision to leave is A) Timegate is the exception, finding another company like that would be hard to find, b) I already had my 15 minutes of fame with C&C Generals, so now the "coolness" of being a game programmer has lessened. In the end, it's just a job. and c) I get bored doing the same thing for too long :) So, with the move, nows a good time to try out new things. I hear they need explosive experts for the mining companies in WA :)

Essentially, I'm glad I did it. If I had to do it all over again, I would! I mean, C&C Generals was my dream project, so now that I've lived one of my dreams, it's time to move on. Of course, I still enjoy games, and I'm always willing to chat about the expriences and to help out those that are trying to get into the industry (I have LOTS of friends in the US game industry).

In any event, I'll still hang out here and help out when I can :)

Submitted by Daemin on Mon, 28/06/04 - 10:19 PMPermalink

DaMunkee: You should still attend the Australian Game Developers Conference this year, I reckon it will be a blast having you there, meeting the Sumea 'crew' etc :-)

Submitted by DaMunkee on Thu, 01/07/04 - 4:09 PMPermalink

quote:Originally posted by Daemin

DaMunkee: You should still attend the Australian Game Developers Conference this year, I reckon it will be a blast having you there, meeting the Sumea 'crew' etc :-)

Sounds like a plan Daemin :) I was actually planning to present this year, but with the move, I completely forgot about the deadline! Maybe I'll present next year. Hmmmm, what topic would interest you guys?

Anyway, I'll definitely try to attend, I mean hey, i feel like I have a few friends on here :)

Submitted by bullet21 on Thu, 01/07/04 - 6:25 PMPermalink

Two questions:
Did you work on zero hour as well?
and do you have a yankee accent :)?

Submitted by DaMunkee on Fri, 02/07/04 - 12:55 AMPermalink

quote:Originally posted by bullet21

Two questions:
Did you work on zero hour as well?
and do you have a yankee accent :)?

Nope, Zero Hour was completed in LA, that was after I left (they finished that as I was backpacking).
As for your second question, I don't have an accent, all of you guys do :) Just kidding :P Yeah, I spent about 23 of my 26 years in the US so i lost my accent a long long time ago.

Submitted by bullet21 on Fri, 02/07/04 - 1:36 AMPermalink

also did you work on axis and allies? cos it looks awesome.

Edit: while at timgate of course

Submitted by DaMunkee on Thu, 08/07/04 - 2:30 AMPermalink

Hehe, yeah, A&A is coming along great!!!! They had just a little bit longer on it before they are able to print the gold master, but hey, at least A&A and Kohan 2 will actually come out before christmas, unlike some games :) (Doom3 and Half Life 2... yes yes, I know they're suppose to be out before xmas, but hey,I'll believe it when I see it sitting in my hands :) )

Visual C++ .Net Standard 2003 + VC 2003 Toolkit?

We're looking at moving from VC++ 6.0 to the newer M$ compiler. VC++ 7.1 sounds to be closer to fully implementing the ISO C++ standard (eg scoping of variables in for statements + partial template specialization), so boost is more fully supported under it, among other things.

Some extra info might be handy here: we're only interested in native C++ code, not .NET, and only interested in using the STL, not ATL or MFC.

So, to get hold of the compiler for VC++ 7.1, we have three options:

* Visual C++ .Net Standard 2003 (does not have an optimising C++ compiler, about AUD$170)
* Visual Studio .Net Professional 2003 (has a lot of crud we don't want, but has an optimising C++ compiler, and is about AUD$1,700)
* VC2003 Toolkit (free in terms of price, but overly restrictive EULA - which even appears to prevent it being used on OSS projects!, an has optimising C++ compiler, but no debug libs and no debugger...)(http://msdn.microsoft.com/visualc/vctoolkit2003/)

Nice how microsoft don't do a Visual C++ .Net Professional 2003, hey? [:(!]

Now it seems to me that it should be quite feasible to get the Standard edition, copy some files from the VC2003 Toolkit, and bump the Standard edition to the Professional edition we're after.

Has anyone tried this? Interested in what people have found.

We'll have to get the "real" professional version of Studio at a later date to be able to release our finished game - either that or we'll grab the intel C++ compiler, I guess. There really are some nasty clauses on the EULA for the free version of VC2003... (At least, I assume professional version of studio has a more relaxed EULA)

Cheers,

Mark/CW

Submitted by GooberMan on Sun, 06/06/04 - 2:40 AMPermalink

You don't get the debugger with the VC2003 toolkit, so you'd have to do normal development with the standard compiler/IDE and do release builds with the toolkit compiler if you can't live without your debugger.

Submitted by CombatWombat on Sun, 06/06/04 - 2:50 AMPermalink

Yeah what I hoping that if I copied the right executables across, that it would be possible to debug (non-optimised) code with the VC2003 tools... I'm assuming that the only differences between the cl.exe will be the fact that the VC2003 version will implement the optimisation behind the /O1 and /O2 flags - just wanting to check before I pay any money to the evil empire though ;->

However, it wouldn't suprise me if microsoft actually did something nasty like stop the cl.exe from the VC2003 tools from generating debug information that was compatible with the Standard edition's IDE :)

Submitted by Barry Dahlberg on Wed, 09/06/04 - 5:39 AMPermalink

Is it an option to have the low end version for all but one, and have one copy of the optimising version to compile release code etc on?

Submitted by redwyre on Wed, 09/06/04 - 10:06 AMPermalink

You can use the 7.1 compiler with 7.0, I've done it myself and know of other that are doing it now. The main thing is that you have to specify the optimising command line args manually (the IDE doesn't have them). I even have a command script that let me switch between 7.0 and 7.1...

Also, Standard doesn't support source control at all, so you'll have to do that manually too..

You should only need one copy of Professional to compile the final release build.. ;)

Submitted by CombatWombat on Wed, 09/06/04 - 11:57 PMPermalink

Oh, looks like my response got eaten by something... Here goes again:

Yeah, one copy for the release code looks like it is the cheapest, legal way here...

Thanks for the info about SCC missing from standard. We're using CVS over SSH through cygwin, so no worries there.

c#

Hello all,

Does anyone here use c#? I havent used c# yet. I was thinking of porting some of my c/c++ engine code to c#. I'm quite sceptical about performance issues and whether it would be worth doing.
any suggestions..?

adios
rx

Submitted by Zaph on Thu, 13/05/04 - 8:29 AMPermalink

quote:Originally posted by rx

Hello all,

Does anyone here use c#? I havent used c# yet. I was thinking of porting some of my c/c++ engine code to c#. I'm quite sceptical about performance issues and whether it would be worth doing.
any suggestions..?

I haven't used c# but I enter a few programming competitions for which performance is important (mostly at an algorithmic level though) and I've seen quite a few people using c#.
Personally I just stick to C for really simple stuff, and C++ when things get bigger. I've programmed in too many languages over my life to want to learn a new one without good reason :-)

Submitted by OJ on Thu, 13/05/04 - 6:57 PMPermalink

I have the misfortune of having to use it every day as part of my current job, and I'd rather use C++ any day. Then again, I am heavily biased :D

Unless there are a few good reasons to justify the switch to C#, I wouldn't bother doing it. Stick to what you know.

Submitted by Daemin on Thu, 13/05/04 - 10:42 PMPermalink

C# appears to me to be the Microsoft Java clone, although I think it has superior features to Java and I think I'd enjoy working in it more than in Java (Uni, ergh). However having said that I don't think anyone would be developing games in it yet, maybe the tools to make games assets with, but not the actual games themselves. If you are looking for a scripting language to write a game with there are plenty out there, Python being by far the most popular, with Lua/Ruby coming in close too.

I'll write more about C# when I actually get a chance to use it in a concrete application.

Submitted by redwyre on Thu, 08/07/04 - 2:29 AMPermalink

C# is nice, however as an "experienced" programmer, I feel there are a few things wrong with it, and the .NET CLR. However, it is very nice for writing GUI apps in, and very fast for simple apps development, so if that's what you're using it for then it's great (trying to do the same thing in C++/MFC/WTL/etc is much much more painful).

Also remember that .NET and the CLR allow you to mix languages at will, so you can write all your low level stuff in C++ and write a quick and rich UI in C#.

Submitted by Daemin on Sun, 11/07/04 - 4:09 AMPermalink

Well I've had a bit of a play around with C# using the new fangled Visual C# Beta Express thing. It seems to be a lot like java with some of the nice things of C++ built into it. I must say that I enjoyed programming in C# more than programming in Java. Of course the tools might have something more to do with it, but still.

One of the nice things that I found out about C# while coding in it was that I wasn't doing as much casting as I would have been in Java, at least with the Generics of C# (though the help docs warn that they are not CLR compatible?), and thus the code seemed to be easer to write.

Now I will actually start writing some serious applications in it and see how it goes. I might even like it and decide to become an applications programmer - heck Game Tools need to be made too! (Now if only I could find a job doing that!)

Submitted by redwyre on Tue, 13/07/04 - 10:12 AMPermalink

Also, please be aware of Mono http://www.mono-project.com/, a cross platform runtime. If you are going to start writing C# apps, you should probably try and avoid using windows.forms if you want real portability. Mono has Gtk#, which seems to be a very good alternative to windows.forms.

Submitted by Daemin on Tue, 13/07/04 - 11:16 PMPermalink

I'm aware of the mono library, but I'm not really concerned about writing cross platform applications.

So far the Gui components of C# are pretty damn good and I have had no complaints.

Submitted by Daemin on Thu, 15/07/04 - 12:06 AMPermalink

As to RX's original question I would say that building graphical tools in C# would be quite easy to do, and I would recommend it, however building a game engine in it, I would advise against it. Maybe if you used C++ .Net and then C# for the scripting that might work out. However personally I would stick with C++ for the engine and use C# for tools if necessary.

Java in games

Is it true that most (If not all) console and PC games are coded in C++

And there a chance of a change to Java or any other programing language. I know Java has it's speed disadvantages being a half compiled half interpreted language,is ther any major advantage that Java has over C++

I just want to know what language I should focus most of my attention on, I have just started lerning Java and I like it more than C allready.

Acer

Submitted by CombatWombat on Sun, 09/05/04 - 8:59 PMPermalink

I'm unaware of any PC (or console) games that were written in java (other than hobby projects, this is).

I can't see game developers changing to java any time soon. The reasons, as I see them, are performance (not only from slower execution of code, also from garbage collection hits), protection of their code from decompilers (a higher level bytecode makes it easier to see what the code is doing), and the variation in versions of the java runtime (potential support nightmare :)

At least when I was doing a little bit of java development a few years ago, the speed problems were quite noticable - especially in slight interface lag which irks me.

There are also a few compilers around that do compile java to native code (eg gcc) but I've not used these.

I'd say the main advantage that java holds over C++ is that it's a simpler langugage and it's easier to learn.

Certainly once you know C++ reasonably well (and have started to develop some good OO design skills), one can pick java up very quickly. The opposite way, going from java to C++, will be more trouble as there's a lot of things will strike the new C++ developer as quite unintuitive (they're not, but they just appear that way :)

If your dream is to write FPS or RTS games, I'd suggest C/C++ is the way to go, but if you're wanting to write puzzle games or turn-based web games, probably java is all you'll need.

Cheers,

Mark

Submitted by Daemin on Sun, 09/05/04 - 10:19 PMPermalink

I eally doubt that Java will be used at all for programming console games. The main reason for this would be the garbage collector, since it would run whenever it felt like it, and that is not good when on a console you need to make your code run at a constant rate. On PC however there might be a future in Java, however it would require better graphics and sound libraries in order to do so. Probably also better input libraries too!

One area where it could be used is as a scripting language on top of a pre-built engine already made in C++ etc.

Submitted by awf on Mon, 10/05/04 - 12:33 AMPermalink

I hear c# getting mentioned sometimes. C# and managed DirectX might worth checking out.

Submitted by Blitz on Mon, 10/05/04 - 2:50 AMPermalink

Garbage collection is not a problem in java if you are reasonably smart about your memory usage. You can control the garbage collector and only have it run when when you call it. Java is getting faster all the time, but so is C++. Even with java compield into machine code, it still has all the little extras of overhead that can hurt your code that needs to be badass optimized.

I don't see C/C++ being replaced anytime soon for intensive console and PC games.
However, Java is used a LOT for web-based games and also for quite a lot of mobile phone games, so if you're interested in those platforms, then java will do you fine.
CYer, Blitz

Submitted by Acer on Wed, 12/05/04 - 9:04 AMPermalink

Thanks for the input, I definately want to do FPS and 3D games, so I will have to focus my attention to C++, Im just wondering where can I find out about all the C++ funtions, is there a catalouge of the standard C++ functions, i have only got the basic compiler, and it has little documentation.

Thanks again.

Acer

Submitted by DaMunkee on Wed, 12/05/04 - 12:04 PMPermalink

Check out the microsoft MSDN site, they have their full documentation online. Other then that, just search online for C++ tutorials and refereces.

By the way, for hard core games (pc or Console), C/C++ is the way to go. If you're looking to make games for Phones and handhelds like phones. Java is the way to go.

Looking for someone

Hey a guy from america email a friend of mine from here he said he worked on a command and conquer game and was asking about moving to perth and about our game programming course at uni. If your that guy email me because i would be interested in helping you develope the course here at murdoch.

look forward to hearing from you

Submitted by DaMunkee on Fri, 30/04/04 - 10:33 AMPermalink

Yep, that would indeed be me :) I'll shoot you an email.

Chris

Enumerating Display Modes in Linux

I'm writing an OpenGL application for Win32 and Linux. I use WGL on Win32 and GLX on X-Windows to handle OpenGL rendering contexts.

In Win32 I use EnumDisplaySettings( ) and ChangeDisplaySettings( ) respectively to handle full screen mode switching at various display modes. I'm wondering if there are eqivalent routies for enumerating display modes in Linux for full screen rendering?

I don't want to use GLUT, because it is not suitable from my application.

Submitted by dom on Mon, 19/04/04 - 9:55 AMPermalink

i thought about using SDL, but i don't want to use another library that just wraps around X-windows.

How do I render with DRI?

Submitted by Shplorb on Wed, 21/04/04 - 8:09 PMPermalink

You don't have to use SDL - just have a look at the source to see how they do it.

Submitted by rx on Sun, 16/05/04 - 10:25 AMPermalink

hello

hope this might help
http://www.xfree86.org/4.4.0/XF86VidModeModModeLine.3.html
this site has some documentation about calls to the X server

Bool XF86VidModeGetAllModeLines(
Display *display,
int screen,
int *modecount_return,
XF86VidModeModeInfo ***modesinfo);

this is function u wanna call to get the display modes from the x server.

chao
rx

Submitted by dom on Fri, 28/05/04 - 11:01 AMPermalink

Thanks for your reply RX. :) I'll check it out.

"Universal" 3D File Formats

I'm after a file format specification that serves as a "standard container" for 3D geometry data. I know that CAD applications comply with various universal formats such as IGES and STEP, which allows them to export/import 3D design data between different CAD applications. I'm after something similar specifically for computer graphics.

Basically, I need information on non-application specific 3D file formats. Any suggestions?

Submitted by Blitz on Thu, 15/04/04 - 12:01 AMPermalink

Not 100% sure, but i think VRML is an open standard...
Check it out. Lightwave .obj might also be an open format, as i've seen several applications that can import/export them.
CYer, Blitz

Submitted by redwyre on Fri, 16/04/04 - 4:38 AMPermalink

I think .3ds is the way to go. discrete have an sdk on spark that shows you how to read and write it.

Submitted by dom on Fri, 16/04/04 - 8:45 AMPermalink

I tried looking for the official docs for the 3DS format, but I can't find them AT ALL.

Submitted by Daemin on Fri, 16/04/04 - 9:54 PMPermalink

My suggestion is to try and make your own, not all formats support all things, and the ones that come close are bloody hard to parse.

I haven't seen the lightwave object format but I'd assume that it wouldn't be 100% suited towards games because half of the processing and all of the animation is stored in the lightwave scene file rather than the object file. I suppose it would be easier then to make an export format based on the two file formats though, although I've never tried.

Try and avoid the 3ds file format, since that only supports one set of texture coordinates per vertex, and right now we definetly need more than that for modern games. I.e. texture map, displacement map, bump map, normal map etc...

DXF might be interesting but I think its text based

MAX is also text based but a lot more complex and contains a large amount of 3DS MAX specific data that is superfluous to games.

Submitted by TheBigJ on Sat, 17/04/04 - 12:49 AMPermalink

DXF can be binary and text. I would strongly suggest staying away from it. DXF is revised with new versions of AutoCAD which makes compatibility very painful.

I agree with Daemin on this. Work with your own format and write a converter to *fairly* standard formats like 3DS if you need to.

Submitted by dom on Sat, 17/04/04 - 3:05 AMPermalink

Thanks for your suggestions.

I wanted to avoid writing my custom format, because I didn't want to go trough all the hassle of writing conversion routines, etc., when I could just read in a third party format straight away. Looks like I'll have no choice.

Submitted by alia on Thu, 22/04/04 - 8:42 PMPermalink

Oj, you beat me to it! :)
File formats for 3d stuff has always annoyed me... hope these guys come up with something that isnt too complicated but still powerfull (yes i know thats damn hard!)

A.

Submitted by OJ on Thu, 22/04/04 - 10:29 PMPermalink

Alia: Isn't it always the way :) I'm usually on the other end aswell! Looks like I finally got in before someone else this time :)

I think they're going to have quite a challenge in making a decent format that covers a good percentage of the requirements for people in the industry. Bearing in mind that this (probably?) might not be just for gaming, it'll be a really tough task to keep people happy.

Good luck to them, I look forward to seeing the result.

OJ

Submitted by OJ on Fri, 23/04/04 - 11:55 PMPermalink

One step ahead of ya ;) Have already had a good look through the responses from the various posters. I still thought it was a worthy topic to mention :)

Submitted by dom on Sat, 24/04/04 - 4:48 AMPermalink

U3D? Cool, that looks very interesting!!!

Submitted by rx on Mon, 17/05/04 - 12:26 PMPermalink

This discussion topic reminds of the pain I went thru while writing a .3DS parser :S. Specially the key frame animation chunk in a .3DS file is the worst of all.
3ds files are smaller and IO efficient being a binary file. But writing a parser from scratch can be challenging! Simpler file formats such as .ASC, .ASE are easier to read but bulkier. there's always a trade off for efficiency.
The good thing is, if u're not comfortable with one format there's always a second choice and there are hundreds of plugins for interconversion.

Submitted by Daemin on Tue, 18/05/04 - 12:45 AMPermalink

Yeah, writing a 3DS parser was hard, however the format has several major flaws, first being the texture coordinate garbage (only allowed one set). So really it shouldn't be used now at all!

Submitted by CombatWombat on Tue, 18/05/04 - 1:24 AMPermalink

I was pretty impressed with the maya API, quite well designed, if a little confusing to begin with.

Jumping Characters

I'm not making a game involving this or anything, I was just curious because I have never tried to do it before...

How do you make a 2D character jump? Is it like moving the image up a certain number of pixels over time, then dropping them down again?

And how how would you tell when the character has jumped and landed on a higher platform?

Submitted by Daemin on Fri, 02/04/04 - 10:36 PMPermalink

You just move the character's y position up temporarily. Like you'd keep a flag or a variable that tells you how many more seconds the character will be jumping up for, and you keep moving them up for that period of time, then after that you just let gravity do the work to get down.

If they jumped up on a hihger platform that would just mean that they have landed on a higher platform, just by virtue of following the laws of gravity (albeit to some limited extent)

Submitted by Kane on Fri, 02/04/04 - 10:43 PMPermalink

cool...i thought that was how it would work...just wanted to be sure...thanks!

Win32 stuff...

ok, what is Win32 programming used for in games and how much is it used?

i know that to get a game up and running, you can use Win32 to create a window and display your game in it, but what else is it used for? do tools use Win32, or is something else used?

basically, give me the run down on game dev and Win32...

Submitted by Shplorb on Fri, 02/04/04 - 8:30 PMPermalink

Win32 is the Windows API, it provides access to all OS functions such as window creation, file i/o, process management, etc. Many of the ANSI C functions in MSVC are wrappers to the Win32 equivalents. eg. fopen() wraps CreateFile(). Likewise, on a Unix system you would use the POSIX API, or Carbon or Cocoa on OS X.

In reality, you shouldn't need to use it much, just little bits to handle all the interfacing with the OS. This is why it's good to use cross-platform libraries and design your application so that it is abstracted from the OS-dependent things. If you do that then you won't need to completely re-write the program if you need to run it on a different platform - you just re-write the little bits of platform-interface code and recompile.

Hope that helps.

Submitted by Kane on Fri, 02/04/04 - 8:35 PMPermalink

ok thanks...

so would it be worth learning some of it?

Submitted by alia on Fri, 02/04/04 - 10:16 PMPermalink

Some.. like registry functions prehaps.. or file permissions, maybe even the event log... all of wich should take you no time at all. Everything else id say no.. you know the portable/standard why of doing things why specialise before you need to?

my 0.02$

A.

Submitted by Kane on Fri, 02/04/04 - 10:20 PMPermalink

rightio...so IS Win32 used to get a Window up and running in most PC games?

Submitted by Daemin on Fri, 02/04/04 - 10:33 PMPermalink

Well you can either use the "raw" Win32 API functions, or use some sort of library such as GLUT (shudder) or other game type library.

If you're going to use Win32 you might as well then use all of the functions containted within the API instead of the standard C functions since it'll all be the same thing and you can do extra things if you just use the Win32 API.

To create a window you'll need to use the RegisterClassEx and CreateWindowEx functions (tho you might not want to use the extended versions right away, they are the ones with the Ex at the end), you'll need to fill out the WNDCLASS structure etc. You will also be requried to create a function that processes window messages.

Some other funky things that could be done with Win32 functions are: using memory mapped files, for which the OS can handle most of the work for you, using sleep so that your program uses only as much CPU as it needs to, and handling the minimisation and maximisation of your window properly - so like the user can alt-tab in and out of your game with no worries.

Submitted by Shplorb on Sat, 03/04/04 - 4:57 AMPermalink

Yep, basically just go have a scan of the Platform SDK on msdn.microsoft.com - or if you have Visual C++ have a look in the help.

Memory mapping files is funky stuff, but it's not like other OS's can't do it. If you want to see how to create a window using Win32, check out the NeHe OpenGL tutorials at http://nehe.gamedev.net - they take you through everything you need to know and then some.

Also, a little self plug here, but I have an example of the funky stuff you can do with Windows on my site at http://shplorb.ods.org/develop/icqnobanner/ - it's a little program that starts icq and injects some code into it that hijacks the window and prevents it from displaying the ad banner at the top of the contact list. The Win32 API has loads of stuff to let you do almost anything imaginable with Windows. If you're really interested in learning all that you can do then I'd suggest buying one of Microsoft's books on it.

Submitted by DaMunkee on Sat, 03/04/04 - 10:56 AMPermalink

Just to through in my 2 cents. On the last couple projects we always kept a distinction between where we used Win32 and where we didn't. The theory is, when porting the game to another system (like macs... shudder....) to make the life of the porting company easier we had a strict line between device dependent and not. We created virtual classes that we would then inherit Win32 specific classes off of that. That way our code will only deal with the virtual base class and when the game is ported, the only changes that need to be made is to derive a new class from the base class. Of course we also split the project into os dependent directories. Everything that is os independent go into a common location and every device dependent item goes in its own directory. When dealing with two, three, even ten thousand files for a game, this is the only way to do it :)

In terms of is it worth learning win32? Like was said before, things like registry, file io and of course DirectX (if you want to get into graphics) are all you need to know. Occasionally a game will use Window's Widgets for their UI and in that case a decent knowledge of Ownerdraw is usefull. (Yuri's used all owner draw widgets where as Generals we used our own UI system... and man was that a pain in the butt!)

Anyway, just have fun, focus on what's fun, and the rest will follow :)

Submitted by Daemin on Sat, 03/04/04 - 9:03 PMPermalink

AFAIK Unreal uses Ownerdraw GUI elements, so far I've only done my own ones, but that wasn't too difficult...

Submitted by DaMunkee on Sun, 04/04/04 - 11:14 AMPermalink

Yeah, using your own isn't too difficult it's just a pain in the butt when 2 weeks before you ship, they tell you they want all the functionality of a windows widget, right after they told you that they're scrapping the look of the UI and it will all be programmer generated/animated and you have no systems for this in place. Ahhh I loved the feature creep that happens post beta...

Maya PLE dissection :)

Hi,

I was wondering if anyone knows how to modify a maya ple file so that it is importable into maya complete? I have heard rumours there is only a 4bit difference in the file itself and I wondered can u open ur saved file even in a txt document and try to find something to modify that would make it a complete file..Or on the otherhand is there a mel script for maya complete that allows you to import a ple?

Submitted by TheBigJ on Thu, 01/04/04 - 9:41 AMPermalink

I have no experience with maya file formats but I had a look around. Alias obviously don't want you opening .MP files in maya complete but I expect the formats will be very similar.

I compared two .MP files to a .MB and noticed some differences in the first 17 bytes of the files:
MB: Bytes 0-4 read "FOR4 ". Bytes 8-16 read "MayaFOR4 "
MP: Bytes 0-4 read "FOR4K". Bytes 8-16 read "MPLEFOR4K"
Bytes 5-7 don't seem to matter. Note that the spaces are not ASCII spaces but NULL characters (value = 0).

My suggestion:
Change byte 4 from "K" to " ", bytes 9-11 from "PLE" to "aya" and byte 16 from "K" to " ". Again, spaces are NULL characters.

I am sceptical that this will work though; it seems too easy. Also, I could only find a few files to compare so the "FOR4 " and "FOR4K" differences could be purely coincidental. The "Maya" and "MPLE" part is pretty obvious though.

You might find this link useful:
[url]http://caad.arch.ethz.ch/info/maya/manual/FileFormats/[/url]

Good Luck. Let me know if it works.

Submitted by DaMunkee on Thu, 01/04/04 - 10:59 AMPermalink

when attempting to modify a binary file, don't use things like notepad and such. I recommend either Ultra edit, or if you don't have that, just open the file in Visual Studio so you're actually viewing the hex data in the file.

Visual Studio 6.0 you can drag and drop any file into the window to view it's binary contents. Visual Studio .net 2k3 on the other hand, first try's to Open the file (meaning if it's aliased to use Maya to open the file, it will run the program instead of opening the file in VS.net.)

Anyway, It's worth a shot right :)

Good luck.
Chris

Submitted by redwyre on Thu, 01/04/04 - 8:23 PMPermalink

To hexedit in visual studio.net, got File | Open | Open file... | select the file and click the little down arrow on the "Open" button | click "Open with" | select "Binary editor"

Design Help - Object Manager

Just wanted to get some feedback for a better way to design an Object Manager. This was from one of my assignments last year I want to clean up and the object storage is shocking.

What I have now:
Object Manager
StaticObject staticObj[STATIC_NUMBER]
DynamicObject dynamicObj[DYNAMIC_NUMBER]
PlayerObject playerObj[PLAYER_NUMBER]

So basicly the object manager sets up the static, dynamic, and player objects and holds an arry of each as well as reading in file information for the static objects and created the databases for the different object types.

Static objects have set positions.
Dynamic objects have random positions.
Player objects is the player (only single player).

ATM the code is quite nasty - the assignment was only 3 weeks :) But I am keen to try and clean it up so that I can use it as a test bed to play with other things.

Really - I was just wondering about how people would set up an object manager design and what type of storage you'd use.

Submitted by Barry Dahlberg on Sun, 28/03/04 - 9:09 PMPermalink

Is for managing objects during the execution of a game or for storage between or a mix?

I tend to use something more dynamic than fixed arrays for storing the objects but there's pros and cons to that. Do alot of objects get created and deleted while running or is it fairly static?

Submitted by Jacana on Sun, 28/03/04 - 9:16 PMPermalink

Managing during execution - main thing it would be for would be running collision tests on objects etc really.

The objects are fairly static - there's only something like 5 of the objects which the player can "pick up" and when they do that I just make those objects invisible since they can "respawn" later.

Submitted by alia on Sun, 28/03/04 - 10:47 PMPermalink

How about a map with the object ID and an object pointer? you could derive the objects from the same class:

class Object{
ID object_id;
TYPE object type; // (static/dynamic/plr)
... (object data)
}

map< ID, object *> blah

then to updatee just iterate through the map
to do collision test - iterate trhough with two iteraters.. etc

quick and _dirty_ :)

A.

findfirst( ) / findnext( ) functions in Linux

Just wondering, what are the equivalent functions for findfirst( ), findnext( ) and findclose( ) in Linux? I'm particularly intereted in functions that portable across Win32 and *nix systems.

Submitted by tachyon on Sat, 27/03/04 - 9:40 PMPermalink

correct me if i'm wrong, but they are just included in the standard c library that comes with linux, so the equivalent functions are the same. just #include .

Submitted by Daemin on Sun, 28/03/04 - 2:26 AMPermalink

Looking at the MSVC documentation it says that the findfirst / findnext / findclose functions are win32 only. I'm sure that there are *nix compatibles out there though, just have to find them...

Can't help you more than that because I'm not much of a *nix programmer.

What means static?

Gday,

Just wondering what the static statement means in C++ and Java?

ie. public static void JavaMethod() or
static int variable;

Submitted by Jacana on Thu, 25/03/04 - 12:33 AMPermalink

textbook def - by prefixing the variable declaration with static the compiler maintaines the variables value even after losing scope.

Example given:
long IncreasePeopleCount()
{
long NumberOfPeople = 0;
NumberOfPeople =+ 1;
return NumberOfPeople;
}

main()
{
long Num;
Num = IncreasePeopleCount();
Num = IncreasePeopleCount();
}

What happens is that count will always be 1 because NumberOfPeople is reset to 0 each time the function is called. So two ways around that is creating a global variable or make it static (static long NumberOfPeople = 0 ).

That may not be the best explanation - so if one of the other programmers has more to add.....

Submitted by Kane on Thu, 25/03/04 - 12:49 AMPermalink

i think i understand...so even though the variable is assigned 0 at the start of the function, it will always be the last value it was set to?

actually, i think thats even more confusing that your example...[xx(]

Submitted by Jacana on Thu, 25/03/04 - 1:47 AMPermalink

I think part of it is personal preference in terms of how you code. Using a static in the function or a global outside are really the same thing. From a point of view for reading code I find it better to keep the variable as close as needed (local) to what your coding - this can make it easier to read other peoples code.

I am not sure what/if the performance hit would be between global and static local variables.

Submitted by Kane on Thu, 25/03/04 - 2:10 AMPermalink

ok then...thanks Jacana!

btw, r u going to the Indie Game Dev Conference?

Submitted by Jacana on Thu, 25/03/04 - 3:27 AMPermalink

Thanks for that Red :) I knew someone would have something more defenitive then I would (didn't think of MSDN )

Submitted by Jacana on Thu, 25/03/04 - 4:28 AMPermalink

Forgot to mention about static functions (as per Red's post) singletons would be used in that manner as you only want to create one instance (thus being singleton)

Submitted by Daemin on Thu, 25/03/04 - 8:22 AMPermalink

A static variable within a function in C or C++ is like a global variable but just for that function.
A static variable within a class in C++ is a global variable, shared among all instances of that class. A static function within a class is the same as a standard C function as it exists on the global scope, it cannot access any non-static variables in the function though. A static C function is only seen within the file that it is defined.

A static method or variable in Java means that there is only one for that class, no matter how many objects of that type exist. It also means that you do not need to create an object of that type to call that method or access that variable.

That's why the main method in Java is static becuase you only want it executed once, and you shouldn't need to create an object of that type beforehand.

Submitted by DaMunkee on Fri, 26/03/04 - 2:00 PMPermalink

In a phone interview for Westwood studios, I was once asked what a static function was. My answer was. "I really have no idea, I could tell you what a static variable does." The guy laughed as said it was fine. Sure enough it was as I got the job :) Back then C was the main language we were coding in so he wanted the answer to be what Daemin said about it only being seen within the file it was defined. Now a-days though, working in C++ land, Static functions are your friends when working in a truly OOP style.

So, just remember, when preparing for job interviews, it's good to know a few obscure terms :)

Submitted by Daemin on Fri, 26/03/04 - 11:26 PMPermalink

Yeah, and C or C++ is filled with them, well not really obscure, but just different meanings for the same word in different contexts. It's not really a beginner friendly language...

Submitted by Kane on Fri, 26/03/04 - 11:42 PMPermalink

C++ was the first language that I learned proprly and I thought it was fine...but then of course I had to move to Java and that was just a breeze...

Submitted by Barry Dahlberg on Sat, 27/03/04 - 1:25 AMPermalink

Some tricky things that have caught me out in past interviews:

Multiple inheritance and where it can be useful. At the time I couldn't think of anywhere I'd want to use it.

What is the biggest number we can store in an C++ integer? I asked on what platform but forgot to ask about sign.

Why are man holes and their covers round?

Submitted by redwyre on Sat, 27/03/04 - 11:08 AMPermalink

One thing to note is that static non-member functions are depreciated, use un-named namespaces instead:

static void MyFunc() {}

should be:

namespace
{
void MyFunc() {}
}

Submitted by Blitz on Wed, 31/03/04 - 2:39 AMPermalink

The technical definition of a static variable, is that it occupies a static location in memory. That is, no matter what the program does, the variable will always occupy the same chunk of memory for the run-time of the program. This is in contrast to stack variables (whose location changes depending on whats on the stack) and dynamic/heap variables (whose location depends on where the memory allocator put it). However, as has been said static has other meanings as well :)
Also, static variables should not be seen as being any sort of exact equivalents for globals. Static variables in functions are only available in the scope of that function (although you could return a pointer/reference to the variable), and within functions, static variables are only initialised the first time they are encountered.
Possibly the more important thing is for global-scope static variables. Global variables will be initialised in the order they are encountered in the file/s. Static variables make no such guarantee, so you should never use one static variable to initialise another static variable! There is, however, a guarantee that both static and global variables will be destroyed in reverse order to the order they were initialised.
This is my recollection anyway...possibly based on older C++ standards :)
CYer, Blitz

Teach Yourself Programming in... 3652.42 days?

[url]http://www.norvig.com/21-days.html[/url]

So true...

Edit: Whoops, I don't know how many days there are in a year, luckily google does ;)

Submitted by Barry Dahlberg on Sun, 14/03/04 - 12:59 PMPermalink

Haha, true. I haven't quite been programming 10 years yet but even so it's scary to look back at my early efforts and see how little I knew. I wonder how much I'll have learnt in another 10 years!

Submitted by TheBigJ on Tue, 16/03/04 - 1:26 AMPermalink

Heh heh.. My favourite is Sam's "Learn Game Programming in 24 Hours".

But seriously, I've been programming in some form or another for about ten years (more if you count C64 and QBasic) and I still have plenty to learn. Programming (especially game programming) is the sort of field where there's always more to learn.

Submitted by redwyre on Tue, 16/03/04 - 10:13 AMPermalink

The more you learn, the more you realise you don't know ;)

Submitted by TheBigJ on Tue, 16/03/04 - 11:50 AMPermalink

Indeed. "True knowledge is knowing that you know nothing".

Submitted by tbag on Sun, 28/03/04 - 11:28 PMPermalink

Homer: 'But Marge everytime i learn something new it just pushes old stuff out! Remember at that wine making class? I forgot how to drive.' Marge: 'No you werent! You were just so drunk you forgot how to drive!'

I only know very basic programming and some of the basic stuff still confuses me [:p].

Submitted by Blitz on Wed, 31/03/04 - 2:43 AMPermalink

Homer:'And how...'
")
CYer, Blitz

OpenGL 2.0

I've been an OpenGL coder a while ago. But I haven't kept up with 3D programming for over 2 years now. I want to get back in to OpenGL coding, particulary with OpenGL 2.0. Is anyone here who used the OpenGL 2.0 spec before? How does it compare with D3D? Should I bother with OpenGL 1.5 backwards compatibility, or shall get straight into 2.0? Will there be a solid support for OpenGL 2.0 across different platforms in the future, like on Win32, Linux, PS2/PS3, GameCube? Where can I get headers and libs for v2.0? I know 3DLabs has some, but are there other sources?

Thanks! :)

Submitted by Daemin on Sat, 21/02/04 - 11:04 AMPermalink

AFAIK there is no real OpenGL 2.0 implementation out yet, so far I think its just still in development and only a half revised bunch of documents...

Submitted by Blitz on Sat, 21/02/04 - 10:28 PMPermalink

I would also suggest don't expect windows to ever ship with an openGL 2.0 implementation...
I think Linux will be your only platform that will ship with it...for the others you would probably need to get the library from a third party source.
CYer, Blitz

Executing Programs Within Code

I want to write a program that runs different programs depending on user input. How on earth do I do this?

Using C++ by the way...

Submitted by TheBigJ on Mon, 16/02/04 - 9:48 PMPermalink

The easiest way in windows is probably the system() function:

int system(const char *command);

The command string is the command to run, for example:

system("C:FooMyProgram.exe");

Submitted by Kane on Tue, 17/02/04 - 3:05 AMPermalink

sick...do I have to #include anything special?

Submitted by redwyre on Tue, 17/02/04 - 9:23 AMPermalink

Noooooo! That should be ! isn't even standard! Bad Big J! *slaps wrist*

If you want more control (and are planning to only run in windows) ShellExecute[Ex] is an alternative.

Submitted by Blitz on Tue, 17/02/04 - 11:00 AMPermalink

fork isn't available in windows. I think the (somewhat) equivalent is _spawn() ??
CYer, Blitz

Submitted by Daemin on Tue, 17/02/04 - 11:29 AMPermalink

fork only creates another process anyway, you'd manually also have to load the executable code into that process and get it running. Using the system call or the windows only ShellExecute is preferred and much simpler.

Submitted by TheBigJ on Tue, 17/02/04 - 10:31 PMPermalink

Hmm.. Not so sure about fork..

And Yes, sorry about . Was going from memory, haven't used system() for a while. I would normally use ShellExecute[Ex].

Submitted by redwyre on Wed, 18/02/04 - 9:59 PMPermalink

Well, you know what they say... "When all you have is a fork, everything looks like a process..." or something...

Submitted by davidcoen on Fri, 20/02/04 - 5:30 AMPermalink

mem wars flash back, take both branches (and fork)

Submitted by ReDucTor on Sun, 07/03/04 - 10:21 PMPermalink

I prefer to use CreateProcess() gives you more control when starting it.

Boost 1.31.0 released

"A unified Boost Software License has been developed and will gradually replace the individual licenses for most Boost libraries. The new license offers better legal protection for both users and developers, and should speed user's legal reviews of Boost libraries. Dave Abrahams led the Boost effort to develop better licensing."

The update also includes two new libraries and updates to numerous others.

Get it now: [url]www.boost.org[/url] (You know you want to)

Submitted by Kezza on Fri, 13/02/04 - 9:26 PMPermalink

I agree that boost is pretty damn cool, but the way much of it is written is not "compile-time friendly". I don't believe boost is in any form a replacement for the STL, just something you use in indervidual object files to solve specific problems (in style).

Returning multi-dimensional arrays

I should know this, but unfortunately I don't...

I have an array in a file called Character.h that looks like the following:

char board[8][8];

And I want a function that returns this array called Get_Player_Board(), but I do not for the life of me know how to return this array! I have tried eveything I know and still cant get it to return...someone help me![?]

I have declared the function in a source file and it is declared as follows:

char Character::Get_Player_Board()
{
//need to return array here
}//close function

Submitted by boat on Mon, 09/02/04 - 12:19 AMPermalink

um i didnt think you could return an array.

but u cant return a pointer to the array. well thats what ive been doing anyway :)

Submitted by boat on Mon, 09/02/04 - 12:26 AMPermalink

err i cant find the edit button...

i ment can return a pointer.

um i didnt think you could return an array.
but u can return a pointer to the array. well thats what ive been doing anyway :)

Submitted by Kane on Mon, 09/02/04 - 12:43 AMPermalink

i have been trying that, but for some reason it doesnt like it

Submitted by Daemin on Mon, 09/02/04 - 12:50 AMPermalink

You can either return a pointer to the array, or pass in a pointer to a pointer of the array of that size as a function parameter, then the function sets the pointer.
i.e.
[code]
char board[][];
void Get_Player_Board( char ** b ) { *b = board; }
[/code]

Either that or you could make the board be a structure instead of a character, although you'd still have a similar problem. Unless you wrapped the whole board in a structure or class, but that's going OO, and I don't think that you are doing that atm.

Submitted by Kane on Mon, 09/02/04 - 1:06 AMPermalink

ok, i tried what you said Daemin, and it spat out this error

my new code looks like

[code]
void Character::Get_Player_Board(char **tempBoard)
{
*tempBoard = playerBoard;
} //close Get_Player_Board function

C:KoolGame DevChessCharacter.cpp(60) : error C2440: '=' : cannot convert from 'char [8][8]' to 'char *'[/code]

What the?

Submitted by Blitz on Mon, 09/02/04 - 10:16 AMPermalink

Man, those smilies are making garbage of this thread :P

Ok, I think this comes down to the way the compiler (and ANSI standard too i guess!) percieves pointers and arrays as different entities. For instance, when you do
char c[10];
char *d;
d = c; // Note may need to be "d = &c"!
sizeof(c); // 10
sizeof(d); // 4 (sizeof(char*))

Because of this, often you can't directly assign an array to a pointer, and sometimes if you can strange things may occur that you don't expect...

The solution to this should simply be to replace:
*tempBoard = playerBoard;
with
*tempBoard = &playerBoard;
or, i like to use this for better (IMO) readability
*tempBoard = &(playerBoard[0][0]);

This just takes the address of the array (first element of the array).
AFAIK the array and the array address should both equate to the same pointer value, but the compiler just throws a fit over type differences. Hope i'm not wrong :)
Hope that helps.
CYer, Blitz

Submitted by tachyon on Mon, 09/02/04 - 10:19 AMPermalink

You can pass the whole array by reference like this (remember, a 2d array is basically just a pointer
to a pointer (in c++)):

char ** Get_Player_Board()
{
char **board; // Your board array

return board;
}

or you can pass in the pointer and set it to that value as mentioned earlier

void Get_Player_Board(char **b)
{
char **board; // your board array

b = board;
}

Submitted by Jacana on Mon, 09/02/04 - 6:11 PMPermalink

Just a note on comments Kane -

We were taught at tafe to have starting and ending comments like you have. When I got to AIE I got my butt kicked a few times for that :) I guess the idea is that if you comment the start of every function they'll know where one function ends and the next starts.

Submitted by Kane on Mon, 09/02/04 - 9:16 PMPermalink

thanks guys...

i wish i had stayed up last night and said that I had found another solution to my problem, cos i feel bad now that you all went and replied! thanks tho, cos i'll probably need to remember this later on...

thanks again! [:D]

Submitted by redwyre on Tue, 10/02/04 - 12:02 AMPermalink

I would say that wrapping the entire board up in a class would be a good idea...

Submitted by Kane on Tue, 10/02/04 - 8:33 AMPermalink

have done...but with my current knowledge, it is probably not the best way to do it...but hey, thats how you learn!

thanks again

Submitted by redwyre on Tue, 10/02/04 - 10:39 PMPermalink

Feel free to come on IRC and discuss your findings :)