Arsonide's Recent Forum Activity

  • 1: Not yet, a plugin for LUA support would be easy to make though. I'm sure someone could whip it up.

    2: This is something that you would do with Construct, but Construct has no built in support for this specific thing.

    3: Yes.

    4: This is something that you would do with Construct, but Construct has no built in support for this specific thing.

    5: Construct is very fast, and is much faster than MMF2. Construct uses DirectX hardware acceleration, and MMF2, from what I'm reading, uses a software renderer. That alone makes Construct leagues ahead of it in terms of render speed. As far as logical speed, that depends on how your events are set up.

  • I've checked out SFML and some very basic prediction algorithms utilizing cubic splines, which I think will function for my purposes. I think I can work something simple out over the next few weeks.

    A few caveats: the connections will likely be UDP or TCP using a dedicated server built into a console program. UDP is pretty easy to do for me, as it's connectionless, which means for simple two player connections you don't even have to know if the second player is there - you just throw the data out and hope it arrives. TCP utilizes socket connections, so dealing with tons of players is an option. I'll have to program a server program though, as it's not something I think Construct facilitates well.

  • Nice plugin, but why Chugs?

    Mainly a reference to his lighter.

  • This plugin was actually a smaller part of a gigantic plugin that I'm working on - the bigger one is specifically tailored to a game I'm making, so I can't release it, but I'll release some information about it in a few days in movie form. I know a few of you from chat have already seen it in it's infancy.

    Here's a hint though -

    <img src="http://content.screencast.com/users/Arsonide/folders/Jing/media/03545f3b-c860-4763-9e33-78c3468635b3/BigBang.png">

    When I make that announcement you guys will probably want to light up the nearest illegal substance, throw on a smooth tune, and put a sheet of plastic on your chair to protect it when you crap your pants.

    The whole point of this plugin was to figure out how to use the plugin SDK to port the bigger part of that project over to Construct from it's testbed application - it's already written and working in a text console form. But...of course it was also because I truly believe that procedurally enhanced games are better than static ones. The more people come up with the better, for everybody.

  • Ugh, I guess I'll start checking out Raknet then. NO PROMISES though. I'm going to start looking at it and making testbed programs. If it clicks and I can figure it out, I'll see what I can do.

    Gonna make a simple console based chat program tonight with it. Raknet's licensing basically states this - you do have to pay them $5000, but only after you earn $250,000. Up until that point it's totally free. I think that's a pretty fair licensing scheme.

    Meanwhile, you guys can start brainstorming how it will work in Construct. I'm envisioning it as three plugins. A client, a server, and a network replicator. The client and server are single objects that you drop into your program. The network replicator attaches to any network aware objects or sprites and synchronizes them over the network.

    EDIT: Just made my first Raknet connection over the interwebs. It's not terribly difficult. Multiplayer Tic Tac Toe is functional.

    Well...after checking it out a little more...yeah Tic Tac Toe is easy, but once I start thinking about implementing interpolation, my brain starts leaking out of my ears. I think I'll leave this to someone that knows what they're doing. Interpolation is not built into Raknet. It's what smooths out an object's movement between packets so that it's not jumping around. I will continue to supply plugins to the community, just not things this complex.

  • VERY nice. That's definitely something I wasn't expecting.

    I duplicated the Sprite as another sprite and bumpmapped it with the light set at the mouse's position, a black background, and Multiply Plus on the water. Nearly looked like something out of a fairly modern 3D game.

  • The noise has no position, so it can't "line up". Remember, it's not a physical object like a Sprite. It is more like an Array, except this array can stretch to any size you need it to, since it calculates based on percentages rather than absolutes. If you took a 640x480 noise map and condensed it down to 4x4, it'd still be the same noise map, squished down into 4x4 pixels. You'd lose a lot of detail obviously, but the calculations would be the same because the seed was the same. The size is irrelevant to what comes out of the noise map - it gives it more detail at higher resolutions, that's all. I could just as easily make the noisemap 20x15 - one for each tile, and it would look exactly the same...but keeping it big like this would let you stretch the world out to bigger proportions than one screen without losing detail.

    Don't think of the resolution of the noise map in "pixels", rather they are entries of an array that is spread over a constant noise map based on the seed it was given. Higher resolution and you get more detail because there are more entries. Think of it this way. The noise map is a nice beautiful picture, but the picture is under a floor made of glass tiles that distort it. These glass tiles represent the width and height of the noise map. If there are more glass tiles in the floor, you see more detail in the picture underneath. If there are less tiles, or if the resolution of the noise map is lower, you don't see as much detail, but the picture is still the same.

    When you reference X and Y coordinates in my conditions, you are referencing the coordinates of the noise map, not the layout. Perhaps I should reword the conditions to make that more clear. It is, however, much easier to think about, when the layout and the noise map are the same size, because those coordinates line up.

    If you made the noise the same width and height of the Sprite, and paired them together, it should work. I'd be able to explain it better if I knew exactly what you were trying to do.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So the noise will always have the absolute coords of the layout, starting at x=0, y=0?

    The width and the height of the noise object are arbitrary. They can be any number you choose, but if you set the width and height of the noise object to the width and height of your layout, then yes...that would be the case. I did it that way so that people could use it for other purposes, I'm sure someone could come up with a use for a noise map that's smaller than the size of the layout.

  • I have a hypothetical question for you guys. I'm not an amazing programmer...I don't think I'm good enough to get most networking implementations working with Construct, but I have found one that I think I can manage to integrate into a multiplayer plugin fairly quickly actually.

    Here's the stipulation. This library has a stipulation within it that says if you make a cent with it, you have to pay $5500. That includes donations as well. Now I know a lot of people using Construct do it with dreams of one day selling their stuff, so this threw a wrench in my plans. I also know a lot of people using Construct do it for the pleasure of creating games, so I am at a loss.

    Theoretically, there could be a multiplayer plugin, but if you used it you could not sell your game. It's either that, or wait for someone with a better understanding of the more forgiving libraries to come along and make it, like Rich. What do you guys think?

    If worst comes to worst, it could just hold us over until that time comes when we have a true plugin.

  • Plugin download link is active at the top of the first post. I haven't noticed any glaring bugs myself, but you guys will find some. Remember to post them here when you do, so I can make it better.

    Other than that I can't wait to see what you do with it.

  • I have released my Perlin Noise Plugin. I still have a bit of testing to do, and of course, I'll want you guys to report any bugs you find in this thread. I'm going to use this first post as a tutorial on how to use this object, and to explain what it can do for you.

    Please keep in mind this is a beta, I want to see how far you guys can push this thing, and how hard you can break it. When you do, tell me how you did so here.

    DOWNLOAD LINK

    Introduction

    So what is Perlin Noise? Well, in 1985, Ken Perlin came up with an algorithm for noise that wasn't quite so random. It had smooth transitions, and to this day that algorithm is used to generate everything from cloud textures, to detail maps on "dirty" textures, and more importantly - to generate terrain. If you use the values given by this algorithm in a grid, you can create random, persistent terrain. The algorithm is pseudo-random, and uses a seed. If you feed it the same seed, you will get the same noise out of it, which means you can generate as much noise as you need, on the fly, and if you generate it again, it will be the same as it was, without actually storing all the noise into a gigantic texture. I'm going to be using this for generating as much terrain as I need on the fly in my game, and terrain will be the focus of this tutorial, but please keep in mind that there are many applications for Perlin Noise outside of terrain.

    Tutorial

    Alright, first of all you are going to want to open the zip file you downloaded, inside you will see a folder called "Runtime", and another plugin: "PerlinNoise.csx". You are going to want to drag the contents of this zip file into your Scirra\Construct\Plugins folder. If any warnings pop up, just ignore them and continue extracting.

    Now fire up Construct, and double click inside the layout to drop a new object on it. Once the dialog pops up, you should see the Perlin Noise object inside. It looks like this:

    <img src="http://content.screencast.com/users/Arsonide/folders/Jing/media/b31604d6-d811-44a2-8974-81d5b305393a/TheObject.png">

    Drop one of those into the layout, and select it. You will notice that it has many properties on the left. Among these are "Width", "Height", "Octaves", "Frequency", "Amplitude", and "Seed". I will briefly explain each one of these settings for you.

    Width and Height are the size of the object, but you will notice that there is not actually a physical object on the layout. That is because the noise is generated at runtime, and acts more like an array than a sprite. The size of the object is arbitrarily chosen by you, but for now let's keep it at 640x480, which by the way should be the same size of your layout and application window. This will make it easier to fill the layout with noise. If you had to generate noise on a smaller scale, say for a sprite, you might want to change these values.

    Octaves are basically how many passes the Perlin algorithm makes, the less octaves you use, the cloudier the noise will look, and the more you use, the grainier it will look. For most purposes, a value of 4 to 8 is fine. For our terrain, we will keep it at 4.

    Frequency is similar to the frequency of sound. If you look at a frequency wave, a higher pitched sound has the waves closer together. In our noise, the higher the frequency, the tighter the noise is going to get - there will be less whitespace and more activity. Values between 1 and 8 are fine as frequencies, and we will be using 4 for our terrain.

    Amplitude is a bit easier to understand. It is simply how high and how low the noise will go. The noise at any given position on the grid is a decimal value between negative amplitude and positive amplitude. So if your amplitude is 4, you will get values between -4 and 4.

    Seed is the unique identifier for the noise you are generating. If you change this, the noise will change to represent the new seed. If you go back to the original seed, the noise will return to how it was.

    Alright, now create a new sprite on your layout, size 32x32, and name it Tile. Color it white, and make sure it's hotspot is centered. Now position it at position 16,16, so it is in the top left corner of the layout. Right click on the tile, and choose "Array Paste". Click on the 2D option, set the 1D field to 15, and the 2D field to 20. Now set the X Row Offset to 32, and the Y Move Transformation to 32. It should look like this:

    <img src="http://content.screencast.com/users/Arsonide/folders/Jing/media/ec8cf95f-88bd-4dd6-8391-3ac207504d54/Array_Paste.png">

    Hit OK. You should have just filled the entire layout with white tiles, now right click the Tile object in the object list, send it to the back of the order list, and lock selection so it won't be in our way.

    Now create a button named GenButton, and set it's caption to "Generate". We're now ready to generate some terrain, but first we need to set up the event sheet.

    Alright, now add a condition for clicking the button, and a subcondition of that that: "For Every Object", choose the Tiles as the object. Now here's the easy part. Create two more subconditions using the Perlin Noise object "Compare Noise At", set the X and Y values of both to Tile.X and Tile.Y, and the value to 0, but make one of the conditions "Less than" and the other "Greater or equal to". What we are doing right now is checking the position of each tile against the noise map that is covering the whole layer invisibly. We are taking the value of the noise at that point, and checking to see if it is below our artificial "Water Line", which is 0. You should currently have an event sheet that looks like this:

    <img src="http://content.screencast.com/users/Arsonide/folders/Jing/media/e3259c7e-7c3c-4443-ac71-6c2e2b21a028/EventSheet.png">

    Lastly, we want to color everything in. On the condition that says the noise is below 0, set an action to colorize the tile object as a blueish color. On the other one, do it again as a greenish color. Now the tile map can easily be rendered, but we have to do one last thing before the program is done. We want to see how random this Perlin object is, so go back up to the condition where GenButton is clicked, and on that level, add an action for the Perlin generator: SetSeed. For the value, choose Random(2000). This way, our perlin map will be updated every single time that button is clicked. This is how your final event sheet should look:

    <img src="http://content.screencast.com/users/Arsonide/folders/Jing/media/b7bc8e7f-7123-4333-97e0-930119bb00ba/FinalSheet.png">

    Now hit that preview button! You should end up with something like this: http://screencast.com/t/T6D9oR19 Keep in mind that the blockiness is caused by the size of our tiles, the noise map is MUCH more detailed than that. It looks a little like this:

    <img src="http://infohost.nmt.edu/~imcgarve/perlin_noise/perlin_noise2.jpg">

    You could make the tiles 16x16 instead for a more detailed map, and instead of checking if it was above and below zero, to check if it was BETWEEN certain values using that action to create layers for darker blues in the deep ocean, lighter blues near the shoreline, yellow sand along the shore, green hills and dark green forests in the center of the mainland. If you changed the amplitude from 1 to 10, you'd have a lot more room to add more of these layers in. The amount of detail you can generate is limited only by your creativity.

    Do keep in mind that you don't want to use 16x16 tiles in a real game, that's why I didn't do it here in this tutorial. That many sprites at once would start to choke up Construct. Keep in mind that here we were generating the entire world, but your player isn't always going to see the entire world. You only need to show what is in his field of vision, so he's going to be looking at a small portion of the map at any given time. However, the noise map adds a lot of realism to the terrain that wouldn't be possible otherwise.

    Conclusion

    You will find that there are enough actions, conditions, and expressions in the plugin to do whatever you need to do.

    I have a few names to drop in here at the end. I have to thank Ken Perlin for his algorithm, you will notice the default seed for a Perlin object is 1985, homage to when he made the algorithm. Secondly I have to thank John Ratcliff, as he came up with this implementation of Perlin Noise, and I am simply porting it to Construct. Lastly, I have to thank my buddy Alex for cranking out a little TV with static on it at 4AM in the morning for my stupid project.

    I will be releasing the plugin very soon. You can use the plugin for whatever you want to use it for. It is my first plugin ever, so PLEASE report any inconsistencies or bugs you might encounter. And please, be on the lookout for my future projects. Anything that comes out of me will involve randomizing or procedurally generating something...

  • That's the beauty of it's simplicity. The Perlin Noise object doesn't store anything. You can put the noise into an array or a canvas if you want to by looping through the array indexes or the pixels on a canvas. All the noise object will do is tell you what the amplitude is in a given area on it - since it uses a seed to figure that out, it doesn't even actually "store" the noise itself in any way. That's what I meant when I said it can be as detailed as you want it to be. If you want 1 to 1 pixel canvas art Perlin Noise, it can do that. If you want tilemaps, it can also do that.

    It's a computational tool, it has no visual component unless you give it one. In the editor it doesn't even show up, it's OF_NODRAW like the Keyboard and Mouse plugin.

Arsonide's avatar

Arsonide

Member since 5 Dec, 2007

None one is following Arsonide yet!

Trophy Case

Arsonide has no trophies yet!

How to earn trophies