Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

About this blog

My first step into developing 3D games

Entries in this blog


Beta Release!

Click to go to Beta Release Topic

Well, after two weeks of working and learning and trial/error, I've got what I believe is suitable for a BETA release! The game is intentionally simplistic; even having my own dreams of the next great MMORPG, I realize and respect the concept of biting off more than one can chew, lol. I felt this was both realistic yet large enough endeavor for one person to be a great first step. As simple as it is, I feel like it's a huge accomplishment, and it's a good sense of pride knowing that I took something small and am accomplishing it (rather than taking something large and only accomplishing .01% of it.)

I will keep working on it, fixing all bugs, and adding small features here and there until I feel it's worthy of being more than a WIP/Beta.

Who knows, I might even eventually earn the right to call myself a "Game Developer". ^_^




Models added, collision detection improved and new bug...

After a days worth of trial and error, I've taught myself enough to rig/animate my zombie model, and let him animate and move in game! Also, my collision detection has been fixed, and the zombies no longer walk over one another. Initial pistol model is in place with a simple particle system for the flash.

One major thing to correct for... On collision, enemies tend to bounce into the air. Probably an easy fix.

After that, it'll be GUI, SFX, and menu screens. Then first version will be complete.




Graphical Upgrade to Onslaught

Yesterday I went ahead and added most of the starter graphics to the game. My floor and walls are now textured to fit the basic theme of the game. The zombie mesh is working appropriately (Was having trouble recognizing when it had been shot and was suppose to die). I removed the bullet model. Never really had any intentions of using it, but figured it was a good first step to using models, lol

My next goals:
--Make basic walking and attacking animations for the enemies.
--Fix the collision and AI so enemies don't overlap or "walk through" one another.
--Basic GUI (Timer, Enemies Killed, Health)
--Game Over condition.

Will make another entry as those are accomplished.





This journal will outline the process of making the first steps into 3d gaming, using Unity3D. I've decided upon a project I've entitled, "Onslaught."

The premise is simple: The player will be placed in the center of an inescapable arena, where he will face enemies that are endlessly spawned from one of four entry-ways. The object will be to survive for as long a period of time as possible. As the project progresses, I will undoubtedly decide to add random features to the game, such as multiple weapons, multiple enemies, pick-ups, so forth.

Something I feel must be clarified: This project is a learning experience, first and foremost. As such, this journal isn't so much to display some great work, but more for journaling and sharing with you my personal accomplishments. Feel free to leave your comments and criticisms. Now, onto the project:

I began by using some of Unity's primitive GameObjects (Cube, Sphere & Cylinder) to prefab fillers for my games key components (enemy, walls, entry ways). I then developed a stand in object for the player, and basic movement script. Testing this, everything was fine. All colliders and rigidbodies in place, time to start some very primitive AI (if you would even call it that)...

Pretty easy, using Unity's LookAt() and transform.Translate() functions, enemies will face me, and move forward. Test it out, works fine. ((Unfortunately, Translate() ignores colliders and rigidbodies--at least dynamic ones--so I'll have to deal with that... a little later)). I make a small sphere to stand in as a bullet that destroys itself upon collision or 1 second (whichever's first), and going back to the enemy AI scripts, when triggered by colliding with the bullet, the object deactivates it's full body collider, all of the bodies separate segments switch their rigidbodies to non-kinematic and add a small explosive force. After 2 seconds, the object destroys itself. To test this out, I add a small "shoot" script to my player that instances a bullet when the space bar is pressed. The bullet, having a constant force in the direction faced by the player, is shot. Start the scene, shoot the nearest enemy coming toward me, presto! He falls to pieces and disappears.

Next step, instancing enemies through the doorway. This is my first real task, as I've never done this. I attach a script to the entry way specifically for spawning enemies that uses the Instantiate function to place one at the same space as the entryway. Test it out, and poof, an enemy in each entry way seeking me out. So, going back to the EnemyAI, on they're death, using an array and for() loop, each entry way spawns a new enemy. And here, I reach a conundrum... Killing one enemy, spawns four, and I'm quickly filling the arena up with enemies. Furthermore, with the Translate() function used to move enemies ignoring dynamic colliders, enemies are occupying the same space, making a single bullet kill two or three enemies at once, spawning 3 enemies at each entry way, already occupying the same space...

First, to eliminate the mass amounts of enemies, a static variable in my spawner script, to limit the max enemies. A simple if() statement maxes out the amount of enemies that will be spawned at any one time. ((Here I messed up and forgot to decrease the enemy amount when one's killed, quickly fixed that.)) That still left me with them being spawned on top of one another being an issue. After a little reading on the RayCast() function and some testing, I used the function to detect for enemies within a reasonable distance of the entry way, only instancing if the result came back false.

At this point, everything is working within reason (except for enemies moving over one another). Just to put that off slightly longer, I replaced the sphere I'd been using for a bullet, with an actual bullet model. Importing the accompanying empty casing model and coupling an Instantiate() and AddForce() call into the shooting script, a real bullet is shot, and a shell casing ejected. Here, I deleted the cube/cylinder/sphere model used for the player and for the time being am simply a floating entity.

Enter, Bob... Using the same skills learned by adding the bullet and shell casing models to the game, I chose a zombie model to use as my basic enemy. It should be noted hat the model is not animated or rigged (when you download free models, you get what you pay for.)

And now... you're up to date. I personally don't think that's bad for a day's worth of work doing something one's never done before. Before I go any further, I'm going to correct my code to prevent enemies from occupying the same space. Will add another entry at that point.



Sign in to follow this  
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!