Advertisement Jump to content
  • Advertisement
  • entries
    66
  • comments
    120
  • views
    4562

About this blog

Unsettled World, the working title for my most overly-ambitious project yet.  Here I shall blog all of the resultant madness.

3bots.thumb.jpg.64b609a8838d3d868994618826e47a1d.jpg

 

Entries in this blog

SlingBots - Turret Installations in Park, Improved Player Controls, Mini Map

Okay some new/improved things: Mini-Map!  Displays player location(direction arrow doesn't point in the "moving" direction yet though..), arena level locations(still just 1 atm) and turret locations. Turrets now pay out 20 rings on disable!  The good kind of feedback. There are now 10 turret installations in the park(in a circle around the hill for now) to keep the jump rings company.   These installations will be more "interactive" and "adaptable" in future builds.  But it makes freestyle play a little more entertaining as is. I've also done some more player control tuning and have locked a few axes out of the physics simulation, this has eliminated the left/right drifting on straight thrust.  It's also made the player even more accurate to steer and aim.  You might still find yourself slightly airborne when you cross a terrain mesh seam(invisible) but they shouldn't cause you to spin out of control anymore, just a random vertical bump..  Still trying to figure out how this is happening.. haha. Can somebody let me know if the NPCs in the race courses are too easy to beat?  I am not challenged by them in the least anymore...  lol  Some of that might have to do with improved control accuracy and easier flight too.   Thanks again to all the folks who have given me feedback so far, it's beyond invaluable!! SlingBot Boarding v0.4.1: https://www.kongregate.com/games/WilliamOlyOlson/slingbot-boarding

Septopus

Septopus

Some Handy Procedural Methods (Placing objects on the ground in circle/grid patterns or individually)

It's been a while since I posted any code..  Here are some handy methods that I've been using frequently in my SlingBots game.  Keep in mind, some examples use local variables where it's better to reuse variables with more scope for memory/GC reasons in practical application.    If you see something that I could really improve, please let me know.  Many of these are "setup" routines so I've not bothered with optimization really at all since they run once, or very infrequently. All of these are designed to work with the standard Unity orientation, with normal terrain objects or terrain meshes. RayCast Position of Ground at any point on terrain: Vector3 GroundPosAt(Vector3 position) { Vector3 result = position; //some altitude above the highest possible ground position. float checkAltitude = 2000.0f; Ray rr = new Ray(new Vector3(position.x, checkAltitude, position.z), -Vector3.up); //I use a fixed allocation ray cast as a general practice to keep GC down. //It will need to be big enough to contain all the possible hits it could catch finding your ground object.. //YMMV with these *NonAlloc methods, but they work wonderfully for me. RaycastHit[] hits = new RaycastHit[20]; if (Physics.RaycastNonAlloc(rr, hits) > 0) { foreach(RaycastHit hit in hits) { //make sure this entry isn't null if (hit.collider != null) { //check for collision with object tagged ground if (hit.collider.CompareTag("ground")) { result = hit.point; } } } } return result; } Get A Vector3 position on a Circle at a specific angle and radius: Vector3 CirclePos(Vector3 center, float radius, float angle) { Vector3 pos; pos.x = center.x + radius * Mathf.Sin(angle * Mathf.Deg2Rad); pos.y = center.y; pos.z = center.z + radius * Mathf.Cos(angle * Mathf.Deg2Rad); return pos; } Object Placement using fixed arrays for object tracking and management: This example shows one of the ways I programmatically instantiate turrets into SlingBot Boarding. public GameObject worldTurretPrefab; GameObject[] worldTurrets = new GameObject[100]; SnowBallTurret[] _worldTurrets = new SnowBallTurret[100]; void PlaceWorldTurret(GameObject parentobject, Vector3 position, int firefrequency, float firepower, float sightdistance) { for (int i = 0; i < worldTurrets.Length; i++) { if (worldTurrets[i] == null) { if (parentobject == null) { worldTurrets[i] = Instantiate(worldTurretPrefab); } else { worldTurrets[i] = Instantiate(worldTurretPrefab, parentobject.transform, false); } _worldTurrets[i] = worldTurrets[i].GetComponentInChildren<SnowBallTurret>(); _worldTurrets[i].playerAvatar = GameController.GControl.Player; _worldTurrets[i].fireFrequency = firefrequency; _worldTurrets[i].id = (i + 1).ToString(); _worldTurrets[i].turretProjectileVelocity = firepower; _worldTurrets[i].turretSightingDistance = sightdistance; worldTurrets[i].transform.localPosition = position; break; } } } I use an array for both the object and a reference to the script it holds to save time on future getcomponent lookups.  This will come in handy when I want to upgrade the settings on all of the already instantiated objects due to a player increase in level/etc.  I use a fixed array so I can predict(reasonably) what the upper level of memory usage will be(after testing).  I iterate through the existing collection and only add a new object if there is an empty slot in the array.  This allows me to ensure there will be ZERO runtime exceptions related to object instantiation.  It is better for my game to end up being a little easier than it should have been than it would be for an exception to be thrown right at an exciting moment.  Note: the above method could be easily modified to return a bool on success/failure if you wanted to adjust the object arrays and try again on failure. Putting this all together, here's instantiating Turrets in a circle around a specific point(on uneven terrain): void PlaceTurretsCircle(Vector3 position, int turretcount, float turretradius) { //place turrets in circle for (int i = 0; i < turretcount; i++) { //Adjust settings based on players level float levelModifier = 1.0f; if (currentGameLevel > 1) { //add 20% to modifier for each level levelModifier += (0.2f * currentGameLevel); } //Calculate angle for object around circle float angl = (360 / turretcount) * i; PlaceWorldTurret(null, GroundPosAt(CirclePos(position, turretradius, (360 / turretcount) * i)), (int)(2000.0f / levelModifier), 50.0f * levelModifier, 500.0f); } } and a bonus, Here's placing turrets on a Grid: This one is presently written to require a parent object as it places the turrets in relative position to that object. void PlaceTurretsGrid(GameObject parentobject, float xstart, float zstart, float xrowdist, float zrowdist, float yoffset, int xrowcount, int count, int firefrequency, float firepower, float sightdistance) { float xoffset = xstart; float zoffset = zstart; if (count > 100) count = 100; int xmaxcount = xrowcount - 1; int xcount = 0; for (int i = 0; i < count; i++) { //Without ground position checking PlaceWorldTurret(parentObject, new Vector3(xoffset, yoffset, zoffset), turretFireFrequency, turretFirePower, turretSightDistance); //With ground position checking(untested) //PlaceWorldTurret(parentObject, GroundPosAt(parentObject.position + new Vector3(xoffset, yoffset, zoffset)), turretFireFrequency, turretFirePower, turretSightDistance); xcount++; xoffset += xrowdist; if (xcount > xmaxcount) { xcount = 0; xoffset = xstart; zoffset += zrowdist; } } } Not a lot of rocket science going on here, but it could be a time-saver or a mental-block fixer for somebody I'm sure. Check out the game if you get a chance: https://www.kongregate.com/games/WilliamOlyOlson/slingbot-boarding/ Happy coding out there!!

Septopus

Septopus

SlingBots - First Playable Arena Level & The SuperLoop!

Okay, so major notable changes/updates in this build(mostly untested): Revamped player steering and lots of tweaks to the way the player interacts with surfaces in the game.  As a side effect you can now almost fly endlessly(with airBoost Fuel) by tapping the flip back button and keeping the board straight.   hehe, I'm gonna need to add an Altimeter and revamp the records section a bit after this.. Revamped NPC steering, should prove more reliable and less twitchy. Introduction of System Damage, damage that occurs as the result of explosions(mostly turret snowballs, your own do a little damage but not enough to accumulate). Arena levels, the first playable level featuring 10 pretty hard to defeat turrets firing explosive(on contact with the player) snowballs. Snowball explosions that trigger other snowball explosions. Player snowball explosions can trigger turret snowball explosions(only 1 level deep, but it's enough), mass explosions do lots of damage.. watch out!  Too much damage and you lose the arena level.  Also, turrets can still fire if they are close enough to their platforms, their numbers will disappear and the platform will spray particles straight up when they are offline.   These were fun to make! Strategy Note: Hold Right-Click on the mouse and use reverse thrust, this fixes your camera angle "forward" so you can aim while in motion. The System Damage slowly repairs itself over time, but not very fast...   When you lose, you just get kicked back to game start position so you can try again.  There will be a screen with stats and music and whatnot when I get it all working.   SlingBot Boarding v0.3.7   https://www.kongregate.com/games/WilliamOlyOlson/slingbot-boarding Keep in mind, several days of programming with only a couple web builds, significantly less time testing.. haha, let me know if you find any bugs! Enjoy and let me know what ya think!

Septopus

Septopus

Surprise Music!

So, I got really close to getting a new build out last night, maybe tonight. If you've played thus far, you've probably noticed there wasn't any music.  I hadn't even thought about it much, more of a final touches thing in my mind I guess..  But then I got a DM a week or so ago, randomly from a very nice guy offering to help with that. Then this morning I woke up to an equally nice bit of theme music in my inbox! Check this out!  Sling Bot Boarding (Theme).mp3 I think it's pretty rad. Let me know what you think?!   Check him out, here's his info(he approved the share): User: @Jacky Chan https://soundcloud.com/jacky-chan-536075013 https://open.spotify.com/artist/4CeAevk6JYAzqIJAqVz3g5

Septopus

Septopus

SlingBots - Foundations for Progressive Levels

Been working and reworking a whole lot of things in SlingBot Boarding over the past few days.  I've finished up some of the lingering aspects of the NPC steering code, so they're a bit more reliable and less twitchy.   I've also been reworking some of the player controller code... Mainly because I brought back the LOOP!! I know I never put it in the game anyhow, but I posed a teaser of it a while back.  And well, it's still not IN the game, it'll be another day or two before I put out a new build, lots to do. So, great, a big loop to nowhere eh?  Nice one dude...  haha, not really..   Here you see the invisible arena that appears as you complete the SuperLoop! Inside this arena we have a new prototype Snowball Turret! I know, SUPER INTIMIDATING right?  haha!!  I'll model something more.. More!  Later..  For now, it appears to shoot snowballs just as well as a fancy model will. As the basis of my first level prototype(and it will likely be the contents of Level1) I have a grid of 20 of these guys in the middle of the arena that you must disable by exploding a snowball near them.  When they are hit with an explosion that is strong enough they get knocked off their pads and can no longer fire.  I have not yet, but I will be enabling a damage and/or power meter for arena levels and racing so that I can establish a few more lose scenarios and increase the difficulty in more ways. Another thing I've discovered on my journey to getting Tube riding working, was how to enable extended flight in a controllable manner.  So, you should expect some form of that to be appearing before too long.  But not before we have some progressively harder levels to defeat!! So, what happens when you defeat an Arena Level?  Well, that's easy, your defeated foes start appearing in the wild.  They will show up in random places around the park and will also be setup along user generated courses.  This will allow the entire game difficulty to increase as you progress through the levels.  For example, after defeating level 1 and it's array of snowball turrets, you can expect to find snowball turrets showing up on race courses and in random spots in the park.  With bonuses and rewards and awards for defeating them wherever they appear!!   Well, that's about all I feel like divulging at the moment!  More.. tomorrow probably.   Happy Coding Everybody!

Septopus

Septopus

Super Charged Snowballs!

Look what I can do!  Look what I can do! (Imagine some explosion sfx) Oh this is wicked fun!  They don't do any "damage" as yet(nothing does actually..hmm..), but they cause some serious chaos, especially during races.  And propulsion, I'm getting pretty good at moving some distance just using the flip and explode maneuver, especially with airBoost!  hahaha!!    They are kinda touchy too, so go blow yourself up! and Live in v0.3.6 try out the latest new game mechanic, explosive snowballs, for yourself right here: https://www.kongregate.com/games/WilliamOlyOlson/slingbot-boarding  Also in this build I've improved my ground detection method a bit so I'm back to using just the one (set of split ground mesh objects).  I was previously using these for the visual meshes only and a full undivided mesh for the collider as that would allow seamless physics interaction with the ground without adjusting my code.. lol.    I'm now just simply ignoring raycast attempts that don't return anything.. Duh!..  and it seems to be mostly working so far..   Easy enough for now and saves me almost 30mb in the final build! So, smaller build(quicker load time), exploding snowballs, first run at the explosion sounds(just a mix of cco specials for now)..  Let me know what ya think! P.S. My audio setup is crap, so let me know if something sounds way terrible...

Septopus

Septopus

Sling(Toss, Throw, Hurl, Fling)Bot Boarding

I should watch what I say..  I think it was yesterday I posted about new animations and how little time it took me because there were only two. And today my animator looks like this.. mhmmmm!  Here's some visuals, use your imagination when I say snowball.. it's not there yet. Collecting Snowball. Riding around with a big'ol Snowball and throwin it! (the throw animation is distorted a bit in this gif, I've fixed it since). ... and throwing while in mid-air!   This game is finally getting some juice!   Only a few more days of programming/modeling before we have snowballs, exploding ice bombs, chairs, kitchen sinks, and who knows what else I'll rig up to throw around.    Oh man, this is getting to the fun bits now!!  Game Link(no throwin yet): https://www.kongregate.com/games/WilliamOlyOlson/slingbot-boarding/

