making a game-from-scratch tutorial.... help request

I’d like to make a series of tutorials that take the reader from nothing to a complete game. The software would be Blender, Gimp, and Panda3d. I’d like to use a wikibook format so that readers can insert questions write at a paragraph/step that confused them and others could write in a solution. That way the book could mature as oversights are spotted.

I’m relatively new to Panda3d and Python programming but I’d still like to think I can help organize this project. The more that join the project the better.

When I initially thought of this, I was watching someone play a basketball video game and was thinking, that should be relatively easy. The terrain is flat. The terrain is small. There are only a few models. The AI might be difficult. I don’t know if flocking, seeking, and such would work or use some kind of zone defense approach or a combination I guess.

But now I’m thinking, start with a really simple game. Arcade style. I prefer going from simple to complex.

So maybe a series of wikibooks. One wikibook per game.

But I definitely need help to make this more than a pipedream.

Sounds like an excellent idea. Why not start up a wikibook-like thing somewhere on a distant wiki and just starting on it, and letting the entire community help by enabling everyone to add pieces? When it’s done, we might even think about putting it on wikibooks.

Sounds like a good idea. One things with snippets and tutorials on Panda3D features is that is doesn’t cover the bigger picture on making the pieces fit together. Maybe you should consider requesting space on the panda project area, which is running a wiki.

That site is here: (doesn’t appear to be up this morning)

And I would likely help out. I’m still figuring things out in Panda3D, though.


I’d also like to make a series of complete tutorials. I wasn’t planning on basketball though.

I’m taking my software engineering class next semester, so I may be more helpful then.

I think we should start off with something very simple, like 3D pong, and then move on to slightly more advanced games each tutorial.

The software tools should be free, but not necessarily limited to Blender and Gimp. ThunderZ is working on a list of good tools. Blender, for example, is a very capable package capable of both 3D modeling and animation (among other things), but it has a steep learning curve mostly because of its obscure interface. The way the hotkeys are set up allows a very fast work flow, but only if you already know what you are doing. Wings3D, on the other hand, is easy to learn and does a very good job of making low-poly models (the kind you need for games) quickly and easily. It might be faster to make you models in wings and then export them to Blender for animation.

I think the first tutorial shouldn’t even be a game. (There’s a big gap between the available samples and a complete game.) It should handle the basic things that almost every game needs: * a main menu

  • a skybox
  • an animated model
  • a pause menu
    From there, you can built it to pong (for your first game) then to breakout, which is similar to pong, but teaches you to load levels. (Don’t forget to teach sound effects.)

After that, I’m not sure of the order. Maybe a basic fighter to teach animation, and simple flight sim to teach terrain. (Maybe include music and shaders here too)

Next would probably be a 3D platformer or something to teach physics and dynamic sound, an RTS for AI and networking, and finally some kind of RPG to teach scripting, worldbulding, and advanced GUI’s.

If you can do the tutorials on all these kinds of games, you ought to be able to make any kind of game you can imagine.

Warning: This is a rather long post, as I have a few ideas that I want to mention. :stuck_out_tongue_winking_eye:

There are two main parts: A game idea for the tutorial, and suggestions for the tutorial itself. I’ve separated them from this section and each other for easier navigation.

First of all, however, I want to say that I think that such a tutorial could well be a very good idea indeed. :slight_smile:

My own idea for a game is a simple one in which the player controls a basic model that moves over the ground, directed using the WASD control system for forwards, backwards and strafing movement, and the mouse to control direction, and with the camera following the player.  The player avatar has a basic animation that loops continuously.

The player would be tasked with destroying some small number of turrets, which fire repeatedly.  The player avatar and turrets have one animation each.  Instead of using the particle system (which I've found to be problematic), turrets produce a non-lit and coloured sphere when destroyed that expands and then contracts.

The player can collide with the turrets, and with the environment walls.  Shots collide with the player, turrets and the environment walls.

The environment should include obstacles, to allow the player to take cover and pop out to shoot.

This should teach, in some sort of sequence, very basic avatar control, reparenting, basic animation, some task-use, basic collision, and a few other things, I believe.  It should also be possible for interested readers to build it up into something more fun.

Simple, not pretty, but fairly easy, I think, and I believe that it can be built up in parts reasonably well.  I imagine that a sequence something like this should work:

 - Reader implements the initial tutorial in the manual.
 - Reader implements a simple "GameObject" class, to be used
   for the player avatar and enemies.  This has the following
   - An Actor (the representation of the object)
   - A "weapon cooldown" value
   - A "max weapon cooldown" value
 - Reader replaces the interval controlling the panda with key
   control, using "accept", a key setting function, an update
   function, setPos and getPos.
 - Reader re-parents the camera to the panda, and implements 
   mouse-based turning.
 - Reader replaces the panda and manual tutorial environment with
   the player-avatar and environment for this tutorial.
 - Reader implements player-to-environment collision.
 - Reader implements shooting, including bullet-to-environment
 - Reader implements enemies and enemy "logic", which consists
   of looking at the player and shooting whenever the cooldown
   value is at or below zero.  When enemies fire, they also start
   a "shooting" animation.
 - Reader implements bullet-to-player and bullet-to-enemy collision.
   - When a bullet hits the player, the game ends and a game loss
     screen appears.
   - When a bullet hits an enemy, it is destroyed, and a sphere is
     created, as described above, which is itself destroyed at the
     end of its sequence.
   - When there are no more enemies, a game win screen is shown.

Note that in this case I intend that enemy logic be placed in the main game update loop.  This isn't wonderful design, but it allows me to use one class for both players and enemies, without dealing with getting weaponsfire out of the object or taking the player's position in, which keeps things simple.

As I said, ugly, but simple.

I should be able to give more detail on most of those points, if desired, I think.

I also have a few suggestions regarding the tutorial itself:

1) Make certain assumptions about your readers, but, importantly, I believe, be explicit at the start of the tutorial about what you’re assuming.

