Showing posts with label game development. Show all posts
Showing posts with label game development. Show all posts

Wednesday, September 1, 2010

Second Life Game Tile Testing


I've been messing around with game tile systems again using second life. Looking at the rudiments of a table top game like checkers, chess or even something as complex as monopoly. Trying to figure out how to develop something that doesn't use physics, but uses a tile based movement system.

I started by building a blank table top and adding a piece to it. Right now, the piece simply moves from corner to corner when someone clicks on the table. Under the hood there is a lot more going on than you might first think.



This is the code in the init script in the table.

default
{
state_entry()
{

//list bb = llGetBoundingBox(llGetKey()); // get my bounding box
vector sz = llList2Vector(llGetPrimitiveParams([PRIM_SIZE]),0);
llMessageLinked(LINK_ALL_OTHERS,1,(string)sz,NULL_KEY);
}

touch_start(integer total_number)
{
//llSay(0, "Touched.");
llSay(1024,"move");
}
}

You might as why did I comment out llGetBoundingBox. The reason is it works great when the table is by itself, but once the piece is on the table, the piece's location is included in the bounding box. This makes the box larger than expected.

So, the script get's the actual prim size from the table top and passes it to all the other linked objects (in this case the "disc" using a linked message. The identifier of the message is the number "1" which in this case means "table size", and the size (vector) is passed as a string.


You can also see that when the table is touched, it says "move" on channel 1024 which you can guess that the "disc" is listening for. Why not use llMessageLinked for both communications? We'll I should, but the "move" message was added early on and I started using linked messages later and have to get back to change to use llMessageLinked.


This is the code for the disc

vector mysize;
vector mysizediv2;
vector tablesize;
vector min;
vector max;
integer posMinOrMax;

default
{
state_entry()
{
//list bb = llGetBoundingBox(llGetLinkKey(1)); // get the bounding box of the table
//max = llList2Vector(bb, 1); // max corner
//min = llList2Vector(bb, 0); // min corner
//min = >min.x,min.y,max.z<;

//llWhisper(0,(string)min+" "+(string)max);

posMinOrMax = 0;

llListen(1024,"",llGetLinkKey(1),"move");
}


listen( integer channel, string name, key id, string message )
{
if (channel==1024)
{
if (posMinOrMax==0)
{
llSetPos(max);
//llWhisper( 0, "max" );
}
else
{
llSetPos(min);
//llWhisper( 0, "min" );
}
posMinOrMax = 1 - posMinOrMax;

}
}

link_message(integer sender_num, integer num, string str, key id)
{
if (num==1)
{
mysize = llList2Vector(llGetPrimitiveParams([PRIM_SIZE]),0);
mysizediv2 = mysize / 2;
mysizediv2.z = 0.0;

tablesize = (vector) str;
llWhisper(0,"got size = "+(string)tablesize);
vector sz = tablesize / 2;
min = >-sz.x,-sz.y,sz.z*2< + mysizediv2;
max = >sz.x,sz.y,sz.z*2< - mysizediv2;

}
}
}

You can see that early on I calculated the min and max positions based on the bounding box which I have already said is wrong. On the listen channel when I hear "move" I toggle the position between the min and max. That should be pretty straight forward.


The interesting stuff is in the link_message function. I first get the size of the "disc" using the llGetPrimitiveParams call. All positioning is done from the center of the object, so if I use the absolute min and max sizes of the table then the disc will hang off the edge. I divide the size by two because that is how far I have to inset the position from the table's min and max.

I then convert the table size vector from the string that was passed on the link message back to a vector and calculate the min and max positions using the inset of half the disc size. The min adds half the disc size and the max subtracts. The other thing is that the table's origin is at the center, and positioning the disc has to take that into account. So the min is the table position (center) subtracting half the size of the table. The max is the table position (center) and adding half the table size.

Thursday, May 17, 2007

Doom Slayer III

One of the student games in the contest I ran two night's ago did a two minute trailer for his game. It was actually really fun to watch and I thought I would link to it here since he just uploaded it. Most of the content from this video was in game capture. It is a real game that is fully playable, created by a sophmore at Chapman University in about 6-7 weeks. A huge piece of work for that short of time. He is going to be an amazing programmer.

Doom Slayer III
http://www.youtube.com/watch?v=PN5E3E_nIhA

I've already posted it, but the final results of the contest are here.
http://www.gamedev360.com/contest07/

Wednesday, May 16, 2007

Game Development Contest Results

Last night's contest for my class was amazing.

http://www.gamedev360.com/contest07

The RailGunner game is an amazing piece of work built in about six weeks. Jess and Noah really outdid themselves. Even the second (T-Orc) and third place (Doom Slayer III) games were very nicely done. Rail Gunner and T-Orc are fully playable. Doom Slayer III while not completely done had a ton of code to it. He even did a trailer that was hillarious and everyone enjoyed. I'm hoping he uploads the trailer for others to see.

