Quake3World.com Forums
     Programming Discussion
        Using Q3 as a teaching tool


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: Using Q3 as a teaching tool

Señor Shambler
Señor Shambler
Joined: 07 Mar 2006
Posts: 849
PostPosted: 05-03-2010 04:58 PM           Profile Send private message  E-mail  Edit post Reply with quote


I would like to have some outside opinions on this, so that I can see if my reasoning is valid....

Next year, beginning after Christmas, I get to help teach a sort of "the computer science in video games" course at my university. It is not necessarily intended to be like a fast-track-into-game-industry-money-grabbing-trendy sort of thing, but rather a "special topics" course inside of a general CS program. I am going to be designing the course this summer with the professor who will be teaching it. I basically have the choice between Quake III and Unreal 3, and I would love to choose q3 because I'm intimately familiar with it, etc. However, I don't want to shortchange the students and teach them something that is no longer relevant.

Pros of Q3:
-Open source engine
-Simpler in general
-Less abstraction (could be a con i suppose)
-Would be writing C, not a proprietary language

Cons of Q3:
-Not the greatest documentation
-Outdated architecture (how outdated is it?)
-Might not be exemplary design

Pros of U3:
-Still highly relevant
-Probably easier to implement game logic changes

Cons of U3:
-Closed source engine
-Unrealscript is proprietary, although this isn't necessarily terrible or anything
-Complex art pipeline
---------------

My list for U3 is smaller because I don't want to betray my true ignorance of what might be bad or good about it because I'm really just not familiar with it at all.

What are your initial thoughts? Is it a definitive Yes/No or does it just depend upon what I want them to get out of it?

I wouldn't be teaching them everything about either engine (couldn't do it in 10 semesters, wouldn't be useful really), it would be more like finding examples of where CS stuff is used (like lets say an examination of the data structures in the UI module or something) and having them make modifications or write their own functions, or just having them work on their problem solving skills.

Thanks!




Top
                 

Grunt
Grunt
Joined: 25 Nov 2009
Posts: 65
PostPosted: 05-03-2010 08:31 PM           Profile Send private message  E-mail  Edit post Reply with quote


I'd have to say U3 just because of it's relevance.




Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 05-04-2010 12:55 AM           Profile Send private message  E-mail  Edit post Reply with quote


I'm not that familiar with U3 but the Q3 source is rife with all kinds of bad practices you shouldn't be exposing your students to.




Top
                 

Señor Shambler
Señor Shambler
Joined: 07 Mar 2006
Posts: 849
PostPosted: 05-04-2010 06:29 AM           Profile Send private message  E-mail  Edit post Reply with quote


What are some examples of what you mean? I am not too worried about them being exposed to bad programming if I do not purport the code to be particularly well designed. One thing I have considered doing, which would help to offset that, is removing all of the UI code, and leaving them with the small set of engine calls to build their own abstractions and data structures on top of. I'm not sure if a similar thing could be achieved in the game/cgame code within the given time constraints.




Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 05-04-2010 09:06 AM           Profile Send private message  E-mail  Edit post Reply with quote


To name a few:

1. Poorly documented
2. Code duplication
3. Lots of magic
4. Pervasive use of globals

As an example of #2 are the gazillion (ent->r.svFlags & SVF_BOT) checks. Why not a is_bot() function, for chrissake? Now if I want to change anything, I have to do it in forty places!




Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 05-17-2010 07:46 PM           Profile Send private message  E-mail  Edit post Reply with quote


Hey Kaz, what did you end up using?




Top
                 

Señor Shambler
Señor Shambler
Joined: 07 Mar 2006
Posts: 849
PostPosted: 05-18-2010 09:54 AM           Profile Send private message  E-mail  Edit post Reply with quote


I meant to respond here but was sidetracked...

For the class we have been looking for books that give a good overview of all the topics we want to cover, and have found Game Engine Architecture by Jason Gregory. Unless we find a better book, then we'll probably use that one as a guide for the course. We are going to use Q3 for a semester long project, as well as for experimenting in the class and other assignments. Many of the topics he covers have direct examples in Q3.

However, you're definitely right about the quality of the code in some places, and over the summer we're going through the code and making a "clean" version which would attempt to:

-reduce the amount of code there is to navigate through
-reduce the stuff you mentioned: magic numbers, move code to functions, make things static that should be static, document, etc.
-remove functionality such as: specific effects (smoke trail etc.), most weapons, awards, gametypes, etc.