Try to limit the scope of the tutorial to avoid treading ground already more thoroughly covered by other tutorials.

I would recommend assuming (as mentioned above) that the readers have basic knowledge of Python and object-orientation, and are capable of basic modelling (enough for the purposes of the tutorial, at least), basic image editing, and basic use of the programs being used. However, do mention any common stumbling blocks, such as (in my impression) the use of UV-mapping instead of automatic texture mapping in Blender.

Instead, link to external tutorials for the programs used. I’ve used the following tutorials, I believe; there may be better, but these should at least provide something to start with, I think:

Blender 3D: Noob to Pro.
Python Tutorial
I’ve also found this Python 2.5 Quick Reference to be useful as well.

2) Include descriptions of at least part of the workflow for the modeller and graphics program, but don’t focus heavily on either.

As I said, assume that readers already know how to model, and instead show them how to do things directly related to Panda for the most part - for example, getting Chicken up and running if Blender is used - as well as any common stumbling points.

3) Provide for download the (basic) models and textures.

This allows the user to get started easily, as well as look at a (presumably) working copy, so that they can hopefully more easily test whether a problem is related to their model, or their other methods.

I would recommend doing this in both engine-ready (.egg and .png, for example), and the formats of whichever modelling and image-editing programs are used, such as .blend and .xcf for Blender and The Gimp respectively.

4) Link to the programs used.

Personally, I use Blender more often than not these days, but I’ve also found Wings to be good, and, to second Cyan’s statement, I recall Wings being rather easier to learn. The GIMP is, I think, a pretty good choice of image editor; if another editor is chosen, I would suggest that it be one that can handle layers and store them in some format.

5) Finally, be careful to explain what you’re doing, and take things step-by-step.

Avoid the potential pitfall of giving some amount of text, and then just dumping a large quantity of code on the reader. (Which I seem to recall hearing about being done in at least one tutorial.)

Lots of great ideas so far. I agree with starting simple. I also was thinking of starting with pong, then tetris, breakout , maybe pacman…the arcade style games. Keeping it simple would allow us to focus on the big picture. Laying out the start menu, healthbar or icons (3 pacman icons in the lower corner, one disappears when you die), level changes, basic collision.

I was also thinking about a small game with spinning fan blades and walls/ceiling moving in to crush the player. Stuff that isn’t really considered an animation in blender; just a change in rotation/position.

I like the turret game. Definitely should be included. And I agree that the tutorial should be well layed out, step by step.

I’ve written a tutorial before and typing out all the steps is really time consuming. I was thinking that using a screen capture program that captures the screen once per second would make it easier. Then just delete all the images that are redundant. Then turn it into an animated gif so the images form a “video” (as an overview) and can be seen frame by frame to follow along. This way, the quality of the images is far better than a youtube video. But for the screen capture to really work, recording the keystrokes is important. I was thinking of writting a program that would display the keys (and mouse buttons) currently pressed somewhere on the screen, maybe with a translucent background.

I’m not too sure about the assumptions for the reader. I’d like the tutorials to be simple enough for all noobies to follow along. But I also agree there is no need to reinvent the wheel. Linking to a tutorial would be a lot easier. On the other hand, the links should be specific not general; linking to the python manual and saying “read this and come back when you know python” and then step 2 has a link to the blender manual and says "read this and come back when you know blender is a little intimidating. But I do have a tendency to get bogged down in the details so maybe starting with a rough outline and then filling in the steps with more and more detail as needed would help. Its also important that readers can insert a question right into the paragraph that is confusing and others can answer it.

