Monthly Archives: September 2013

Formations #2

 

The past week and weekend was spent on formations. Its funny because a while back I was worried about the math (with me not being great in matH0 involved and the specifics of ships forming up, but that aspect turned out to be very easy. The harder aspect became management, leaving a formation, creating a new leader, etc etc.

This aspect became very complicated – because there are many ways that a ship leaves a formation. Though dying, through being promoted to a leader (at which point the ship isn’t [in code] a part of a formation), when a formation “rebalances” itself (meaning that ships re-organize themselves to be closer to proper [nearest] formation positions) ships can leave and then rejoin a formation.  Because the code wasn’t all the way thought out (my bad) this led to infinite loops. A few bits of code later they went away. The GUI and how formations worked on that side also took a bit of thought and doing – but overall things work. What’s left is having formations save/load across games, cleanups and a lot of tests. I’m a bit afraid that Iteration 18 will be fairly buggy.

Now that formations are soon to be mostly completed, this will allow for a across the board AI improvements, since formations are going to be a big part, AI is basically mostly completed as far as major features. The future goal will be to make it more obedient.

Almost forgot – another item added is “SPROG” fire mode – it is an add-on to turret/weapon control in Command mode – with it you can control all turrets in a formation from the lead ship’s Command mode – making an overwhelming amounts of firepower directed at the player’s cursor possible. It is funny because I’m not sure how useful of a feature this is – but I’m sure that its cool and unique.

 

 

 

Gates and Formations

Early this week – I focused on some bug fixes and improvements to the “gate exit” system. Strangely a bug cropped up on the new content map, where a ship (often though not always) wouldn’t exit the gate properly – and it would slowly drift towards the exit and thus hold up other ships in line or worse yet, be smacked into by new ships traveling through the gate at high velocity – sending them far off into space due to the collision.

Though fixed – I’m still not sure what the issue is/was. Seems like a timing glitch because I couldn’t track it down and in debug mode things worked fine (making finding the problem – much more difficult). Still in trying to fix the bug I did some nice improvements to the gate exit system. There is still a ways to go – most importantly getting ships out of gates faster, right now it is a one at a time affair. Improving just slightly would yield good results – since two at a time would be twice as fast :)

Post that I did some more work towards the new story content, the main result is that I need more art assets, the map is a bit too boring. Speaking of art assets – I got a few very important pieces in, and with them a new type of in game object – the “other” object. The other type of object – doesn’t do anything, but often it is important to have objects that don’t do anything, that you can link to objectives. In this case it is the destroy objective.

I was actually planning on releasing the story content sooner than working on formations, but while waiting for the new assets I decided to start work on the formation system. I wanted to do something major – and I’ve been battling burn out so this felt like a great fit.

It is in a barely functional state. Overall the hard part is done – the formations themselves. There is the line, the wedge, the V (reverse of a wedge), the X, the claw (X with ships being positioned forward in space relative to other ships) and the wall. The wall is actually an X formation combined with a “cross” formation. So post fiddling with the X code adding the wall formation code was very easy :) There will be some other formations in as well in the future.

There is another formation called the “custom” – which is basically – whatever the positions the ships are in at the time of creating the formation.So if you setup a ship formation manually they’ll maintain that shape if you move the leader. This will eventually turn into – editing the formation in 3D, which I haven’t seen as a feature before in a RTS/space sim so I hope that system is another “oh cool! I always wanted that!” type of a feature in Void Destroyer.

In the beginning of formations – ships bumped into each other – all the damned time. One solution was to intelligently have ships go to formation positions (via a simple – who is nearest loop). Another solution was improved collision detection/avoidance in the “thrust to position” AI. When I added the “thrust to position” AI – I knew eventually I’d use it for formations, and here we are. They “sort of ok” go to their positions now, still needs improvement which will help the AI overall.

To create the formations layouts/positioning I had to do some math figuring out odds/evens and multiples. It wasn’t too bad (I thought it would be harder), but I’m sure someone actually good at math would have done this so much faster than it took me.

