Gaming Your Way

May contain nuts.

Decision Style #4: Activity-Focused Design

I'm still awe and wonder about what shit comes up when you search for our post titles. This time it's a tech-talk-bullshit gem.

Anyway, it's time to get going with the prototype game and start piecing together all the little tools written so far. I mentioned it on g+ already, but I reached the point where I needed more than my usual ToDo list to keep track of what I want/need to do next.


Just a small part of my "map helper"

The first map I used for testing was quite big and complex and with some 20 rooms and even more doors a bit - shall we say - shit to keep track of. So I invested 2 hours to make a smaller map, then rendered it out and drew my notes on it (making revisions on paper is a bit messy after a while).

Color coded rooms help to maintain overview and layers in photoshop make it incredibly easy to keep track of items to place and doors to connect. Right now I'm placing these in Unity and wiring things up to be able to do a "play through" with the main objectives: find docs (USB drives), codes and key key cards and avoid being caught.

The next thing on my ToDo list however is the minimap, which wont show you the location but items, guards and cameras (and their "senses"). With that in place it's finally time to add security to the map.

Maybe I should add a trigger for the exit first so I can have a "well done" screen up and running (and make it feel more like a game than a pure game mechanics test bed).

-- Oliver / nGFX

And then they said that burning the secret documents ...

... only made things worse.

See, all the good intentions are gone by now - that is having the weekly post done before Sunday, well at least it's not 23:52h.

Although I have a good reason as I haven't worked at all for two days straight, trying to get my laptop back to work. In theory it would have been a case of just restoring the last weekly backup, but alas ...

I'm using a Dell, you know, running win 8.1 pro (64bit) with Intel Rapid Storage (magically using a SSD and a HDD mixed up for speed), Intel onboard gfx and an additional ATI Radeon card for 3d / games. I mention this because this combination is the the reason for the two wasted days (although, it's partly my fault).

The whole mess starts with me noticing that the Catalyst Control Center wasn't running (so no choice which card to use), as I had that earlier (when running still running win 8) so I knew that I just needed to install the latest ATI drivers again. That done and a reboot later the only thing I got was a black screen and a flickering cursor. What followed was a lot of cursing, because after I used a "recover to last working version" I ended up with a clean win 8 install and just a few of my settings and none of my programs left.

Ha! No problem, I have a backup that is just one day old.

To cut this short, in order to get the OS partition restored I needed the following: change boot mode to legacy (UEFI by default, to run the linux based frontend of the backup software), turn off the Rapid Storage/RAID settings in BIOS in order to access the HDD and write back the partition. With this in the recovery only took about 30 minutes, great that there's nothing to be found about this on the interwebs ... and you only come to this after 2 days of "can't this", "error that".

Oh and I had to install the ATI drivers provided by Dell in order to make things work with win 8.1 ...

... now lets's start with this week's post.


Yes, I used that image before.

I mentioned that the HUD in MTR is far from ideal or even "pretty", too much information, too small and not helpful. One of the tasks on my list therefore read "redesign HUD" and this post will go through some of the iterations that the HUD went through.

The information I wanted to show was: car, position ( the badge icon), lap time/total time and boost (the battery). Once the race is running, having 4 pairs of changing numbers is quite a bit much distraction from the track.


Iterations of the new HUD.

As you can see the icons changed quite a bit and all of the icons that were used as labels are gone now, too. 

The final HUD comes in two flavours: horizontal (for smaller screens) and vertical (for larger screens):


Default view for larger screens ...


... and for smaller ones.