After reading some of the replys. I think the book would be more useful if it was separated into 2 books. One book of tutorials with each ‘chapter’ being a different game and a second book which is more like a cook book which would pull apart the code and look at isolated functions. Like WASD character control. Setting ‘trigger’ zones (where stepping on a certain tile/zone would cause a rock to fall down or a turret to turn and aim at you). The code to fire a gun. Setting up a health bar. Setting up a lake. Getting a character to swim when it enters water. Making wind. Making a portal that loads a different map.

In terms of software. It should be freeware. I’ll look at the Wing program again.

To get things moving, lets start with a rough outline for making pong. We are going to make mistakes but we will learn from them and the next tutorial will be that much better.

I threw this wiki together in about 10 minutes.
You don’t need to know any Wiki syntax code. It works for me so far. If anyone has a better site to use, I’m open to changes. I threw together a rough outline showing a method that would allow redundancy, if someone wants to model in Wings 3d or Blender or anything else, it’s okay. The format also allows different python code structuring.

I’d like to get involved in this. I’m a pretty experienced Wings3d user if you need help with that and I just started on blender too. I just looked at the wiki. I don’t think its a good idea to have Tetris be the second chapter of the guide. Pong to Breakout is a more logical progression, Tetris is kind of complex, my pet panda project is a 3d version of Tetris and it’s been giving me some pain (though that might just be the scope of my project).

The other thing about this is that Pong/Breakout shows an inherently 2D game. What would the next step be, because stepping into a full 3d game means camera control pains etc.

With regards to sound production, Musagi could be useful though I don’t know how to use it myself. It was made by the indie game scene so its tailored towards retro sounds.

I’d also push for having a single coding style in the guide, mixing OO and non-oo seems to be asking for trouble. We could start from a non-OO and work up to OO but I really don’t see the need to mix function driven programming alongside OO in the main guide.

Is there a way I can contact you directly Brian? IRC would be the best for me but MSN/YM would work too.

I’ve added some more to the wiki. Side notes: Once you indent a line you need to use the back indent button for the next line. To change the link text, click edit link, copy the link address, remove the link, edit the link text, highlight the new link text, click the link button, paste the link address. Try not to start a line with a hyperlink. You can’t change the indentation if you do.

I also added the cookbook idea to the same wiki.

For the overall structure, I’m trying to use subsections to link from. For example, in the ‘throwing an object’ section of the cookbook. I’m not linking from that line. I created a subsection ‘method 1’ from which I will link to a page using my method to throw a projectile. That way others can easily create method 2 to link from if they have a different way of coding it.

I looked more at Wings 3d. Is there a supported exporter for Panda3d? Where do you do your animations at?

Wings3D is a pure modelling package. It can export to OBJ’s so I usually export that and import to Maya for animation, so I can bring it into Blender for the purposes of the tutorial too.

Zerobyte, glad to have you onboard. We can use this thread or the discussion board on the wiki site to exchange ideas for awhile. I agree about Tetris. I will remove it. What other 2d games can you think of to progress through. What should be the first truly 3d game? I’m thinking of something with flat terrain to keep it simple.

I don’t think camera control is a pain. The lookat function is really nice. But I haven’t done anything advanced yet. I will look at the Musagi link. I’ve used Audacity which is freeware to record mp3 and wave files for other programs. About single code style, not too sure. I’d like to structure it so that anyone can add to the wiki. I believe in a single code style within one program, say if a group is co-writing a game. I’ve tried to structure the wiki so that many different people could write their own py file for a game if they so choose. But as the games get more advanced, co-writing will be necessary and a code style will need to be chosen by the group.

I checked out the Musagi link. Seems like a pretty useful piece of software. I’ll definitely be downloading it and following that tutorial.

I’m using EasyCapture for my screen captures. … l#overview

I’m thinking about making the first game Ping instead of Pong. Pong is a two player game which is a little harder to make. Ping is like hitting a ball against the wall. The game continues as long as you don’t miss.

I disagree, to an extent (although I don’t think that one should be quite as blunt as saying “read this and come back when you know python” :stuck_out_tongue:).

I think that there’s quite a bit to cover if you want to teach newcomers Python, the use of a modeller (more so if you want to include more than one) and the use of an image editing program as well as teach the use of Panda. For those that do know these things, perhaps from having come to Panda from elsewhere, the additional detail is more likely to get in the way than help, I think. In addition, the non-Panda topics are also ones that I feel are well-covered elsewhere, so I think that it makes the most sense to tell your readers that you are presuming that they know at least the basics of Python, modelling and image editing (and I mean the basics; they needn’t learn Python in any great depth to get started, I don’t think), and link to good external tutorials for those that don’t.

Finally, I think that doing so would help you to retain the focus of the tutorial.

For those newcomers who don’t yet know any of modelling, image editing or Python programming, there is probably a fair bit to learn anyway. In these cases, I think that they would be better served by providing models and images for them to use in their games, and a link to a Python tutorial, than by a tutorial that attempts to cover all of that in one go.