Lots of work to do – and lots of little things which means lots of motivation and easy pickings ahead of me during the week days. I plan on putting in lots of neat standard and unique formation related features.

Mice, burnout and mines

That’s about the order of things. Last Monday was Labor Day – a holiday in the US. I spent it finalizing the mouse changes, packaging new installers and creating marketing videos. The goal being to get more Steam Greenlight votes – (PS: If you haven’t voted – please do so: http://steamcommunity.com/sharedfiles/filedetails/?id=146068036 ). I told my wife how thankful I was for the extra weekend day and most likely without it what I accomplished on Monday would have taken me till Friday.

As usual post a release I was burned out and this stretched into the weekend. Still I started working on new story content and have made pretty good progress and am excited. I don’t want to reveal too much but the new leg of the content involves mines. So I spent time giving the ability for defensive platforms to generate mine fields. Meaning that they have a mine quota, that they will maintain and keep track off. Also the mine launchers now can be configured with additional parameters. An additional velocity and angle of launch, allowing for random angles and speeds. The end result is mine fields.

 

 

Happenings

The goal of this week was to “overhaul” the mouse system. Meaning that I would scrap the old code and start fresh. I tried this several times and went back to a backup file of the source code dealing with mouse control.

Finally I realized that – I would be creating a nightmare scenario. The code is extremely complex, most of it is my fault – in terms of choosing such a design where the player can control the game via joystick, mouse for maneuvering, mouse for camera, mouse for GUI, in multiple views and even a RTS interface. So the code is complex because it needs to be complex, and since it mostly works (its just a pain to work with) I decided to leave it along. I did simplify a bit of old code via deleting and got rid of some redundant code via merging/re-use so I guess there was a – ever so tiny – overhaul.

The goal of the overhaul was to simplify the code so that adding in new features would be easier, now that the overhaul was a bust I still wanted to add the new features. For the most part I’m very pleased. The mouse maneuver code now has added functionality where the “maneuver cursor” returns back to the “dead zone” – which is an area of the screen (at the center) where the mouse doesn’t have an impact on the ship’s rotation - the ship moves forward. This allows for the dead zone to be much smaller since there is assistance in hitting it, thus allowing for greater precision in flight. Making mouse flight much improved. It feels better, I enjoyed a few rounds of the simple dogfight instant action scenario.

Next up was something a bit more complex – “mouse look to turn” and the ability to manually steer in command mode. To recap – command mode has a “turn to” and “go to” commands. Allowing for the player to issue orders on where to go, but I wanted a manual mode as well. This works now, though I stumbled for a moment wanting to change the command mode camera to eliminate the effect of the attached to ship’s roll. I wanted to eliminate roll because when the ship rolls the camera inherits the roll and thus can feel wild as it changes orientation without the player’s input. Sadly the camera system fought this and I decided to let it go for now. Once I moved on from that aspect the mouse look to turn was quickly added – and I really like it. Although command mode is intended for large ships – there is a sort of a “complex” dogfight mode in there as well with lots of interesting options for the player on how to fly and maneuver. Still this works best for ships with turrets due to the freely rotating/orbiting aspect of the command camera.

Next up was putting in a “mouse look to turn” mode in first and chase person cameras. Works pretty well though I’m a bit disappointed at the end result – its not as good as I imagined it. Though I think some players will prefer it to the “mouse turn” to maneuver mode. The difference is this: mouse turn to maneuver – the camera is attached to the ship’s front, the ship chases the mouse maneuver arrow that the player moves and the attached camera moves with the ship. In “mouse look” to maneuver – the camera can freely turn – without having the ship turn – and the ship chases the center point of the camera. So – the difference is that in mouse look – the player looks at the target or turn to point (like in a first person shooter game) and the ship rotates to achieve that heading. I’m a bit disappointed with it, because it isn’t as “efficient” as “mouse turn” – which feels more “in control” and “responsive” – still this is the first iteration that this feature  is fully in (years ago I had a more basic functionality like this – when I first put in turrets) so we’ll only improve it from here on out.