My very first game demo ;-)

This is really exciting :slight_smile: I just put my very first little game demo online. I just started playing around with Unity last weekend (and actually, I might upload some of the stuff I created then, too, because it was so much fun :wink: ).

My first ā€œgame projectā€ is a Tron-Clone. Since my ā€œMMORPG-plansā€ are somewhat ambitious (hehe), I thought I’d better start off with something REALLY simply. I would consider this V0.1, there’s no real game logic involved, yet, but I’m already having so much fun with this.

It’s one arena, and you can ā€œride your bikeā€ in there. It already creates a wall that other players can later run into (or you yourself could run into). However, there’s no collision detection implemented, yet, so you can simply run through your own walls.

It’s all very simply: cursor left/right makes sharp 90° turns. 1, 2, 3 gives you 3 different camera angles (1 is ā€œcockpit viewā€, 2 kind of ā€œclose-upā€ and 3 more like the ā€œoverviewā€). With q and e you can do quick looks left or right. That’s the ā€œofficial stuffā€ so far :wink:

You might also try cursor up/down which accelerates or decalerates. You could even go backwards (but that will break the wall-creation). With a and d you can move the camera left or right (this is actually currently a ā€œbugā€, but I might turn that into a feature :wink: ).

There’s a lot of ā€œobviousā€ stuff missing right now, and I still have quite a few ideas about this that might actually make this some fun to play…

So, here it is: TRaceON

Hey, cool. :slight_smile: It works exactly as you describe. Good jobbo!

This alone is the reason why so many of us use Unity. There are only that small handful of delightful programs to use you ever run across and Unity, especially 2, falls right there among those special ones (ArtRage and Sketchup being two others).

And that’s a good looking Tron clone btw. Let me know when it’s a bit farther along and I’ll link to it from WMG.

Cool! Hey how did you get the smooth movement of the cameras when switching? Do you use lerp or slerp or similar?

Check this thread out:

http://forum.unity3d.com/viewtopic.php?t=2681

One of my classmates demos…

AC

Cool! That also looks really nice… In fact, very interesting idea to allow ā€œsmooth turnsā€ in a Tron-style game. I was actually thinking of adding some ā€œeaster eggā€ that allows you to get out of the arena (like it actually happens in the movie), and there, ā€œsmooth turnsā€ would probably be nice :wink:

For the smooth movement of the cameras when switching I did use lerp. Basically, all I did was take the smooth follow camera script from the default assets and added what I needed. I did run into the Quaternion/Euler-Angle issue a few times giving me some headaches, but I guess by now I should have learned it :wink:

I made the original variables for distance, height etc. private (and I previously had added a variable for moving the camera to the side, which I can simply do by adding it to wantedRotationAngle = target.eulerAngles.y), added sets of public variables for far, near and ā€œcockpitā€ view, and then ā€œsmooth everything outā€ by using lerp for pretty much ā€œeverythingā€ (the ā€œside looksā€ are ā€œhacked inā€, however, AFTER transform.LookAt(target)) :wink:

Most important change: I’m now using Visual Studio.NET 2005 on Windows XP (on VMWare Fusion) to edit my scripts. I like it much better that way…

So, no more JavaScript in this version, at least not that I would be aware of it. All scripts are now C#. Next will be Subversion support in my dev-environment.

One thing I found interesting: When I moved the camera script from JavaScript to C#, it suddenly started jittering like hell. Should be the same code, but behaved quite differently. I noticed, however, that the Web player of V0.1 did the same, even if not as severly as my initial C# version in the editor (I never noticed that with the editor in JS). Well… RTFM, right!?: cameras should be done in LastUpdate() instead of Update() as I originally did it - now it’s smooooth (at least on my computer :wink: ). Also, I removed one really bad hack when turning left or right (that was just… um… well, I better don’t tell anyone :wink: ).

Other changes:

