oosyrag's Forum Posts

  • If you're interested in further reading, the patron saint of procedural generation Amit Pai and Red Blob Games has you covered.

    redblobgames.com/maps/terrain-from-noise

    redblobgames.com/articles/noise/introduction.html

    www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation

    redblobgames.com/maps/mapgen4

    simblob.blogspot.com/2018/08/mapgen4-goals.html

    He's got a billion and one articles on procedural map generation and he fully documents and references every step.

  • It's not so simple... especially since there are many ways to go about it, depending on the requirements of the game you are generating the map for and your own preference of the end results.

    gamedev.stackexchange.com/questions/186194/how-to-randomly-generate-biome-with-perlin-noise

    But if I had to boil it all down, first I would use Perlin noise to generate a topographical map, then modify (multiply) the resulting values by a modifier determined by the Voronoi value at each position.

    Understand that all (2d) noise is, for any given given input (x/y coordinate set), a value is returned based on the noise algorithm used. So if you have apply Perlin noise in an area, every coordinate will have a value that corresponds to its elevation, or whatever else you desire. Those same coordinates will also have a different value according to Voronoi noise.

    So lets say if you decide all Voronoi cells with a value of less than .5 is an ocean, you would first get the elevation of x/y from the perlin noise, then check that if that x/y is less than .5 in Vornoi noise. If it is, multiply by .1, thus the final value will end up "lower" than the cells that are not oceans.

    Layering additional noise is similar. Lets say you don't want such a sharp cutoff between land and ocean. Notice cellular (Worley) noise has the same borders and cell shapes as the Voronoi noise, but lower values towards the center of the cell, and higher values at the edges. You could invert this, and multiply the biome modifier from the Voronoi noise by the value from the cellular noise. The result would be that there is less of an effect near the edge of the cells, and a greater effect towards the center.

    The returned values can be anything you want, not just elevation. For example, you could use Voronoi noise to determine "Are there trees at this coordinate or not?", or you could use classic (Perlin) noise to determine "How dense are the trees at any given coordinate?"

  • That would be Voronoi. Probably with some adjacent cells joined together to make it more irregular.

    There are algorithms to make the shapes more regular, but not so much irregular. Or of you just want larger cells, just zoom in/scale your input.

    Alternatively, you can try perlin noise with the outputs rounded to the nearest increment of your choice, but that would probably be worse.

  • Are you still interested in this Newt? I got super distracted playing with the new 3D shapes feature but I revisited this after the other post about the advanced random plugin bug. I've got a working example that can pull the node coordinates and voronoi vertices (right click to calculate and plot the vertices).

    dropbox.com/s/fem59cdrowu4ig3/Noise%20graph-voronoiscript.c3p

    The edge and cell information is also there but I don't really know how to utilize them at this point. They're available though!

    The points may not match the output from the advanced random plugin exactly, since the resolution of finding the node origins only resolves to the nearest pixel, while the actual points are probably not whole numbers.

    I also ran into some issues with fullscreen scaling and the drawing canvas coordinates when the window size doesn't match the viewport size. Not sure how to resolve it yet so I just left scaling off for now.

    No...

  • Does adding the persist behavior help?

  • Try matching the origin image point on each of your parts. So for the head, it wouldn't be in the center of the head, but where the center of the body is relative to the head. Then when you mirror the body and the head, they will flip to the correct positions.

  • I take that back, its probably a bug (possibly faulty implementation?) or at least a limitation of whatever Worley noise algorithm was used (Voronoi is generated from the same base noise as Worley, so it is also affected). I don't see it happening with the other noise functions with negative inputs.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • No I think he posted the wrong screenshot - you can see it clearly if you head to negative y and negative x coordinates on the noise in the example project he posted.

    I don't think its a bug. Its probably just the way the example project was put together does not handle negative coordinates well, but I haven't examined it enough to see why yet though.

  • Looks like common practice for animating diagonal directions is to set animations based on angle of movement, rather than inputs.

    Edit: Setting an instance variable, and changing the animation only once per tick based on that variable also seems to work, like so:

    + Keyboard: ↑ is down
    -> Sprite: Set anim to "up"
    
    + Keyboard: ↓ is down
    -> Sprite: Set anim to "down"
    
    + Keyboard: ← is down
    -> Sprite: Set anim to "left"
    
    + Keyboard: → is down
    -> Sprite: Set anim to "right"
    
    + Keyboard: ↑ is down
    + Keyboard: ← is down
    -> Sprite: Set anim to "upleft"
    
    + Keyboard: ↑ is down
    + Keyboard: → is down
    -> Sprite: Set anim to "upright"
    
    + Keyboard: ↓ is down
    + Keyboard: ← is down
    -> Sprite: Set anim to "downleft"
    
    + Keyboard: ↓ is down
    + Keyboard: → is down
    -> Sprite: Set anim to "downright"
    
    + Keyboard: ↑ is down
    + OR Keyboard: ↓ is down
    + OR Keyboard: ← is down
    + OR Keyboard: → is down
    -> Sprite: Set animation to Sprite.anim (play from beginning)
    
    + System: Else
    -> Sprite: Set animation to "idle" (play from beginning)
    
  • I'm actually not sure what's happening here. There's some conflict with your other animation events. If you disable the walk right event it works fine, but I'm not seeing why at first glance... Will check it out some more later, or someone more familiar with animating 8 direction would probably know.

  • It works... Unless you've got a keyboard that can't have s and d pressed at the same time, which is extremely unlikely but not impossible. Is your animation set to looping?

    You're probably going to need to upload your project to see what's wrong with it.

  • Computers don't care if they have to add 10 or 100000000, but if you divide first before adding, that's two things the computer has to do instead of one...

  • I don't think there is a simple solution to this problem, it's a pretty classic issue with pathfinding and collisions.

    A common solution is to disable collisions/solid behavior during movement. That is probably the easiest way out, and also quite effective for most people's purposes.

    Otherwise, you're looking at predicting the future position of each object, and probably also a queue for each position since there can still be conflicts. I don't know how exactly to go about doing this, but there are algorithms out there, specifically the parts regarding leader following and queueing. Those articles are not for tile based movement, but any concept regarding grid coordinates can be applied to tiles as well.

  • CSS will apply to the entire object.

    You probably want BBCode, but I think that's only for the text object. Not sure you have any options for inline styling of a text input object.