The latest version adds a hint of color to the backgrounds of the badges (using the car's main color). The position is now shown by the order of the badges, the local player is marked by the orange line (color may change). It also brings back the battery icon, well sometimes, but that's for another post ...

More next week,

-- Oliver / nGFX

Gears are polygon bitches.

After last weeks post I started working on the real version of the "cave" showcased in the last week. Basically it is the "puzzle" part of the first block for the game. The idea is to compose a set of independent blocks that are connected by doors, portals or "glitches" (I'll give an explanation for that in a later post).

Let's talk about controls first (be patient, I'll come to the gears soon enough).

My main method of control for this game will be twin-stick gamepad (with a WASD/mouse fall back - maybe). I played with a few types and settled whit what I call "locked view" 3rd person controls. My first idea was to go the classic twin stick route and have one stick for movement and one to set the aim direction. I admit I don't like that very much, so I started looking for another method. The method I use now uses one stick for moving AND aiming (read you aim into the direction you move) and the second stick is used for moving the camera (classic 3rd person I would say). I added one addition to it, though.
In fights you can "lock" the view aim direction with a button press (and release it with a second press) this way you can move towards a group of enemies (thus aiming at them), lock the aim and retreat backwards still aiming at the enemies. When moving the camera you keep aiming relative to the camera, so you'll be able to shoot enemies nearby without having to heavily move around.

Puh. That's a lot of text, let's get to the gears.


This machine is a part of the first puzzle.

You'll notice the gears in this image, and the eat up polygons. Although I cheated and removed all invisible faces of the gears in the background, they still make up a good part of the polygon count for this block (10k so far, but there's room for optimisation), but then I liked the mechanic look of them. Seeing them in motion when solving the puzzle was reward enough to keep them the way they are now. The game isn't purely about killing enemies, so I wanted to add puzzles to the blocks that unlock new locations (rooms, blocks, mazes). This isn't a great puzzle, but it's a start and as the game grows and I'll add more blocks with more puzzles adding a hint of adventure to the game.


This bridge leads to a different part of the block.

I doubt this area will stay like it is right now, as I had the idea of adding a BIG spiral staircase down to a big room with lots of ... things.


The "cave", not quite looking like the one I showed last post.

This area is still not finished, I'm going to add at least one bigger wooden structure to the right "island" (which you can't reach without solving the puzzle) and a portal.

Oh someone told me that the images are a tad small, so I'll have a g+ post with bigger versions ready if you follow this link: bigger version images.

And with this ... see you all next week. 

Enter title here

Another week passed already? Damn.

I'm not sure if I mentioned it, but I'm having two weeks off. No coding except what I want to, I even could have a complete lazy day. During the last week I've been digging out an old game that went to oblivion - because paid work took over all the free time and there was a distinctive lack of "vision".

Both problems have been solved for the time being. MTR, the racing game is partly client work so I decided to let it rest for two weeks.


Is back from the dead.

On Monday my first action was to zip away all the old files (except the 3d models already made) and start a new project. I did this because one of the main features of the game is gone: randomly created dungeons (not entirely, but not as sole method of creating the environment).


A rather ... unspectacular first screenshot.

