• What Are You Working On? September 2015
    1,261 replies, posted
[QUOTE=polkm;48663811]now with multithreads <gif>[/QUOTE] Now mask it onto a world map, and simulate an epidemic Edit: Should add I meant so it looks like an epidemic, and not actually [I]simulate[/I] one
[QUOTE=Tamschi;48661698][...] [del]It's limited though. Anything that needs curly brackets generally is incompatible.[/del] [URL="https://msdn.microsoft.com/en-us/library/bb397687.aspx"]It seems I was mistaken about this.[/URL] I remember reading somewhere that there were some restrictions, but I have no idea which ones or if that's really (still) the case. It's also completely not typesafe (but you could make a wrapper library that provides those constraints). [...][/QUOTE] I did a few checks: - Async lambdas are incompatible. - Lambdas with expression body are incompatible [del]in apparent disagreement with MSDN[/del] (which means anything with curly brackets doesn't work (for no good reason :disappoint:)). [editline]edit[/editline] I misread MSDN in this regard. Anonymous methods are incompatible too, but I don't think anyone still uses them. - Lambdas with captures are compatible, at least. Async lambdas being prohibited makes a little sense since they contain an (in C#) impossible jump, assuming [I]Expression[/I]s follow those rules. Lambdas with statement bodies should just compile into layered [I]BlockExpression[/I]s though.
I'm embarassed by how long it took me to implement this. In other words, a part of a proper user interface with crude, placeholder graphics: [vid]https://my.mixtape.moe/fkvlac.webm[/vid] Also, would someone please happen to know if there's a better way of doing this: [t]http://i.imgur.com/TZfSjhe.png[/t] The constructors only differ in their names and this seems like an amazingly stupid solution. Is there a better, more object-oriented way, or do you still end up with a ridiculously huge switch statement at the lowest level (I plan on having dozens of classes which all extend a base class there)?
[QUOTE=Phantoml994;48666474]I'm embarassed by how long it took me to implement this. In other words, a part of a proper user interface with crude, placeholder graphics: [vid]https://my.mixtape.moe/fkvlac.webm[/vid] Also, would someone please happen to know if there's a better way of doing this: [t]http://i.imgur.com/TZfSjhe.png[/t] The constructors only differ in their names and this seems like an amazingly stupid solution. Is there a better, more object-oriented way, or do you still end up with a ridiculously huge switch statement at the lowest level (I plan on having dozens of classes which all extend a base class there)?[/QUOTE] Here's how I did it [url]https://gist.github.com/CptAsgard/9b8fecb425de8a7ff6e1[/url] [editline]12th September 2015[/editline] So you can do [code] DerivedRegister<SupportTower> Wall::reg(L"SupportTower"); [/code] And then you can do [code] tower = TowerFactory::Instance()->createInstance( type ); [/code] Where type is "SupportTower" or "GaussTower" or whatever
[QUOTE=NixNax123;48662405][vid]https://my.mixtape.moe/kmrumg.webm[/vid] ALMOST THERE BOYS[/QUOTE] You've mave a lot of progress these past months, you can be proud of yourself. Now continue making that game lad!
[vid]http://files.facepunch.com/ziks/2015/September/12/2015-09-12-1454-49.mp4[/vid] Still wrestling with some GC churn though, which is the stuttering you see. I'm not actually allocating all that much, but the octree structures I'm using are a complex mesh of pointers so I guess the GC struggles to traverse it quickly.
[QUOTE=Ziks;48666821][vid]http://files.facepunch.com/ziks/2015/September/12/2015-09-12-1454-49.mp4[/vid] Still wrestling with some GC churn though, which is the stuttering you see. I'm not actually allocating all that much, but the octree structures I'm using are a complex mesh of pointers so I guess the GC struggles to traverse it quickly.[/QUOTE] I've always wondered how trees are generated with worlds like these. World height is pretty easy, random 1x1 structures like flowers too, but what happens if you generate a tree near the border where it'd get cut off? [editline]12th September 2015[/editline] Actually, looking at it again shows you probably haven't tackled that problem as well. [img]http://novaember.com/s/8f9453/ZI6Kbt.png[/img] Still, do you (or anyone else) have an idea on how to handle it?
[QUOTE=Darkwater124;48666896]I've always wondered how trees are generated with worlds like these. World height is pretty easy, random 1x1 structures like flowers too, but what happens if you generate a tree near the border where it'd get cut off? [editline]12th September 2015[/editline] Actually, looking at it again shows you probably haven't tackled that problem as well. [img]http://novaember.com/s/8f9453/ZI6Kbt.png[/img] Still, do you (or anyone else) have an idea on how to handle it?[/QUOTE] Knowing the maximum size in width of a tree, couldn't you just have a chunk bounds-check before you place it?
[QUOTE=Profanwolf;48666905]Knowing the maximum size in width of a tree, couldn't you just have a chunk bounds-check before you place it?[/QUOTE] That could look pretty obvious though, especially in forests.
[url=http://arstechnica.com/gaming/2015/09/epic-games-releases-2-million-in-art-and-sound-assets-for-free/]I think you lot might like this.[/url]
[QUOTE=Darkwater124;48666913]That could look pretty obvious though, especially in forests.[/QUOTE] I'm sure it could be mitigated though, you could also instead of just *not* place if it it's cutting across a boundary, nudge it in the direction it needs to go to not be over the bounds. Could still be a bit awkward though. Alternatively, defer placing the tree until the chunks it "cuts into" exist. (allowing the tree to cut across chunks, since it's not in the chunk-gen, but a second pass?) Not sure if a silly solution :v:
With a somewhat continuous tree-ness function you could just run it across the border a bit. The placed tree is cut off again so the parts make a whole one.
[QUOTE=Tamschi;48666997]With a somewhat continuous tree-ness function you could just run it across the border [B]a bit[/B]. The placed tree is cut off again so the parts make a whole one.[/QUOTE] There's the next problem. How about big structures, like nether fortresses in minecraft? Would it be viable to scan in an area the size of the biggest structure in order to use this approach?
[QUOTE=Darkwater124;48667013]There's the next problem. How about big structures, like nether fortresses in minecraft? Would it be viable to scan in an area the size of the biggest structure in order to use this approach?[/QUOTE] I'm fairly sure those are at least partially random and the initial room tiling should be cheap. They are also unique as far as I know, so the code doesn't need to run outside a certain area. In general though, it's relatively easy to make functions like these abort early if they or parts of them are out of range.
[QUOTE=Tamschi;48667030]I'm fairly sure those are at least partially random and the initial room tiling should be cheap. They are also unique as far as I know, so the code doesn't need to run outside a certain area. In general though, it's relatively easy to make functions like these abort early if they or parts of them are out of range.[/QUOTE] As far as I know from watching some minecraft speedruns, the only random part of world-gen is the layout of the towers in the end. Also, what do you mean with 'unique'?
[QUOTE=Darkwater124;48666913]That could look pretty obvious though, especially in forests.[/QUOTE] Consider this drawing I made: [url=https://d.maxfile.ro/itxujmxxne.png]Arté[/url] When Player P comes close enough to trigger generation of chunk A, also generate chunks B{1-5}, which are all not-yet generated chunks neighbouring A, with just the terrain. Then you can arbitrarily place trees on A and store the overlap in the chunks B. Alternatively you could use a function for tree generation that uses the treestem coordinates as a seed, aswell as a global world seed, that would result in repeatable tree placement. Then, on chunk generation, you can traverse all neighbouring chunk coordinates and again spawn the trees, except that you only output new blocks to the chunk that is currently being generated. If I had to choose between the two, I'd choose the latter, as it is more elegant and prevents generation of unnecessary data, while also giving you a repeatable way of placing trees.
Since I want to let players write their own world generation, I have a general solution in mind for any structure that crosses a chunk boundary. Basically all of the block region placement calls that cross a chunk boundary would be buffered in a list and stored to be executed again later when the neighboring chunks generate. This list would also be saved to file if the game exits before those neighboring chunks are generated.
[QUOTE=Berkin;48664537]The human vocal tract is a very complicated resonator. [IMG]http://i.imgur.com/76xGZzE.png[/IMG] One of the higher frequencies is present only for half of the fundamental's phase. And this only appears in open vowels. I have no idea how I am going to start creating a mathematical model of this.[/QUOTE] Let me give you some ideas :). - Transform time domain into frequency domain and shift it to center frequency. This way the signal should become frequency independent. - Cross-correlate with vowel kernels for finding similarity. - You can do really fast cross-correlation, auto correlation (for finding period / self similarity), and convolution in Fourier space (with help of FFT).
[QUOTE=Fourier;48667211]Let me give you some ideas :). - Transform time domain into frequency domain and shift it to center frequency. This way the signal should become frequency independent. - Cross-correlate with vowel kernels for finding similarity. - You can do really fast cross-correlation, auto correlation (for finding period / self similarity), and convolution [B]in Fourier space (with help of FFT)[/B].[/QUOTE] Shameless self advertising, pfft.
[QUOTE=Darkwater124;48667039]As far as I know from watching some minecraft speedruns, the only random part of world-gen is the layout of the towers in the end. Also, what do you mean with 'unique'?[/QUOTE] There is only one [del]nether[/del] end fortress at a somewhat random location. If it's not randomised otherwise then it's pretty simple to just paste the relevant parts of the template into the different chunks. The nether fortresses are definitely made up of "parts". It shouldn't be too difficult to find a function that generates it at any point directly while letting it fit together. [editline]12th September 2015[/editline] [QUOTE=Ziks;48667210]Since I want to let players write their own world generation, I have a general solution in mind for any structure that crosses chunk boundary. Basically all of the block region placement calls that cross a chunk boundary would be buffered in a list and stored to be executed again later when the neighboring chunks generate. This list would also be saved to file if the game exits before those neighboring chunks are generated.[/QUOTE] What if the "neighbouring" chunk is generated first?
[QUOTE=Tamschi;48667288]What if the "neighbouring" chunk is generated first?[/QUOTE] Then it can place it immediately, or if that chunk isn't currently loaded it will still buffer it for when that chunk loads
[QUOTE=Ziks;48667313]Then it can place it immediately, or if that chunk isn't currently loaded it will still buffer it for when that chunk loads[/QUOTE] What if structures are large enough to reach chunks that are already accessible to players when they're generated?
[QUOTE=DrDevil;48667463]What if structures are large enough to reach chunks that are already accessible to players when they're generated?[/QUOTE] I think if the chunk exists it gets placed and if it doesn't exist yet it gets buffered. Seems like a nice simple solution.
[QUOTE=DrDevil;48667463]What if structures are large enough to reach chunks that are already accessible to players when they're generated?[/QUOTE] That will be up to authors of custom world generators. They would be expected to use this system for small structures like individual buildings or rooms of a dungeon, while managing the placement of whole towns or large dungeons so that they generate extending out into unexplored areas.
[QUOTE=KmartSqrl;48667575]I think if the chunk exists it gets placed and if it doesn't exist yet it gets buffered. Seems like a nice simple solution.[/QUOTE] But I think the question is if, what if a structure is to be generated in a chunk that is yet to exist and so isn't triggered, would run into a chunk that has already been generated? EDIT: Answered above, right.
[QUOTE=Ziks;48666821][vid]http://files.facepunch.com/ziks/2015/September/12/2015-09-12-1454-49.mp4[/vid] Still wrestling with some GC churn though, which is the stuttering you see. I'm not actually allocating all that much, but the octree structures I'm using are a complex mesh of pointers so I guess the GC struggles to traverse it quickly.[/QUOTE] Have you tried just using a flat array, and perhaps a runtime-compressed RLE? In most situations I've seen octrees are often worse than just bog-standard flat array storage, as surprising as it may seem.
[QUOTE=Tommyx50;48668017]Have you tried just using a flat array, and perhaps a runtime-compressed RLE? In most situations I've seen octrees are often worse than just bog-standard flat array storage, as surprising as it may seem.[/QUOTE] The only real trouble I've had with octrees is the GC churn, I think I'll just move it over to a native plugin so I can manage the memory myself.
Hey waywo! I haven't worked on much recently, but about a week ago I started my first programming job! Learning all sorts of stuff that I never really touched upon before, like databases and websites as well as some ios stuff. I think I'm going to finally add random buildings into that city generator I worked on a long ass time ago (if any of you even remember). Apparently arbitrary polygons inside arbitrary polygons is not a solved subset of the packing problem :/
Yesterday I implemented a basic cubemap reflection that sampled from the current skybox. Today, I'm working on supporting multiple cubemaps in a single scene, so that one can manually specify what a specific region should reflect. In this picture, I have a basic scene with 2 objects reflecting the sky, and the circle region is reflecting an additional cubemap - one with just 6 differently colored sides. [t]http://i.imgur.com/X5z5xxq.png[/t] The hope is that I can make the two blend together without much issue. Next up though, getting the cubemap component to render the scene once to a texture, and store it, rather than needing to be supplied one.
[QUOTE=Ziks;48668041]The only real trouble I've had with octrees is the GC churn, I think I'll just move it over to a native plugin so I can manage the memory myself.[/QUOTE] But when the possibility of moving to a memory system which is often both cheaper and simpler, it can't be easy to turn down! I'd suggest you'd try giving it a small benchmark anyways, it could be worth it.
Sorry, you need to Log In to post a reply to this thread.