|
Rocko Bonaparte posted:What all crap should I be worrying about when implementing pause and resume in Unity? I looked it up and got a bunch of stuff about setting Time.timeScale to 0.0f to stop time. That's half the situation. My player controller can still reorient the player, even if the player won't move. So I already know that's one thing to check. Should I generally just wrap everything in some kind of pause/resume framework? You could do something similar to what I'm using in my TBS game to only let actors move on their turn: All objects you want to be pausable inherit from some mother class, let's call it RockoObject. RockoObject inherits from MonoBehaviour, and implements the methods Update and FixedUpdate. However, it also has the virtual methods MyUpdate and MyFixedUpdate, which all of RockoObject's children will implement. MyUpdate and MyFixedUpdate are where you will actually write the code you want to run every frame/interval. Children of RockoObject will not implement Update or FixedUpdate, and at the end of their MyUpdate/MyFixedUpdate methods will call base.MyUpdate / base.MyFixedUpdate. RockoObject will look like this: code:
|
# ? Dec 13, 2015 20:22 |
|
|
# ? Jun 10, 2024 11:45 |
|
Rocko Bonaparte posted:What all crap should I be worrying about when implementing pause and resume in Unity? I looked it up and got a bunch of stuff about setting Time.timeScale to 0.0f to stop time. That's half the situation. My player controller can still reorient the player, even if the player won't move. So I already know that's one thing to check. Should I generally just wrap everything in some kind of pause/resume framework? The timeScale thing can work, either 0 or with a tiny value as Shalinor suggested, as long as you don't need to do anything in your pause menu that depends on time passing. For example, if your pause UI uses tweens or has animations, make sure they use unscaled time (Time.realtimeSinceStartup) to proceed instead of the normal scaled time, as otherwise they'll never finish and your UI will become unusable. I don't remember for sure, but I believe Coroutines also stop running at 0 time scale. In any case things like WaitForSeconds do use scaled time, so be careful with those. With situations like your player still being able to look around, you may still need to implement some kind of global 'isPaused' thing to get those sorts of things in line. What's happening there is probably that your mouse look code just directly sets the player/camera's transform values instantly every frame based only on how much the mouse moved. The movement code is most likely getting an input vector and then multiplying it by some values to get the final move vector, one of those values being Time.deltaTime (so that movement speed is not framerate-dependent). At time scale 0, Time.deltaTime will also be 0, so no movement. But since the mouse look isn't using that, it's completely unaffected by the time scale. You could also put Time.deltaTime into the mix for your mouse look, but then your look movement would scale up and down with framerate, and it typically 'feels' better to have mouse look in first person games not be tied to anything other than just the mouse movement. So for this, you could do something like add a globally-reachable 'isPaused' variable, and modify your mouse look script to check for that at the start of it's Update, and just return if it's true without doing any movement. Or maybe another script listens for when the game is paused, and disables the entire player controller script. There's a bunch of ways to do pause in games, and they all have their crappy edge cases or extra work that you'll run into eventually
|
# ? Dec 13, 2015 20:23 |
|
You could do what systems like PlayMaker have integrated, and is generally the suggestion method for these kind of things: Your game should run via a hierachy of timelines. The global timeline is realtime (if you want to scale this it's suggested to put the scaling on a nested timeline inside that, but i guess you could if you want?) and there's nestings of timelines. Each timeline has a timescale and when you tick the global timeline, it updates the time of each inner timeline by delta * timescale. So if you have a timeline that ticks from 0 to 10s, and an inner one with 0.5 timescale, it goes from 0 to 5s. You also have the ability to completely pause a timeline so that nothing on it gets updated or processed (typically also automatically paused when it's set to 0 I think). That way you can have a Game timeline and a Menu timeline, particles and animations and updates stop happening when the game is paused, but the menu can have animations and whatever still absolutely fine. This also instantly lets you do cool stuff like having a level and every enemy and particle in it slow down to a stop while the player stays on their own timeline and can continue moving around it freely. Also, this doesn't just have to work for global "game start -> game end" timelines. Particles for example could run on a timeline of 0 -> lifespan, and everything still scales fine.
|
# ? Dec 14, 2015 13:27 |
|
How can I get a random unit vector that exists inside the imaginary cone around some vector A where the angle between the new vector and A is less than or equal to θ? I'm trying to do simple bullet spread where the distribution inside any disc orthogonal to vector A is uniform. Everything Google comes up with is either non-uniformly distributed (when a random point inside a sphere is used) or too expensive (converting to polar coordinates then back again) or it doesn't let me describe the spread as an angle where the angle would be equal to 2θ.
|
# ? Dec 14, 2015 21:40 |
|
StickFigs posted:How can I get a random unit vector that exists inside the imaginary cone around some vector A where the angle between the new vector and A is less than or equal to θ? Is converting to polar coordinates and back again really too expensive? Are you doing it like 100,000 times a frame?
|
# ? Dec 14, 2015 21:43 |
|
StickFigs posted:How can I get a random unit vector that exists inside the imaginary cone around some vector A where the angle between the new vector and A is less than or equal to θ? 1. Compute a target disk from the desired angle, direction and distance. 2. Generate a sample on the unit disk. 3. Transform the sample from the unit disk to your target disk. 4. Normalize. Specifically for generating a uniformly distributed samples on the unit disk there are a couple of schemes. Simplest is to use polar coordinates and sqrt the radius. Possibly better (less distorting) is to use a concentric mapping. E.g. from the Mitsuba source: code:
E: Clarification, uniformly sampled polar coordinates are of course not uniform in Cartesian space. Xerophyte fucked around with this message at 23:06 on Dec 14, 2015 |
# ? Dec 14, 2015 23:03 |
|
Depending how up-your-own-sleeve clever you want to get, you could also calculate a random unit vector in the XY plane off of origin, multiply it by a 0.0 to 1.0 random, rotate that vector by whatever heading rotation you used to generate your forward vec in the first place, and then add the result to your forward vector. That would possibly be faster, maybe? Since you're only doing a single 3x3 matrix rot mult? But we're reaching how many angels can fit on the head of a pin territory, here.
|
# ? Dec 15, 2015 01:24 |
|
Shalinor posted:Depending how up-your-own-sleeve clever you want to get, you could also calculate a random unit vector in the XY plane off of origin, multiply it by a 0.0 to 1.0 random, rotate that vector by whatever heading rotation you used to generate your forward vec in the first place, and then add the result to your forward vector. That wouldn't be uniform.
|
# ? Dec 15, 2015 02:57 |
|
I've worked up some UDP netcode using Boost ASIO to fire packets back and forth, but I'm getting worried that NAT traversal and other general networking problems might bite me in the rear end down the line when it'll be harder to rip it all out again. Any common advice for this sort of thing?
|
# ? Dec 15, 2015 03:00 |
|
Shalinor posted:Depending how up-your-own-sleeve clever you want to get, you could also calculate a random unit vector in the XY plane off of origin, multiply it by a 0.0 to 1.0 random, rotate that vector by whatever heading rotation you used to generate your forward vec in the first place, and then add the result to your forward vector. Generating a random unit vector and multiplying it by a factor in 0 to 1 is a unit disk sampling. It's not directly a uniform one, which may or may not matter. float3(sqrt(u) * cos(2 * PI * v), sqrt(u) * sin(2 * PI * v), 1) is the cheapest way to go from a uniform sample on the square uv to a uniform sample on a disk around (0, 0, 1), although it's more distorting than a concentric mapping. This also may or may not matter. Then it's indeed a 3x3 rotation + scale to transform that sample to the desired disk around the target. There are various clever trade-offs you can make for cheap computation versus uniformity and sample quality in general, but if you want the samples to end up on a uniform disk then you're probably going to want to use a polar or concentric mapping from the square at some point.
|
# ? Dec 15, 2015 03:07 |
|
Xerophyte posted:There are various clever trade-offs you can make for cheap computation versus uniformity and sample quality in general, but if you want the samples to end up on a uniform disk then you're probably going to want to use a polar or concentric mapping from the square at some point.
|
# ? Dec 15, 2015 03:28 |
|
I'd also question, are you really sure you *want* a uniform disc mapping for your bullet spray? Seems like concentrated towards the center (like you'd get from random angle * random distance) would be the more realistic distribution anyway.
|
# ? Dec 15, 2015 03:37 |
|
There's also a problem with Xerophyte's answer, where what's uniform on a unit disc is not uniform on a circular solid angle. This problem is small so long as θ is small. If you really care though, this should be truly uniform (adapted from here): 1. Generate u and t uniformly: u = [cos-1θ, 1], t = [0, 2 pi] 2. The cartesian coordinates are then: code:
|
# ? Dec 15, 2015 03:41 |
|
HappyHippo posted:There's also a problem with Xerophyte's answer, where what's uniform on a unit disc is not uniform on a circular solid angle. This problem is small so long as θ is small. If you really care though, this should be truly uniform (adapted from here): This is true if you want uniformity over solid angle. The stated problem was to have a uniform distribution on the cap of a regular cone and not a spherical cone, though.
|
# ? Dec 15, 2015 03:50 |
|
Xerophyte posted:This is true if you want uniformity over solid angle. The stated problem was to have a uniform distribution on the cap of a regular cone and not a spherical cone, though. Well he said he wanted a "random unit vector" which I took to imply the solid angle. Honestly though roomforthetuna makes a good point that you don't necessarily want a uniform distribution if you're modelling bullet spread.
|
# ? Dec 15, 2015 04:22 |
|
Triarii posted:How is this situation handled in Git? FWIW, there's a version control megathread: http://forums.somethingawful.com/showthread.php?threadid=3113983
|
# ? Dec 15, 2015 10:51 |
|
roomforthetuna posted:I'd also question, are you really sure you *want* a uniform disc mapping for your bullet spray? Seems like concentrated towards the center (like you'd get from random angle * random distance) would be the more realistic distribution anyway. I'm trying to simulate some error in aiming with my game's AI so I figured that uniform would make more sense but now that I think of it maybe I do want it non-uniform with bias towards the center. It probably wouldn't make sense to see a uniform distribution on a disc in nature or statistical data.
|
# ? Dec 15, 2015 17:00 |
|
I have these two classes, both of which are attached to a MonoBehaviour object: code:
Edit: OH FOR poo poo'S SAKE (code currently in my HGObject method:) code:
DStecks fucked around with this message at 17:03 on Dec 15, 2015 |
# ? Dec 15, 2015 17:01 |
|
Here's my implementation of what I assume will give me a distribution biased towards the center:code:
|
# ? Dec 15, 2015 17:06 |
|
DStecks posted:... *snrrrk* Yeah, it took me few seconds to see, even with you pointing it out. Isn't the human brain's image processing wonderfully helpful with it's shortcuts? I try to use words that don't look similar when doing something like this, for this very reason. My recommendation would be to change "Audio" to "Sound" or "Animation" to "Movement".
|
# ? Dec 15, 2015 17:25 |
|
Blasphemeral posted:*snrrrk* Yeah, it took me few seconds to see, even with you pointing it out. Isn't the human brain's image processing wonderfully helpful with it's shortcuts? I try to use words that don't look similar when doing something like this, for this very reason. My recommendation would be to change "Audio" to "Sound" or "Animation" to "Movement". Sound is already the word I'm using for the game's mechanical actions-producing-sound system. As in, enemies can hear player footsteps, etc, and that system uses the word Sound to preface elements of it. And the AnimationHandler covers a lot more than just movement. In any case, I won't need to type either name very often, since both classes are going to run pretty much purely by event listening.
|
# ? Dec 15, 2015 17:36 |
|
StickFigs posted:Here's my implementation of what I assume will give me a distribution biased towards the center: That will give you a square-like shape, not a disc. Also it isn't biased. If you want to do it this way (this will be biased towards the center): code:
|
# ? Dec 15, 2015 17:47 |
|
StickFigs posted:Here's my implementation of what I assume will give me a distribution biased towards the center: If you want the max angle to be strict and no samples outside of it then you can still generate samples on a unit disk and map them to a target disk of radius θ, just generate the initial samples non-uniformly. For instance (I have no knowledge of your language/framework so code is approximate): code:
|
# ? Dec 15, 2015 18:35 |
|
So I'm slowly figuring pathfinding out; that is to say, it's barely functional at all. One of the many issues is that npcs sometimes just stop pathfinding, and it happens next to particular walls. I reckon it's because they run out of the grid (which isn't perfectly aligned to obstacles) because of their physical momentum or something. Another pressing issue is that they can't seem to pathfind past other npcs, either constantly or occasionally (I can't tell). In fact they end up walking into each other very often. I imagine that it happens (although it shouldn't) because they find themselves in the same cell; or maybe it's my algorithm, which works via each npc having their personal heuristic, which reports a very high cost whenever there's an npc in a cell that this npc knows of.
|
# ? Dec 17, 2015 18:48 |
|
supermikhail posted:So I'm slowly figuring pathfinding out; that is to say, it's barely functional at all. One of the many issues is that npcs sometimes just stop pathfinding, and it happens next to particular walls. I reckon it's because they run out of the grid (which isn't perfectly aligned to obstacles) because of their physical momentum or something. Another pressing issue is that they can't seem to pathfind past other npcs, either constantly or occasionally (I can't tell). In fact they end up walking into each other very often. I imagine that it happens (although it shouldn't) because they find themselves in the same cell; or maybe it's my algorithm, which works via each npc having their personal heuristic, which reports a very high cost whenever there's an npc in a cell that this npc knows of. We're going to need to see some code man, there isn't much to go on here. As general advice though I recommend you add some debug code which displays each entity's current path in the game somehow. It can be very helpful to have an idea of what's going on under the hood when trying to debug issues like these.
|
# ? Dec 18, 2015 17:57 |
|
I really wouldn't know where to start with code. Although quickly implementing the path rendering (which was really easy and why haven't I done it ages ago) has allowed me to see that my heuristic implementation is working far from flawlessly. Or rather, apparently I was supposed to clear the path myself every time the pathfinder updates it, which I didn't do, so consequent updates would just layer on top, and putting a heavy cost on npc-occupied cells doesn't do anything. So yep, a giant mess. This is from my npc heuristic: code:
Yeah, of course I'm using the "stock" gdx-ai A* pathfinder. Maybe I should finally dig into those guts... Oh my god! These paths are far from optimal.
|
# ? Dec 18, 2015 18:50 |
|
I only yesterday discovered that my A* algorithm was forgetting to actually stop pathfinding after it found its destination, so don't worry if it's not perfect right away. You'll be finding bugs for a while yet if you're anything like me.
|
# ? Dec 18, 2015 19:17 |
|
DStecks posted:I only yesterday discovered that my A* algorithm was forgetting to actually stop pathfinding after it found its destination, so don't worry if it's not perfect right away. You'll be finding bugs for a while yet if you're anything like me. If you program at all you'll find bugs forever. Don't sweat it.
|
# ? Dec 18, 2015 20:53 |
|
So I've decided to go from being a hobbyist to making a full fledged product. It's a hack-n-slash game targeted toward PC, and possibly console if it comes to fruition. I'm a journeyman game developer and professional coder and I'm proficient in both Unity and Unreal, and I don't really have a preference towards either. What I lack, however, is thorough knowledge of the asset creation pipeline. This is a bit of a problem because a robust modular armor/clothes system will be very important to my game. I want to be able to have a system where adding armor/clothes to joints or attachment points is not difficult, and be able to continually add armor pieces as development progresses and my artist gives me new pieces. Also the armor pieces would need to follow along with the model as it moves, with some associated cloth physics when necessary. The game doesn't have to look fantastic, however, the ability to make good looking characters is a priority. Would I be better off using Unity or Unreal? And what would be my overall steps to doing this?
|
# ? Dec 19, 2015 06:59 |
|
Personally, I really like Unreal, I think I have a slight bias because for some reason Unity doesn't work on my computer. That's not to knock Unity, I just don't have experience to say one way or the other. For object creation, I'm not sure when it comes to models, but adding props and things was really easy. I think the only format it accepts is .obj files, but it's really easy to convert any sort of format to .obj (I found an online one that did the trick to import some free prop models for a game I was making as a test). It has a built-in modeling system too, which looks pretty nice, but I haven't done a lot of fiddling with it yet. I think you'll be able to snap bits together fairly easily, with enough paitence/skill. For other aspects of Unreal, I really love the node-based coding system. (you can also code in C++), and just all around feels like a neat tool . Looking at the engine stuff, I think Unreal has the better engine, and has a better chance of looking nicer with less effort too, but to be fair that may be more of who's using the tool as I see a lot more indy developers with less money using Unity and a lot of the stuff from Unreal has been from big studios, or small studios backed by big studios (Dontnod with SquareEnix). (edit: I've been toying with the idea of a story telling game, ala Wolf Among Us or life is strange, though I'm having a hard time nailing it down beyond a basic concept (being about keeping a rag-tag group of young rebels together, helping them all get along), and that I'm going to need a lot of custom modeling, which I'm not going to be able to do myself, and buying from the marketplace is going to be expensive) Foolster41 fucked around with this message at 09:36 on Dec 19, 2015 |
# ? Dec 19, 2015 09:33 |
|
The Atomic Man-Boy posted:So I've decided to go from being a hobbyist to making a full fledged product. It's a hack-n-slash game targeted toward PC, and possibly console if it comes to fruition. As someone who relatively recently made a set of assets for modular character customisation for a Unity game, Unity can definitely do this just fine, but then so can UE4. So I wouldn't base my choice of engine on that, because either will do the job. And they both support more mesh formats than just .obj, thank god - obj doesn't support anything like skeletons, animation or skinning information, so you'd be a bit SOL for character art if that was all you could use! It depends a bit on what kind of art style you want to go for, but the way I usually go about it is to create the character base mesh, and all of the different clothing/armour pieces, all as separate meshes skinned to the same skeleton. Export them to your engine of choice as .fbx files and you should be able to load different items onto the character without too much trouble. As long as they share the same rig, adding more pieces as you go along shouldn't be an issue.
|
# ? Dec 19, 2015 13:31 |
|
I want to try my hand at making an action/adventure game in the likes of Little Big Adventure, but I'm devoid of any creativity. Is there some place where I can find a plot/puzzles for this?
|
# ? Dec 19, 2015 14:39 |
|
Boz0r posted:I want to try my hand at making an action/adventure game in the likes of Little Big Adventure, but I'm devoid of any creativity. Is there some place where I can find a plot/puzzles for this? Having been in that position for wanting graphics, I'd suggest starting out with not even worrying about plot or puzzles - make your game framework before you start trying to get other people involved. Once you have a blank slate that a character can walk around in and some vague objects or blob-monsters that the character can interact with and it feels like an empty shell of a game in the genre you're going for, then find someone to contribute plot or puzzles. I have a story and puzzle-concept that I'm probably never going to get around to developing myself, so we could form the beginnings of a team, but I wouldn't want to be expending effort on it without some good evidence that the time-consuming hard work portion of the process isn't going to just flake out. (Which, statistically, it is.)
|
# ? Dec 19, 2015 18:05 |
|
Hi everyone, We're a two-man development team working with the Unreal 4 engine in hopes of creating a career for ourselves in the games industry. It would be greatly appreciated to hear your feedback for our game. Currently it's packaged to run on 64-bit PC systems and we're in the process of packaging a 32-bit version as well as Mac and Linux ports. Right now 1368x768 resolution support has not been implemented.We're still heavily refining our gameplay and contorls. Wormhole City is a single-player sci-fi adventure game with top-down platforming, puzzle and action elements developed in Unreal Engine 4 for PC. Control vehicles and gain power-ups through exploration and defeating enemies while making game-changing decisions throughout your story. Through faster-than-light technology, nations strive to colonize the universe while diverging factions struggle for control and freedom throughout space. Play as space forces, space pirates, and alien races and uncover their motivations. If you think our project has enough merit, please support us on Greenlight! Here is the link, a trailer, media gallery and a link to the demo, greenlight http://steamcommunity.com/sharedfiles/filedetails/?id=576376585&result=1 trailer: https://www.youtube.com/watch?v=3Pexe5Pu-lI media gallery http://imgur.com/a/jMdDp Wormhole City demo https://mega.nz/#!iNoRGTaQ!i7nqftfApEJMB_C-ZqUdvSud5DURgvh3yI7nDhvWQlU Bonus Gameplay Segment: https://www.youtube.com/watch?v=lz0qgb6K2dE We also have a slightly unrelated gameplay demo that is compatible with the Oculus Rift. Dowload and media below, https://www.sendspace.com/pro/dl/hq2c5a http://imgur.com/a/0eVEy Please let us know if you have trouble downloading or playing the game, we're in the process of trying new file hosting services and we need your feedback! Thank you and happy holidays (USER WAS BANNED FOR THIS POST)
|
# ? Dec 19, 2015 22:17 |
|
Boz0r posted:I want to try my hand at making an action/adventure game in the likes of Little Big Adventure, but I'm devoid of any creativity. Is there some place where I can find a plot/puzzles for this? Steal the plot to your favourite movie. This approach to video game stories has sustained the industry for 30 years.
|
# ? Dec 20, 2015 00:28 |
|
sorry mispost- Always liked the idea of returning to a story and seeing things are worse than they used to be like in Alice Madness Returns or Return to the Wizard of Oz maybe try this with a public domain story? Zenro7 fucked around with this message at 00:50 on Dec 20, 2015 |
# ? Dec 20, 2015 00:48 |
|
Zenro7 posted:... quote:Please let us know if you have trouble downloading or playing the game, we're in the process of trying new file hosting services and we need your feedback! My reaction to the MEGA-whatever client was "oh hell no, installing some download tool I've never heard of". And downloading direct with browser didn't even make it as far as starting the download when I saw >4GB.
|
# ? Dec 20, 2015 01:57 |
|
I'm reading Game Programming Patterns and I'm thinking about Entity Component systems. Hypothetically, if I made an "GraphicsComponent" class, is the idea to map it to a single sprite/visible item and have an entity contain multiple graphics components? Maybe it might be better to have each entity contain a single graphics component have a collection of sprites within it? For example, you could have a "monster" entity containing a graphics component with a monster sprite and a sword sprite. In the first method, there would be two graphics components in the monster entity one containing the monster itself and the other containing a sword. In the second method, you would register both sprites with a single graphics component in the monster entity. If this is really an open-ended question, it'd be awesome if people could provide some intuition behind their explanations for why one way was better than the other. Thanks!
|
# ? Dec 20, 2015 06:29 |
|
Each entity should probably only have one representation on the screen. If you have a guy holding a sword, and the guy and the sword are two sprites, both the guy and the sword are entities. You'd probably want a component that describes the relationship between the guy and the sword.
|
# ? Dec 20, 2015 06:38 |
|
|
# ? Jun 10, 2024 11:45 |
|
Oh I see. What about if you modeled your "monster" in different pieces, like having legs, and a torso, and arms, and wings all in some kind of "papercraft" animation? Would you still model them with separate entities?
|
# ? Dec 20, 2015 07:50 |