All in all I think everyone enjoyed themselves and I think a number of the students will get jobs. There was enough time at the end for the industry folks to mingle with the students and I'm sure a number of them will get calls.

One of the things that became apparent and I had sort of forgotten about it was the fact that half of my class were seniors and half were freshman. I went really fast in the first few classes knowing the freshmen were out of their experience level and hoping they would drop. A number of them did, but a few of them stuck with it and while they didn't have winning games they did have some impressive pieces of work. Although I should mention that Jess (one of the winners) is only a sophmore. Brilliant.

One of the crowd favorites was a freshman game called Beer Sweeper. It was fun to watch as Luis kept raching around the virtual recreation of an actual dorm room (it was very close, I once lived in that same dorm) the keys started to change and it became very hard for him to control. It got some good laughs.

The fourth place game Ork Fight had a ton of AI code and Chris got the orcs to fight on teams with the other players. It was very fun to watch. He had some funny stories about problems while he was working on the AI. Some of the problems sounded almost human.

The fifth place game was a huge endeavor. Given a few more weeks I think Vinnie would have taken first place. He's going to be the Peter Jackson type some day. Double majoring in Film and Philosophy and a minor in computer science he made some major engine modifications and is well on his way to a significant creation.

All in all it was a great semester. I worked way too hard at it and didn't make much money, but I love doing it and I'm looking forward to at least taking a semester off. I'll decided later in the year if I'll do it again.

Tuesday, May 15, 2007

Tonight's Contest

Tonight is the night I'm hosting a bunch of local game industry folks to view the student projects and presentations. The best game get's a $100 gift card, but the students have done most of the work with the opportunity to get in front of a bunch of folks from industry. It's an experiment, but right now the wave looks a lot bigger than I ever expected.

This is how judging will be weighted. It doesn't have anything to do with their grade on the project, just who 'wins' best game.

Completeness: (25 %)
Replay/fun factor (20 %)
Uniqueness (15 %)
Story (10 %)
Graphics (10 %)
Simple graphics that are used in a unique way will also receive high scores here.
Audio: (10 %)
Student Choice: (10%) (max 90 points = 18 students x 5 points each)

I've tried to break completness out into the following sub items: Splash screen, main menu, Scoring, Game has a story, Game controls/play, multiple levels, game ends/menu cycle/quit, high score system.

I have this obscene spreadsheet created which will automatically calculate the winner based on judges input. Once I have the number (1-100) from the judges for each game and category I simply imput them and come up with a winner. I did this last year, but I put the numbers in as I went. I just hope it doesn't take forever to enter the data, but things have a way of working themselves out. I'll report again tomorrow with the winners.

Just as I finish writing this I may dump the spreadsheet and just ask for the judges first, second and third choices for the winner. Hmmm.

Monday, May 14, 2007

Game development class - huge finale

If you've been following my blog you know I've been teaching a game development class. The student's have been working on their own creations for almost half the semester and here is a (two week old) preview of the results.

http://www.gamedev360.com/contest07/preview.html

I have about 10 people from five of six of the biggest game companies in the area coming to judge the final presentations. I offered the student with the best game a $100 EB giftcard. Last year they were focused on the gift card, this year I'm sure they are focused on the job so putting them together with people who are looking for talent seems like a win win for everyone. All sides are excited.

I went into the lab on Saturday to help students with last minute problems and I have to say this is one of the best group of students I have ever had. The quality of the work is phenominal. The screenshots on the contest preview are almost three weeks old and the games since then are looking very very polished. A couple of them are going to be standouts.

There was the funniest quote the other day in one of the extra lab sessions. About halfway through the class I stopped assigning homework and allowing the student's to work on their own projects. One of the student's said to me, "Man, when you stopped assigning homework this class got a lot harder!". That has to be one of my all time favorite teaching quotes. The pressure of the final presentation in front of industry seems to have really worked.

I'll try and post results of the contest on Wednesday. I've been spending every minute of my free time on this contest. What am I going to do with all that extra free time?

Monday, April 16, 2007

Game Development or Game Playing

Not all game development is without it's fun side. One of the main reasons I'm into game development as a hobby is that I've loved to play games since I was a kid. It all started with that pong game my dad bought when I was about 9. The console wars have been going on ever since.

My current console is a ps2 which I have not played in a while. I was playing a lot of game boy until I gave it away to an orphanage in Africa when we were on a mission trip. I do miss it, but those kids really loved it a lot more that I ever would.

My current game is World Of Warcraft (Character Ironwood, Realm: Duskwood) One of the most addictive games I have played. Probably the most addictive for me since I got to 67% complete on GTA III, Vice City and San Andreas. Anyone who has played those knows 67% complete is too much fun time and not a lot of TV. I'm not sure where I stand in WoW, but I'm sure it's only in the 20% range at level 31. Lately I've slowed my progress and have been working on my Leather Making and Cooking skills. The game is very open ended and has a lot of ways to play. My only complaint is that I'm a bit bored with the same monsters over and over and over with a slightly different skin or model, but it's still a lot of fun.

