Game Development Community

Updating TDN platformer tutorial for Beta1.1 - let's pitch in

by Matt Troup · in Torque Game Builder · 02/09/2006 (5:29 pm) · 20 replies

I'm not a great coder, but I'd still like to contribute by at least pushing forward the process of updating the platformer tutorial on TDN to meet the Beta 1.1 criteria (luckily this mostly involves moving stuff around that already exists in the tutorial). If I could do it all myself I would, but I've got to ask the help of everyone out there in some form or another when I have a problem I'm unsure how to solve. Hopefully the more I learn the more I'll be able to help others.

I'll just list the steps and any time I meet a brick wall I'll hope someone comes in with a little help. By the end, hopefully, we'll have an outline we can use to restructure the tutorial.

Edit: removed most of the code in the thread because it was updated on TDN

#1
02/09/2006 (5:39 pm)
Problem solved by Stephen Zepp. Thanks! Updating more code in a minute...
#2
02/09/2006 (5:46 pm)
SetGroup was changed to setGraphGroup IIRC, give that a try and see what you get :)
#3
02/09/2006 (6:03 pm)
Edit: removed code as it was updated on TDN
#4
02/09/2006 (6:27 pm)
Edit: Code removed from this thread as it was updated on TDN.
#5
02/09/2006 (7:08 pm)
Thanks for doing this Matt! Feel free to update this on the actual TDN page as well.
#6
02/09/2006 (7:15 pm)
Edit: Code removed from thread and updated on TDN
#7
02/09/2006 (7:20 pm)
Edit: No problem, Adam, I just wanted to be sure I could update most everything on TDN at once. I'd feel silly awful if I posted misinformation.

At this stage, you get a warning in the console that says:

T2D/gameScripts/game.cs (55): Unable to find object: 't2dScene' attempting to call function 'getId'

This is normal... when you launch the game the warning goes away because you moved from the level builder scene to the game scene. If you plan on spending some time in the level builder you may want to comment out those lines in game.cs so the warnings do not bog down your console - I imagine they can slow down your machine after a while! (remember to uncomment those lines if you run the game again or else you'll find yourself having animation problems later on).

Edit: The warning will go away later in the tutorial when we change the process of loading and unloading levels.
#8
02/10/2006 (9:39 am)
Edit: Removed code and updated it on TDN.

When you execute T2D and look at the console you will receive a warning that says:

T2D/gameScripts/player.cs (63): Unable to find object: '' attempting to call function 'getLinearVelocityX'

Again, this is normal (and will go away later on when level loading code is added). When you launch the game (and get the player into the scene) the warning will go away. However, if you plan on spending some time in your level editor when you execute the game you should do something to take this function out. Otherwise, it's going to bog down your console with warning messages - and eventually start giving you some performance problems I imagine.

It is also worthy of note that this code will allow you to move onto and land on a ledge connected to a wall you are touching. The ability to still jump over a wall even if you are touching it would be nice for someone smarter than me to add to the tutorial (seems like it'd be something simple that would hinder someone basing their game off the tutorial).

This concludes the air movement section of the tutorial.
#9
02/10/2006 (9:41 am)
Edit: Removed code from thread and updated TDN
#10
02/10/2006 (10:09 am)
Edit: Removed code from thread and updated TDN
#11
02/10/2006 (10:09 am)
Edit: Removed code and updated TDN
#12
02/10/2006 (11:14 am)
Is this going to be updated on TDN ?

Thanks for this update btw :)
#13
02/10/2006 (11:48 am)
Yep, I'll start updating things around on TDN (monday at latest - I work on the weekend, but then again, anyone's free to update TDN if they'd like)... I think King Tut has been doing the previous updates but I bet he's super busy. I just wanted to have enough of the tutorial updated before it was actually changed on the site.

Edit: As of now, I've updated TDN all the way through the camera.cs segment... I'll get on with the rest when I get home.
#14
02/11/2006 (10:54 pm)
I updated the "Create Enemy" page to work. I'm currently testing the AI, in which everything mentioned in the tutorial seems to work fairly well. You may need to add a couple extra if statements in your doAI function depending on how you design your level.
#15
02/14/2006 (12:05 pm)
The "Implementing Winning and Losing Conditions" was updated and tested/working (I shot an email to Adam Larson in which he may offer extra code to make it air tight - if it already isn't).

I've got the "PlatformerLevels" segment *close* to working (by the way, a link to "PlatformerLevels" should be added on the main T2D page between the "Implementing Winning and Losing Conditions" and "Building the User Interface" links... if anyone with unrestricted access has the time to add that).

As of now, I get some warnings in the log:

ImageMap(Enemy_Config) Error: 'Invalid Bitmap File!' (2)
T2D/data/levels/testLevel.cs (0): Register object failed for object Enemy_Config of class t2dImageMapDatablock.
t2dTileMap::loadTileMap() - Cannot Load without SceneGraph!
Object 'Enemy_Config' is not a member of the 't2dBaseDatablock' data block class

********************
Three of those four warnings seem to be related. Not bad. The sceneGraph warning seems to not be an issue, because the tileMap loads up just fine. Not bad again.

This post is kind of just a reminder for me to come back and finish this asap. I don't think I scripted everything as it should have been, so I'll make a write-up here of what exactly I added and where it's located in my documents... really tired right now, and I have to leave for work. PishPosh.
#16
02/14/2006 (1:09 pm)
Hey Matt - I did get your email and I'll be taking a look at it as soon as I can. Thanks again for doing this!
#17
02/15/2006 (1:08 am)
Oooooooo, Ooooooo! I think I'm closer. Right now everything looks as it should but I have no enemy and there's still a warning in the console that says:

t2dTileMap::loadTileMap() - Cannot Load without SceneGraph!

I'm unsure of what to make of that.

Anyway, as far as the enemy goes, I noticed everything from the old style of setting up levels was imported to the new way to Load/Unload levels via the simgroups... everything except "setSize". So, I'm thinking the enemy might not be visible because it has no size.

However, if I put:

setSize = "8 8";

in the enemy simgroup with the rest of the attributes nothing happens. I'm not sure if I have the correct call for setting the size, though, as I noticed some attribute calls are slightly different when transfering them from the "old style" to the new (collisionResponseMode/setCollisionResponse for instance).

4 AM... damn I'm tired.

Edit: Nah, I doubt my theory is correct now. Actually, there were a couple other things left out from the transfer now that I look at the datablocks, too (image file, image name)... I guess those three variables are too specific and wouldn't pertain to all enemies within a level - though, if there's only one enemy I figured I should have been able to put those attributes into the simgroup and have it work out anyway.
#18
02/27/2006 (12:18 pm)
I didn't have much luck after my last post, and I've been super busy getting ready for my cross-country driving excursion, so if anyone wants to finish this section of the tutorial (and I think the GUI section remains after that) then give it a stab!
#19
02/27/2006 (10:46 pm)
I'm working on some things in TGB that are basically a combination of this tutorial and Matt Langley's strategy tutorial.

Once I get it polished up I'll take a pass at the current platformer tutorial for any updates I may catch.
#20
03/18/2006 (11:24 am)
Hey, i'm currently using this tutorial with beta 1.1, but for some reason after my player dies for the first time there's no collision detection between the player and the enemy. Any suggestions?