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

About this blog

Adventures in game making

Entries in this blog

 

Missile Command, Part 1

I'll follow this up with a more verbose post with pictures and links, but I figured I'd start things out. So for the Missile Command challenge, I decided I wanted to try a couple of different things: 1. Drunk Missiles.  You know, those weird randomly spinning anime missiles from Macross / Robotech. 2. Use UniRX some more. Now, the first one ended up causing lots of other design decisions.  First, to really be able to see a drunk missile, I needed 3D, and to best show off the drunken 3d spin, I decided I need a more cinematically placed camera.  My early experiments with 3d spinning in Unity, I quickly learned that the default spin rate on rigidbodies are incredibly low, and hidden behind a code only property.  I also found any tweaks to missile speed would have them behave rather unpredictably, either doing a very slow spin in a circle, or that my missiles were too drunk, and easily spun off and then back on camera again,  It's not much fun to lose a city because a missile spins off camera and then back on camera at the last moment. Now, I knew going in, that I might have to scratch missiles as an interception mechanic, as drunk missiles would be too hard to intercept.  But it turns out, even doing a hit-scan raycast was difficult.  Partly because clicking directly on a spinning drunk missile is hard, and partly because, the spirit of missile command is causing chain reaction explosions to catch other missiles.  To that end, I wanted to be able to click anywhere.  and setup an explosion in advance.  But... how do you do that in 3d?  I ended up setting down a 3d Plane in between the missile spawner and the ctiyscape.  But my drunken missiles were so drunk, that there was little guarantee of them even meeting that plane at all. The solution was to drop my first implementation of drunken missiles.  The second implementation is even hackier than what I had, but also much more predictable.  It involves two game objects.  One is the anchor, that is invisible, and moves right along that 3d Plane, and moves straight towards it's target (A city or a tower).  The second is the missile, which is attached to the anchor via a hingejoint.  It spins around the anchor via the motor property on the hingejoint.  I then play with the anchor distance as it gets closer to the target, eventually becoming zero, so that it converges with the anchor.  Viola -- Drunken missiles stay on the 3dplane, but still spin.  They're still a right pain to click on, but one can still click the plane, and set up chain explosions. Now, for the interception mechanic, I probably could've settled for straight up clicking, but I've decided to try implementing lasers.  My first thought was a big beam, but I've since rethought it.  I've still got the three towers, and shoot from the nearest tower.  That makes planning where the beam will come from kind of a pain.  So now I'm thinking of the more traditional star wars blaster laser.  It'll still be fairly thick, to help catch drunken missiles in their spin. (I'm still tempted to have all shots come from a single point, and the towers to just act like ammo containers.)   And I'm digging UniRX for it's event handling.  I'm not utilizing it to it's fullest though, and hacky code abounds as I don't have as much time as I'd like to polish things, but oh well.

ferrous

ferrous

 

Learning UniRX

