|
I must say the minelayer is pretty drat fun I'm really curious to see how hectic this would get with more people.
|
# ? Oct 8, 2015 14:01 |
|
|
# ? Apr 19, 2024 18:16 |
|
ZombieApostate posted:I'm really curious to see how hectic this would get with more people. Goddamn, as am I. It can scale to 16 teams, but would need more than 225 players to spawn the last one. I could dial this back to less than 1:1 players per team to teams. It can cut back the tickrate (it's probably too high to start with, as good as my forward-sim is.) to reduce load enough to maybe handle that after some good optimization passes. It might need some final objective to 'win', like 10k energy or something. Tank costs include 4% of your team's total energy and half of that is lost. You can steal 20% of a team's energy (once a minute) by getting close enough to their base (almost touching) and deposit energy in your own base just the same. Tank and module costs might need to be leveled out a tiny bit, since all that energy is dropped when you die.
|
# ? Oct 8, 2015 14:15 |
|
I am massively stuck on trying to code a grid-based Line of Sight system for my TRPG. The way I'm handling it is that line of sight is based on tile objects which are created every time an enemy object moves tiles: So far, so good. Every time the enemy begins to move, the LOS cone is cleared, using this code: code:
So here's my problem: The problem appears to be that this code here: code:
code:
EDIT: Made code less lovely, executes identically. EDIT EDIT: Okay, I should be clearer, the clearVision code is not running perfectly. It appears to be correctly deleting all the objects, but it does throw "Argument out of range" errors because I can't find a way to iterate through the List while destroying each object without throwing these errors. At this point I feel like the problem is probably in an area where I don't totally understand how Unity does things. EDIT EDIT EDIT: OK son of a bitch I am now 3 for 3 for finding the solution to a problem immediately after asking you guys. The problem was in clearVision after all. Here's the corrected code: code:
DStecks fucked around with this message at 16:08 on Oct 8, 2015 |
# ? Oct 8, 2015 15:42 |
|
DStecks posted:EDIT EDIT: Okay, I should be clearer, the clearVision code is not running perfectly. It appears to be correctly deleting all the objects, but it does throw "Argument out of range" errors because I can't find a way to iterate through the List while destroying each object without throwing these errors. At this point I feel like the problem is probably in an area where I don't totally understand how Unity does things. When you remove an element from the list, you need to subtract 1 from the index and also update the countSize to avoid going out of bounds. You can also approach it other ways, such as going through the list backwards. code:
|
# ? Oct 8, 2015 16:12 |
|
It isn't throwing errors at all anymore, since I just Clear the whole list once I'm done with it. And there's never a scenario where I'd want to stop halfway through, so I think the code is probably OK as it is.
|
# ? Oct 8, 2015 16:21 |
DStecks posted:
Welcome to my life. 25% of my problems are unsolveable on my own, but become bafflingly transparent as soon as I talk to someone else about them. Can't talk to myself though, that doesn't count
|
|
# ? Oct 8, 2015 19:36 |
|
ChickenWing posted:Welcome to my life. 25% of my problems are unsolveable on my own, but become bafflingly transparent as soon as I talk to someone else about them. Can't talk to myself though, that doesn't count https://en.wikipedia.org/wiki/Rubber_duck_debugging
|
# ? Oct 8, 2015 19:55 |
|
What's a good foundational basis for lighting in a tile-based 3d world? I'm starting to think about it for my situation since I'm reaching a point where I could actually worry about it. I asked about it earlier and saw some stuff about generating light information, but I have to admit I don't even know what I should be trying to do. At this point I assume that--given my map data is basically a 3d array--I should create a 3d texture representing my light levels at each location. I assume I then ingest that data into a shader. The lights I add affect that 3d texture and I apply all my logic for deciding how much an area of a level is affected by lights to that texture. Is this about right?
|
# ? Oct 9, 2015 07:34 |
|
ZombieApostate posted:I still got stuck where I couldn't shoot anymore with the LC and I think you saw what happened when ramming You were right. I wasn't resetting burst to maximum when I set the cooldown. Letting off the fire button with a partial burst was causing it to continuously reset the cooldown to the 'adjusted' amount, and then you had to hold the fire button down for that length of time for it to fire again and empty the burst, else it would keep resetting it. Missiles, Mines, and Energy sprited. Tomorrow might be sound. Ranzear fucked around with this message at 09:10 on Oct 9, 2015 |
# ? Oct 9, 2015 08:01 |
|
So, in my game, I'm using a class to hold tags for in-game objects (to specify if they're a map tile or if they block line of sight, for example). And my code that constructs an A* navigation map from the map tiles checks these tags when doing an OverlapSphere so that I don't get silliness going on. I'm now at the point in development where I need to move forward to a more advanced prototype, so I've created a new scene. The OverlapSphere is being created in the correct position, and is finding the tiles, but for some reason they don't have the assigned tags from the prefab, even though it shows that they do in the inspector: "NOGOUpperFarLeft" is a tile I copied-and-pasted from the first, working, TEST scene. TestTileNOGOPrefab (50) is obviously created from a prefab. Notice their identical tags in the inspector. EDIT: Four for four. The code that loaded those inspector tags into the actual data values wasn't running before the map was being built. DStecks fucked around with this message at 17:12 on Oct 9, 2015 |
# ? Oct 9, 2015 16:05 |
|
Rocko Bonaparte posted:What's a good foundational basis for lighting in a tile-based 3d world? I'm starting to think about it for my situation since I'm reaching a point where I could actually worry about it. I asked about it earlier and saw some stuff about generating light information, but I have to admit I don't even know what I should be trying to do. At this point I assume that--given my map data is basically a 3d array--I should create a 3d texture representing my light levels at each location. I assume I then ingest that data into a shader. The lights I add affect that 3d texture and I apply all my logic for deciding how much an area of a level is affected by lights to that texture. Is this about right? Or do I just use built-in lighting with Unity and not freak out over this stuff?
|
# ? Oct 9, 2015 18:17 |
|
Rocko Bonaparte posted:Or do I just use built-in lighting with Unity and not freak out over this stuff? HitboxTeam, the devs behind Spire (previously DustForce) have been pretty much completely re-writing Unity's lighting. Here's some posts about it. Sorry there's not much more info but there's a lot to explain and a lot I don't personally know the details of. http://hitboxteam.tumblr.com/post/118169134856/lighting-volumes-generated-at-run-time-still http://hitboxteam.tumblr.com/post/121955642786/finally-plugged-the-baked-volumetric-light-volumes http://hitboxteam.tumblr.com/post/128373526536/had-an-idea-for-a-hybrid-dynamicbaked-shadow From what I remember, the last one there is basically trading memory for speed. Unity re-calculates lights per frame so it doesn't have to store them. Their approach is just creating a cubic lightmap for each light (or singular texture for a spotlight, etc) and recalculating if something or the light itself, moves within the region it effects. The speedup is enormous but it's not always necessary or feasible. Their game also uses tile-based lighting as you can see in the top image, or at least, used to. Something like that would require mapping each tile to a 3D lightmap (where each "cell" in the 3D array is a single tile wide) and optimising so you only store detail about cells that actually are filled and etc. There's lots of different ways you can choose to light things, or just say gently caress it and use Unity's default one. If it works for you then it doesn't matter! Jewel fucked around with this message at 18:24 on Oct 9, 2015 |
# ? Oct 9, 2015 18:21 |
|
Jewel posted:Their game also uses tile-based lighting as you can see in the top image, or at least, used to. Something like that would require mapping each tile to a 3D lightmap (where each "cell" in the 3D array is a single tile wide) and optimising so you only store detail about cells that actually are filled and etc. There's lots of different ways you can choose to light things, or just say gently caress it and use Unity's default one. If it works for you then it doesn't matter!
|
# ? Oct 9, 2015 19:27 |
|
Rocko Bonaparte posted:What's a good foundational basis for lighting in a tile-based 3d world? I'm starting to think about it for my situation since I'm reaching a point where I could actually worry about it. I asked about it earlier and saw some stuff about generating light information, but I have to admit I don't even know what I should be trying to do. At this point I assume that--given my map data is basically a 3d array--I should create a 3d texture representing my light levels at each location. I assume I then ingest that data into a shader. The lights I add affect that 3d texture and I apply all my logic for deciding how much an area of a level is affected by lights to that texture. Is this about right? Do you have a reference image of what you want it to look like?
|
# ? Oct 9, 2015 19:31 |
|
Rocko Bonaparte posted:If I just bake my lighting, how will moving entities figure out how bright or dark they have to be? That's a part I never quite understood. I'm guessing if I'm storing lighting data that would be used for that, I might as well use that data to shade the level too. The only thing is that baked lighting would yield much better shadows. Well the light entities should still exist, right? Use that information to light your models. It's not unusual for engines to use different lighting systems for static and dynamic geometry.
|
# ? Oct 9, 2015 19:31 |
|
xzzy posted:Well the light entities should still exist, right? Use that information to light your models. It's not unusual for engines to use different lighting systems for static and dynamic geometry. This. Unity has a mixed lighting mode where you can bake lightmaps for static geometry and use dynamic lighting for dynamic game objects. I believe it is set on the camera game object.
|
# ? Oct 9, 2015 20:54 |
|
Sex Bumbo posted:Do you have a reference image of what you want it to look like? Ehh not really. In 2d the mapping would be calculated from something like: Numbers are the light value at the center of each tile. Presumably, each vertex would look at the values in the spaces it corners and blend it together. This could then be extrapolated into 3d space. I believe Minecraft does something like this, for example. It sounds like I should instead try to use the built-in lighting stuff and then go off on a tangent if I figure out I don't like it for some reason. Rocko Bonaparte fucked around with this message at 23:47 on Oct 9, 2015 |
# ? Oct 9, 2015 23:42 |
|
Rocko Bonaparte posted:Ehh not really. In 2d the mapping would be calculated from something like: Stock minecraft doesn't do per-vertex lighting, it does per-block lighting like what you drew (but not what you described). The lighting algorithm would be quite similar to what you drew -- for each block, calculate the distance to the light, either taxicab or euclidian, and scale the lighting on the entire tile/block based on that. If you have an instanced tile rendering algorithm, you'll need to batch the lighting data into the instance data. Calculating the distance isn't necessarily going to be cheap. You can notice minecraft does optimizations that result in lighting errors sometimes with blocks being lit when they shouldn't be, likely because it's caching the lighting data and not updating it correctly.
|
# ? Oct 10, 2015 00:16 |
|
Does anyone have an algorithm for random but fairly regular points distributed across 2D space from a seed such that I can plug in a set of bounds and get the points in that region? I suppose I could always parcel it into regular squares and randomly generate n points within using the square's coords plus the general seed as seed but I feel like there's gotta be a more elegant way. MikeJF fucked around with this message at 06:22 on Oct 10, 2015 |
# ? Oct 10, 2015 06:17 |
|
Sex Bumbo posted:Stock minecraft doesn't do per-vertex lighting, it does per-block lighting like what you drew (but not what you described). The lighting algorithm would be quite similar to what you drew -- for each block, calculate the distance to the light, either taxicab or euclidian, and scale the lighting on the entire tile/block based on that. If you have an instanced tile rendering algorithm, you'll need to batch the lighting data into the instance data. There's apparently a smooth lighting option in Minecraft now--or maybe that's one of the mods I've been using. I've been playing it a bunch and saw that hiding in there after looking it up a little bit. Nonetheless, I did draw one thing here and while writing something else. I guess to fully-represent things, I'd be talking about something like a shader that blended the values a little bit so it did not look like a series of progressively lit squares with stark boundaries. I'd assume the 3d texture would basically cache the current lighting. I don't expect to be moving lights around much, but I do want to have light switches. I don't have a 100% clear idea of the final game I'm trying to make, but all of the concepts involve a darker mood with things happening in the evening. I just looked up what it would take to get that working in Unity, and it's much less trivial than just doing a one-time bake.
|
# ? Oct 10, 2015 07:07 |
|
MikeJF posted:Does anyone have an algorithm for random but fairly regular points distributed across 2D space from a seed such that I can plug in a set of bounds and get the points in that region? Sounds like a noise of some kind to me? Perlin/simplex would be a good start.
|
# ? Oct 10, 2015 11:14 |
|
Figured it wouldn't hurt reposting this issue from the Making Games Thread in here, too. Please tell me if that's bad form. Been trying to change the line spacing of text in Haxeflixel. Using FlxText, it's possible like that (Text1 is an FlxText): NewFormat = new TextFormat("assets/fonts/SkullzFontv1.ttf", 16, 0xF074d8f, false, false, false, null, null, "left", 0, 0, 0, 1); Text1.textField.setTextFormat(NewFormat); The TextFormat is being ignored using FlxTypeText, though, which is what I'd like to be using: https://github.com/HaxeFlixel/flixel-addons/blob/dev/flixel/addons/text/FlxTypeText.hx Here is FlxText, for reference: https://github.com/domrein/Flixel-Haxe/blob/master/org/flixel/FlxText.hx Maybe there could be some way to figure out what about FlxTypeText is leading to the TextFormat being ignored? Thank you!
|
# ? Oct 10, 2015 11:15 |
|
How do I make Unity stop throwing this error: "You are trying to create a MonoBehaviour using the 'new' keyword. This is not allowed." ? I can't not use "new" when I'm instantiating an object.
|
# ? Oct 11, 2015 05:18 |
|
I think I can articulate what I don't get about Unity's built-in light baking system now that I think back to when I did level editing for Quake and Half-Life. In those cases, you could have light switches just fine, and they would transition to different baked effects based on the light setting. I don't see anything obvious when googling showing how to do this in Unity. In fact, I'm reading that having separate light maps is a technical limitation; I have to engage in shenanigans when baking lighting if I want to have multiple light maps to switch between. So is this not normally a thing with Unity?
|
# ? Oct 11, 2015 05:28 |
|
DStecks posted:How do I make Unity stop throwing this error: "You are trying to create a MonoBehaviour using the 'new' keyword. This is not allowed." ? I can't not use "new" when I'm instantiating an object. Top answer should help: http://answers.unity3d.com/questions/653904/you-are-trying-to-create-a-monobehaviour-using-the-2.html
|
# ? Oct 11, 2015 05:34 |
|
DStecks posted:How do I make Unity stop throwing this error: "You are trying to create a MonoBehaviour using the 'new' keyword. This is not allowed." ? I can't not use "new" when I'm instantiating an object. You can't use new when creating any instance of a class that derives from MonoBehaviour or when creating instances that derive from UnityEngine.Object. You have to attach MonoBehaviours to GameObject's and create GameObjects by calling Instantiate: See: http://docs.unity3d.com/ScriptReference/Object.Instantiate.html If it is a regular C# class or struct using new is fine.
|
# ? Oct 11, 2015 06:31 |
|
DStecks posted:How do I make Unity stop throwing this error: "You are trying to create a MonoBehaviour using the 'new' keyword. This is not allowed." ? I can't not use "new" when I'm instantiating an object. It really isn't allowed because of how Unity works. Use Instantiate. You would use GameObject foo = GameObject.Instantiate(bar); instead of = new GameObject();
|
# ? Oct 11, 2015 07:09 |
|
evilentity posted:Sounds like a noise of some kind to me? Perlin/simplex would be a good start. Ehhh... but I want to generate points, not a field. Also, I want consistency. Like, I want to be able to plug in 'get me a square from x20y20 to x40y40' and 'x30y30 to x50y50' and the overlap between the two areas would be consistent. But anywhere in the infinite xy space Basically, this is closer to seed-based procedural terrain generation. But with dots. I think the 'segment space into squares and use the coordinates of the square as seed' approach might be the way to do it.
|
# ? Oct 11, 2015 08:30 |
|
MikeJF posted:Does anyone have an algorithm for random but fairly regular points distributed across 2D space from a seed such that I can plug in a set of bounds and get the points in that region? It made me laugh, and also puke a little bit at the same time, that when I clicked on this thread for the first time in a long while, that the first thing I see is a question involving random numbers and some clueless guy responding "AHHHh, SOUNDS LIKE jUST THE PERFECT SPOT FOR A BIT OF THE OLE PERLIN NOISE, MY gOOD GOON SIR." It's a bit unclear what you want here. I can see three ways to interpret your question:
German Joey fucked around with this message at 14:04 on Oct 11, 2015 |
# ? Oct 11, 2015 11:42 |
|
Thank you very much! I basically want a monte carlo method. I'll look up more on specific implementations of those, there may be one that suits me best.
MikeJF fucked around with this message at 12:03 on Oct 11, 2015 |
# ? Oct 11, 2015 12:00 |
|
You could use this http://mathworld.wolfram.com/HammersleyPointSet.html
|
# ? Oct 11, 2015 17:01 |
|
Here's a neat series of articles from a developer on The Witness about point distribution (for foliage and light scattering, in this case): http://mollyrocket.com/casey/stream_0013.html http://mollyrocket.com/casey/stream_0014.html http://mollyrocket.com/casey/stream_0015.html http://mollyrocket.com/casey/stream_0016.html Each link is fairly short, they're definitely worth taking a look at.
|
# ? Oct 11, 2015 17:15 |
|
Rocko Bonaparte posted:Does anybody have an existing, nice little angle calculation helper? I'm dealing with shenanigans like testing if something is rotated to -90 degrees, and finding out instead it's rotated to 270 degrees. I'm scribbling it as a I go, but I am willing to shamelessly draw upon some helper code if there is some. If you just want to make it turn the least distance why not calculate the angle, then if the result is >180 go the other way!!! -(360 - result)
|
# ? Oct 12, 2015 07:34 |
|
Rocko Bonaparte posted:Does anybody have an existing, nice little angle calculation helper? I'm dealing with shenanigans like testing if something is rotated to -90 degrees, and finding out instead it's rotated to 270 degrees. I'm scribbling it as a I go, but I am willing to shamelessly draw upon some helper code if there is some. atan2(sin(A-B), cos(A-B)) AFAIK this always gives the smallest angle (not sure if always positive though) between angle A and angle B. Just absolute value it to test for a 'cone', divide by absolute value for a turning direction, etc. I now live by it for Caliber stuff (though still normalize all my angles). Caliber now has: Chat. Teamchat. (Dis)Connection messages. Sounds (Server even sends some from the fog). New modules, which now have costs. Some little menu descriptions on tanks and modules. Drop pods (as spawning delay). A server-cpu-saving adaptive tickrate. Reload bars. The major Firefox bug (white tanks) fixed. (Also, FF never liked BeamDuel's sounds, but the Web Audio API works great) A bunch of tweaked energy mechanics. and a bunch of other crap I can't remember. Ranzear fucked around with this message at 10:33 on Oct 12, 2015 |
# ? Oct 12, 2015 10:23 |
|
Ranzear posted:atan2(sin(A-B), cos(A-B)) If you use this, make it really clear in the function name or whatever that it's calling three trig functions and should probably not be in a tight inner loop.
|
# ? Oct 12, 2015 18:32 |
|
Why not just idkcode:
If you really want to get angles between -180 to +180 you can do code:
Edit: hmmm yeah this won't really work for angles that are way out of range, might actually want to first do the modulo operation and only then correct the range I guess. h emanresu tnuocca fucked around with this message at 18:49 on Oct 12, 2015 |
# ? Oct 12, 2015 18:46 |
|
Do you people seriously store angle measurements as integers? E: wait this is C# or something isn't it. Sex Bumbo fucked around with this message at 19:05 on Oct 12, 2015 |
# ? Oct 12, 2015 19:03 |
|
MikeJF posted:Thank you very much! I basically want a monte carlo method. I'll look up more on specific implementations of those, there may be one that suits me best. I have no idea if it's what you want, but "Poisson distribution" is fun to say.
|
# ? Oct 12, 2015 19:28 |
|
Having issues with exporting to Flash with Haxeflixel. Neko works fine, Flash has text cut off due to a too small textfield and blurriness. Would anybody know anything?
|
# ? Oct 12, 2015 23:45 |
|
|
# ? Apr 19, 2024 18:16 |
|
Sex Bumbo posted:If you use this, make it really clear in the function name or whatever that it's calling three trig functions and should probably not be in a tight inner loop. I use it in feedback mostly. "Turret needs to aim at x,y, which way does it need to turn?" I'm coming from JS/Node though, where math is cheaper than lookups.
|
# ? Oct 13, 2015 03:30 |