I've already gone through the removing of functionality before, so that part I know is feasible within the timeframe. The documentation will just be our best effort, and if we fall short of time, we will have a class wiki and forum where the students can pool knowledge and ask questions. They will be encouraged to question the code, and improve upon it if they feel they could write a better function, etc.




Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 05-18-2010 11:44 AM           Profile Send private message  E-mail  Edit post Reply with quote


I envy today's kids and all the cool stuff they get to do in college. In my time it was all enterprise Java en C++ business code drudgery. :/

Anyways...

Good luck with the project, Kaz. Be sure to post some screenies of your students' work.




Top
                 

Señor Shambler
Señor Shambler
Joined: 07 Mar 2006
Posts: 849
PostPosted: 05-23-2010 03:40 PM           Profile Send private message  E-mail  Edit post Reply with quote


Thank you sir! I'll be sure to post cool stuff they do.

People can see the state of the "clean up" here:

http://code.google.com/p/cleanquake3/




Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 44136
PostPosted: 11-02-2010 12:30 AM           Profile   Send private message  E-mail  Edit post Reply with quote


Just noticed this thread.
It's pretty cool that students are getting to tinker with Quake 3 gamecode for school assignments. Like misantropia said, all we got to do was boring business logic, sorting algorithms and assignments like creating a client/server based patient record tracking system for hospitals in Java.

And this was what... 7 or 8 years ago.

I would've found it to be awesome if I could mess around in Quake 3. It would've certainly upped my motivation a lot.

So erm, if Kaz ever notices this thread again, keep us updated on how things are faring with Q3 as teaching tool. I'd be interested to see what kind of things you're doing with it.

The whole premise of a "clean" Q3 gamecode seems very interesting, because it'd be an excellent basis for creating your own game from scratch without the nastiness of building your own 3D engine, sound engine, network code, etc.




Top
                 

Señor Shambler
Señor Shambler
Joined: 07 Mar 2006
Posts: 849
PostPosted: 05-12-2011 07:27 AM           Profile Send private message  E-mail  Edit post Reply with quote


Hey again - the class is over so I thought I'd post on how it went:

Last fall some of the graduate students wanted to do an independent study with the UDK, so I was able to join in on that class so we could test out some ideas about how things would work using an engine. It didn't really work very well, for a variety of reasons, and we ended up spending most of our time finding which class to extend to get some functionality working, or finding bits of code that did sort of what we wanted a tweaking it slightly to achieve some effect. It was about what I expected, and in some ways it was valuable, but in other ways we found it pretty hard to justify as a CS class to the department chair.

Reading back over the thread, I should have known my idea about creating a clean version of Q3 was silly and not actually going to happen, considering the amount of work that would entail :toothy: . I felt also that repeating the experience of using an engine would lead to the same sort of "well... its software engineering??" justification for the class, and I wanted people to come away with an idea of how games actually do the things they do. So we ultimately decided to just scrap using a pre-existing engine altogether, and instead have the students build their own little "engine" for the course project.

The obvious problem with doing this is that they really aren't going to get very far, but I tried to mitigate that by providing bits of code here and there that really didn't have any conceptual value (e.g. I gave them an ASE model loader, basic code to pop up a window, etc). We had to choose what sort of language, platform, libraries, etc. we would use, and we ended up going with plain ANSI C, OpenGL, and SDL. We used Eclipse for the IDE, and I had them stick their projects up on GitHub so we could all see each other's progress. We went with C instead of C++ because we didn't want them to have to learn a new language (ANSI C is used for the "Systems" courses at my university, everything else is Java) at the same time as all the other information, even though C++ is essentially ubiquitous anymore. I did end up using Q3 alot anyway, just to draw connections between what they were doing and actual engines.

Most of the people in there were happy with it, although there were a few that thought it was dumb that we weren't technically making games (i.e. coming up with a story, making some art, etc). A couple of the students were Math/CS double majors, so they were excited to have an actual use for Calc3/Linear Algebra.

Here is what we were able to get through:

