View Full Version : Idea: A program that variates tiles in a level
DennisKainz
Dec 9, 2015, 10:55 AM
Basically, this is how it should work:
You tell the program to find one or more specific tiles.
Then you tell it to replace the previous tile(s) with one or more different tiles.
The tiles found will be randomly replaced around the level.
Example:
This is what you got in the level:
http://i.imgur.com/XzKSaTI.png
You tell the program to find this:
http://i.imgur.com/rBKc0PM.png
And replace it with these:
http://i.imgur.com/D8ve0RP.png
Then you do the same with this:
http://i.imgur.com/Nkug6Ve.png
And you replace it with these:
http://i.imgur.com/JYpfwqY.png
The program will give you something like this:
http://i.imgur.com/J7PFMw7.png
Primpy
Dec 9, 2015, 11:33 AM
Well, that would be something, but...
1. It's pretty much useless. How much of a lazybones can you be to use a program instead of placing some random tiles by yourself? Just spend a few more seconds placing random tiles, your hand won't hurt, trust me.
2. I highly doubt that someone is going to do this. It's most likely insanely hard to do such a thing or maybe even impossible because different tilesets have different tile placement.
Seren
Dec 9, 2015, 02:07 PM
I recall Violet had shown screenshots of MLLE doing this. I don't think the current build is capable of it but it's open source (https://github.com/Violet-CLM/MLLE), feel free to fork it, as did I when I wanted to fix the flood fill tool (Violet if you're reading this go accept or reject my pull request from 8 months ago).
Violet CLM
Dec 9, 2015, 07:18 PM
This is precisely what MLLE's ctrl key is for, particularly in combination with flood fill, yes. Though that won't be able to detect separated wall areas, so you have to hunt them down individually, but a whole lot of manual randomization time still gets saved for you.
That said, there's also some appeal to making AngelScript do it for you instead, since that way you don't need to worry about <em>remembering</em> to do randomization every time you add a new wall or whatever to the level. Just fill in all the walls with your standard tile and let them be randomized at runtime.
In any case, you're still doing a lot more work in that example picture than you need to. What I do (among other things) in <a href="http://www.jazz2online.com/jcf/showpost.php?p=488592&postcount=56">violetmaze5.j2as</a> is construct walls <em>entirely</em> out of single tiles, and then the script not only randomizes the individual wall tiles, but also figures out whether they're floors, ceilings, etc. That's really all you need in simple tilesets like Diamondus, Carrotus, or Castle. So instead of
<img src="http://i.imgur.com/XzKSaTI.png" />
, I prefer
<img src="http://oi65.tinypic.com/zo7qwx.jpg" />
DennisKainz
Dec 9, 2015, 11:06 PM
Thanks a lot for your example! It didn't only turn useful for tiles, but for a lot of other things!
I now can select more values at once for a purpose.
There's one only problem: Whatever I try to use multiple values for, it says "No conversion from "uint[]" to "uint" available"
How do I check or change multiple expressions at once for weapons, enemies, coins and all?
Violet CLM
Dec 9, 2015, 11:34 PM
I'm not sure exactly what you're asking, but I have two guesses, and hopefully one of them is correct:
If you want to know how to get a random value from an array: <code>ArrayName[jjRandom() % ArrayName.length()]</code>
If you want to know how to tell whether a specific value is in an array: <code>ArrayName.find(SpecificValue) >= 0</code>
Otherwise, please give a little more context.
DennisKainz
Dec 9, 2015, 11:45 PM
This was exactly what I wanted to know! Thank you again!
zapS
Jan 1, 2016, 04:57 PM
the program you describe in the first post sounds really simple to do. if you still need something like that i might do it if i get the time.
vBulletin® v3.8.2, Copyright ©2000-2025, Jelsoft Enterprises Ltd.