As the game will be gamepad controlled (but I'm also working on a wasd/mouse version) I spent some time making the controls feel right. Next things to work on are traps, doors (keys), terminals and connectors (which will be used to connect pre-built blocks) - all as dummy objects to see if it works like planed.

There are still some decisions to make, mainly player progression and inventory, but I need something to post next week.

Colliders are mean shits in Unity, let me tell you.

Lots of problems have been revealed since I started to roll my own set of car physics *without* car physics. At first it all seems so easy and logical, get rid of wheels, torque, motor and what not else to get a better control over the car's handling and setup.

 


(first setup, notice the shitload of settings ...)

 

I wanted to be able to take the car and set a top-speed from 1 to 10, as well as acceleration, a value I called "handling" and maybe "boost" or something like that.
Normal wheel based setups are a bugger to tune and I've spent a fair time trying to get the values right but still it felt ... wrong.
Anyway, the idea was simple enough: make a rigidbody box (so I can have "easy" collisions) and move it along the track, but you cannot simply move rigidbodies (or it isn't a particulary good idea as physics calculations depend on force). 

 


(simple box collider setup)

 

OK, just apply force to the box in the direction I want the car to move, which works (in a way) but then failed after I altered the track's physics material to behave more like a road.
Now the friction killed any movement and the easy solution was to just let the box float (representing the car's body only) and that seemed to work well until I recalled that I have sloped tiles. "Oh no problem", I thought and was wrong again.

[we fast forward here a good deal and stop at a point where I have a semi floating box that is always aligned to the ground, does slopes, accelerates, breaks and what not else]

 


(new setup, less settings, looks odd, but the
capsule colliders have their purpose...)

 

Looking at the image you might ask where the difference is, the most obvious are the 4 capsule colliders at the car's corners and you might have noticed that the wheel colliders are back.
There is a simple reason for this setup: it works. Using wheel colliders with no friction is heavy cheating, but it keeps the car's body afloat and always aligned to the ground (esp. on slopes). Reading out their contact points also allows the put the tires on the ground and using the suspension.
The rest of the setup consists of a box collider for the car's body and four capsule colliders (not really needed, but they simplify the handling of some of the collisions).

Yeha!

On to colliders ...

Reading out collisions is easy and Unity offers three events to track these:
- OnCollisionEnter
- OnCollisionStay
- OnCollisionExit

"Oh cool, just listen to OnCollisionEnter and detect when the car crashes into something."

In theory, yes.

In reality it isn't reliably reporting when you collide, and OnCollisionStay is reporting all the time as the wheels nearly always touch the ground (as they are part of the rigidbody setup).

But this is the story for the next post ... 

 

nGFX

Mack The Knife is back in town ...

... or checking a track for errors

 

Let's start with a screen shot and jump right into the fun stuff, without messing much with the underlying game (where users can create their own tracks).


[a very simple user (read: me) created track]

As always the problem is with teaching that damn computer to see if this is a valid track before it can be played. So what makes a valid track?

  • only one start tile is allowed
  • it must be a closed loop
  • the AI track must be valid and reach all tiles
 

Only one start tile is allowed

This is an easy one, loop over the map and count the number of start tiles. Another easy step to prevent 2 or more of these would be to disable the tile after it has been used one time.
I guess not.

What if you decide that the start you placed in the beginning might be better suited just before that bend you added a few minutes before, you could however just delete it, place it at the new location, then fill the gap ... yeah sure.

 

It must be a closed loop

Now that's a tough one and it took a few minutes to get the right idea. Basically it's using a node based pathfinder (again) and dungeon cells (stolen from Hellstrom.

A screenshot first.


[dungeon cells "applied"]

So each track gets a new property "exits", which is a four character string "0" (white) for a closed exit and "1" (orange) for an open one and as bonus "2" for start tile's start direction. A simple straight track becomes "0101" (N, E, S, W) a corner "0011".

Let's go over all the tiles connected, starting with the start tile ("0201") ... next one is a "0101" and a "0011" (which also change the direction to the next tile to "2" or "South"). While adding new cells to the map we also add a node for the pathfinder and connect it to the previous cell's center.

Blabla bla (new Screenshot)


[Cell'ed up and connected]

At last, we add another node to the start tile when we reach it (and we don't connect it to the first node), just run the pathfinder and see what happens (we should end up on the start tile ...).

 

We continue with the last check after this entertaining commercial about SEO scum that spams our mailbox with the promise to bring us into the top 5 positions on google - or, if you can't see the commercial, when I've written that check.

 

nGFX

Unhappy meals - and that's OK

If you come here often you might have seen the screenshots of the "random mine" game, well this one won't make it to a full game.
There's a good reason of course (actually there are a good number of reasons).
I still like the appeal of random created levels, but this one didn't quite work as well as I thought. The early alpha version showed that a jump & run game needs carefully designed levels in order to be fun and you can't fake that by adding elements from other genres.
That was something I discovered pretty early in development and changed the idea from "really random" to "random pieces" or blocks.
This created levels that were playable, but in worst case quite repetitive. The obvious thing to do was to create more variations of the basic tiles (or parts). 

 
These are the basic blocks the generator used.

 
A version of the 0101 block.

I create a set of variations for the blocks (each one uses 30*20 ingame tiles) which worked well at a first glance.  But due to the random nature could appear multiple times in a large map. That drained the fun more than I expected. In the end it proved as much work to create varied and fun blocks as to create a whole level.
Tough decission, but I didn't want to design a jump & run game, I wanted to write code that does that for me.

Zipped and stored away for later use.

 

So while Squize works on an AAA title I'm back at the beginning of a new project.

 

You've seen Knuckles (I think he might change a bit in the end), the main character in the Unity game I decided to do (that mine game should have been done in Unity in the first place, too - but flash seemed to be make a faster development possible).

The Idea for Nuckle's game evolved from a 2d sidescroller into a 3d game, so using Unity seems the better choice - even though there's the promissing stage3d api around.

Right now I'm focussing on the controls, aiming at a mouse only controlable game, but adding optional keys for movement. I think point 'n' click controls are what I'll use in the end.
But first there's a lot of stuff to code for the first level and I need to find ways to wire things in the game (like alarms and lights) to create an working environment.
If that proves to be "fun", more things can be added for the later levels (guards, cameras, more types of alarms and security).

nGFX

Happy Halloween

Have a scary one kids, and to get you in the mood, imagine how much you'd pap your pants in this situation.

 

 

Squize.