+ Improved Materials of lightcycle and "lightwalls"
+ lightwalls now disappear after a little while
+ increased camera clip plane (just not enough, though)
+ collision detection - light cycle explodes if it runs into a wall
  (the explosion sound is from Gear Worx...
  I'll replace that with something that sounds more 
  electronic, but for now it's a nice shock-effect ;-) )

Btw, the collision detection is kind of ā€œhomegrownā€: I’m using 3 transforms (basically a triangle from the center of the light-cycle to ā€œa bitā€ in front of it with its width left and right) and checking (both left and right, of course):

Physics.Linecast(refPointFront.position, refPointFrontLeft.position)

I think the next thing I’ll be doing is a little start screen, game over and navigation in between (it’s not that much fun having to reload the web player to restart :wink: ), some GUI-stuff and an opponent with an unbeatable AI (just kidding).

Then comes multiplayer-support (that will be the most exciting part for me). Oh… recently I couldn’t sleep one night and had quite a few ideas… Possibly, this might turn out more interesting than I had originally planned :wink:

… and now I almost forgot to include the link:
http://www.jashan-chittesh.de/JCsUMTRON_V03/tabid/100/Default.aspx

Good night…
Jashan

PS: Btw, do I really HAVE to do:

    Vector3 pos = transform.position;
    // Set the height of the camera
    pos.y = currentHeight;
    transform.position = pos;

in C#? I haven’t found something like ā€œsetPosY(…)ā€ which I think would be nicer… But maybe I’m not seeing something obvious…

Hey Kevin, depending on how you rotate, it leads to empty spaces here…

58198--2116--$bild_3_100.png

Kevin? Who’s Kevin?

Hey George, how the hack did you get that done?

Instructions, please! :wink:

It’s kind of funny you managed to create it in a way that looks like this, because my very first approach was instantiating many ā€œwall-partsā€ (based on the distance the cycle had moved since instantiating the last wall-part and the size of the wall-parts), so when the framerate was low, and the lightcycle fast, it would look quite similar to what you’ve created. I then moved to using one wall-part and scaling that until you turn.

In previous versions, you could move backwards (the ability to change speed is just for testing purposes, so I do no bounds checking there), so I guess that might be a possibility to create something similar… I just reproduced it in V0.2 but I get visible seams… in V0.3, it should not be possible…

Now you really got me :wink:

How did you do it?

Jashan

Kevin Flynn was the programmer of Lightcycle in the TRON movie. ;O)

I ran into it when i was trying to aviod the walls, if you quickly change between the left and right arrow keys you can draw those holes.

Ah, now I remember… it’s been a while since I saw that movie the last time, even though I have the DVD lying around on my desk. Thew, I better watch out for the master control programm… I have this cool beamer right behind me, hope it’s not a scanner (even though it sure would be fun talking to the Unity programm :wink: ).

I guess I’ll have to try this on another computer or create something that really makes the framerate drop. Does it run smooth on the computer on which you’re trying this? That would be my first guess, that it’s got something to do with the Update where the walls are instantiated / scaled etc. not being called often enough.

On the other hand: Moving the cycle, creating / updating the walls and doing turns is all handled in the same Update()-method… are you doing stuff like left-right-right-left very quickly? On what kind of machine are you trying this (Mac OS / Windows)?

Runs smooth on my Mini (until there are a lot of walls built and you’re viewing towards them) and i quickly pressed the keys.

After I finished the 3d 3rd person platform tutorial yesterday around midnight, I felt I should work a little more on my little game demo…

I need to rush, so I’ll keep this short… finally, I got a start screen and ā€œgame overā€, so one is not overwhelmed with the cycle moving right when one has opened the page (before even knowing about how to control it). Also, I’ve added some sound, a Map (which will be available as ā€œpower-upā€ in the final game) and some other stuff…

Oh, and of course: I’ve added standalone players for download…

I can sometimes reproduce the ā€œwall gapā€ bug now but haven’t really figured out why this is happening, yet… for now, I’ll simply call this a feature (makes it possible to run through your own walls).

One thing that sucks is that with low framerates, my collision detection doesn’t work at all…

Have a look at:
http://www.jashan-chittesh.de/JCsUMTRON_V04/tabid/102/Default.aspx

And… a happy new year to all of you!!!

Jashan

Hi taumel,

At last - I figured it out: It happened when you simultanuously hit left and right… because… in that case, within one frame both a left and right turn was done which messed up the wall-creation logic.

Changed

if (Input.GetKeyDown("left")) {
    TurnLeft();
}
if (Input.GetKeyDown("right")) {
    TurnRight();
}

to

if (Input.GetKeyDown("left")  Input.GetKeyDown("right")) {
    // ignore actions of insane users ;-)
} else if (Input.GetKeyDown("left")) {
    TurnLeft();
} else if (Input.GetKeyDown("right")) {
    TurnRight();
}

and now this happens no more 8)

Possibly, JCsUMTRON ran much better on your Mini than it did on my Mac Pro - crazy me had 3 point lights shining all over the place with soft shadows turned on (that I never even really noticed and that really don’t make much sense for this sort of game). I’ve added some simple AI now and put 6 cycles in the arena - and my FPS dropped down to some 15 FPS. :sweat_smile:

Spent almost a day writing a little profiling-tool (I’ll post about that when it’s a little more polished) to ā€œperformance-debug my AIā€. I never played with gfx-quality set to fastest… should have: up to 300 or 400 FPS :wink:

Now… um… maybe I should consider some light-baking…

Jashan

Neat! I love light cycles!

/me goes back to work on his Discs of Tron clone :stuck_out_tongue:

very cool, nice job especially for a first project (tron rules ; )

Cool - now if someone adds this game in Tron where you go through the maze with a tank and then have to shoot those flying robots, we can have a full ā€œUnity Tronā€ :wink:

Btw, I’m in trouble: My game has reached a state where it’s almost more fun to play than continue development (and developing in Unity is quite some fun, so I hope others will like it as much as I do :wink: ).

I might put up V0.5 later today…

Jashan

Imagine my surprise in 1st launching Unitron only to discover it’s not a game at all! :stuck_out_tongue:

Hahaha, that’s the kind of problem you ā€œwaaahntā€ to have! I say run with it! hehe

I have to admit that the last few hours were a bit of a hack-attack… but I had my fun with it :wink:

I think this can now be considered my first ā€œgame prototypeā€. There’s still quite a few things missing, but I’m already having a lot of fun playing this, and I hope you guys have, too:

Jashan Chittesh’s Unity (Multiplayer) TRace ON V0.5

It’s available both as Web player and Mac OS Universal Binary or Windows standalone.

The major changes from the last version are: Other cycles you have to play with or against (don’t kill your team-members :wink: ). I’ve worked over some of the sounds and fixed a few bugs (in particular, the performance is much better now). I’ve replaced my ā€œhome-grown collision-detectionā€ with a rigidbody/collider-setup and guess what: now it’s working (at least I have not managed to run through a wall since I’ve made that change) :wink: Oh, and the ā€œgaps in wallā€-bug that taumel had discovered also ran into one of my development-walls (as mentioned before in this thread)…

Added a little ā€œintro-cut-sceneā€ when starting a level (I’m working my way to multiplayer-support here :wink: ). Oh, and I worked a little on the ā€œexplosionsā€ (you may notice the sound is stereo but still depends on the other cycle’s distance, when another cycle explodes… and… also the intensity of the visual effect depends on the distance… it’s so lovely how easy these things are in Unity :slight_smile: ). When a cycle explodes, after a few seconds the whole wall it had created is ā€œcleaned upā€, it’s color is turned white in that case to give other players a hint that this wall is about to disappear. Oh, and I almost forgot to mention that walls have different colors now :wink:

Cheats

If you experiment a little with your keyboard, you may notice that there’s currently a few ā€œcheatsā€ available. All of these will be available also in the ā€œreal gameā€ - but there, they’ll only be available as limited power ups. So far, I’ve implemented rudimentary versions of:

r → removes your own wall (can be very handy when you’ve locked yourself in… or when one of your team-mates is locked in your walls)

t → bullet-time… very nice if you have to escape very narrow walls… this will be especially funny in multiplayer-mode because it’ll make everyone have bullet-time, but you’re the one who can control it if you have that power-up

m → ā€œ2d-mapā€ā€¦ that’s nice, but (secret secret), I have planned one level where you will really NEED this…

Cursor up / down still accellerates / decreases speed (there will be two powerups, one that makes you faster for a few seconds, and one that slows you down for a few seconds).

I have quite a few other ā€œpower-upsā€ on my mind, but those I have right now are simply useful for testing, that’s why they’re available already. Bullet-Time may or may not pitch down all sound (I haven’t checked if that sounds cool, yet… I’ll only implement it that way if it DOES sound cool :wink: ).

And of course, using 1, 2, 3 (different camera distances, 1 is cockpit view, 3 is ā€œoverviewā€ and 2 in between) and q, e, a and d for switching whether the camera is right or left of the cycle. It’s a good idea to practice using these different perspectives because sometimes, the wrong perspective can be disastrous :wink:

Pah… it’s really time to go to bed now… gotta get up in 5 hours :frowning:

But whoa am I having fun with Unity (now official member of the good guys team in JCsUMTRON, side-by-side with Tron and ā€œYOU ;-)ā€ ) :slight_smile:

Jashan

PS: Ah, one or two last things to be aware of: I forgot to switch the song back to loop and realized that when I was already uploading, so if you survive the song, you’re good, but that won’t happen in the next version. Also, I forgot to switch off some ā€œbackground noiseā€ when the actual game starts (but you probably will hear that only when the music is over and you’re using headphones :wink: ).

That is so much fun! I’m a kid again experiencing TRON. Oops, aging myself. Well done!

Ricko