-Review C/Vector and Matrix math
-Create simple math library, implement dot product, cross product, etc.
-Open up a window with SDL, draw basic stuff with OpenGL
-Use transformation matrices to move stuff around, rotate/translate
-Hook that up with input to make a simple "person" camera (i.e. you look up and you don't fly upward), then a "free" camera (i.e. you do fly upward, like a spectator in q3)
-Texturing, entering coords by hand
-Introduced the idea of a model format, play around in 3DS Max 2011
-Integrated model loading code into projects
-Loaded model built in 3DS
-Use the z-buffer to create a skybox and first person geometry (someone created the halo sword, someone else had a torch, and one of them made a sledge hammer. Another person used it to make a third-person thing where they had a space ship flying toward a Borg cube, and yet another had 2 or 3 weapons you could swap between, and you could press a "charge" button where you would speed up and the weapon would rotate to be pointing out in front of you)
-Decoupled the movement from the CPU using a time accumulator (think Gaffer on Games timing article)
-Simple collision detection - implement AABB vs Triangle and run it against the ASE mesh triangles (this was for illustrative purposes, it was pointed out that typically systems are much less crude :P)

I told them to email me their projects but I think they're gone for the summer and not caring to do more stuff for school, but if I can I'll post some screenshots of what they made.




Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 05-12-2011 12:30 PM           Profile Send private message  E-mail  Edit post Reply with quote


Kaz wrote:
So we ultimately decided to just scrap using a pre-existing engine altogether, and instead have the students build their own little "engine" for the course project.

The obvious problem with doing this is that they really aren't going to get very far

For next year: http://www.pygame.org/

Your students will have to learn Python but it's a more forgiving environment than C and pygame takes care of the plumbing so you'll have more time to focus on the stuff that matters. Python is a ridiculously easy language to pick up, by the way, it took me all of two weeks to become proficient in it.




Top
                 

Insane Quaker
Insane Quaker
Joined: 05 Nov 2010
Posts: 449
PostPosted: 05-12-2011 01:39 PM           Profile Send private message  E-mail  Edit post Reply with quote


The whole idea of using quake 3 as a teaching tool is really good. I wish any of my programming teachers had sought to dive into something as complex and as interesting quake 3. Not unlike Eraser and Misantropia, I also got stuck with a bunch of "business logic" and making GUIs in java. Do you have any course materials you could post up here, Kaz?




Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 44136
PostPosted: 05-12-2011 11:16 PM           Profile   Send private message  E-mail  Edit post Reply with quote


If you're looking for something that's more similar to Java programming, then XNA is a really good option. It's Microsoft's .NET based framework for XBox 360/PC/Windows Phone 7 development. All coding is done in .NET's C#, so it's all managed code. No worries about memory allocation or cleaning up. Visual Studio 2010 Express is a free download and XNA Game Studio (which extends Visual Studio with the stuff you need for XNA development) is free as well. They even have an eduction section on their website.

Your students could, if they want to really be serious about this, develop a full fledged game, pay $99 for an XNA creators club membership and publish their game on XBox Live Indie Games or the Windows Phone 7 marketplace. Ask $5 for your game and if 20 people download it, you've already offset your membership costs.

Man, I wish I had the opportunity to do such things when I was in college :(




Top
                 

Señor Shambler
Señor Shambler
Joined: 07 Mar 2006
Posts: 849
PostPosted: 05-15-2011 02:22 PM           Profile Send private message  E-mail  Edit post Reply with quote


Thanks for your suggestions guys (publishing your game on the XBOX might actually be a really good motivator....). Misantropia: some people I know are working on a PyGame game, but I've only seen 2d examples. Do you know details about 3D stuff?

I've drafted a paper about all of the design decisions that went into making the class, and I might throw some ideas out in this thread when I go back to work on it again (it deals with why you'd choose one language over another, etc). Feedback from a lot of people should help me to keep my foot out of my mouth :P.

Steve: I have some materials up, but looking back over them I want to edit them a little bit before giving the link ;). I was able to correct mistakes or incorrect information verbally for the class but I guess I didn't go back in and change the files to reflect that.




Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 05-20-2011 12:30 PM           Profile Send private message  E-mail  Edit post Reply with quote


Quote:
Misantropia: some people I know are working on a PyGame game, but I've only seen 2d examples. Do you know details about 3D stuff?

pygame isn't really suited for that (sorry, I thought your course was about game programming in general, not specifically 3D). I think Panda3D is the most popular 3D framework in Python land.




Top
                 
Quake3World.com | Forum Index | Programming Discussion


Post new topic Reply to topic


cron
Quake3World.com
© ZeniMax. Zenimax, QUAKE III ARENA, Id Software and associated trademarks are trademarks of the ZeniMax group of companies. All rights reserved.
This is an unofficial fan website without any affiliation with or endorsement by ZeniMax.
All views and opinions expressed are those of the author.