Having the models and images available would, I would imagine, allow them to start learning Python and Panda while potentially giving them some resources to start playing around with so that they can learn the use of their modeller and image editor in their own time.

All in all, I’m inclined to argue that we should focus on teaching the use of Panda here, and only those parts of other systems that are directly related to Panda (such as Chicken).

As to the games, I honestly think that, in the case of Panda, we should start with a simple game that is presented in 3D, but which uses 2D logic (as in my turret game :wink:). It’s my understanding (and I’ll admit, as I have before, that I’m still fairly new with Panda myself) that 3D is the default rendering mode for Panda, with 2D being an available non-main case. 2D in Panda would also call, I think, for learning about such things as texture cards. Finally, the tutorial given in the manual is in 3D, is very simple, and is, I think, a good base on which to build.

Overall, I think that a simple 3D game, with basic assets provided, but with editor-specific versions included, would probably be easier and more rewarding for most new users.

This seems like a good idea to me, although I suggest starting off with simple OO to encourage it in the readers’ minds.

Actually, that’s a good point… I wonder whether it wouldn’t be better to simply stick with Blender, despite its learning curve, rather than suggest that new users go through multiple programs…

True. I’ve added sections in The Cookbook for linking to tutorials on Python, Blender, and other fundamental knowledge. I don’t think too much focus needs to be put on these sections. The primarily focus will be Panda3d.

Giving a link to the assets is a great idea. On that note, I’ve just created a free MediaFire account to host my files. I’ve already uploaded an egg file for a ball mesh I made in Blender and I’ve linked to it from within the wiki.

I’m leaning towards the focus being on 3d game making from scratch using the python language and the Panda3d engine. Others have expressed a similar feeling; currently everything is in pieces, it would be nice to see how the pieces fit together to make a complete game from scratch. The great thing about the wiki format is, some writers can focus on the Panda portion, while others focus on the modeling portion. Anyone can fill in what they consider gaps and can ask for further clarificaation if they need it. For example, I don’t know how the start position was set in the Roaming Ralph example. It would be nice if there was a tutorial on making the Roaming Ralph terrain. Also, I don’t know how the walls and floors were tagged when the maze example was modeled.

Take a look at how the wiki is organized right now. I think the current format would allow people with more experience to skip over sections that they are not interested in.

2d versus 3d. I’m starting to think that starting with 2d is overkill. Panda is a 3d engine. I’m sure we can think of some really simple 3d games that wouldn’t require a lot of code. The turret example could work if we keep it simple.

Hi. This is definately something for Panda3DProjects… :slight_smile:

This might help some folks to get into the engine that liked “click-to-create” game development systems till now.

Python and Panda3D with a good wiki do have the capatibilities… :smiley:

Regards, Bigfoot29

Btw: It P3DP was down? Does this happen often?

Man, i just so want to help with this, but I just started myself in this panda3d engine a couple of weeks ago and i’m still learning the whole thing

I’m going to be developing a JRPG turn based like final fantasy, where i’m planning to combine the ATB of FF 6, the dual/triple attacks of Chronno Trigger and the combo attack of Legend of the Dragoon.

Maybe, when I get something done, 'll be helping on this wiki.

For myself, I’ll be using MakeHuman to model and Blender to animate, still, if makehuman do not apply to me, 'll be switching to wings3d as many had said it’s a good thing.

And, actually, i’m planning on bringing this to the Wii on the HomeBrew Scene. Lets see what we get in the time to come by, cuz, i got a mayor fault, I get distracted pretty easily, xDDDDD

BrianInSuwon, I’ll try to remember to take a look at the wiki - I tried shortly before posting this, but didn’t get through for some reason.

CJLopez, do you already use Blender? If so, then I would suggest using its modelling systems rather than modelling in Wings and animating in Blender - this avoids problems that might arise from changes of control scheme (I’m not sure whether one or the other offers options that might allow you to control one program in a similar manner to the other) or in exporting from one package and importing into another. I also suspect that Blender is likely to be the more powerful of the two modellers (although I’ll admit that my version of Wings is probably not the most recent).

Well, I do know how to use blender, but more for animations and physics than modeling. I got a friend who was the modeler and I was the animator for some examples we did during our university years, but he went to work to spain so i’m left alone to do this, and I’m not pretty confident on my skills. I’m reading the Noob to pro tut and also reading this book I got the other day

Wich explains how to model based from drawings, but I was seeing the MakeHuman program and got my attention, so 'll be testing wich method applies better for me

Well, I don’t think that I’ve used MakeHuman, but I do think that I’ve heard good things about it.

I would guess that for humans (and perhaps human-like models), MakeHuman would be the better choice, followed perhaps by importation into Blender. However, depending on how those tuts are going for you, I suspect that Blender would be a better bet than Wings for other modelling purposes.