Game Development Community

dev|Pro Game Development Curriculum

Capture The Flag

by Dayuppy · 08/20/2012 (1:48 pm) · 8 comments

EDIT: Going to be busy for awhile idk when I'll have enough time to work on this, if you really want what I have so far leave a comment and I'll host the files but be aware there are bugs. In time I will get this completed so if you don't need this right away I would wait a little.

Hey everybody, this is my first blog and I just started working on this again after taking a break for nearly a year on it. I figured it's about time to get this out there and possibly somebody might find a use for it. I'm working on a CTF prototype which appears to be working so far with any number of teams.

Stay tuned and comment if you're interested, your comments will keep me focused on developing this further and put any suggestions you might want included and I'll see if I can figure out how I might add it.

EDIT: Added video demonstrating what's been done so far. This was made on the 20th, most bugs fixed.


TODO:
CTF Gametype - SUCCESS
Spawn Protection - SUCCESS
Teams - SUCCESS - Need to make the pickRandTeam function account for more than just two
Flag Resetting - PARTIAL - Need to fix the way the schedule is canceled so that if you pickup a flag, drop it, then pick it up again, it resets the time counting down rather than continuing off the last time
Team Selection GUI - PARTIAL - Thought it was networked fine but I guess not
Flag tossing - Client and Server functions don't seem to be setup properly, I think it's client in this case
Prevent base flag from being impulsed - FIXED
Prevent flag captures on a dropped flag - FIXED
Swappable Flag Skins - Yet to be implemented
Team Damage Toggle - Yet to be implemented
Optimization: Remove dummyFlag - Yet to be optimized

Flag material doesn't seem to be doublesided on the client in a networked game although idk why that ties in with the server in any way

Please post any ideas you have and what you would like to see in the final resource, I will make a tutorial stepping through the entire process and explaining each point when I find which system works best and most of the bugs are worked out.

About the author

Been playing T2 ever since it came out and then decided to try modding it, liked modding and that's how I got into programming. Just about to finish highschool and get my Cisco Certification as well then off to college.

Recent Blogs


#1
08/20/2012 (6:53 pm)
Very cool, looking forward to seeing it in action.

Edit: Diggin' the video, if you're able to make this clean and painlessly plug n' play with no source modifications then I'd be willing to throw down a few bones for the code.
#2
08/21/2012 (7:45 am)
I will be keeping a eye on this, Do you plan on making this a resources?
#3
08/21/2012 (11:51 am)
@Tom
I think I'm going to make a tutorial as a resource when the bugs are worked out and the team system is refined with a gametype for CTF. I also have another idea how I could recreate this system in a different way. After I complete this design I'll try the other way I have in mind and make a tutorial on the better of the two. If I'm not working on it fast enough and too much time has gone by give me a little nudge and I'll release what I have so far and try to work on it faster. School is just about to start again and I'm getting some things ready and taking a few classes before-hand.

@Mack
This is all done in TorqueScript and I don't plan on using source, it's mostly plug and play currently only requiring a few lines here and there.

@Anybody
If anybody can provide me an example of swapping a skin for another skin on a basic box or something I would greatly appreciate it, I've looked at many other posts and I've seen where you have to create the materials with like base : red or something like that but I never got it to work. Thanks.
#4
08/21/2012 (1:08 pm)
Quote:If anybody can provide me an example of skinning a basic box or something

You can create a box (and many other convex shapes) with the Sketch Tool and apply a texture to it, the texture should stick.

If you need to make a material here's a detailed guide in the docs.
#5
08/21/2012 (1:58 pm)
Sorry, I meant swapping a skin in real time when a shape is already loaded. I'd like to spawn each of the flags, then set a different texture on each one.

EDIT: Still trying to figure this out if anybody has some insight.
So far this is the most complete information I could find but I tried it with no success.

Docs.garagegames.com/torque-3d/official/content/documentation/Artist%20Guide/Pri...

Here is a sample of one of my skin setups in materials.cs
singleton Material(Base_Flag)//This is the name of the material assigned in MS3D for the model's material
{
   mapTo = "Base_Flag";
   diffuseMap[0] ="Base_Flag.png";
   specularPower[0] = "6";
   glow[0] = "1";
   doubleSided = "1";
   emissive[0] = "1";
};

singleton Material( Red_Flag : Base_Flag )
{
   mapTo = "Red_Flag";
   diffuseMap[0] = "Red_Flag.png";
};

After going into the game and doing for example T1Flag.setSkinName("Red"); all I get from the console is Mapping String: Red to index: ##

#6
08/22/2012 (7:40 pm)
I'm not entirely sure how to do it within T3D, I've just added additional material layers in Max prior to export if I needed it.

Personally I'd like the flags to be separate models right off the bat, that way if wanted then I could have different looking flags for each respective team.
#7
08/22/2012 (8:21 pm)
I'll write up an example how to do it in the tutorial because you'll have to change some things each time you add a different flag item. You're also going to be needing to duplicate the same code for each new flag unless it's possible to create a FlagClass without modifying source.
#8
08/24/2012 (4:56 pm)
Going to be busy for awhile idk when I'll have enough time to work on this, if you really want what I have so far leave a comment and I'll host the files but be aware there are bugs. In time I will get this completed so if you don't need this right away I would wait a little.