With 8 million subscribers and still growing don't take my word for it, this is a fun game. Don't start if you don't have some time to waste. I started in January and three months later I'm finally starting to get a little bored with it. I'll probably drop my subscription in June if my usual game life cycle runs it's couse. A very fun game.

Monday, April 9, 2007

Motivating students with a contest

A $100 EB gift card prize goes a long way in motivating a group of students. Sure it costs me a large percentage of the money I make teaching the class, but if I cared about the money I wouldn't teach the class in the first place. Adjunct teaching doesn't pay, at least not for me. I love to teach and the little I do make is just an added bonus.


I've done the contest once before and the work was amazing. This year I've upped the ante and invited a bunch of execs and hiring mangers from local game companies to be the final judges. This will be a great opportunity for the students to show their talent and for these game company folks to hire amazing young talent. It also motivates the students to spend extra time on their projects which is the only way to learn to program. All sides are primed and ready and it seems like the perfect matchup so far.


We still have 6 more weeks of development time left for the students, but after two weeks officially working on their final projects I am throughly impressed with the results. This is going to be much better than last year.


For those that are worried about it, the contest placing has no bearing on the grade for the students' final projects. I'll grade under the same rules as the contest, but that grade is separate from contest placing.

Friday, April 6, 2007

Broader individual knowledge helps the entire team

More thoughts on the 3d game development class I'm teaching.I'm about halfway through the semester and I just stopped giving 'busy work' assignments. Everyone is working on their own projects. The last busy work assignment I gave I introduced them to the installer. My choice of installer is NSIS, since it's free and something I have used on other commercial projects.

What does this have to do with a Game Development class? A ton. From the very first busy work assignment I forced my students to think in terms of a full cycle game. Everything they turned in had to have a splash page, a main menu and a way to cycle back to the main menu. The installer extends this concept of a full cycle game. Isn't this what they are going to deal with in the real world?

Most gaming books seem to only focus on the mechanics of the actual games, but to me that is only about 30% of the overall work that needs to get done. The real work is in the details and those details really matter. As an added bonus, once this class is over each of my students will have an full game with an installer they can give to a potential employer or put on a portfolio website. These students will have a distinct advantage over someone that just says they took a game development class.

To me this has a lot to do with getting a job, but it also has to do with the reality we all face. It is okay to specialize in one area of a project, but you still need to understand a little about the entire process. If everyone has broader knowledge the team will function more efficiently and increase the value of the products you create. Thus increasing the value of the individual to the team. I'm trying to train students I would want to have on my own team.

Friday, March 30, 2007

Why use Torque as a game engine?

As I said in my previous blog entry I've been teaching a game development class using the Torque Game Engine. There were a number of factors that lead to the choice of Torque.

The early meetings with the curriculum board lead to the adoption of Unreal as the engine of choice. As the fall arrived and I had been spending months working with Unreal, reality began to sink in. Since this was a programming class there would have to be more to it than just level editing. While Unreal script is programming I also wanted to be able to have the students understand the actual C code behind the engine. Without access to the engine source this would mostly be a level editing class. The Computer Science department wanted to make sure this was more of a programming class than a level editing class.

In general, there are always C code tweaks to an engine to make any game so anything short of source code would not be a realistic environment for the students. Workable, but not realistic.

When the department attempted to license the Unreal engine it was out of the budget. Rumor had it that it was in the 100s of thousands which was way outside the budget for an edu setting! Another factor was the majority of the official documentation for Unreal requires that same license. While there is a lot of independent documentation on Unreal and this may not be a problem it was a factor in our decision.

Torque had come up in earlier discussions and a review showed it was actually perfect for the educational setting. At around $100 a seat, it included the source. That decision was made in December and I've spent the past few months trying to stay ahead of the students while I learned the ins and outs of Torque. Stressfull, but I think the results I am seeing from the students are amazing.

Thursday, March 29, 2007

Torque Game Engine

This semester I've been teaching a class on game development at Chapman University. The class website is http://www.gamedev360.com/. It is the biggest reason I have not blogged in a while. Secondary was my last post on procrastination which sort of helped me see blogging as a distraction. We are using the Torque Game Engine for the class and so far I am impressed. There are some things I really like about it and some things I don't and I'll come up with some posts along those lines in the future.

My previous gig was called GameWorld.com developing mobile games. During that time I was teaching some other classes (Assembly Language, Computer Architecture) and lobbied the head of the department to teach a game development class. After five years, that finally came through last year and I taught the first class. Last summer the department created a curriculum board of industry professionals to come up with a minor and certificate program. This semester is the first class as part of the minor. Very exciting.

The website for the current class is http://www.gamedev360.com/. Please feel free to comment or contact me about Torque. I'll be writing more about Torque and game development in the future.