Hi, is it possible to set argument 5 (r) lower than 9, for working with, say, 2x2 or 4x4 pixel tiles? The demo crashes at 8 or lower.
A downloadable asset pack
This GameMaker Studio 2 asset provides a complete and dynamic resource for creating destructible terrain. Unlike most other destructible terrain assets, this one does NOT use surfaces or shaders and relies instead on a textured polygon approach, meaning that you can create and destroy the terrain in real--time. This also means that it is incredibly fast, especially when compiled using the YYC. The asset also has simple save and load scripts, permitting you to create levels and save them out as files which can then be loaded at any time... give your game a level editor!
- Complete set of debugging tools
- Game editor Demo where you can create and destroy terrain and see how it all works
- Multiple "quality of life" scripts to make using the asset a breeze
- Scaleable resources that will adapt to any size graphic used
- Highly optimised code that culls to the view and (when compiled using the YYC) is blindingly fast
- Heavily commented scripts and a complete demo to show how it can be used
- One script saving and loading, so you can create in-game editors, or create your levels and save them to be loaded later
NOTE! This asset can be used with pixel art games and gives beautiful crisp pixels on all destructible terrain by simply disabling AA and linear interpolation (or using the handy script supplied "terrain_set_smooth(false)". :)
In order to download this asset pack you must purchase it at or above the minimum price of $4.99 USD. You will get access to the following files:
Log in with itch.io to leave a comment.
I suspect not and I'd assume the crash is due to the sheer number of grid cells being generated... What room size and tile resolution are we working with here? If you could tell me how you're trying to set it up I can investigate and see what I can come up with... :)
Thanks for quick reply, very much appreciated.
Im just playing around with the demo at this point. The crash report says "Array index must be < 32000", which I see you mention a couple places in the code comments, so it will probably work with a very small room. However, Is it possible to somehow change the data structure to something that does not have this restriction of 32k (which I understand to be in place in GM purely for historical reasons) ? I read somewhere that ds_grid could directly replace array to get around that?
I guess one could also set up sectors of a couple screens and re-create the array as you move through the landscape but I guess that would be a massive undertaking to get working...
Ah, that's the issue... yes, GMS2 currently has that hard limit, and I'll be honest and say that I'm a bit loath to mess with the code to work around it right now, as the 2.3.0 update is about to drop and it actually removed this limit completely from arrays. So, I'd prefer to wait a couple of weeks until that update comes out and then update the asset (as I'm sure the update will break something :( )... sorry if that's inconvenient for you, but I really would prefer not to spend days working on something that I'll probably need to re-do again anyway a few days later. Hope you understand and thanks for the purchase and reaching out!
Looks really interesting,does this work in physics world.
Hi there! I'll be honest and say that I have no idea... I mean, the terrain will generate fine in a physics enabled world as it doesn't actually create instances and is all drawn using arrays... BUT, even though it will "work" it won't generate fixtures for collisions and things if you require them. You could probably do this yourself based on the density map or the polygon array, but it's not something I think would be easy to impliment. So, yeah, while the asset will work, I think converting it into any type of physical system would be very difficult. Thanks for the interest!