So, it's been a while, but @Eck posted, and it inspired me to do a post as well.  I tend to code in spurts when something interests me.  And I get distracted easily.  I came across UniRX as a possible solution to the doldrums of writing event systems and doing SendMessage all over the place, and then decided to learn it by just starting a game from scratch with it.  And using it everywhere, even if it might not be the best fit, just to see what it could do.  What's UniRX?  Well here's a small presentation, and here's a link to the github. So, the game?  A simple RTS, a much simpler version of that turn based tank game that's forever on the back burner.  So the short version Mech Commander, with Tanks instead of Mechs. Let's start with our PlayerController, it basically does two things, unit selection, and sending commands to the selected unit. public class PlayerController : MonoBehaviour { UniRx.ReactiveProperty<Controllable> _selectedObject = new ReactiveProperty<Controllable>(); void Start () { LeftClicks().Subscribe(p => { RaycastHit hit; GameObject go = null; if (Physics.Raycast(Camera.main.ScreenPointToRay(p), out hit, unitLayer)) { go = hit.collider.gameObject; } _selectedObject.Value = go ? go.GetComponent<Controllable>() : null; }); RightClicks().Where(_=> _selectedObject.Value != null).Subscribe(p => { RaycastHit hit; GameObject go = null; if (Physics.Raycast(Camera.main.ScreenPointToRay(p), out hit)) { go = hit.collider.gameObject; if(go.GetComponent<Targetable>()) { if (go != this.gameObject) { _selectedObject.Value.CommandStream.SetValueAndForceNotify(new AttackTargetCommand(go)); } } else { _selectedObject.Value.CommandStream.SetValueAndForceNotify(new MoveToCommand(hit.point)); } } }); } public IObservable<Vector3> LeftClicks() { return Observable.EveryUpdate() .Where(_ => Input.GetMouseButtonDown(0)) .Select(_ => Input.mousePosition); } public IObservable<Vector3> RightClicks() { return Observable.EveryUpdate() .Where(_ => Input.GetMouseButtonDown(1)) .Select(_ => Input.mousePosition); } Okay, so on a basic level, each unit has a Controllable component that is fairly simple, it's basically just a ICommand queue public class Controllable : MonoBehaviour { public UniRx.ReactiveProperty<ICommand> CommandStream = new ReactiveProperty<ICommand>(); public IObservable<GameObject> LatestTarget() { return CommandStream.Where(cmd => cmd is AttackTargetCommand).Select(cmd => ((AttackTargetCommand)cmd).Target); } } And then we have optional components that look at that command stream, like Moveable and Turret.  Lets look at Moveable first, it's really simple at the moment. [RequireComponent(typeof(NavMeshAgent))] public class Moveable : MonoBehaviour { void Start () { MoveCommandStream().Subscribe(p => this.GetComponent<NavMeshAgent>().SetDestination(p));} private IObservable<Vector3> MoveCommandStream() { return this.GetComponentInParent<Controllable>().CommandStream.Where(cmd => cmd is MoveToCommand).Select(cmd => ((MoveToCommand)cmd).Position); } } The turret is a little more complicated public class Turret : MonoBehaviour { IDisposable rotateTowardsSubscription = null; void Start () { this.GetComponentInParent<Controllable>().LatestTarget().Subscribe(target => { if(rotateTowardsSubscription != null) { // Stop any rotations rotateTowardsSubscription.Dispose(); rotateTowardsSubscription = null; } if (target != null) { rotateTowardsSubscription = EveryUpdate().Subscribe(x => { if (target != null) { RotateTowards(target.transform.position); } }); } }); } private RotateTowards() {} // not showing this for brevity's sake, and I'm cheesing it at the moment anyway } And then the WeaponMount which does the actual firing, with a bunch of non-uniRX code culled out, I abstracted it out into separate components for multi gun turrets, or fixed guns, etc, as well as code clarity. public class WeaponMount : MonoBehaviour { [SerializeField] float ReloadTime = 1.0f; BoolReactiveProperty weaponLoaded = new BoolReactiveProperty(false); IDisposable fireSubscription = null; void Start () { this.GetComponentInParent<Controllable>().LatestTarget().Subscribe(target => { // Stop any fire subs if (fireSubscription != null) { fireSubscription.Dispose(); fireSubscription = null; } if (target != null) { fireSubscription = EveryUpdate().Where(_ => CanFireAtTarget(target)).Subscribe(_ => Fire()); } }); weaponLoaded.Where(loaded => loaded == false).Delay(TimeSpan.FromSeconds(ReloadTime)).Subscribe(_ => weaponLoaded.Value = true); }   What's interesting is just how different the code looks from standard Unity code, even coroutine code (Though that's perhaps the closest).  I started to really enjoy it once I managed to wrap my mind around it, it's a rather small amount of code to select, move and attack with units.  Once I'd built up my vocabulary of Linq-like syntax, it makes it very easy to see whats going on and do things like the weapon reload, which is just one line.   Minor quibble: I do wish Unity had greater C# version support, I want to do foo?.Dispose() and be done with it already.

ferrous

ferrous

 

Video and a GiF

Last time someone asked for video/screenshots, so decided to try some image recording and uploading to youtube. Hadn't done the youtube thing before, but was fairly straightforward. Time to see if GameDev embeds video or not:
Also, here's a gif:
I've done gifs before, I don't think this game shows quite as well as my turn based tank game does, though here's one with an image shader

And as before:
[color=rgb(40,40,40)][font=arial] Available for Android and WebGL:[/font][/color]
[color=rgb(40,40,40)][font=arial]Android: [/font][/color]https://play.google.com/apps/testing/com.Ferrous.RollSwipeWin
[color=rgb(40,40,40)][font=arial]Web: [/font][/color]http://joshv.itburns.net/RollingWebGL/

ferrous

ferrous

 

Still puttering away

So I still poke at my games, I just forget to post here =) Lets see if I can sum up all the things added since last time: Water
Meteors
Swinging Wrecking Balls
Magnets Overheat, top and bottom magnets as well.
Better tutorial message improvements
Level change message
Some image shader effects for entering the goal, and on death
The goal sucks you in now
Bowling balls And some minor bug fixes. Available for Android and WebGL:
Android: https://play.google.com/apps/testing/com.Ferrous.RollSwipeWin
Web: http://joshv.itburns.net/RollingWebGL/

ferrous

ferrous

 

Integrating Google Play: An Early Open Alpha

[color=rgb(0,0,0)][font=Helvetica] [background=rgb(252,252,255)]This is my first time playing with Google Play Services integration with Unity. It's pretty early Alpha, but should still be fun to play, and I've got an integrated google leaderboard that I'd like to test out. I look forward to seeing your high scores on the leaderboard![/background] [/font][/color] [color=rgb(0,0,0)][font=Helvetica] [background=rgb(252,252,255)]Here's the link:[/background] [/font][/color]
https://play.google.com/apps/testing/com.Ferrous.RollSwipeWin [color=rgb(0,0,0)][font=Helvetica] [background=rgb(252,252,255)](I should also get off my butt and try iOS, everything should work, just need to test it)[/background] [/font][/color] [color=rgb(0,0,0)][font=Helvetica] [background=rgb(252,252,255)]It took a bit more work than intended, the plugin has lots of steps, and there was some mystery compiler errors along the way that had to be deciphered.[/background] [/font][/color]
I need to fix the audio, (including the audio options menu), add a way to view the global high scores without dying first, tweak more sounds. I think I want to remove the rocket turret, though if I could make some art for it instead of the placeholder rocket it might work better. And bugs of abound, of course.

ferrous

ferrous

 

Turn based Tanks, an update

So with limited time, I decided to laser focus on just one thing, and that was optimizing my radial pathfinding. Honestly, probably didn't need to be the focus, but when you don't have a boss, or a time frame, might as well follow your passions. So, first thing of course, was to profile things. Which is relatively easy to do in Unity, though their profiler's UI is really awful, after going about 10 calls deep, it starts to choke. And this is 100% the ui, not the recording, as it's while digging into an already recorded trace while the game is not running. I even ended up moving some of my code around to avoid the problem, which is sad. Anyway, some easy fixes stood out. For checking a dubin's curve, which consisted of a start arc, a line and an end arc, I was checking in that order to determine whether they crossed any tiles. And well, arcs are more expensive to check than lines, and if one is blocked anywhere, the path is invalid, so I swapped my if to check the line first. I also noticed that there was a lot of memory allocations happening, and moved many of my smaller classes that were mostly data to structs. That had a consequence though, structs of structs in the crappy version of mono that Unity uses (seriously Unity, why don't you update, I also would like to use C# 6.0 features), cause a str.memcpy to show up in the profiler every time there is a copy. Now it might just be an artifact, as it's not showing up as taking a large percentage of time, just annoying that it's showing up at all. Also, to improve memory, I moved to pooling my visited nodes. I also decided to dig into the priority queue I was using. It's Blue Raja's Queue. Which is mostly good, it just has a lot of features that I don't really need. For example, each queue node has a double priority, a long for 'InsertionIndex' and an int for the QueueIndex. The InsertionIndex is to prevent ties. You're supposed to then inherit from his structure and have your own data for the visited node. I simplified that down to a float Priority and a unsigned int for the QueueIndex, and an int for an index into my visited node pool instead of inheriting. For tie breakers, since I always start at 0 in the node pool, I multiply my priority value by 10.0f and add nodeIndex/NodePoolSize. It's crude, and if my floats got big enough, could possibly run into issues, but that's unlikely considering the size of my navgrid. So my PriorityQueueNodes are more compact and take less comparisons when doing cascades up/down:return (higher.Priority
I also moved away from an array of Nodes, which contained all sorts of data about them, to simple boolean array of Open/Closed nodes. Eventually I may need to change that to something more complex, to more accurately reflect nodes that cost different amounts to move through, and to take account of different costs between Node0 To Node1 and Node1 to Node0. (aka, not just nodes, but edges) but for now, what I have is good enough. I also trimmed out unnecessary data, ie, don't keep the index of the node in the array, that's just wasteful, I also dropped keeping the position coordinate, and calculate it every time I need it, as it's relatively cheap to calculate on a uniform grid. Anyway, so on a Deep Profile, which is really slow, I am able to pathfind across my map in about 300-400 ms in the Editor. Considering I started around 1200-1400 ms, that's a pretty decent improvement. And outside of the editor, a windows 64 bit executable is screaming fast to calculate. WebGL is still slow, I'm guessing the conversion isn't as good, and there are other oddities as well, like my camera controls don't work the same. I'm tempted to try it as a C++ DLL and see if I get any further improvements. There would be some small benefits to doing so, and the managed to unmanaged barrier would be minimal, since it's only at the start of the pathfind.

ferrous

ferrous

 

Long time no post

I got sidetracked by life for a while. Then I tried to integrate google play services for the leaderboard and somehow broke my Unity project. (Fun times) That kind of killed my drive. That and adding sounds, I found to be mind numbing. I don't like the sounds I have now, I find the saw noise to be too grating on the ears. Anyway, here's a updated link:
http://joshv.itburns.net/RollingWebGL/
I have an APK if anyone wants to try it on their android phone.
I also got sidetracked trying to optimize my radial pathfinder, I'll post about that in a separate thread/article/post/entry/whatever.

ferrous

ferrous

 

I should show my progress

Okay, it's been a bit, I've been having a devil of a time getting a long enough block of time to both code some stuff, and update my journal. So I've been usually defaulting to just coding =) Anyway, here's the latest webGL version. I still need to do a tutorial / control explanation, a web based high score table, sounds, a credits page, and probably should get some real graphics, those you see are all free from the asset store. I need to double check the license on the font, I may need to swap to something else. The turrets are also a little buggy, and I want to delineate the obstacles (easy, medium, hard) so they come in a little more gradually. (There is code in there that every 5 levels, it spawns all the same type of obstacle) I also should try making an iOS build, the Android one runs great.
Controls:
Swipe / LMB + drag to create roads, coins add score + time, get to the swirly vortex to get to the next level.

ferrous

ferrous

 

The GameObject Pooler

So another fellow was doing a journal and was a little nervous about posting code for review. It got me thinking that I should post some code up as well. (I do have a game update that I could do as well, but I'll save that for later) Anyway, my game spawns a lot of random levels that are populated with random amounts of game objects, and rather than use GameObject.Instantiate and Destroy repeatedly, I decided to pool the objects and re-use them. I looked around online for free ones, saw someone posted theirs, but... I didn't like it, but it did give me a good base to strip out and make my own:[code=js:0]//This is a heavy modification of the original code found here: http://forum.unity3d.com/threads/simple-reusable-object-pool-help-limit-your-instantiations.76851/using UnityEngine;using System.Collections.Generic;public class GameObjectPooler : MonoBehaviour{ // TODO: I could probably re-work this to get rid of the singleton public static GameObjectPooler Current; //A public static reference to itself (make's it visible to other objects without a reference) public GameObject[] prefabs; //Collection of prefabs to be pooled HashSet prefabSet = new HashSet(); // internally we use this, makes it easier to programmatically add other prefabs to the pooler if we want Dictionary> pooledObjects; // key = prefab, value = list of pooled objects Dictionary instancedPoolObjects; // Key = instance, Value = prefab public int[] amountToBuffer; //The amount to pool of each object. This is optional public int defaultBufferAmount = 10; //Default pooled amount if no amount abaove is supplied GameObject containerObject; //A parent object for pooled objects to be nested under. Keeps the hierarchy clean void Awake() { //Ensure that there is only one object pool if (Current == null) { Current = this; } else { Debug.LogError("Attempting to spawn a second GameObjectPooler!"); Destroy(gameObject); } //Create new container containerObject = new GameObject("ObjectPool"); //Create new list for objects pooledObjects = new Dictionary>(); instancedPoolObjects = new Dictionary(); int index = 0; foreach (GameObject objectPrefab in prefabs) { int bufferAmount; if (index ()); for (int i = 0; i 0) { GameObject pooledObject = pooledObjects[objectType].Pop(); pooledObject.transform.parent = null; returnObj = pooledObject; } else // I am just always allow growing, TODO: Grow by more than 1 at a time. { GameObject obj = Instantiate(objectType) as GameObject; returnObj = obj; } if(!instancedPoolObjects.ContainsKey(returnObj)) { instancedPoolObjects.Add(returnObj, objectType); } returnObj.SetActive(true); return returnObj; } public void PoolObject(GameObject obj) { CleanPoolObject(obj); Debug.Assert(instancedPoolObjects.ContainsKey(obj), "Object not found in pool: " + obj.name, obj); pooledObjects[instancedPoolObjects[obj]].Push(obj); instancedPoolObjects.Remove(obj); // this causes a bit of churn, but is handy for keeping track of all instances over pooled } // Be very careful with this. If anyone is holding any references to a pooled object, things get wonky public void PoolAllObjects() { foreach(var key in instancedPoolObjects.Keys) { CleanPoolObject(key); pooledObjects[instancedPoolObjects[key]].Push(key); } instancedPoolObjects.Clear(); } private void CleanPoolObject(GameObject obj) { //obj.SendMessage("OnClean"); // OnDisable gets called intrinsically obj.SetActive(false); obj.transform.parent = containerObject.transform; }}

ferrous

ferrous

 

Going Mobile

Oh, updated the webgl one, that link is here: Seems to work in Chrome now, yay. But oddly, it errored for me in FireFox at first. So lets see, since last time, I have: Added a local scoreboard
Added some extra obstacle types
tweaked some physics
drastically reduced the time to remove a swiped brick that is touching the player, color them based on the time left, and have it fall instead of just disappear.
Added a cheesy spark effect. (not sure what I'll do with that one yet)
Added a +X to show the amount of score/time that is received from a coin. (it combos, +1 for the first +2 for the second, +3 and so on)
And I've built a win10 version, and tried it out on my win 10 phones. So far, so good. Though the high DPI on the Lumia made realize that I needed to tweak my Canvas settings, as all my text shrank down to really squinty levels. I was happy with the performance, super smooth on the Lumia 950, though that thing is a rather beefy phone, so I would have been disappointed if it ran poorly. I need to test on an android, I'm downloading the SDK right now, and we'll see how it does on my less high powered slate. I want to look into doing Unity Ads. I'm thinking of a scheme where the player gets an additional 15 seconds to their timer if they watch a 15 second video. Which they can do once per game attempt. It was either that or something like let them unlock another player sprite, with different physics properties, but then I have to add a bunch of things to unlock. I'm a little bummed that Unity Ads aren't supported on Win 10 though. I may have to look into doing Banner Ads or something with the UWP SDK stuff I also want to do a server side high score -- I started looking into it, but all the various editors I found for creating an SQL table crashed on install...not sure what that's about, I know my machine is a little wonky, so I may have to do something drastic like upgrade to win 10. And I should do a tutorial like level, something with some text explaining swiping to create, and some text about coins. I also really need to look into finding an artist or paying for some assets, or going the glowy route.

ferrous

ferrous

 

Okay, so its been a while...

Okay, so I fell off the coding wagon, and found it a bit intimidating to jump back to the big TBS game. I decided I'd ease myself into it by playing around with a quickie simple game, and learn more about the process of putting it up on an app store. (Of various flavors, I might try the Win 10 store first, I dunno) Anyway, so without further ado, here's the prototype of RollingSwipe Firefox/WebGL link. EDIT: Also works in Edge, whaddya now, though I didn't see any UI. Old school webplayer, best with IE: Link A quick how to play, since I haven't put that in there yet:
Goal is to get the tire into the center of the vortex, you can do that by swiping to create ramps for it. The coins give both score and time. When time runs out it's game over. Falling off the world respawns you at the beginning, but otherwise is no penalty. PS. Slightly annoyed that Unity can't manage to make a WebGL exporter that works on anything other than FireFox. But then again my project might be screwed up somehow? I noticed early that I was getting a bunch of crashes outside the editor because none of my UI canvas elements had a default material. Not sure if that's something to do with setting myself up as a 2d project or what. TODOs: Need sounds, some fancier graphics, some animated text increases, some better coin pickups, and more obstacle types. I'm pretty happy with my GameObject pooler, I started out looking at a free one online, quickly realized it was terrible, and completely rewrote it. But it's nice in that beyond the start, there are no game objects being instantiated (unless starting pool sizes are exceeded), and everything is being recycled.

ferrous

ferrous

 

Low hanging fruit

I updated the web player here, though Chrome I think disables plugins always now (works in IE, dunno about FireFox or Edge). But the last time I tried the webgl exporter, things were kind of funky and off. I'm not shooting to make my game as a web game anyway, but it is nice for showing other people my work. Though there's always youtube and Gifs.

So this time around, I decided to do some small stuff. I implemented clamping of the pitch of the gun, changed the gun to move towards the players targeting cursor at it's own rate, instead of just setting it to the cursor, did some smoothing on zoom / FOV, and futzed with some of the internal colliders, though I still need to go in and add the rest. Not sure how best to represent the turret ring, I'll probably have to make a set of small box colliders in a ring shape.

I need to do a cleanup pass at some point, there's some dead code, and some messy code.


Protip of the day:
Paste as New context menu from the component view....yeah, don't try to do that if the thing your pasting has a component requirement that isn't met. Crashes Unity. I filed a bug, though I'm guessing it's a known issue, seems like it should be common, right?

ferrous

ferrous

 

Playing with GIFs

Okay, so I've been doing a lot of mucking with the bullet cam, the damage system, etc. Lots of little stuff, haven't really gotten to dig into new features. Lots of tweaking of underlying things, trying to come up with not super ugly code.

Also here is my first attempt at showing a GIF

(I need to play with the the timescale curve a bit more I think, the more I see it, the more I notice a bit of a jump in time after the penetration.) You'll see some cylinders on the inside, those are crew member stand-ins. sooner or later I should go about learning how to get a hold of a basic human model in a static sitting pose.

That was from a free gif from flv site, IMGFlip, though the framerate isn't that great. I may have to look into youtube next. I'm fairly impressed with the tool I was pointed to for recording the video: https://obsproject.com/ It was free, and pretty easy to record.

ferrous

ferrous

 

Tank Tactics -- getting distracted by bells and whistles

Okay, so I have to admit, I dig the WarThunder Ground forces kill cam. And I'm attempting a rough duplication of it here. I'm learning a lot about shaders, rendering things always on top, and about the Animation class in Unity. Though I was a little disappointed by swapping materials through animation, this seemed broken, and I don't know why, other than in code, you have to swap the entire material array, and not just an entry at a time. (If it's broken, they shouldn't expose it...)

And I still don't like what I have here. I like the bullet outline, that's handy, it also always renders on top. I like the glow effect, but I don't like how it's the entire hull, which is what's getting penetrated here, i'd rather just show the surface portion that was penetrated. I might have to see if I can dig into all the vertices and do something, or maybe just give up and play a particle effect.

Anyway, I also fixed my turret turning slightly, i'm casting a ray from the muzzle to the target and setting the rotations on the turret that way, but introduced more bugs with it, silly PzII main gun being off center turret threw off my math. I'll have to do something there, maybe even mild IK. Though I'm tempted to cheat and just move to first person mode. I still need to finish remapping the collision texture I use. I've colored about 1/3 of it, and need to go in and assign armor values for the rest. It's boring work though. I also need to clean up the end of the bullet cam, it leaves things in a messy state, and do something about the timescale I have currently set. Ideally it would do some lerping between start and target. I could just get rid of gravity entirely and do a raycast to see what gets hit, or fire a phantom bullet first at full speed to see what I hit, then use an AnimationCurve to adjust the timescale as the bullet travels.

And Unity Physics never fails to disappoint, it seems to do all sorts of weirdness. Okay, I get not handling a projectile that's travelling at 1000 m/s, but even after lowering that to 250 m/s and lowering the gravity on my shell by the 1/4 as well, in a sort of pseudo time scaling, I still get strange collision behavior. And upping the solver iteration count and lowering the Fixed Timestep doesn't completely alleviate it either, though it does make it better. I've already marked the shell as Continous and tried both Extrapolate and Interpolate.


And then there's the setting to think about. I'm trying to justify WWII tanks and some sort of X-Com or Pirates like gameplay, with the player accepting missions for different factions and controlling a small hodge podge force of two tank platoons, with possibly some support infantry, if I can swing it. (or i could try to toss the WWII trappings)

ferrous

ferrous

 

First prototype for Tank Tactics game

So I finally got around to uploading a new prototype to the web for people to look. After doing all the work for the pathfinding with a turn radius, I didn't really like any of my initial schemes for then turning the turret toward a target, aiming at a specific spot on the target, calculating cover (I thought about render to texture for a fuzzy analysis, I'd done it before in an XNA prototype). So, I thought about doing it Valkyria Chronicle style, and here's the attempt. It's still really rough around the edges.

Basic Controls:

In movement mode (default):
Left click to select a tank, right click to select a new location, hold down right click to choose a final direction. You can also click and drag the transparent tank to move the destination around, or click and drag the arrow to change the direction. Click the Checkmark button at bottom center to confirm a move, or left click on the ghost tank.

In attack mode (after hitting the attack button with a tank selected)
Mouse look, mousewheel zooms, left click to fire, right click to back out to movement mode. This mode is still rough, I want to give a meter of turret rotation points, limit the up/down, add inaccuracy depending on the movement mode selected on the tank.

And of course, damage modelling. There is almost none. I've added track colliders =) Now it's pretty snazzy what I do have, I check the armor at the point of impact, adjust the armor thickness based upon the angle of impact, and adjust how far the shell will continue to penetrate after impact based on how much penetration value remains. But you wont' see any of that, because, as I said, only the tracks have colliders, and I also don't do anything with that info...yet.

My basic plan there was to add a collider per point of interest, but that got kind of messy, I think I'm going to move to a texture map. I don't' have a simplified hull, so that's going to kind of suck for perf, but oh well, turn based. Though I suppose I should learn to use a modelling program. After modelling the armor/collision model, I also need to add some components inside, like the engine, crew, etc. I also need to model HE / HEAT, etc.


*Also, the tank is just some freebie one from the Unity Asset store. I still haven't decided if I should go sci-fi, or try to come up with a setting that involves WWII era tanks.

ferrous

ferrous

 

Added multiplayer to mazewar

http://joshv.itburns.net/MazeWarMulti.html

So I added multiplayer, [color=rgb(0,0,0)][font=Helvetica] the UI is the default garbage Unity GUI, but it works and its easy, so it'll do for now as a quick placeholder to get to the new stuff. I also have a slider for the number of bots. I'm particularly happy that it supports dynamic joins, updating the map destruction for new players. [/font][/color]

[color=rgb(0,0,0)][font=Helvetica]Now the downsides: [/font][/color]
1. Colors are not synchronized over games (I should do a hardcoded list of good color and distinctive colors, or pass a seed, was lazy, it's just random values)
[color=rgb(0,0,0)][font=Helvetica]2. It's damned hard to find yourself in a 8+ player game, I should add some sort of effect, even just a light. [/font][/color]
[color=rgb(0,0,0)][font=Helvetica]3. The AI gets confused when it gets too close to other AI. (actually a collision/movement issue) [/font][/color]
[color=rgb(0,0,0)][font=Helvetica]4. I don't handle disconnect messages [/font][/color]
[color=rgb(0,0,0)][font=Helvetica]5. Or have a way to restart a game [/font][/color]
[color=rgb(0,0,0)][font=Helvetica]6. Or have a way to set the port (just a matter of adding the UI) [/font][/color]
[color=rgb(0,0,0)][font=Helvetica]7. Or have a way to name yourself (or chat). [/font][/color]
[color=rgb(0,0,0)][font=Helvetica]8. I don't have a win condition. [/font][/color]


[color=rgb(0,0,0)][font=Helvetica]I need to test the synchronicity and smoothness, as it's client/server, but I only have the players instantiated as network objects, and even they don't pass info, except to the server. I probably need to do some smoothing, I think. [/font][/color]

ferrous

ferrous

 

Another Unity Prototype: MazeWar

[color=rgb(78,78,78)][font=Helvetica]
So this is a remake of an old Atari game: http://joshv.itburns.net/MazeWar.html [/font][/color]
[color=rgb(78,78,78)][font=Helvetica]
The basic ruleset is you can have only shot out at a time, hitting a wall causes it to explode shortly thereafter, sending shrapnel in the cardinal directions it wasn't shot from. If a projectile hits a projectile, it causes a backsplash. [/font][/color]
[color=rgb(78,78,78)][font=Helvetica]
Still has a few things to do, player/player collision is borked, for example. I should add difficulty, number of zombies, scoring and if I really want to go nuts, I'd add multiplayer of some sort. I should probably try adding mouse controls, and maybe do some actual AI, the current zombie is really simple (doesn't even really do pathfinding, though I don't believe the original game had all that much either, it mostly speed up their move speed. [/font][/color]
[color=rgb(78,78,78)][font=Helvetica]
The original game, by Mark Price is here: [/font][/color][color=rgb(78,78,78)][font=Helvetica]
[/font][/color]

ferrous

ferrous

 

Added help text to my physics based tower defense.

Alright so http://joshv.itburns.net/WebAttempt.html has been updated with some help text to help guide users. If anyone finds it too terse, confusing, or anything at all, feel free to let me know!

I've also updated my path planning with a minimal turn radius (http://joshv.itburns.net/RadialAttempt.html), fixed a bug, and some other general performance improvements. I still need to add the width test, as you can pass through diagonals, and the routes will cause the object to penetrate the walls on the sides.

ferrous

ferrous

 

Adventures in physics based Tower Defense.

So, a while back, I decided I wanted to make a game using Unity, to get my feet wet in it. I wanted something fairly simple. So I went with a Tower Defense game. But of course, I had to put my own spin on it, by making everything physics driven. No hitpoints! To defeat the creeps, you have to push them off of edges, into the infinite pit below.

Anyway, here it is:
http://joshv.itburns.net/WebAttempt.html


I'm using NGUI (demo license), arongranberg.com's pathfinding (overkill, really, but I just wanted to get up and running quickly), and using open source sounds ..mostly, I need to replace some that aren't.

Honestly, I think it was probably more fun to program than it was to play.

ferrous

ferrous

Sign in to follow this  
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!