Another New Project?

Posted by B on Friday Feb 3, 2012 Under Constructing, Game Development

I seem to have a hard time focusing in on one thing. I have this project and that one. Oh, and one over there, and another in the closet, and yet another in the drawer. All of them are uncompleted.

So here’s another one.

I am putting together a project using an (older) open source 2D game engine called Construct. This was my first introduction to any programming and I hobbled my way through it to make a terrible game for my bro when he graduated from basic training. One of the sweet things about this engine is that it doesn’t require any coding knowledge or ability, as it uses an event driven layout, in which one simply clicks icons. Scripting is available, but I doubt this project will get into it.

The Project

I am putting together a project, or group of projects, to illustrate some of the basic concepts of programming. The logic, if/else, looping, and some of the concepts of OOP, which should fit nicely into the engine.

The first game project is nearly done (a Pong clone called … wait for it … Ping Pong), but I have to make the videos and pdf and put together the assets (though this one may be done in-engine). There are a few bugs to work out still with the project (some angle issues that I get sometimes and how closely I want to follow the actual rules – mostly the set of matches part), but I think that it will be coming along in a bit. I’ll keep you posted… I swear?

Tags : | Comments Off

Lack of Time

Posted by B on Sunday Oct 16, 2011 Under General Comments

I am finding that making time to code and develop is often harder that I would like. I have a million ideas, a handful of projects, and not enough time to do all of them.

So what is a fella to do?

When I get done with this whole schooling thing, I expect I will try to find a job doing something with my newly acquired programming skeelz. I also expect that the person with whom I interview will say “Gee, Mr. Thompson, you have some PHENOMENAL ideas, but they are half baked and abandoned early. Do you have anything finished?” To which I will reply, “Uh…, yeah, about that…”

Interview over. Do not pass go, do not collect Success Kid poster.

So I have to finish something. Something that demonstrates that I can follow through with tough design and brilliant game-play. Something that will make the interview guy get all Marlon Wayans and say “Daaaamn son!” To this end I announce a new old game that I will probably never finish (sad realist face) – AZKG : Another Zombie Killing Game. Dont worry, the graphics will be bad and the AI unintelligent, so you should probably feel like you are driving with a dirty windshield – and an M4. It will have grenades, so that’s sweet. There is also a proposed “girl-scout mode”, though I will leave it to your imagination to figure out what that one is.

Anyway, I promise all of you that I will get something finished one day. It’s rough, because I work really hard and then I get burned out because it is just me working on this stuff. Maybe a team would help? I don’t know, but it’s coming…

Tags : | Comments Off

The Road to Hell

Posted by B on Monday Oct 3, 2011 Under General Comments

They say that it is paved with good intentions. I had those, a bunch of them. This weekend was supposed to be spent playing with AI for Ross3 and getting something closer to playable together for you, me, the guys over there and that one guy in Biology 231 – the one with the weird hair. Alas, even with the best of intentions, life creates things for you to do, or you spend Sunday morning in bed watching Hulu or Netflix. Homework happens, you have to go to the gym, cook, eat, sleep, and all that jazz.

It’s a logistical nightmare and then you wake up monday morning before it’s light outside and you leave the house. Go to work. Then to class. Then home, but it’s 10pm so it’s time to get ready for bed. Tuesday. Work. Other work. Hang out with a friend that you see once a week. Home. 10, maybe 10:30. Bed. Wednesday: see Monday. It’s a cycle, and it’s viscous. And I do mean viscous – thick and sticky.

BUT

I did get to play with Aron Granberg’s A* pathfinding project – the free version. Ummm, yeah. I like this tool. I didn’t get to play with it much more than the demo project that you can download, but it seemed pretty swell. I made a hat-load of copies of the bot and sent them on their merry way – chasing the ball like a bunch of zombie-dog-bots. I don’t recall exact numbers (because I wasn’t planning on doing a benchmark analysis), but I do know that I had 30 or so onscreen and didn’t see dip in frame rates. I got up to 80+ and started to see lag when all of them had to repath, noticing the queue that they had to wait in to be pathed. It is worth noting here that the free version is NOT threaded like the $100 pro version, so I was getting fram rates of about 83 fps with 30 bots and NO threading. I am going to play with the free for a while and if I like it, I’ll pay the money for the upgrade.

