1. Post #641
    F.X Clampazzo's Avatar
    October 2016
    1,088 Posts
    what module is the one thats really giving you trouble? I can try to help more if you can specify which module is the issue, I had to get pretty familiar with how some of them worked to get them to work on GPU architecture.
    Well, I was thinking that since Module::Cache FinalPlanet (whatever the capitals are) was the source module that each pixel's float value was called from. BUT, it turns out this isn't true either I guess, since I was able to create multiple sphere models using it and the same problem happened, so I thought, hey maybe if I just created a vector of NoiseMapBuilderSphere, I can just make each one output to the same elevation grid and just only do its own tiny bit as a thread. Which would have worked in theory, but I can't create multiple instances of an abstract class.

    My next option I think is to just build my own implementation of the NoiseMapBuilderSphere and sphere model that aren't abstract classes so I can make the call for each pixel's float value from as many copies of the source noise module as I want. I believe this to be the problem since mutexing the write call to the elevation grid doesn't actually do anything since it works on pointers.

    This final idea might be over-kill but it should work I'd think. idk. At this point, I'm amazed I got threading to work in the first place, even if it wasn't more than a few seconds faster on average due to the very sub-optimal mutex.

  2. Post #642
    Gold Member
    paindoc's Avatar
    March 2009
    8,508 Posts
    Well, I was thinking that since Module::Cache FinalPlanet (whatever the capitals are) was the source module that each pixel's float value was called from. BUT, it turns out this isn't true either I guess, since I was able to create multiple sphere models using it and the same problem happened, so I thought, hey maybe if I just created a vector of NoiseMapBuilderSphere, I can just make each one output to the same elevation grid and just only do its own tiny bit as a thread. Which would have worked in theory, but I can't create multiple instances of an abstract class.

    My next option I think is to just build my own implementation of the NoiseMapBuilderSphere and sphere model that aren't abstract classes so I can make the call for each pixel's float value from as many copies of the source noise module as I want. I believe this to be the problem since mutexing the write call to the elevation grid doesn't actually do anything since it works on pointers.

    This final idea might be over-kill but it should work I'd think. idk. At this point, I'm amazed I got threading to work in the first place, even if it wasn't more than a few seconds faster on average due to the very sub-optimal mutex.
    At this point, I'd say just dive into the source code of libnoise itself. There's not a lot of changes you'd have to make to get it to compile for 64 bit (if any, tbh, i'm not sure why you needed them in the first place).

    When you try to create multiple models fed from the singular module chain, im not sure wtf would happen. I'm not surprised you get artifacting though. Whenever you see a call to "GetValue(x,y,z)" that just recurses through the list of modules until it gets to the first module, retrieves a noise value, then takes that value up the chain feeding it through the modules as it goes. Using this on threads shouldn't cause too many issues, I guess, since the only time you'll be possibly sharing resources should be in the base generator modules.

    I imagine outputting to the same destination elevation grid also won't work. you're probably aware, but the grid size sets the resolution or number of sampling points and the parameters fed to the NoiseMapBuilderSphere class set the lattitude and longitude bounds that the sampling points stay within. So why not create separate heightfields that are "chunks" of your final heightfield, and change the lattitude/longitude bounds of each NoiseMapBuilderSphere appropriately? then each builder/heightfield could be on its own thread, and you can merge the data later maybe?

  3. Post #643
    Gold Member
    JohnnyOnFlame's Avatar
    February 2011
    3,029 Posts
    Without using the cheatsheets on the bottom, can you guess which is faster? buildb() or buildman()?

    https://gist.github.com/JohnnyonFlam...c1a2803be43dda

    (Code is messy as hell, it's not production ready. It's just experimentation for now)

  4. Post #644
    suXin's Avatar
    July 2009
    1,332 Posts
    You can probably tell the TypeScript compiler to use a newer ES version to make it emit it directly.
    Just want to confirm that config directive below preseved async\await

    "target": "es2017"


    also realised how retarded the building of this typescript project was since long time ago, and I finally made it better for myself.
    it was so bad I don't even want to go into details, I'll just let you know that it also consisted of a gulp task that copied node_modules to a separate directory

  5. Post #645
    F.X Clampazzo's Avatar
    October 2016
    1,088 Posts
    At this point, I'd say just dive into the source code of libnoise itself. There's not a lot of changes you'd have to make to get it to compile for 64 bit (if any, tbh, i'm not sure why you needed them in the first place).

    When you try to create multiple models fed from the singular module chain, im not sure wtf would happen. I'm not surprised you get artifacting though. Whenever you see a call to "GetValue(x,y,z)" that just recurses through the list of modules until it gets to the first module, retrieves a noise value, then takes that value up the chain feeding it through the modules as it goes. Using this on threads shouldn't cause too many issues, I guess, since the only time you'll be possibly sharing resources should be in the base generator modules.

    I imagine outputting to the same destination elevation grid also won't work. you're probably aware, but the grid size sets the resolution or number of sampling points and the parameters fed to the NoiseMapBuilderSphere class set the lattitude and longitude bounds that the sampling points stay within. So why not create separate heightfields that are "chunks" of your final heightfield, and change the lattitude/longitude bounds of each NoiseMapBuilderSphere appropriately? then each builder/heightfield could be on its own thread, and you can merge the data later maybe?
    I was thinking about that, I've been working within the library already since I was modifying the sphere model to see if I could split the entire build process into smaller sets as you mentioned trying.

    Im wondering if maybe chunking out the output would solve the issue but idk. If I combine them later idk if I'll see any benefit. I could implement futures and have an elevation grid be entirely made of futures filled by the threads, which might prevent any weird cross talk by the threads.

    Edit: Nah, it looks like the issue is literally just within the line
    Code:
    //noiseutils.cpp
    //classically found in NoiseMapBuilderSphere::Build();
    float curValue = (float)sphereModel.GetValue(curLatb, curLonb);
    Mutexing around that single line stops the artifacting, but mutexing around the output:
    Code:
    *pDest++ = curValue
    doesn't do anything.

    So to me, this seems like an issue with threads snagging the return float value from the sphere model that belongs to other threads? The sphere model's source module winds its way back to the previous source module, which I think ends at Module::Cache FinalPlanet in their program. I'm not sure though.

  6. Post #646
    Gold Member
    Tamschi's Avatar
    December 2009
    7,908 Posts
    Just want to confirm that config directive below preseved async\await

    "target": "es2017"


    also realised how retarded the building of this typescript project was since long time ago, and I finally made it better for myself.
    it was so bad I don't even want to go into details, I'll just let you know that it also consisted of a gulp task that copied node_modules to a separate directory
    I still have no clue about the build tools at all, so I use a (gutted) Vue.js community(?) template (Webpack with some minifier, I think).

  7. Post #647
    Gold Member
    fewes's Avatar
    December 2006
    1,722 Posts
    In the process of porting my sprite lighting system to Unity:

    Reply With Quote Edit / Delete Reply Windows 7 Chrome Sweden Show Events Artistic Artistic x 6Winner Winner x 1Disagree Disagree x 1 (list)

  8. Post #648
    Gold Member
    Killowatt's Avatar
    September 2009
    3,733 Posts


    Since my last post I added colored blocks and started work on networking the thing

    Also changed my meshing algorithm to be more optimized and cute (thanks layla)
    Reply With Quote Edit / Delete Reply Windows 10 Chrome United States Show Events Artistic Artistic x 1 (list)

  9. Post #649
    Gold Member
    Karmah's Avatar
    December 2007
    6,425 Posts
    In the process of porting my sprite lighting system to Unity:

    Aw yess

    I loved your graphics work in the past; it's been awhile since I've seen this stuff.
    Reply With Quote Edit / Delete Reply Windows 10 Chrome Canada Show Events Friendly Friendly x 1 (list)

  10. Post #650
    TheMrFailz's Avatar
    July 2012
    2,612 Posts
    Nothing spectacular. Working on a final project for a computing class I'm taking and for said project I decided to make a twitter bot. Reads CNN/CBS/NBC/FOX news tweets and forms opinions of sorts on them. Pardon the canned response lines, they do actually vaguely represent the severity of the bot's opinions on the matter. Will replace later with generated ones. It's all over the place though and has a number of hiccup spots so far.

    Also, a side note, it's setup to "remember" certain topics so that if it comes across them later it will develop it's opinion further with respect to those previous events.

    Themed on a 90's emperor caligula: https://twitter.com/CaligulaBot

    Highlights:
    (Click the tweets for the normal tweet view (includes caption). Will make more sense that way.)

    edit:
    Also, I really gotta get cracking on those randomly generated response things because it keeps choosing the same few for some reason.

  11. Post #651
    Gold Member
    proboardslol's Avatar
    December 2008
    6,320 Posts
    I dig this one. I could see it being useful as a mobile app.

    Getting notifications when the Jimmy Johns guy is handing out free samples would be killer.

    Plus, college campuses, inevitably have some legends that would be cool to read about.
    I'd love to do something like that but without anyone getting interested in it I can't get motivated to create such a thing

  12. Post #652
    Gold Member
    laserpanda's Avatar
    August 2006
    3,746 Posts
    Anyone have any ideas for multiplayer games that I could make bots to play against each other in?

    I've been running some Hockey? bot matches, which works well because there's no cheat protection, so the bots can work via memory editing, and everything is physics driven so you can't make a super overpowered aimbot or anything like that. Racing games might be another possibility. I know TORCS has bot racing leagues

  13. Post #653

    April 2017
    1 Posts
    Anyone have any ideas for multiplayer games that I could make bots to play against each other in?

    I've been running some Hockey? bot matches, which works well because there's no cheat protection, so the bots can work via memory editing, and everything is physics driven so you can't make a super overpowered aimbot or anything like that. Racing games might be another possibility. I know TORCS has bot racing leagues
    I think good old blobby volley could be something fun to look at. Not sure if runs on recent Windows tho.
    Reply With Quote Edit / Delete Reply Windows 10 Chrome Ireland Show Events Agree Agree x 2 (list)

  14. Post #654
    Gold Member
    Torrunt's Avatar
    October 2008
    354 Posts
    I've been reworking a lot of my game's code so it works properly at different frame rates. Before the game was locked at 60 and if the fps dropped, it would go slow motion (which could cause sync issues when playing online). The game is now using a variable time-step and has frame rate cap slider in the options.



    Having the game a different frame rates causes a number of problems. The main problem was my animations not working correctly. There's a lot of checks to see if animations have reached a certain frame and that doesn't work if frames are skipped or are stayed on for multiple logic frames. I've reworked it so that kind of game code happens when animations change frame rather than in the normal game update loop.

    Another problem is physics not working reliably at variable frame rates. The good thing is the game only has simplistic physics like a gibs or coins bouncing on the ground. I just had to tweak that a bit to prevent endless bouncing. For collision I use Separating Axis Theorem, it generally seems to be behaving at different frame rates. Though if I limit it to 30fps and I do a sudden fast movement like a leap, I can go through smaller collision boxes. There aren't many of those though and it doesn't break the game or anything if you do manage to jump through them.

    There are also places where I use linear interpolation that end up working differently at different frame rates. For a weapon reload animation I made the player's arm move down to the belt, up to the gun then back to the resting position. Playing the game at 30fps made reload animations faster and playing at 300fps made them slower. To fix this I decided to make the reload animations animate based on time. Making it all based on time instead of waiting for the arm to reach it's current target before moving on to the next makes should make it work for any fps. For example; the whole animation for one gun takes 0.7 seconds, I then calculate the percentage of the total time past each update. Once 30% of the 0.7 seconds has past it moves on to the next part of the animation, then once another 0.14% has past it goes to the next one. The time and percentages I would need to figure out for each weapon reload animation.
    Reply With Quote Edit / Delete Reply Windows 10 Chrome Australia Show Events Informative Informative x 2Friendly Friendly x 1 (list)