Septopus

Septopus

Some Refinements for the New Year

So, I finally got tired of the jerky mismatched and borrowed animations I was using for the robots.  It actually only took me an hour or two to whip up the new working animation set(there's only 2 of them.. sooo..)  haha. Anyhow, NEW ANIMATIONS!!  They look WAY smoother than the old ones.  And when the player is off the ground, the board is properly oriented.  I still have plans for some more complex ankle and leg movement to allow the robots to maintain a mostly vertical stance on angled terrain, but I'm not sure if I want to do this with animation or a partly physics-ragdolled replacement..  The later sounds like it would be more fun and actually less complicated(tedious) so I keep "leaning" that direction... lol  I started playing with the idea a week or two ago and I think I know how to tackle it..  But that will be a later installment. Let's see, what else was I debugging @ 1am on January FIRST?.. haha HAPPY NEW YEAR EVERYBODY! Ah, yes, Anti-Aliasing!!  Got that working.  It's expensive though(20+fps in editor), so it took some profiling to get it back to 60fps on WebGL.  Also somewhere in the testing switcheroo between MSAA and PostProcessing AA I bumped a setting somewhere and lost a good 10+ fps off my baseline, still searching for that.  I could see this being one of those moments where some people would get fed up with their bulky commercial game engine(there have been many on my learning curve), but I'll find what I lost.  Plus it's making me dig in deeper to find more settings/optimizations, and it's still putting up ~60fps on the web. I've reduced the detail on the ring Hoops as they had WAY too many verts and weren't instancing correctly.  There was also too much cpu being used by some of their scripts, so I adjusted that by improving their sense of player location down to a few hundred meters. I'm sure there's more I'm forgetting. Game Link v0.3.5: https://www.kongregate.com/games/WilliamOlyOlson/slingbot-boarding/

Septopus

Septopus

Scoring Navigation Precision on User Created Courses

The Problem: Generate a method to score the players accuracy in navigating any loaded race course, on uneven terrain. The Data: Courses are recorded by users/players and stored as an array of positions that define the central "line" of the course. The player controller maintains a "ground normalized position" which is the "point" result of a raycast it performs periodically to determine its current grounded status. The Solution: Generate a "get line distance" method using the ground normalized position of the player, an increment only index counter to move down the line, and a few square magnitude calculations to produce the closest square magnitude distance to/from the "line". Use periodic samples from the "get line distance" method to calculate the overall average of the players navigation accuracy. The Code: coursePositions is a Vector3[] of the course positions, they are about 5m apart in the game world. courseFinishPosIndex  = coursePositions.Length-1.. currentPositionIndex starts @ zero and only increments.. private float GetLineDistance() { //retrieve the player's current raycast to ground position. groundPosition = sbc.groundPosition; if (groundPosition == Vector3.zero) { //in case the player's raycast failed for some reason groundPosition = Player.transform.position; } if (currentPositionIndex + 1 <= courseFinishPosIndex) { //Calculate the square magnitude to the current index position and the next index position csm = (groundPosition - coursePositions[currentPositionIndex]).sqrMagnitude; nsm = (groundPosition - coursePositions[currentPositionIndex + 1]).sqrMagnitude; //Compare them while (csm > nsm && currentPositionIndex+1 < courseFinishPosIndex) { //Push the currentPositionIndex to the closest point on the line (to the player ground position). currentPositionIndex++; csm = (groundPosition - coursePositions[currentPositionIndex]).sqrMagnitude; nsm = (groundPosition - coursePositions[currentPositionIndex + 1]).sqrMagnitude; } while (csm < 1000 && currentPositionIndex +1 < courseFinishPosIndex) { //Push the currentPositionIndex to ~1000sqMag AHEAD of the player. currentPositionIndex++; csm = (groundPosition - coursePositions[currentPositionIndex]).sqrMagnitude; } } //return the current sqare magnitude. return csm; } Debug Implementation: In loop/at frequency of choice: courseDistanceAccum += GetLineDistance(); courseSamples++; Debug.Log("AvSqm: (" + courseDistanceAccum.ToString() + " / " + courseSamples.ToString() + ") " + (courseDistanceAccum/courseSamples).ToString()); Results: So far, excellent.  Gives a wide range of values(if you stray off course) that are easy to categorize and it will work for any line based course.  Now I just need to implement some logic based on the result. 1000-1200 = Perfect score 2000+ = Just foolin around. 3000+ = Trying not to try. 4000+ = Disqualification zone. CLARITY NOTE: These aren't the players "Final Score" this represents the average distance the player was from the central line of the course.  Which I'll be translating into a Precision Percentage 0-100%(4000 - 1000) that will further modify the players overall standings. The point score I'm currently deriving from these numbers is calculated as follows: (in loop) courseDistanceAccum += GetLineDistance(); courseSamples++; if (courseDistanceAccum/courseSamples > 4000) { PlayerDisqualified(); } if (racePointTimer.ElapsedMilliseconds > 500) { //Sample the current average every .5 seconds. float curOffset = (4000 - (courseDistanceAccum / courseSamples)) / 10f; //Build point modifier. 300-0 if (curOffset < 100) curOffset *= -1; //Subtract points if player is too far off course. playerScore += curOffset; //Modify score. racePointTimer.Restart(); } Essentially, the player earns close to 300pts every .5 seconds they are reasonably within the course boundaries. If they go out of bounds, even for a short period, they experience a much lower score. It also takes some intention to get disqualified.

Septopus

Septopus

Weekend is over.

hahaha!  Well, I wasn't able to make myself code very much for a couple of days there, so I'm calling that my weekend for the next little while.  Today I think I've built and tested no less than 10 WebGL builds getting todays v0.3.3 online.  With this build you should finally be able to load successive race courses and not experience any strange remaining artifacts from previous race courses.  For some reason I had to rearrange some of that code as it was behaving very differently as WebGL than in the editor.  Additionally, the competition should start in a reasonable location on the CORRECT side of the starting line, And I've placed barriers around the starting line to prevent early starts from any stray NPCs/Players. A few other random bug fixes here and there, likely nothing anybody noticed. So, now that race courses should be behaving better in successive scenarios, I can start thinking about setting up a race circuit system where the player competes in multiple race events to earn one position on a scoreboard.  Something with a little more hook to it than freestyle hoop-jumping.. hahaha. Along with multi-course racing, tomorrow I'll start on scoring races,calculating disqualifications for going too far off course/etc. and adding some in-race bonuses and boosts. Enjoy! WebGL Game Link: https://www.kongregate.com/games/WilliamOlyOlson/slingbot-boarding

Septopus

Septopus

Not Changing My Focus

Okay, I was fully intending to be posting about my designs for a dungeon crawler prototype that would serve double duty as the intro for my other macro-project.  That, will not be happening.  I've decided that to split my attentions yet again would be folly.  I have a good game prototype that I just worked my fingers to the bone creating, so I'm going to just go ahead and spend the next couple of months taking that to its next levels while sprinkling in some work on the main project so I don't lose my place too badly.. So, here's my rough list of SlingBot Boarding TO-DOs for before the end of February(gotta give myself some kind of timeline): Some competition modes, where you have to compete in a configurable number of races/etc on specific or user selected courses. Calculations for in-race behaviors, including disqualifications for going too far off course and bonuses for perfect course maneuvers. Investigate shaders, Unity makes it pretty easy to dig into them so I'm going to spend some time on that side of the fence.  I saw a pretty cool how-to vid posted here about using tessellation shaders in Unity to make snow-tracks, I watched it thinking about how cool they would look in this game..   Maybe not for the WebGL version, but still... Player leveling/achievement/skills system. Refining/completing the replay system, build in the ability to save and share replays, auto share replays for new game records. More NPC types, and better record keeping for races including standings for individual courses.  Ice Road and Tube construction, for building race courses and freestyle park features. Snowball Slinging(and other much more humorous objects).  Knock the competition out of your way!!  Gotta put the Sling in the SlingBots.. LOTS more stuff for the store, some upgrades, but mostly comical skins, doodads, and funny objects for slinging. Adjustable camera settings, including a few other standard and easily switched follow/view modes. PC, Android, and IOS builds. Actual real live online multi-player. Begin ID@XBOX application process. Not necessarily in that order... Yeah, I think that's enough for now... It only takes me a few minutes to come up with an oppressive list of things to do for this game, I spent most of yesterday evening staring at a blank Unity project trying to figure out where I was going to start on a dungeon crawler prototype.  Everything I wanted to do I somehow talked myself out of before writing a single line of code or creating a single object.  Just not time to change courses I guess.  

Septopus

Septopus

25 Days. Here's the result.

Well, I fell a little bit short on my goal of a complete game on multiple platforms.  But I got a fairly complete game prototype on 1 sorta tricky platform, and that can easily be ported to at least two or three others with some minimal tweaking.  So, close enough for my personal challenge. SlingBot Boarding v0.3.1: https://www.kongregate.com/games/WilliamOlyOlson/slingbot-boarding I've done a few things since my last post, I changed the camera reverse button on the mouse to right-click and removed the camera look(wasn't advertised) which was causing me confusion.  There's also now 256 hoops you can jump through that get randomly distributed throughout the park when the game starts.  They give you 10 rings when you jump through them.  Makes it a lot more fun to just cruise around and do stuff.  And now that earning rings is a lot easier, time to add more things to do with them..   And the game begins. Happy holidays everybody!

Septopus

Septopus

Left, Left, Left, Left!

So, I found what I suppose you could call a bug.  And it explains why I've been having so much trouble(I have been, btw) tuning the NPCs on the race courses in my game SlingBot Boarding.  In order to create similarly behaving NPCs to player characters, I'm using a similar script and I'm basing their movement on simulated input derived from a signed angle to destination calculation, where the destination keeps moving until finish line, yada yada..  Anyhow, the player character's movement is based on an axis input (-1 to 1, left to right)  Apparently when I wrote the input simulation code, I somehow forgot the input was clamped from -1 to 1, and not from 0 to 1, which doesn't make any sense for an axis type input anyhow..  Long story short, the NPCs have only been able to adjust their course in one direction..  How they've managed to do so well for so long in spite of that, I can't really say. Fixed!  Now, you better have some airBoost Fuel at hand or you're gonna get smoked on any of the longer courses..  Good thing I've changed how that works already.  Now you get 100 rings a day once you've signed in through Kongregate and those rings are worth 1 full tank of airBoost.  And/or other items I've yet to fill out the store with.  Your account will keep accumulating until it reaches 500. These new NPCs are faster, more maneuverable, and I think they can airBoost too... It sure feels/looks like they can, even if their rocket particles aren't firing..(still some bugs to work out, most assuredly)..  So, good luck with those first place trophies. It's actually quite fun to race now. https://www.kongregate.com/games/WilliamOlyOlson/slingbot-boarding ----------------------------- I'm curious, is anybody interested in doing some texture/color work on my models?  I need some paint jobs and fake logos and things like that to make it look like there's more than one robot/snowboard in the game.  You would get full credit, and opportunity for a small cut of(if) revenue.  If so, make a comment or send me a message on here and we'll chat. These are the models I'm talking about: One Board. One Bot. Obviously, I'll provide the actual .blend files to anybody who commits to doing 5 variations for me(would love more).  This is low resolution "mobile shader" stuff I need, nothing complicated, just needs to be fairly clean so it looks good in high speed with basic lighting.  Preferably diffuse only, but diffuse+normal works if it really adds something.  I  may post up a classified if nobody replies here in a couple days.   Would really like to add some shine to this game soon.

Septopus

Septopus

All the Optimize! SlingBot Boarding v0.2.5

Well, maybe not ALL, but all I can fit into one of my days. UI sprites packed into an atlas, all other materials/textures are correctly instancing and taking up as few draw calls as I can manage, it floats around 15-30 per frame, at the moment, depending on activity. My build size has doubled though because I'm essentially using two copies of the ground terrain mesh.  It's a shortcut on the way to getting better performance... hahaha First, I exported the Unity Terrain to .obj using this handy script: http://wiki.unity3d.com/index.php/TerrainObjExporter (it's 10000x10000 units/meters) Then I took it into Blender where I, by hand(box select) cut it up into 110 pieces, so now I can assist with the culling with some simple distance calculations. The reason for the doubling of the mesh is because I'm currently using 1 copy of the full terrain mesh for the ground collider, and the other mesh(s) for rendering the visible texture/geometry. This is all so the player doesn't spin out unexpectedly on a seam..  Which it did, readily..  This is also a hack I'm employing on my main project until I code a better way. I may try to merge the meshes together at run-time instead, but that might have to be a later update. I remodeled the board itself, so you may find it catches here or there a little(lot) differently than it did before, had to get it down to a reasonable number of vertexes for instancing.  And I think it almost adds a touch of chaos which is nice.  You sometimes find yourself spinning when you didn't intend to, but it's reasonable and possibly more correct, for the physics anyhow. What else...  Just lots of texture shuffling, switching out shaders to the mobile versions and adjusting lighting settings until they are tolerable. I converted ALL the text objects to TextMeshPro(just a free version) components as they manage to instance better than the default text objects do. I made sure to replace all the Unity default sprite objects I could find(Background,Knob,etc..) as those can't get packed into an atlas, at least I don't know how to get them there...  They cause all kinds of draw calls on their own.  Just a few simple images. Nearly EVERY quality setting in Unity has been set to the lowest it goes. So...  Does it run any better?  v0.2.5: https://www.kongregate.com/games/WilliamOlyOlson/slingbot-boarding I'm not entirely sure at this point, but I want to say yes... haha. And here's 3am again.. Enjoy.

Septopus

Septopus

Off to the Races!!! :D

So, this is the post as it was started, at about 2am last night: And then I discovered that I introduced an ugly bug somewhere in v0.2.1 or v0.2.2 that was causing a game crash with web console outputting an error resembling "index out of range", you know when you try to access an array element that doesn't exist/etc.. It turns out that somehow in the compilation magics that happen between Unity Editor and WebGL "GameObjects" become array members and when you swap out one type of game object type for another( in my case a normal Text object for a TextMeshPro text object) and you DON'T update the changes in the code/inspector for the code, your WebGL error messages will send you in a wild goose chase for an array that doesn't even exist in your code.  haha.. ffasdjfaswejmafmsdl!! I had to sleep on this build for that reason. But it's here now and I think everything actually works!!  That means RACING!! There's still lots of work to do on the races, currently there are no point calculations being done, and this will add a lot.  Plus in-race items/boosts that I want to add as well.  I've also got some optimization to do, this build brings some significantly lowered FPS..  I'm afraid it might have something to do with all the fancy meshy text objects...  I may need to rethink that one. Anyhow: v0.2.3: https://www.kongregate.com/games/WilliamOlyOlson/slingbot-boarding  

Septopus

Septopus

I finally put the rocket in the board!!!

Time for the 3AM Roundup!  What was I doing all evening??.. hmm.. So, finally, these RocketBoards are ROCKETBoards!  No more put-put'n around on the ground, no no no! I've completed the currency circle and now you can exchange your shiny golden rings for some airBoost Fuel!  1ring = 1 second of fuel.  You can hold 100 seconds worth at a time, recharge whenever by clicking on the Rocket Shop menu item!(even while playing)   This allows you to use your rocket thrusters while in the air, like every true RocketBoard should do.  So, now instead of a few hundred meters on a jump from the plateau, I'm reaching 1000+ on a straight shot with lots of speed.  It's so much fun.  The race courses are a whole other experience like this.  (Still no npcs to race with yet, it's next I swear!!) SlingBot Boarding v0.2.2: https://www.kongregate.com/games/WilliamOlyOlson/slingbot-boarding I've also put some significant work into more/better sound effects, spent some time in Audacity making some permanent remixes since I'm having trouble with applying effects in Unity, this way should be better for performance anyhow. Also spent several hours on the UI, fixing things up and making them nicer to look at(hopefully).. haha What else, mmm.. airBoost rockets, UI upgrades, Rocket Shop menu... Testing the last build... fingers crossed!!!! Ahhh Yeah!  There's the money shot! Enjoy!

Septopus

Septopus

One dose of Currency please! (v0.2.1)

So, it was time I added a form of currency to SlingBot Boarding.  I've been working out how to make the game more interesting and I also wanted to incorporate more classic game elements.  So, say hello to Spinning Golden Rings!  build v0.2.1: https://www.kongregate.com/games/WilliamOlyOlson/slingbot-boarding Every player starts with 100 rings in their account(new space in the UI top-right).  These will be used to buy boost fuel and upgrades for your board/engines.   When I make those things...  Soon. You will soon be able to earn them doing all kinds of fun and interesting things throughout the park.  But for now, you can go Rabbit Hunting every 5 minutes to get a chance at snapping up a goodly sum, before I inevitably extend the Hunting interval out a bit longer...  Or make the rabbit a little less generous..  Probably both.  haha   I've also tweaked all of the sounds a bit and added a few new ones(a good crunchy when the board leaves from/returns to the ground, and a nice classic power-up style ring collection sound), it's really starting to sound like a game now!!  I've also switched out some of the main UI text elements for a more meshy type of.. type..    It will look much cleaner when I get them all swapped out and arranged/colored/etc.. All for now, going to bed before 2am today, trying anyhow.. Happy Hunting!!

Septopus

Septopus

SlingBot Sounds.. and A Rabbit?

So, I've built v0.2.0..  and it's well after 3:00am my time this go-round. haha In this build I've started to implement sounds, currently I have a wind sound for ambiance and a  fairly rough(sounds much better in the editor) board/snow sound.  For some reason it sounds like the High Pass Filter I applied in Unity isn't making its way into the WebGL build.. more troubleshooting.  But it does sound better than NO sound at all... WAY Better!! Game Link:https://www.kongregate.com/games/WilliamOlyOlson/slingbot-boarding Oh yeah, I have the first NPC working too. It was a simple test of NPC steering, and it turned into an entirely new feature of the game! It's called a Rabbit Hunt!  Click the Rabbit button and you have 2 minutes to beat the high-score.  All you have to do is stay close to the NPC.  haha!  Within 50m scores 1 point for each frame, outside of 50m loses 1 point.  Your direction arrow fades away if the rabbit gets further than 200m away.  Just noticed the Courses button is still visible during the rabbit hunt... Shoot... Oh well, hopefully it doesn't let all the bugs out when it's clicked during a hunt...  Fix it tomo... later today!   After sleeps. BTW, I'm really diggin on the easter-egg potential of this new Rabbit Hunt feature.  (no there aren't any yet, but the potential is just ridiculous)

Septopus

Septopus

Unity + WebGL + PlayFab + Kongregate = :D

It can be done.. I got PlayFab leader-boards WORKING!!! heh, it's past 2am.. In spite of my trouble yesterday, I decided to give it another go and somehow it all just worked.  I think I got ahead of myself yesterday and just wrote too much code in one sitting without running it.  I can see that becoming a temptation for me while dealing with the much longer build times for WebGL.. I also have the numbers synchronizing between PlayFab and Kongregate..  And by that I mean whenever I retrieve the stats from PlayFab, I update Kongregate to reflect those statistics.  So I have all the numbers in a system I can manage. And now when you click the little score podium on the top right, you get a nifty overlay showing you your all-time best stats.  I'll add numbers for the current positions of your top scores on the leader boards and whatnot.  But first.. sleeping.. If this is not your sleeping time though, please, give it a whirl.    Link Below. Game Link: https://www.kongregate.com/games/WilliamOlyOlson/slingbot-boarding V 0.1.8: PlayFab integration is functional.  Some minor improvements/fixes to how airtime is recorded, I was seeing unreasonably high numbers before.  I think that's under control now.  

Septopus

Septopus

SlingBot Boarding Kongregate Leader-Boards.

Game Link: https://www.kongregate.com/games/WilliamOlyOlson/slingbot-boarding Okay, all non-racing stats are now updating Kongregate leader-boards.  (Best Trick(combo trick points), Best Airtime(time in air in ms), Best Flight(longest linear distance in air), Best Speed(fastest recorded speed), and Courses Completed. I'll be adding 3 trophy/medal counters when I get NPCs and racing going (gold,silver, bronze).. Unfortunately, the stats system on Kongregate is designed mostly to help Kongregate encourage players to earn Kongregate badges and etc. achievements by playing games.  So, the stats system is only a one-way transaction.  Which makes it nearly impossible to display accurate leader-boards in-game.  They display on the side-bar in non-cinematic mode, and I'm sure you can browse to them somewhere else too, but for now I guess that will have to do. I spent at least 3 hours trying to figure out how to get PlayFab(an actual leader-board back end that's supposedly "partnered" with Kongregate) to work with my WebGL build on Kongregate and no go...  I've used PlayFab before on a PC/Android game and it worked flawlessly, so it's not just me, haha..    Got frustrated with it for now, so Kongregate stats will be all there are for the moment.  haha   I need to work on some other things for a while...  Like providing some visual feedback on the fact that you've earned points for doing stuff..   Oh yeah, and some NPCs.. Anyhow, there's something at least sort-of competitively motivational in the game now.  lol

Septopus

Septopus

SlingBot Boarding first public playable WebGL build.

Well, it's not complete but I think the gears are all there now.  I still need to incorporate leader-boards, build some NPCs and do some more fine tuning here and there.  Still, not much more than a toy, but it's pretty fun! https://www.kongregate.com/games/WilliamOlyOlson/slingbot-boarding ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Really anxious to hear about frame-rate numbers(bottom corner).  In this latest(WebGL) build I've been getting close to a stable 60fps in FireFox. I even threw together a simple touch interface, haven't tested it on a touch device yet though, so I dunno how well I guessed for size/placement of the buttons.  I'm thinking they might need scaled down a bit for some devices... haha.   Anyhow, would love some feedback if you got a minute to do some rocket-powered snowboarding, with a robot.    

Septopus

Septopus

Hello Unity + WebGL + Kongregate, goodbye sanity.

So, it's 2am and I'm writing a blog entry.  I must be waiting on a Unity WebGL build to complete so I can upload it and THEN check if my Kongregate API code hacks are working yet... Wow, never expected this journey to be like this.  I suppose I never do anything the easy way.  So now I'm integrating a JavaScript API into my c# Unity game... I'll do a more thorough write up/code share later, this will just be some quick notes.. and something to keep me busy between builds.. Go here first for basic Kongregate API initialization and integration: https://www.kongregate.com/forums/1021798-game-programming-subforum/topics/1673115-guide-kong-api-with-unity-jslib-system The above uses the new(2017.1+) Unity way of including JavaScript (.jslib), so at least you know it's supported, even if there's no documentation on how to use Kongregate with it yet. I'm currently working on adding support for kongregate.sharedContent to my game, may even contribute to/fork the above when I'm ready for that.. This will allow players of SlingBot Boarding to Create and Share their own race courses.  With shared leader-boards it will be pretty close to multi-player without all the headache.  I may even simply record race data and use that to generate npcs that actually move like players. Alright, last build and hopefully I'll have Race Course Save and Load working on Kongregate... If not, I will sleep anyways, because now it's almost 3am..  haha.. Well.. one more.. Haha.. Still not quite there.. I can save items, I can view saved items, I just can't figure out the callback registration for "loading" the saved file.  So the struggle will continue tomorrow.

Septopus

Septopus

Sling Bot Boarding Day 7, Toy Build 4! :D

Not much to say about today's build that I didn't post yesterday... or earlier... wait.. what day is it??.  haha In fact, there's nothing else to be said...  Just play it!! .zip = Win32 (Scanned clean with Kaspersky VirusDesk, see .png for checksums) SBBB4.zip  

Septopus

Septopus

Well now, I can't be the only one having fun! :D

So, as this first day of raBid development has come to a conclusion, I find I've spent far more of it having fun playing my new mini-game than I did actually feeling like I was making one.  And HEY!  Check this out, I have a Toy Build for you to play with too...!! (this is just a screen shot of it though, you'll have to find the attached .zip file) Takes a second to get used to the controls, it's a fully physics driven movement system, so keep that in mind.  You are moving with Thrust, and there WILL be THRUSTERS!! on these super robot boards!  I didn't have time to add the THRUSTERS!! to the toy, sorry for that..  Yes, they will be awesome enough to have two exclamation points, and yes even in the middle of a sentence..  So don't worry about it. Enjoy. Oh yeah, and if you happen to think about it, I would love feedback on EVERYTHING... 32bit Win Build in zip(Scanned with Kaspersky VirusDesk before upload), I'll probably put up an Android toy too, dunno when yet(tomorrow?).  Trying for several platforms here, but I've only got PC and Android that I can test myself, so we'll see how it goes.  I may have to borrow an Ipad from somebody. Anyhow, enough of my rambling, go on, kick the tires!!  Hope it doesn't crap out on ya.  It works on my dev. machine which has some pretty terrible "graphics hardware"..  Easier to keep things mobile-friendly that way though. Latest Build: https://www.gamedev.net/blogs/entry/2266237-sling-bot-boarding-day-7-toy-build-4-d/  

Septopus

Septopus

  • 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!