My First Game

61 views
Skip to first unread message

Denman Rooke

unread,
Feb 28, 2014, 9:08:05 AM2/28/14
to one-game-a-...@googlegroups.com
So I've got the early baby steps of a game together. And since I've had no programming or Unity knowledge in the past, getting these simple things to work is pretty exciting.

Figured I'd post the progress as it goes along (and ask for advice & tips!). 

So far, I've just got the camera basic rigging setup for an isometric style game.

Controls: 
 - Panning: Left Click and Hold - and hit the edges to do precise panning. Or use the arrow keys for basic panning.
 - Zoom: the scroll wheel.


Next steps:
 - Fix the Middle Click far-out zoom bug.
 - Adding & Finessing the camera boundaries
 - Adding Right Click & Drag Panning
 - Adding mobile touch Zoom with Pinch & Two Finger Swipe for Panning

Any thoughts and ideas are more than welcome! :)

Paul Dolan

unread,
Feb 28, 2014, 4:46:32 PM2/28/14
to one-game-a-...@googlegroups.com
Performs exactly as described! 

Super excited to see your next steps

-Paul

Denman Rooke

unread,
Mar 1, 2014, 4:42:54 PM3/1/14
to one-game-a-...@googlegroups.com
Thanks Paul!

Denman Rooke

unread,
Mar 2, 2014, 11:58:04 AM3/2/14
to one-game-a-...@googlegroups.com
Here's a link to the Repo, (not sure if that's a normal thing to share, but ah well). 

Do you guys follow and watch on GitHub similar to other social networks? I'm new to GitHub, but it seems like that's a thing :)


On Friday, 28 February 2014 14:08:05 UTC, Denman Rooke wrote:

Denman Rooke

unread,
Mar 6, 2014, 5:03:54 AM3/6/14
to one-game-a-...@googlegroups.com
So last week was messing with camera movement. Last night I switched gears and played around with character movement and such. Arrow keys move, space jumps (and unintentionally makes you fly if you press it over and over). Need to play with the shadow under the sprite as it's hard to see his placement in the world.


Next steps:
 - Add character shadow
 - Limit jump
 - Play with sprite animation system

On Friday, 28 February 2014 14:08:05 UTC, Denman Rooke wrote:

Paul Dolan

unread,
Mar 6, 2014, 5:41:03 AM3/6/14
to one-game-a-...@googlegroups.com

Man, so much progress so fast! Looking great :)  Agree with the shadow, going under the floating block is a bit jarring without it using the orthogonal camera.

Can't wait for next update!

Denman Rooke

unread,
Mar 7, 2014, 3:34:05 AM3/7/14
to one-game-a-...@googlegroups.com
Thanks Paul!

Got a faux shadow in via projector last night... still trying to figure out how to limit that jump script.
I need to make the rigidbody know it's grounded somehow to prevent the additive jumps (fly).. will take some googling tonight.

Denman Rooke

unread,
Mar 7, 2014, 10:05:42 PM3/7/14
to one-game-a-...@googlegroups.com
The latest!

Main improvement is the limit on the jumping. (fixed it by using a combo of collision detection and ray casting to determine if the rigidbody was grounded)


As you can see, I'm playing with the choice of whether to limit change of direction while in mid-jump... not sure if i like it. Could make for an interesting mechanic, or could just be completely annoying. At any rate would need to be designed in the levels. This test level is very poor for starters.

My main issue with the NoMoveJump version is that I've had to change the movement of the character from transform.position to rigidbody.addForce... however, I'm having trouble figuring out how to Mathf.clamp the rigidbody.velocity... any of you guys have experience in that?

Also, as you notice, the character kinda gets stuck (and shakes) on the sides of the cubes as you moving into them, do you guys know why that's happening? I'm guessing it has something to do with the transform.position forcing itself into the colliders? i don't really know.

Paul Dolan

unread,
Mar 9, 2014, 4:44:34 PM3/9/14
to one-game-a-...@googlegroups.com
Looking good Dedman! I *think* I prefer the ability to change direction while mid-jump - agree that the level design would definitely drive this decision, as well as how high you'd make the jump. Methinks smaller jumps lend themselves more to fixed/non mid-air update jumps.