So, I didn’t get you anything to play, but I did get me some useful info and I passed it along. See how helpful I am? And I have a new project that I want to start working on, as well as an old one, but I’m going to put them off if I can. Too many sticks in the fire, if you will.

Have a killer week.
B

Tags : | Comments Off

Ross3 – What’s going on?

Posted by B on Thursday Sep 15, 2011 Under Game Development, Ross Cubed

So here is where I am with Ross3:

The camera (demo) is working properly (I think), the avatar controls are coming together (using a character controller – not too hard here), though the jump needs some SERIOUS tweaking, and the basic mechanics are seeming to work. So what do I have yet to do so I can get a playable demo to you? Well, wow… I guess I’l start the list:

1) GUI – the actual interface to give you info about what’s going on. There are still a few things that are in the game play (or not…) that will inform the HUD GUI design. I am going to mock one up after I get this posted to give you an idea of what I am thinking.

2) RigidBody motors – This is for all NPC’s. This will allow them to move about, but still have collisions. Also, this is because I have been having trouble getting two CharControllers to interact properly with one another – which seems to be a common problem (Unity support?).

3) RigidBody drag – this is so Ross can pull boxes as well as push them. I figure this will be necessary when you push the box against a wall and need it somewhere else.

4) Music – this is going to be a task. I want the music to be dynamic and responsive to what is happening in the game. BUT I don’t want to script every little thing. I will if I have to, but I would rather like it to be autonomous, with me doing set up and the scene controlling the music. I would like to use it to add to the feel of the game, like they do in movies. I know that I could use triggers, and I probably will make use of a fair amount of them, but I also want all the music and sound in a level to flow seamlessly together, which means beat matching and timing issues. I have a grand idea (think Peter and the Wolf) and it is going to be a lot of work to accomplish it. I will keep you posted.

5) Spawning – I don’t want the player to have to restart the level when he dies, since I want it to be a casual game that is easy to pick up and put down. SO I’m thinking a spawn system that uses checkpoints. We’ll see how well it works out. I haven’t looked into this yet, but I expect that it will be harder than I think.

6) Point Systems – Yeah. People expect points. ‘Nuff said.

7) Millions of tiny things I haven’t yet foreseen – Really. There is probably more that I haven’t thought of than I have.

Tags : | Comments Off

Below you will find the playable camera demo. Move with the arrow keys or WASD, jump with SPACE, but there isn’t anything to do, this is just to see how the camera works.

Tags : | Comments Off

I am working on the camera control for Ross3 and it’s going pretty well. So well, in fact, that I think it is almost there. Of course it will have to be tested in play and adjustments made, but the base is there… I think.

The Goal

Make a camera script that will follow the player position and rotation, while maintaining a visual. In essence, I don’t want a wall or ceiling to block the view of the player.

The Plan

Steal other people’s hard work. And then, before you get all huffy-puffy, alter it to suit my needs.

The Implementation

I decided to start with the SmoothFollowWithCameraBumper script from the unitycommunity wiki page – written (I think – there is no name on the .js file) by Daniel P. Rossi, so thanks go to him.

This was a great start, but as I ran around a test level I found that I needed more. I decided that more Raycasting was needed (isn’t this just typical?). After playing around a bit I am casting a ray from the target to the default position of the camera. If the ray hits anything that isn’t the camera, the camera height is set to hit.point.y (the height of the point hit by the ray) minus a bumper hight offset (in this case 1). I didn’t want to change the x and z of the position of the camera, just the height.

Great. This works, but now if something is behind the player and lowering the camera by interfering with the raycast, we often can’t see the player. Solution? Raycast backward from the target, like the original Rossi file did. I am raycasting as far as the “distance” variable and if I hit something I adjust the x,y and z positions of the camera. If I don’t hit something then I just set the y position as above.

I also found an issue with standing in front of a bad guy. While I admit that this won’t happen much, it will (most likely) be possible to do and I don’t want the camera bouncing around as the bad guy turns and his corners interfere with the ray for a few frames. To solve this I started using the Physics.Raycast() overload with a LayerMask. If you look at the code you will see that there is one in there and in the editor this is exposed as a list from which you can select. I’m not sure if I am going to have the camera ray ignore the bad guys or not, but I can with a few clicks of the mouse, should I desire to do so.

