New Levels and Bug Fixes for Piggy Chase

In preparation for submitting my game, Piggy Chase, for Magfest, I’ve been doing a bunch of work on the game. I’ve fixed some of the AI bugs (like animals floating up in the air on hills?!) and changed the control scheme to be more user friendly. Additionally, I added two new levels! I am hoping to have 10 levels — so only 6 more to go before I go for a release.

Now I have a tutorial level, a farm level, a city level, and a snow level. The farm level has the animals dodging tractors while the city involves lots of traffic. The Snow level has bad snow man that patrol perilously narrow ice platforms. I also have a Bowser’s Castle-style level in the works with lava and spikes–but it’s not ready yet so it isn’t in the video.

lavalevel

At the moment it’s basically a deceptively simple looking happy silly animal frogger game that actually is a pretty hard timing/reflex based game underneath. It’s pretty unfair and unbalanced right now and I think one would have to be really skilled to get all the animals to survive in the end. Part of me thinks I should scale back the difficulty or add  in lives to allow players to sort of pick up where they die. I could also have animals respawn, so if you are really into completing a level you could go back and get everyone. I was also thinking about puzzle elements beyond the maze and timing elements, but I don’t want to spoil the formula that I have so far.

Working on a 3D A* algorithm for Embers of Empire

It’s been a bit of gap since my last post and that’s not for want of doing gamedev! I’ve been working on completing a Web Developer program over the last 6 months so I generally have not had much head space to work in Unity and C#. I have become a better programmer, however, and hope that I can apply some of the things I’ve learned to my gamedev sideprojects.

(Sorry if I am talking too quietly on video – everyone was asleep in my house!)

Recently I been working on Data Structures and Sorting Algorithms and it made me think back to my pathfinding problems I was working on last fall. Getting a better understanding of algorithms made me want to tackle A* and see if I could create a version adapted to a 3D space game without grinding the framerate to a halt. If I can get it to  work, I can get my AI to navigate the giant Ember ships during dogfights much more convincingly. One challenge is the A* complexity increases as you add a 3rd dimension since you go from testing 8 neighbor nodes per pass to testing 26! Not to mention the vast playing field makes the grid huge!

A couple things I am doing- AI ships will still do some Raycasting to see if they just have a clear shot to their target. If they get too close to an obstacle and its in the way they ask the A* pathfinder to find a path.

I plan to add a way to check if the path brings the ship to an open shot to the target early thus they can abandon the path. Also I could figure out a test that determines if a pathfinding can end at an early node because that node has line of sight. This will cut down on lots of searches when an AI is just jumping around one asteroid. I also want to add a way to cancel a path if the target moves into the open, etc.

Additionally, I may tap Unity’s job system to let a new thread handle the pathfinding to keep the program from stuttering as it calculates. I figure paths could be generated async with far enough lead time that the ship wont crash.

Embers of Empire Update – AI Dynamic Navmesh / A Star Experiments

screen_12.08077

Ever since this summer I’ve been struggle to make my AI better. I have Behavior Trees in and really easy to debug logic now, but the path finding has become an issue. The AI stumbled across the age old robotics problem of escaping a concave obstacle. I added a big derelict alien space craft that is integral to the story and a super cool set piece to fight around and explore, but the AI acts like an idiot ramming itself into the structure with the current avoidance AI. The current avoidance works ok for smaller obstacles but when things go on for miles in one direction, path finding seems to be necessary. So, off to AI school I go again.

I looked into the new dynamic navmesh for Unity and its ability to be created on surfaces that don’t necessarily have to be horizontal. I thought I came up with a good hack, but it still doesn’t always work, and the dynamic building of individual navmeshes for lots of ships is going to be a problem when battles scale up. In the video below the agent doesn’t change its angle much, even tho I programmed it to do it and it was doing it a week ago… A great demonstration of how hacky and unreliable it is. It was an exciting idea tho, especially given all the off the shelf stuff you can use with the navmesh like steering and formations. Too bad..

Since I don’t really like how the navmesh system fails a lot and building the navmesh over and over is necessary and slow because you need to keep orienting the plane in different directions so the ship can move in 3D, I decided to start looking into other stuff. 3D A* was an obvious place to go, but A* is not super fast-especially in 3D over great distances. So, I am looking at a Jump Point A* where you can have a mesh of nodes, but you don’t have to traverse symetrical nodes and you can jump to ones where you need to make a decision. I am thinking of it as like a line of site type thing. If you don’t have a direct shot to the target, traverse through nav nodes that connect to create a clear path.

