|
Can Of Worms posted:I spent some time brainstorming some randomized algorithms for generating landmasses and got one that gives some nice looking results. The idea for this one is that it starts with a flat map, then identifies some peaks. Then it raises land by looking at elevated tiles and randomly decides to raise neighboring tiles (i.e. it takes each tile, looks at its neighbors that are lower and raises a percentage of them) and forcibly raising peaks. Then to generate an actual map I just take a slice at a specific height level, so the actual land are the tiles higher than some prescribed height. On the subject of generating landmasses I'd be very interested if anyone knows a way of generating random landmasses with given a area (e.g., I want two landmasses, one with 40% of the total land area, one with 60%, these % will change though). What I have been doing so far is using perlin noise to generate a completely random one, counting the pixels, then scaling the image to get as close as I can to the desired size. It's not great though as it's often off by quite a bit. Does anyone have any better ideas?
|
# ? Nov 4, 2013 09:25 |
|
|
# ? Jun 12, 2024 15:33 |
|
Maybe a fractal curve of some kind? That way you could keep track of how much land has been allocated with each step of the function.. add a piece of dirt, subtract it from the budget. This site has some really intruiging-looking possibilities: http://www.fractalcurves.com/
|
# ? Nov 4, 2013 16:13 |
|
Heisenberg1276 posted:On the subject of generating landmasses I'd be very interested if anyone knows a way of generating random landmasses with given a area (e.g., I want two landmasses, one with 40% of the total land area, one with 60%, these % will change though). You could also do a few batches of perlin noise at first and pick the one closest in density to your target, to begin with, to minimize the chances of a really sparse map having to be expanded to an 80% fill, which would produce horrible results with a naive coast-expanding method. Edit: you could also do kind of like the guy you quoted, generate a heightmap instead of a landmap, and then simply move your cutoff "land" height (ie. the sea level) to get the area you want. roomforthetuna fucked around with this message at 17:05 on Nov 4, 2013 |
# ? Nov 4, 2013 16:55 |
|
Writing C# tools for C++ apps can be interesting with CLR.code:
What I had to do was move my native DllMain entry point into its own file and mark that file, and only that file has having no CLR support. The rest gets compiled with CLR support. Crazy voodoo poo poo. xgalaxy fucked around with this message at 03:37 on Nov 5, 2013 |
# ? Nov 5, 2013 03:32 |
|
I've been trying to develop a melee attack system for a character controller using Mecanim, but it's been frustrating. My original plan was to use this event system to tie the various tasks (initiating and ending the attacks, adding input buffers, etc) to specific frames in the animations, fighting game style, but it turned out to not be reliable enough for gameplay. Instead, I used it to record the time intervals of the frames I wanted to use for a system using timers in scripting, like so: code:
Please tell me that there's a better way to do this that I'm just not seeing because I'm dumb. Please.
|
# ? Nov 6, 2013 02:40 |
|
Lork posted:I've been trying to develop a melee attack system for a character controller using Mecanim, but it's been frustrating. Christ, what a mess. No, what you're doing would seem to be the best-ish way right now. You could make it data-driven, based on a list of attack windows, but the code driving it will still be a horrible mess. What about the plugin isn't reliable? Practically speaking, what you're doing is what the plugin SHOULD be doing, more or less. I continue to be amazed at what a gigantic pile of poo poo Mecanim is, and their seeming lack of interest in even remotely fixing it. Shalinor fucked around with this message at 03:14 on Nov 6, 2013 |
# ? Nov 6, 2013 03:11 |
|
Shalinor posted:What about the plugin isn't reliable? Practically speaking, what you're doing is what the plugin SHOULD be doing, more or less. I could be using it wrong, but I followed the instructions pretty closely and tested it pretty thoroughly, so I don't know.
|
# ? Nov 6, 2013 03:34 |
|
Lork posted:I've been trying to develop a melee attack system for a character controller using Mecanim, but it's been frustrating. My suggestion is either abandon mecanim or wait for 4.3. I built a complex melee system for mecanim and it was a giant shaky stupid bastard that is hell to debug or balance. It was basically like what you are doing though I had some editor scripts for tweaking at run time (really helpful) and used generic listeners for the animation state that each attack would attach to. I used parts of this when designing my event system. Maybe a smarter bear could deal with all the stupid poo poo in mecanim and create a good melee system but I threw a lot of time at the problem and it wasn't getting any better. 4.3 may not even fix mecanim but if they add a few basic functions to it like jump to state it might make working with it less crazy. As it is mecanim's problems kind of killed that project for me as I haven't had the energy to dive in and create a new system. I'm enjoying mixing procedural animations and legacy animations a lot more in my current project but that might not work for your particular needs (it is easy to fake a lot of things in first person). edit: not event system's dev's fault but mecanim blend transitions can gently caress everything up even trying to work with their own curves. Even trying to run with zero blend transitions you can still get some goofy misfires. You would need to put in checks to make sure when an event fires off it isn't mecanim just being dumb and a valid time for it as well as a timeout check if the event accidentally doesn't fire at all. FuzzySlippers fucked around with this message at 03:40 on Nov 6, 2013 |
# ? Nov 6, 2013 03:37 |
|
I can see what you guys are saying about not using Mecanim, but retargeting is kind of the thing that makes developing a game even possible for someone like me. That is, someone with no money and no talent for visual art. I guess I'm going to have to just keep banging away at it and hope that Mecanim improves in the near future.
|
# ? Nov 6, 2013 03:50 |
|
Heisenberg1276 posted:On the subject of generating landmasses I'd be very interested if anyone knows a way of generating random landmasses with given a area (e.g., I want two landmasses, one with 40% of the total land area, one with 60%, these % will change though). Related to this, I've added graphical visualization to my generator! It's awesome. I also compiled an executable (Windows) if anyone wants to try it out: https://www.dropbox.com/s/hq843vt2hvgfl89/worldgenerator.rar The program to run is visualizer.exe. The code is still sloppily optimized and it runs in O(Width*Length*Height), so I would not suggest trying to generate maps on the 200x200 scale unless you want to wait a while. Even 100x100 maps takes a while with tall mountains.
|
# ? Nov 6, 2013 06:05 |
|
Can Of Worms posted:Related to this, I've added graphical visualization to my generator! Also is it just me, or does your terrain generation prefer NW -> SE landmasses? It's more noticeable in 200x200x? sizes http://tinypic.com/r/sp94jb/5
|
# ? Nov 6, 2013 10:22 |
|
Can Of Worms posted:One idea I'm thinking of implementing in the future (mostly for optimization) is to take a section of the map, and generate an island inside it using a variation of this strategy, then plop it back into the original map. It should be easy to control the size of the island relative to the section, and code some variations on how the hills are placed to get more exotic shapes. This is assuming you want a connected landmass, i.e. a single continent that occupies a % of the map. Otherwise roomforthetuna's heightmap suggestion is what I did. Looking alright! I think the results from that way are fairly limited, and these days there's some much much cooler techniques that allow things like river-flow and better generation in general. This is my favorite article on the subject, definitely give it a look http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/ Also I got some nice terrain last year (no heightmaps though) using a cellular-automata method: http://forums.somethingawful.com/showthread.php?action=showpost&postid=410479431
|
# ? Nov 6, 2013 11:05 |
|
Can Of Worms posted:One idea I'm thinking of implementing in the future (mostly for optimization) is to take a section of the map, and generate an island inside it using a variation of this strategy, then plop it back into the original map. It should be easy to control the size of the island relative to the section, and code some variations on how the hills are placed to get more exotic shapes. This is assuming you want a connected landmass, i.e. a single continent that occupies a % of the map. Otherwise roomforthetuna's heightmap suggestion is what I did. That looks awesome. Thanks for the suggestions everyone - I have a few projects on the go at the moment so won't be able to try these out for a few weeks - I'll post back if I have any success with this.
|
# ? Nov 6, 2013 11:13 |
|
I'm popping in to mention that we have a nice little game development community that has grown following the 2013 SAGamedev competition. We have a healthy and humming bustle of gamedev nerds on IRC and our new mumble server. If y'alls need a place to chat about your issues or just find fellow gamedev nerds, the IRC and mumble info is here: http://goo.gl/fy5Ml4 vvvv: a cyberpunk goose fucked around with this message at 21:02 on Nov 6, 2013 |
# ? Nov 6, 2013 20:51 |
|
Mido posted:I'm popping in to mention that we have a nice little game development community that has grown following the 2013 SAGamedev competition. We have a healthy and humming bustle of gamedev nerds on IRC and our new mumble server. I can verify this information as credible and that Mido is very handsome.
|
# ? Nov 6, 2013 21:00 |
|
Sharing is caring. So here you go. In Unity, recently I needed to have an editor script that found all prefabs which had a particular component on it, regardless if it was referenced in the project at all, regardless if it was in the Resources folder or not. This does the job nicely. code:
code:
|
# ? Nov 6, 2013 21:03 |
|
Your recursive Directory search is unnecessary. Use code:
One more thing, why do you have a constraint "where T: Object"? That is a redundant constraint, as all C# objects derive from System.Object. If you meant to restrict it to reference types (i.e. not int, double, etc) use: code:
Orzo fucked around with this message at 21:28 on Nov 6, 2013 |
# ? Nov 6, 2013 21:24 |
|
The constraint is needed because Object is referring to Unity.Object not System.Object. The cast to T needs the constraint because LoadAsset returns Unity.Object. Prefab can be null because I'm searching for a particular component type on all prefabs and not all prefabs will have the component. Casting to T will not throw an exception because its a regular style cast. If I said 'as T' then it would be throwing an exception. This way I get a null if the prefab doesn't have the component and can discard it. Thanks for the tip on AllDirectories. xgalaxy fucked around with this message at 21:41 on Nov 6, 2013 |
# ? Nov 6, 2013 21:35 |
|
Why not have the function just return the list it was working with, rather than converting it to an array for the return value? That conversion is potentially a wasted operation, isn't it, if the caller could work just as well with a list? Or is it some sort of expectation/standard for return values? vvvv That's a fair reason not to change it. Just wanted to check I wasn't missing some great reason for doing it that way. roomforthetuna fucked around with this message at 21:45 on Nov 6, 2013 |
# ? Nov 6, 2013 21:39 |
|
I could I guess. But I'm not really caring about efficiency since its an Editor only script.
|
# ? Nov 6, 2013 21:42 |
|
Orzo posted:Also, when would prefab ever == null? You cannot cast a null instance to T without throwing an exception, so that would never happen. Actually sorry. You are right. I had (T) and as T backwards. Switching it to as T so I get null assigned. Thanks. Here is the updated script if anyone wants it: code:
xgalaxy fucked around with this message at 22:21 on Nov 6, 2013 |
# ? Nov 6, 2013 21:52 |
|
xgalaxy posted:Sharing is caring. It certainly is, so I'll pay it forward with one of the more useful little code snippets I've written recently. transform.FindChild() doesn't seem to run down the heirarchy unless you know exactly where what you're looking for is supposed to be. So this is a C# Extension Method that adds a depth-first search down the heirarchy to the Transform class and returns the first child of the requested name it finds, or null if it doesn't find anything. code:
|
# ? Nov 6, 2013 22:32 |
|
xgalaxy posted:The constraint is needed because Object is referring to Unity.Object not System.Object. The cast to T needs the constraint because LoadAsset returns Unity.Object.
|
# ? Nov 6, 2013 22:35 |
|
xgalaxy posted:Actually sorry. You are right. I had (T) and as T backwards. Switching it to as T so I get null assigned. T blah = (T)null; doesn't throw as far as I know. The difference with as is that it doesn't throw if the value can't be converted to a reference of type T, so I guess it would avoid an exception if the Unity call is bugged or you accidentally passed in the wrong type, but I'd prefer an exception in either case. quote:6.2.4 - Explicit Reference Conversions
|
# ? Nov 7, 2013 04:35 |
|
I'm suddenly curious to try Unity and some of the 2D libraries but I can't really find any info on the licensing for 2DToolkit and I'm not that fond of the idea of buying it without having used it or read the license.
|
# ? Nov 8, 2013 04:38 |
|
The 2D Toolkit FAQ says they don't offer a trial or anything so you are pretty much stuck buying it.
|
# ? Nov 8, 2013 04:47 |
|
I must be missing something obvious, who would buy a license for a library without first knowing what the licensing implications are for their own derived software?
|
# ? Nov 8, 2013 04:51 |
|
Seashell Salesman posted:I must be missing something obvious, who would buy a license for a library without first knowing what the licensing implications are for their own derived software? What do you mean? It's pretty standard policy that stuff you buy on the Asset Store can't be redistributed in source form. I'm not sure what you need to know other than "This extension requires one license per seat" which means everyone using Unity on your team needs a license.
|
# ? Nov 8, 2013 04:53 |
|
I believe that since it's only sold through the Unity Asset Store it's covered under the Unity Asset Store license which is pretty much "one license per seat"? Have you looked at it in the store?
|
# ? Nov 8, 2013 04:58 |
|
^^ I looked at the page on the store that's linked to from their website but it didn't have a license on it that I could seeObsurveyor posted:What do you mean? It's pretty standard policy that stuff you buy on the Asset Store can't be redistributed in source form. I don't use Unity so I guess the obvious thing I'm missing is some implicit license for asset store stuff. You can't distribute the 2DToolkit source, but they give you source access and you can distribute their binaries? Can you modify their library, compile it, then distribute those binaries? Is this stuff I need to look up on the asset store or some other general Unity thing?
|
# ? Nov 8, 2013 04:59 |
|
Seashell Salesman posted:^^ I looked at the page on the store that's linked to from their website but it didn't have a license on it that I could see Relevant sections: Unity Store EULA posted:3.6 Unless you have been specifically permitted to do so in a separate agreement with Unity and except as permitted under the Unity-EULA, you agree that you will not reproduce, duplicate, copy, sell, trade or resell any Asset that you have acquired from the Unity Asset Store for any purpose. quote:4.1 Some components of Assets (whether developed by Unity or third parties) may also be governed by applicable open source software licenses. In the event of a conflict between the Terms, the applicable EULA and any such licenses, the open source software licenses shall prevail with respect to those components. Basically, you can only distribute the compiled versions of your Unity projects built with Asset Store assets.
|
# ? Nov 8, 2013 05:04 |
|
Obsurveyor posted:Link to the EULA is at the bottom of this page: https://www.assetstore.unity3d.com/ Ah thanks! I guess I need to read up on there about modifying the sources of libraries if that 2DToolkit license gives you source access.
|
# ? Nov 8, 2013 05:16 |
|
You just get 2dToolkit as source files you add to your project, so yeah. I guess it never even occurred to me that modifying it for use in my own project could be against the rules.
|
# ? Nov 8, 2013 05:22 |
|
RC3 of Unity 4.3 came out today, and they said they were only going to do 1 RC lol. Hopefully this is it and it gets released soon.
|
# ? Nov 8, 2013 05:45 |
|
It's sort of a pain in the butt to give back to Unity. In addition to throwing stuff up on github, we've made a bunch of fixes and improvements to various asset store libraries, but we're just stuck sitting on them or waiting for the original author's to (finally) update their code with our changes. We'd like to publish diffs or something so others can enjoy, but alas!
|
# ? Nov 8, 2013 14:05 |
|
xgalaxy posted:RC3 of Unity 4.3 came out today, and they said they were only going to do 1 RC lol. I just want them to fix the constant crashing I'm getting in OSX Mavericks. I know it's pretty much my fault though for ever upgrading anything Mac until after the first point release. :\
|
# ? Nov 8, 2013 16:56 |
|
xgalaxy posted:RC3 of Unity 4.3 came out today, and they said they were only going to do 1 RC lol. That seems like the most broken thing they've got right now. Input is a close second, but Input's been a poo poo system for so long, everyone's long since designed around it. EDIT: VV events! Thank god! Shalinor fucked around with this message at 04:20 on Nov 9, 2013 |
# ? Nov 8, 2013 18:31 |
|
Shalinor posted:Any word on if it makes Mecanim less lovely? Here you go: code:
|
# ? Nov 8, 2013 19:21 |
|
I'm making a hockey game, but not being all that familiar with Unity, I'm having a little trouble with keeping the puck from phasing through walls. The docs seem to suggest that Continuous and Continuous Dynamic modes don't work for mesh colliders. They also suggest the sweep test functions don't work with mesh colliders. I can't really just change it to a capsule because it just turns into a sphere and rolls across the ground. I've made the walls thicker and made sure they don't meet just at the corners, which has helped, but doesn't completely eliminate the problem. I also made the puck bigger than it "should be", which I don't mind since it needed to happen to make it easier to see anyway. I have two options I'm considering. First is to using a capsule to collide with the walls and the mesh to collide with the ice. It shouldn't ever get moving fast enough vertically to go through that way and I can make the ice as thick as I want without it affecting anything else. Not ideal and could probably have some artifacts to the physics, but it might work well enough. Second is to write my own cylinder collision tests, which will probably take a lot more time and be a pain. Does anybody more experienced with Unity's physics have any better ideas? Oh, and have a gif from the post screenshots thread which totally doesn't show off the problem because marketing or something:
|
# ? Nov 9, 2013 20:05 |
|
|
# ? Jun 12, 2024 15:33 |
|
ZombieApostate posted:I'm making a hockey game, but not being all that familiar with Unity, I'm having a little trouble with keeping the puck from phasing through walls. The docs seem to suggest that Continuous and Continuous Dynamic modes don't work for mesh colliders. They also suggest the sweep test functions don't work with mesh colliders. I can't really just change it to a capsule because it just turns into a sphere and rolls across the ground. I've made the walls thicker and made sure they don't meet just at the corners, which has helped, but doesn't completely eliminate the problem. I also made the puck bigger than it "should be", which I don't mind since it needed to happen to make it easier to see anyway. Make sure the walls have no rigidbodies but do have colliders. This makes them static colliders. Make your puck have rigidbody and collider. I just went through the same headache last night and once I had static environment pieces with JUST colliders no rigidbodies, it fixed every issue I had all at once.
|
# ? Nov 9, 2013 20:28 |