With regards the stuck/shakes issues you've having - at a guess you're probably trying to apply your transform.position changes within an Update() function directly which is conflicting with the Unity physics simulations controlling collisions, forces (gravity/jumps etc.) - without getting too much into it (I'm sure there are much better explanations then any I could give!) you want to keep your Update() function for handling user input (the frequency the Update() function is called can vary depending on the current execution environment)  and FixedUpdate() for handling the application of physics events i.e. addition of force (FixedUpdate() is called after every simulation "tick" at an interval specified by Unity [or overridden by the dev!] - directly affecting the number of simulation updates per second).  So yes, by the sounds of it your transform.position is forcing the colliders through each other causing them to constantly shake between the transform and the push-back of the collision.

With regards using Mathf.clamp on your character rigidbody while applying forces, I recommend you sidestep that approach and try implement everything within the Physics simulation - varying the type of force being applied, fiddling with the mass/drag etc. Trying to override these mechanisms using transforms/clamps within the Update() cycle is asking for issues (from my limited experience!)

As an aside, I don't believe you should need to resort to ray-casting in this instance - you could probably just use a small collider under your character, and make it a trigger. Then use this trigger to update an "isGrounded" boolean using the OnTriggerEnter() and OnTriggerExit() functions. I guess in my mind, ray-casting is a concept that can come a little later in the Unity learning adventure - can't argue with results though!

Hope this helps! 

-Paul

Denman Rooke

unread,
Mar 10, 2014, 10:44:13 AM3/10/14
to one-game-a-...@googlegroups.com
Wow thanks a ton Paul. Honestly i had no idea what the different functions did (Start, Update, FixedUpdate... etc.). So that's immensely helpful.

I managed to get the Mathf clamps to work with the velocity, but I might play with the mass drag stuff as well, as i haven't played with that at all yet.

And i think you're right about the ray casting as well... I think currently I'm having a bug, where it triggers my isGrounded bool when you jump, but fails to trigger it when falling off a ledge (probably because ray casting doesn't have an OnExit function? i dont know, but that's my guess). the use of the trigger collider and the enter and exit, will probably solve that. will check it out tonight.

once again, thanks a ton for the help.

Here's where it's at currently.

Denman Rooke

unread,
Mar 11, 2014, 8:24:20 PM3/11/14
to one-game-a-...@googlegroups.com
Here's the progress so far... not much of any game yet, but that will come soon! at least a simple win and death functionality of sorts to start with.


Paul, that simplification idea away from RayCasting was a life saver! I changed it to the collider, and it worked waaaayyyy better. Cheers for that.

I've also added some nice touches like Camera Lerping on the Y axis when landing. Some nice atmospheric fog to help with the orthographic depth. And last, my favorite, making elements fade when the character goes behind them.

Thanks all for the help! ONWARD!

Paul Dolan

unread,
Mar 12, 2014, 6:20:53 AM3/12/14
to one-game-a-...@googlegroups.com
LOVE the transparency - and the camera movement.

How are you identifying the elements to fade? - using rays to identify colliders between player and camera?

Denman Rooke

unread,
Mar 12, 2014, 6:53:16 AM3/12/14
to one-game-a-...@googlegroups.com
Thanks! It is awesome isn't it. It's some code i found through googling (Should probably remember the guy's name or something)... but ya, your spot on. It's a raycast to determine if there's any element between the camera and the player's character, then it changes that object's shader into a Transparent/Diffuse... here's the code. https://github.com/SylvanRover/Longstone/blob/master/Assets/ClearSight.cs

Colm Larkin

unread,
Mar 12, 2014, 1:33:48 PM3/12/14
to Denman Rooke, one-game-a-...@googlegroups.com
Yep Chrome on a mac. I just tried Safari and same issue so maybe it's my version of the unity web player: 4.3.5f1


On Wed, Mar 12, 2014 at 5:20 PM, Denman Rooke <con...@denmanrooke.com> wrote:
Thanks for pointing it out. Are you on a Mac? does that make a difference?... hmmmm.... shit. seems to be rendering the fog everywhere.... I'll have to check that out. I've got it set to a linear fog between 0.02 and 0.04 for the ortho camera, if anyone knows more about that fog rendering stuff than i do (cause i don't know much about it at all).


On 12 March 2014 17:15, Colm Larkin <co...@gambrinous.com> wrote:
I'm only seeing this when I start the game... (on Chrome)

Inline image 1

Denman Rooke

unread,
Mar 12, 2014, 1:20:17 PM3/12/14
to Colm Larkin, one-game-a-...@googlegroups.com
Thanks for pointing it out. Are you on a Mac? does that make a difference?... hmmmm.... shit. seems to be rendering the fog everywhere.... I'll have to check that out. I've got it set to a linear fog between 0.02 and 0.04 for the ortho camera, if anyone knows more about that fog rendering stuff than i do (cause i don't know much about it at all).
On 12 March 2014 17:15, Colm Larkin <co...@gambrinous.com> wrote:
I'm only seeing this when I start the game... (on Chrome)

Inline image 1
On Wed, Mar 12, 2014 at 10:53 AM, Denman Rooke <con...@denmanrooke.com> wrote:

Colm Larkin

unread,
Mar 12, 2014, 1:15:08 PM3/12/14
to Denman Rooke, one-game-a-...@googlegroups.com
I'm only seeing this when I start the game... (on Chrome)

Inline image 1
On Wed, Mar 12, 2014 at 10:53 AM, Denman Rooke <con...@denmanrooke.com> wrote:
Reply all
Reply to author
Forward
0 new messages