Currently I am working on ways of generating efficient node maps of my levels. I am thinking of using non-uniform cubes represented by a bounds object at runtime. When baking the navmesh info, the cube might start very big like 1km in volume and if it detects a collider within it, it will break into small cubes that test for colliders until you have some areas with finer navmesh data. This way the empty areas of the map would have fewer navnodes to traverse, but when a ship gets in close to an object they need to path find around the nav data will be more refined. This of course sounds great on paper, but I need to make sure I can generate such a thing without locking up Unity or making the player wait an hour for the next scene to load. If it works I think I can add some very cinematic dog fights and ship battles with the small craft dodging and weaving in and out of complex space stations or between capital ships.

Space Warfare: Infinite April Developer Log

April has been a busy month!  I’ve been putting in a lot of hours bringing the game back to demo level with the new graphics and the new code spurred on by some good pressure due to awesome interview with Fists of Heaven and a video chat with  ThatCooperFellow. In retrospect, the whole year has been rather busy if I think back on it…. here are some things I’ve been up to…

Lasers, missiles, explosions!

Lasers, missiles, explosions!

Since last year, I’ve:

  • rewritten a lot of the ship components – making the engines and maneuvering more realistic and customizable to work on all different ships,
  • made more complex AI with goal setting and steering,
  • implemented some moving origin capabilities to make the battlefields more expansive and allow for some seamless travel – still WIP,
  • created the beginnings of a procedural galaxy generator that builds different galaxies and nebula and plots planet locations as well as assigning star types, planet types-based on distance from the star etc- and other details,screen_7.920277
  • created some new nebula types that can be randomized and colorized for more variation
  • created and found some procedural substance textures for planets that work with Unity5 lighting and can be randomized for variation through the galaxy generator
  • built a few new HDR space skyboxes
  • made new cap ship models that should lend themselves to part swapping to make more type variations (more to come),
  • new beam weapons and missiles,
  • more complex turret AI that takes orders from its main ship AI to focus fire, target certain types or even fire at any targets of opportunity,
  • more complex explosions that have multiple stages for bigger ships (still wip but already looking pretty cool)
  • implemented a new radar and target tracking system connected it to the AI
  • targeting now seamless allows for targeting whole ships or component pieces
  • targeting all based on factions and classes instead of unity tags – more complex relationships and more advanced decision making for AI
  • there is a new mission / battle editor that I worked on over the summer too – something I need to start revisiting soon.screen_46.13708

Here is a recent video of some of the dogfighting action (hoping to get a cap ship video up soon too!)

Making a Space Game with Unity and Blender: Modeling Space ships and Sci-Fi Interiors

Welcome to the first in hopefully a series on making a space game. For some time I’ve been thinking of creating blog posts and videos about how I am creating Space Warfare: Infinite and creating a resource for other aspiring developers. I’ve been messing around with programming games since I was 11, but I am completely self taught so I never feel like an expert enough to really tell people how to do stuff in this world. However, I do lots of research and have been collecting lots of resources. So while I might post some vids / tuts on how I did things, I also want to share some places I found helpful. Below are a number of videos on how to model sci-fi scenes, space ships, and other related things. I am storing them here for myself and my own work as well as for you!

Blender Specific Videos

Space Ship Creation in Blender Tutorials

Hull Plate Tutorial from Daniel Brown on Vimeo.

Interiors, etc

Blocking out – Design Videos – Not Blender Specific

The video above does not use Blender, but watching how he designs and his commentary is really cool for your process. No matter what software is used or what language, you can always learn from people who know what they are doing and then try to apply that learning to your own world. So don’t only look at Blender or Unity tutorials when you can apply overall concepts.

Reference and Idea Videos

Blender Artists Giant Spaceship Thread…

Random Spacey Stuff

Developer Log – Building my own galaxy

All week – during my snow days! – I have been working on procedurally generating the galaxy for Space Warfare – Infinite. I have been researching a lot on the old Elite as well as my Traveler RPG core rule book to help inspire me through it. I’m also using some complicated math to generate the galaxy shape. Essentially the galaxy generates and determines what sort of stars are Red, White, Yellow or Blue as well as their sizes. Then it determines how many planets they have. When you investigate an individual star system, the game runs some code to figure out what planets are their and what their characteristics are.