That’s pretty much the gist of it. Below is the actual code, with a few comments in it. You may notice two lines setting the targetLookOffset commented out, this is because I’m not sure if I am going to move it around or not. Play testing…

The Outcome

Play a small demo to see how it works.

The Code

var target : Transform;
var layerMask : LayerMask; // which layers to interact whith while checking for things between the cam and target
var distance : float = 7.0;
var height : float = 4.0;
var damping : float = 5.0;
var smoothRotation : boolean = true;
var rotationDamping : float = 10.0;
var sideOffset : float = 0.0; // used to position the camera to the left or right of the target
							  // similar to an over the shoulder view of a third person shooter
// set the following public if you need to access them or want them visible in the editor
private var targetLookAtOffset : Vector3;     // allows offsetting of camera lookAt, very useful for low bumper heights
private var bumperDistanceCheck : float = 2.5;  // length of bumper ray
private var bumperCameraHeight : float = 1.0;   // adjust camera height while bumping
private var bumperRayOffset : Vector3;    // allows offset of the bumper ray from target origin

function Awake() {
	target = GameObject.FindWithTag("Player").transform;
	targetLookAtOffset.x = sideOffset;
	// comment the next line out if you want to specify the length of the bumper ray manually
	bumperDistanceCheck = distance;
}

function setTarget(newTarget : Transform) {
	target = newTarget;
}

function FixedUpdate() {
    var checkForCamDirection =  target.TransformPoint(sideOffset, height, -distance) - target.position;
    var wantedPosition = target.TransformPoint(sideOffset, height, -distance);
    var back = target.transform.TransformDirection(-1 * Vector3.forward);
    // check to see if there is anything between the target and the camera
    var hit : RaycastHit;
  	Debug.DrawRay(target.position, checkForCamDirection, Color.green);
    if(Physics.Raycast(target.position, checkForCamDirection, hit, distance, layerMask) && hit.transform != this.transform){
		if (Physics.Raycast(target.TransformPoint(bumperRayOffset), back, hit, bumperDistanceCheck, layerMask)) {
	    // clamp wanted position to hit position
	        wantedPosition.x = hit.point.x;
	        wantedPosition.z = hit.point.z;
	        wantedPosition.y = Mathf.Lerp(hit.point.y + bumperCameraHeight, wantedPosition.y, Time.deltaTime * damping);
	       // targetLookAtOffset = Vector3(0,0,2);
	    }
	    else{
    	 	wantedPosition.y = Mathf.Max(target.position.y, hit.point.y - bumperCameraHeight);
    	 	//targetLookAtOffset = Vector3.zero;
   		}
    }
    targetLookAtOffset = Vector3(0,0,2);

    transform.position = Vector3.Lerp(transform.position, wantedPosition, Time.deltaTime * damping);

    var lookPosition : Vector3 = target.TransformPoint(targetLookAtOffset);

    if (smoothRotation) {
        var wantedRotation : Quaternion = Quaternion.LookRotation(lookPosition - transform.position, target.up);
        transform.rotation = Quaternion.Slerp(transform.rotation, wantedRotation, Time.deltaTime * rotationDamping);
    }
    else {
        transform.rotation = Quaternion.LookRotation(lookPosition - transform.position, target.up);
    }
}
Tags : | Comments Off

Going Live

Posted by B on Tuesday Sep 6, 2011 Under General Comments

Welcome to BillyGoat! I keep hearing that I need to be on LinkedIn and all the social sites to do networking, but I decided that having nothing to show to interested parties is equally as depressing and counterproductive as having no interested parties.

So to get this party started I present – Me! This page is my ever evolving portfolio and development blog. My goals are simple: 1) to allow you to play, critique and (hopefully) enjoy games and projects that I am working on and 2) to get a sense of who I am and how I go about things. The dev blog will be where you find the stuff to make the second goal achievable.

So, for now, there isn’t much that is up here and there is less that is playable. I am working on a few things to get the Ross3 demo up and running, but I will go into that in a separate post. Thanks for checking it out and come back often.

Tags : | Comments Off