|
Stick100 posted:In short TDD is NOT recommended for game development for these exact reasons. Instead when you have an issue you want to implement, go implement it and afterwards consider if a covering unit test might be worthwhile. In some cases it will but in many it won't, unit tests can be great for code logic, but be very careful to not use too many as it can kill your ability to adapt (which is the essence of early game development). It's arguable that if you are writing tests that break when the implementation changes, then they weren't good tests to begin with. Unit tests aren't for testing your implementation details. If you have an hour to spare, this talk by Ian Cooper titled "TDD, where did it all go wrong" is pretty good. It definitely stamped out some incorrect assumptions I had about unit testing. The closest I ever came to "Game Development" was some poo poo little roguelike made for a 7drl challenge. It was written in Javascript and had no unit tests. So I can't really talk about how the knowledge applies to game development. I guess in a perfect world, you test the "outside" api of the core logic of the game which is separated from anything else. In practise, I have no loving idea how that would work with something that traditionally relies so heavily on state like a video game. On a sort-of-but-not-really related note. I recently read about the concept of the Component-Entity-System through a blog post by Chris Granger. I could probably see that approach being easier to unit test, but is starting to seriously drift away from the "how do I unit test" question.
|
# ? Apr 3, 2014 08:35 |
|
|
# ? May 12, 2024 15:09 |
|
Xik posted:It's arguable that if you are writing tests that break when the implementation changes, then they weren't good tests to begin with. Unit tests aren't for testing your implementation details. Edit: just realised this is basically what you said towards the end, my bad. I think the main problem is that games are simulations (of fantasy universes in most cases), and so it's often hard to define a test for whether the simulation ran correctly. Even physics is difficult to predict without running the simulation yourself. You try to ask "What is the postcondition of a jump?" and test for it. But the answer changes as the game design changes. I'm also a game developer with zero understanding of TDD so maybe I have it wrong. Flownerous fucked around with this message at 10:14 on Apr 3, 2014 |
# ? Apr 3, 2014 10:09 |
|
It is also worth mentioning that TDD was largely popularized by users of dynamically typed programming languages like ruby and python. Strongly typed languages provide a safety net for common programmer errors, and often a large portion of TDD style test cases are devoted to verifying trivial integrity properties of programs which would be entirely unnecessary in a strongly typed language. Problems which have well defined inputs and outputs and operate as a pure function (like a parser or a sorting algorithm) lend themselves well to automated testing, and when you find yourself solving this type of problem TDD can be an appropriate and helpful tool. Problems which are more like a continuous simulation with lots of persistent state evolving through time in response to inputs (the main portion of most games) are poorly suited to automated testing, and TDD can lead to tremendous incidental complexity for little benefit. Use the right tools in appropriate situations.
|
# ? Apr 3, 2014 13:51 |
|
Yeah, TDD only ever made sense to me when working in a dynamic interpreted language where you have no idea if there's even syntax errors in your code until it's executed. There you need test coverage even of otherwise trivial code because it's basically replacing a lot of the static error checking that a compiler would do. (I have no idea why people don't realize this overhead completely wipes out any perceived productivity gains from working in those languages, but whatever.)
|
# ? Apr 3, 2014 15:45 |
|
Internet Janitor posted:It is also worth mentioning that TDD was largely popularized by users of dynamically typed programming languages like ruby and python. Strongly typed languages provide a safety net for common programmer errors, and often a large portion of TDD style test cases are devoted to verifying trivial integrity properties of programs which would be entirely unnecessary in a strongly typed language. I can't find the "like" button. How do I tweetshare this?
|
# ? Apr 3, 2014 15:46 |
|
Why do the Unity BitStream.Serialize() overloads have char, but not byte, when the documentation explicitly tells you that if you serialize a char only one byte will be serialized? I can't imagine any scenario where this is useful, and it causes me to have to allocated buffers twice the necessary size while they sit perpetually half-empty. Plus I have to cast between char and byte all over the place. Anyone reading my serialization code will think I'm insane.
|
# ? Apr 4, 2014 04:22 |
|
What that lecture calls "BDD" has actually gained some traction in game dev in the form of bots, which are really neat, but they have to be planned for early. Small, isolated tests are incredibly difficult to make in a game where very few things act in isolation and it's difficult to get a program state suitable for input. OneEightHundred fucked around with this message at 06:34 on Apr 4, 2014 |
# ? Apr 4, 2014 06:31 |
|
Internet Janitor posted:Problems which have well defined inputs and outputs and operate as a pure function (like a parser or a sorting algorithm) lend themselves well to automated testing, and when you find yourself solving this type of problem TDD can be an appropriate and helpful tool. Problems which are more like a continuous simulation with lots of persistent state evolving through time in response to inputs (the main portion of most games) are poorly suited to automated testing, and TDD can lead to tremendous incidental complexity for little benefit. Use the right tools in appropriate situations.
|
# ? Apr 4, 2014 08:52 |
|
Scaevolus posted:If you have a deterministic game engine, you could record inputs and check that changes you make (optimizations, refactorings, ...) that shouldn't affect behavior don't by comparing game states.
|
# ? Apr 4, 2014 19:17 |
|
Flownerous posted:I think the main problem is that games are simulations (of fantasy universes in most cases), and so it's often hard to define a test for whether the simulation ran correctly. Even physics is difficult to predict without running the simulation yourself. Many programs are like simulations: take initial state, perform operation, capture result state. If that operation depends implicitly on a lot of non-input state, it's hard to test, but with TDD you sort of inherently avoid that, because you ipso facto have code that's reasonably testable. You probably reason about the mechanics of the game in relatively isolated ways: "when they press jump, they arc through a height of X units and end Y units farther ahead." Not "when there's lava they jump over it if they jump from this close." One test approach could be to put the player at an origin, initiate a jump, track the height as you advance the simulation, and run a few steps of the simulation beyond where they hit back to zero to make sure they don't end up too low or whatever. This is easier if your player/physics logic is distinct from rendering and game setup, but many things will be. I was a TDD skeptic for a long time, until I realized that it wasn't a way to end up with the same code and some more tests. You end up with different code, as an effect of writing it with tests front of mind. You might or might not find that different style of code to be desirable, but I found it way easier to work with, especially when I was iterating on a lot of parts and wanted confidence that changing the log format hadn't broken something else. The core of tests are that same kinda-functional input->output verification that most behaviour comes from (for me). If the code is amenable to testing, I'm also just more likely to actually write tests. I'll admit that I'm a bit lapsed and sometimes end up trying to retrofit tests (usually after some very frustrating bug was introduced); I almost always wish I'd has tests in mind all along. The *trivial* game stuff I've done has so far let me write non-graphical/command-line tests for most mechanics, though it was annoying to build map/board state in some cases until I wrote a bit of tooling. The systems that were tied deeply into some other state were the ones that caused clenching when I had to change them (like shaders). My background definitely influences my position here, though. I spent a decade-plus working on browsers, where test-friendliness of things determine whether "make sure we handle network timeout well" is or , and things like system text measurement can ruin your day. Diffs that decoupled systems were acts of righteousness, because they made things easier to work with, and less likely to suffer from breakage at a distance.
|
# ? Apr 4, 2014 21:00 |
|
Internet Janitor posted:It is also worth mentioning that TDD was largely popularized by users of dynamically typed programming languages like ruby and python. Strongly typed languages provide a safety net for common programmer errors, and often a large portion of TDD style test cases are devoted to verifying trivial integrity properties of programs which would be entirely unnecessary in a strongly typed language. Interesting discussion about all of this. Although I should have pointed out that for the particular case I'm interested in using TDD for is a tool, rather than a game. The issue that I'm trying to resolve is that a lot of things in the tool are interconnected, and I need to make sure that everything is updating its values correctly in a predictable way. Also there are several operations that can be performed that need to be communicative, so moving, rotating and scaling an object yields the same results as scaling, rotating and moving an object.
|
# ? Apr 7, 2014 04:03 |
|
AntiPseudonym posted:Interesting discussion about all of this. Although I should have pointed out that for the particular case I'm interested in using TDD for is a tool, rather than a game. You're confusing validation tests with unit tests. Unit testing is making sure each individual component in your program does what you intended it to do. It's a different kind of testing - validation or integration testing generally - that checks how components interact, and while those tests are incredibly valuable they're not part of TDD. As to how to write those tests: break your program into smaller pieces and program to interfaces. If your program is so heavily interconnected that you're having trouble accessing the data you need to verify that an operation worked, that's an indicator that your program is badly designed.
|
# ? Apr 7, 2014 08:37 |
|
You should also try to parameterize everything you might ever possibly want to change later on. This makes stuff easier to change later, and then also allows for proper unit testing where you pass various sets of parameters to a function and get testable output back. The functions themselves should be mostly ignorant of any constant values. Algorithms you can imagine yourself trying to optimize for speed later on in development are a good example of a thing you should probably build a test for. You know you'll probably want to adhere to that algorithm, but the details of how that happens are something that might change. Testing can help you avoid changing the algorithm in subtle ways while attempting to optimize it. Places where you think to yourself, "A lot of other pieces of code rely on this thing working a certain way..." are also places where tests can be really useful to make sure that those things, in fact, don't change. You don't necessarily need to be building tests from the outset and doing a full-on TDD, but building tests in the alpha stage could be massively helpful moving forward to avoid breaking things unwittingly during the optimization or porting process.
|
# ? Apr 7, 2014 09:52 |
|
So Shader Forge is half off today ($40) and looks really goddamn powerful. Has anyone had any experience with this and is there any reason I wouldn't be able to take advantage of it with a 2D game? https://www.assetstore.unity3d.com/...#/content/14147
|
# ? Apr 7, 2014 16:56 |
|
Yodzilla posted:So Shader Forge is half off today ($40) and looks really goddamn powerful. Has anyone had any experience with this and is there any reason I wouldn't be able to take advantage of it with a 2D game? Shader forge is fantastic. I can't think of much it'd help with in 2D though. Could be used, just depends on the game I guess! If you had a big wall with glowy pipes that had a pulse going through them, this would definitely work for that. If you had just plain sprites with normal mapped lighting or something, I'd use builtin stuff.
|
# ? Apr 8, 2014 09:30 |
|
Just launched our greenlight campaign for Guild of Dungeoneering today, any votes & shares much appreciated! http://steamcommunity.com/sharedfiles/filedetails/?id=246445759 Also the trailer is here: https://www.youtube.com/watch?v=mDyA7h50fjw
|
# ? Apr 9, 2014 14:29 |
|
retro sexual posted:Just launched our greenlight campaign for Guild of Dungeoneering today, any votes & shares much appreciated! Upvoted. This definitely looks like it could be some good fun. Love games where you don't have direct control of the character!
|
# ? Apr 9, 2014 14:51 |
|
Unity peep... Are the extensions compatible with C++ 11 at all? I have a static library for iOS that uses C++11, when making an extension for it I'm having a conflict since the Unity static lib uses the C++ 03 standard library while I need the clang C++11 standard lib. Any way to resolve this?
|
# ? Apr 9, 2014 18:23 |
|
Hughlander posted:Unity peep... Weird. I've used C++ 11 stuff as native plugins with Unity without problems before.
|
# ? Apr 9, 2014 19:46 |
|
Eurgh. As a note of warning, if you sign up for AdMob and at any point in your life you want to use AdSense make sure you have an approved Adsense account first. It looks like if you do it the other way around Adsense will pretty much lock you out of using the account forevermore. You could potentially make a new Google Account, but you'll have to be careful that the personal details are different because otherwise Google will helpfully note that it has the same details as an "approved adsense account" and then deny the request. This seems to have been around for over half a year already. This is barely game development related, but as I was hoping to put up a web version of my game and reap my 2 bucks a month from ad clicks it's a bit annoying having to jump through all these hoops.
|
# ? Apr 9, 2014 22:09 |
|
Does anyone know of articles or blog posts on the topic of building a diagnostics UI into a 3D and/or multiplayer game? I want to get an early start on this in my current project (alongside getting the networking model ironed out). The sort of thing I'm thinking of are: visualizations of player interpolation/server-position/extrapolation, stats on player latencies and packet dropping, probably other stuff I didn't think of yet or forgot. I'd also like to create a debug UI for tuning network features so on a client I can do stuff like disable syncing to server, or disable prediction etc. without having to rebuild or even leave the game. But I think I already have an idea how to build that UI (although if there's a really good write-up on that then I want that too!).
|
# ? Apr 9, 2014 22:40 |
|
xgalaxy posted:Weird. I've used C++ 11 stuff as native plugins with Unity without problems before. I misspoke, what I meant was CXX standard library. We use libc++ (Clang's C++11 runtime) internally for all projects and Unity is linked against libstdc++ (GNU's C++ runtime.) Which I believe still has issues around things like shared_ptr is still TR1 and not std...
|
# ? Apr 10, 2014 02:41 |
|
What book to the cool kids use to learn Unity these days? I'm pretty familiar with C# so I don't need anything that covers the programming language side of things, just a guide to the Unity IDE and how Unity-specific code snaps together. Thanks!
|
# ? Apr 11, 2014 19:06 |
|
I'd say just do one or two of their tutorials, then just google "how do I do _X_ in unity". Every question has been asked in the Unity forums! And they have documentation on all the functions on their site too. Of course, this requires an Internet connection, so a book has advantages.
|
# ? Apr 11, 2014 22:16 |
|
I agree, I spent a few hours with the project tutorials and that was plenty for me to become comfortable in Unity. I did roll-a-ball and then about half of space shooter and didn't bother with the stealth one. Since you're coming from a programming background that should be plenty to get you started.
|
# ? Apr 11, 2014 22:46 |
|
The "Unity 4.x Cookbook" would be a good place to start if you want a book. It has Mecanim coverage which is nice, especially because all the videos on it that Unity 3D has produced are out of date so they're harder to follow in one viewing. There's also a bonus chapter on the legacy animation system you can download from Packt Publishing's website. You could also run through "Unity 3.x Game Development Essentials". I flipped through it real fast and most of it still applies to 4.x. Just don't use Javascript. Chapter 10 is on the legacy animation system but you should still know how to use it. Both of these books are available on Safari, if you have a subscription. If you don't, you can get the Cookbook for $18 off packtpub.com with the coupon "bawdanu"(I just looked up on retailmenot). It's probably not worth spending money on the U3.xGDE unless it's like $5. P.S. Don't use Javascript(or Boo).
|
# ? Apr 11, 2014 23:25 |
|
Tutorials are the place to start, not books. Just tinker around with very very simple projects to get the hang of individual systems, at which point you can start combining one or two. Mostly you just learn by trying things out and seeing what happens, then referring to the manual to figure out why it didn't do what you expected. And yes, use C#. Unity doesn't actually use Javascript at all; instead it uses Unityscript, which is basically an object oriented language with Javascript syntax. So there's no reason to use that when you could just pick up C# and have a language that's actually used elsewhere as well.
|
# ? Apr 11, 2014 23:25 |
|
dizzywhip posted:I agree, I spent a few hours with the project tutorials and that was plenty for me to become comfortable in Unity. I did roll-a-ball and then about half of space shooter and didn't bother with the stealth one. Since you're coming from a programming background that should be plenty to get you started. One Note: The stealth tutorial is pretty useful but it requires many features that are present in Pro only. I got about 1/2 of the way through and then they go into light probes and other neat things and then BAM! no warning it just doesn't work unless you're using Pro. So the tutorial just falls flat without Pro. Because of this I wouldn't suggest the Stealth tutorial.
|
# ? Apr 12, 2014 06:08 |
|
The space shooter tutorial is really easy to go through. I think it is perfect to do first.
|
# ? Apr 12, 2014 06:12 |
|
Another vote for tutorials. I will also throw in hitting the #sagamedev channel on SynIRC. A lot of us in there know Unity rather well.
|
# ? Apr 12, 2014 06:25 |
|
The space shooter tutorial is way better than the stealth one as a general unity tutorial, but the stealth one IS doable without pro. It's just some lighting related stuff that you'll have to improvise or leave out. All the animation, AI, general scripting stuff, etc. are fine. My personal preference was the method someone suggested above of doing separate tutes and then combining them. That plus well documented engines (eg. GoldSrc, Source) that do stuff different or better than unity are good resources for implementing anything else.
|
# ? Apr 12, 2014 20:52 |
|
Guild of Dungeoneering showed up on Boing Boing this morning: http://boingboing.net/2014/04/14/build-the-dungeon-not-the-adv.html They apparently hate the audio!
|
# ? Apr 14, 2014 15:38 |
|
I am using Unity ScriptableWizards to automate creating rooms and such in the editor. It's very easy to launch these wizards from a custom option in the File/Edit/GameObject/etc menus, but it would be really great if I could launch them from a script, in my case, a CustomEditor that puts a button in the script in the inspector. It seems so simple but I am getting nowhere.
|
# ? Apr 21, 2014 16:45 |
|
I don't know if this is beneficial to anyone else or not or if I'm silly for even doing this, but: http://bobthenameless.github.io/fmod-studio-docs/ For some reason it annoyed me to have to open up the FMOD .chm file to look at the FMOD API instead of getting a good result from google for "FMOD Studio API" like a lot of other APIs, so I started converting the .chm file into a gh-pages deal. It's still not in a very good usable format, and for now it's literally a bulk table of contents from just the API section of the .chm cleaned up and rearranged a bit, but hopefully I can turn it into something useful eventually. And I have no idea of the license of the docs of a freely downloadable API with assorted commercial licenses, but I'm not trying to claim it's anything but a repackaging of the normal docs, and once i get it to a better state I'll send fmod an email and find out for sure. It's also no-where near fully automated so it'll probably be just for the current version for now. bobthenameless fucked around with this message at 19:18 on Apr 21, 2014 |
# ? Apr 21, 2014 18:47 |
|
shimmy posted:I am using Unity ScriptableWizards to automate creating rooms and such in the editor. It's very easy to launch these wizards from a custom option in the File/Edit/GameObject/etc menus, but it would be really great if I could launch them from a script, in my case, a CustomEditor that puts a button in the script in the inspector. It seems so simple but I am getting nowhere. There's probably a direct way to launch them, but if that fails you should just be able to call EditorApplication.ExecuteMenuItem
|
# ? Apr 22, 2014 03:19 |
|
After Garry Newman came out speaking against the uLink networking API and their attempt to silence his outspokenness about the lack of support, I'm kind of reluctant to be using Unity at this point because I was really relying on uLink. Are there any alternatives? I really don't want to use the cloud solution, I want functioning netcode so I can build off of it and create dedicated server tools and all that good stuff.
Alexander DeLarge fucked around with this message at 12:26 on Apr 22, 2014 |
# ? Apr 22, 2014 10:16 |
|
Alexander DeLarge posted:After Garry Newman came out speaking against the uLink networking API and their attempt to silence his outspokenness about the lack of support, I'm kind of reluctant to be using Unity at this point because I was really relying on uLink. Are there any alternatives? I really don't want to use the cloud solution, I want functioning netcode so I can build off of it and create dedicated server tools and all that good stuff. I think even with Photon you can do your own dedicated servers, but I'm not sure if they require you to use their software for the servers you host or not. I remember not being that impressed with Photon's offerings.
|
# ? Apr 22, 2014 14:57 |
|
Alexander DeLarge posted:After Garry Newman came out speaking against the uLink networking API and their attempt to silence his outspokenness about the lack of support, I'm kind of reluctant to be using Unity at this point because I was really relying on uLink. Are there any alternatives? I really don't want to use the cloud solution, I want functioning netcode so I can build off of it and create dedicated server tools and all that good stuff. This, raw Unity3D API, or just use .NET?
|
# ? Apr 22, 2014 17:43 |
|
Alexander DeLarge posted:After Garry Newman came out speaking against the uLink networking API and their attempt to silence his outspokenness about the lack of support, I'm kind of reluctant to be using Unity at this point because I was really relying on uLink. Are there any alternatives? I really don't want to use the cloud solution, I want functioning netcode so I can build off of it and create dedicated server tools and all that good stuff. Take a look at TNet. http://forum.unity3d.com/threads/163681-Released-TNet-Tasharen-Networking-Framework It's from the creator of NGUI and it's a full networking solution. People seem pretty happy with it.
|
# ? Apr 22, 2014 18:44 |
|
|
# ? May 12, 2024 15:09 |
|
xzzy posted:Guild of Dungeoneering showed up on Boing Boing this morning: This was pretty good for me, given it was a single paragraph about the game! They sent about 3.5K visits to the Dungeoneering page on my site which led to about 40-50 pre-orders. (I don't know for sure because I haven't set up a thank you page for post-purchase redirect + corresponding GA 'goal' yet) I hadn't pitched them specifically when I did my media blitz on the 9th (trailer release + greenlight day), but I bet it was a knock on effect from that.
|
# ? Apr 22, 2014 18:47 |