screen_16.33853

Here I’ve got the stars being generate and each star is a star system with a number of generated planets. The big grid sphere is my work on picking areas for various factions to control so in the one pick there is a blue faction and a yellow faction. The control spreads just out of the sphere to directly linked systems. The control zone is within a certain radius of the home star. Faction areas will name their systems with their own naming conventions – either different influences for human factions or alien languages for those factions. Also from here I can catalog the resources from each planet and determine the strength of the factions to give them bases and fleets etc. Taking over a new system would mean adding to that strength later in the game. 

screen_54.12553On the top left you can see my simple read out of planet info for the selected star. It’s not super formatted for the players yet. I just wanted to get the info out so I could see what was happening. screen_67.16019

I still have to work on nebula regions and adding more detail to the star systems like asteroid fields and things. Once those are in, the galaxy generator will be hooked up to the actual game engine and generate the star system the player is in on the fly. Then players will be able to FTL jump to other systems as well. Below is a shot of the Galaxy map projected on the UI so the player can pick a place to jump to.

screen_67.58907

Dev Log: Bigger System Maps, New Procedural Generation Work

screen_121.3082I’ve spent most of my time lately reworking the way the game builds the galaxy, solar systems and local regions where the combat takes place. Just about got floating origin working so that the game can support battles over a solar system without having to jump between points of interest in separate zones. Also worked it out so planets and other big objects can be approached and not be background. Space stations or entire fleets could be on the other side of a big object and the system will handle switching everything from 3d skybox to real stuff to interact with. Also I am messing around with some art like this space station mock up. Its not a final piece, just something I through together to see wh
at it looks like in game.

Laser Star – 3D Voxel Space Shoot ‘Em Up for the #indiesvsgames GameJam

Great productive game jam weekend! I really enjoyed making and playing Laser Star. The theme was ‘arcade’ and I think I captured that! It has a lot of challenge and style for something made over the course of three days (while still managing to hang with friends most of Friday night, and most of the day on Saturday.)

Premise: Galaga vs. Voxel Art Games vs. Infinite Runner

PLAY!

Play it here…  (WebGL version but it doesn’t have the score board)

Play in on GameJolt (compete for the top score and vote for me in the gamejam – uses FLASH….)

Screen Shot 2015-07-20 at 11.44.20 AM

An homage to Galaga with style that reflects some of today’s games. Obviously the graphics are made using the same tools as Crossy Road and its millions of copycats. The perspective of the game was shifted to an above and behind the ship which gives it an infinite runner feel. The alien patterns are inspired by Galaga, but I never did get to creating a large block formation where the enemy can be hit easier…

Screen Shot 2015-07-20 at 11.43.15 AM

Features:

The game is infinite as far as I can tell, I set it up to continue indefinitely and increase in speed for later iterations. Stage types will cycle as the speed increases.

There are about 7 stages with different make ups of enemies. There is an asteroid stage as well.

There are a number of enemies with unique patterns and abilities.

There are power ups which increase your lasers.

There are extra life bonuses for high score milestones up to 1,000,000 points.

Sounds were all made in BFXR.

3D models were all made in Qbicle.

Gameplay Video:

Developer Log #2 – Creating a Mission Editor for Space Warfare: Infinite

I’ve been hacking away at a less fun and visually unimpressive part of the game idea for Space Warfare: Infinite — the Editor. The mission editor will hopefully be one thing to help set the game apart. As a gamer, the one thing I’ve always loved is being able to create my own game maps and play them. I made my own text adventures, had 3D Studio, I made stuff with the DEU – Doom Editing Utility, tried my hand making Unreal Tournament levels, made my own Starcraft maps. My hope is that this will be a feature that will attract an audience. I call it a Mission Editor, but the scope is going to be more than that. When its complete the player or me (I plan on using this to build the entire campaign mode of the game….) will be able to create simple battles, missions with objectives that range from patrol and fight pirates to a scripted battle between two giant fleets complete with dialogue and cutscenes.

Screen Shot 2015-07-07 at 9.15.31 PM

Features I am currently coding:

  • Place ships, stations and other objects on a 3D map.
  • Select a setting including naming the sector, adding planets, nebula/other background art, asteroids. Setting space dust/nebular clouds.
  • Place nav points and waypoints.
  • Trigger and Event Scripting – Trigger events like spawning new ships, winning a mission when ships are destroyed / navpoints reached, displaying a comm message etc.
  • Mission set up – Briefings, objectives, Debriefing, Success / Failure
  • Camera control for cinematic cut scenes
  • Campaign Editor – Connect missions together into a full game sequence – with ability to connect missions based on success / failure or other triggers

Currently, I have the XML backend working pretty well. You can move around the 3D map, place and manipulate ships. I have mission set up in and saving to a file. I have extendable menus for objects to place on the map as well as extendable lists of events and triggers. I am in the process of solidifying the events and triggers stuff and getting it to save to the XML. After that I am gonna jump back into the engine and make sure it plays nice and decodes some sample missions. I also have a mock up of the setting editor…

Planned / Stretch Features:

  • Ship yard editor – Customize, edit existing ships or other objects. Change default load-outs etc. Build new ships from component parts and add them to the game for user-created campaigns. (Customizing ship data will be available in xml no matter what… ). Something like this will be useful for my own dev so I might make something like this part of the initial tool set. At least to set up different specialized ships so I don’t have to dig through XML files.
    Unity is tough to mod for. I am looking at way to import user generated models for ships etc, but at the moment the moment it’s looking complicated. I have some ideas, but I can’t focus on it just now. On the flip side, modeling component based ships is already happening so adding a build-your-own based on my already modeled ship pieces might be simpler. I might even add some Star Trek / Star Wars -inspired hull styles etc, so that players can design their own styles.
  • System Map Editor – Like the campaign editor but missions would stand in as maps, they would be connected by triggers like reaching a nav point in a warp to bring you to the connected map.

 

Developer Log #1- Modeling The Fleet in Space Warfare: Infinite

Over the last few weeks I’ve been trying to limit my programming time to focus on 3D modeling. I find switching between Unity and Blender to be difficult, so just working on making stuff in Blender has helped my productivity in creating new art assets for the game.

Sketching and modeling in Blender.

Sketching and modeling in Blender.

I have a list of space ships that need to be made and I’ve been working through it. I am almost ‘done’ one faction’s main ships. I still need to model a new fighter–and I might do a 3D cockpit while I am at it. Keep in mind nothing is really done. Everything is WIP. I’ve haven’t quite gotten my skills yet for painting textures and generating bump maps so there is still more work to be done. Also, as time goes on, these early models might need to be redone if I get better.

A new battlecruiser - 1 kilometer of destruction.

A new battlecruiser – 1 kilometer of destruction.

Above is the battlecruiser. Its basically the battleship class of the space fleet. For some reason I can’t use battleship. The ISC ships are going to be more boxy like current military ships and tanks. The other faction will have more sloped / angular plates on their ships.

screen_64.67316

Huge carrier ship capable of launching fighters and corvettes from those two bays in the front.

This is the carrier ship. It will have some point defense turrets on it, but other than that it will rely on its fleet and fighter squadrons to defend it. The carrier is also big enough to launch corvettes which will be used as anti-fighter type ships.

screen_67.37792

The corvette. A ‘small’ ship.

The corvette is the latest model I’ve made. Its meant to take on small missions and has weapons geared more towards fighter management or hit and runs on capital ships. The ship is fast but would probably get eaten up if it tried to go head to head with ships of the line.

The Destroyer-class. This ship is 500m long. Its got around 8 turrets mean for engaging other cap ships and point defense. It has a deck mounted rail gun and an  internal beam weapon.

The Destroyer-class. This ship is 500m long. Its got around 8 turrets mean for engaging other cap ships and point defense. It has a deck mounted rail gun and an internal beam weapon.

The Destroyer will be the workhorse of the fleet. The cruiser is a force to be reckoned with but these destroyers will pack a punch. A couple destroyers can take out a cruiser pretty fast.

Very early space station.

Very early space station.

After these, I plan to remake the fighter and then start on the enemy faction. I also have dreadnoughts on my list as well. They’d probably be 2km. Additionally, I started messing with Space Stations.

Here is a video where I talk about the ships and compare their sizes…