|
2018/12/27
I started on a next version of DropTable DSL because I was really inconvenienced that I limited myself to what I have with DT2. Don't get me wrong this shit is easy to write. But it is quite limited in terms of flexibility. Such as not being able to have the same weight for multiple brackets or only being limited to RandomTable for item ids and RandomRange for item amounts... That's why I am creating DS3. It will be more flexible. It will be more powerful. It will be more.
DT2.7a (a for arbitrary because i didnt base this version on any measurable metric, not alpha) update brings some syntactic quality of life
- Created util.Common
- This is where objects and misc classes used throughout multiple files will go.
- Best example is DO_NOTHING_X functions, they are functional types that can be used anywhere a functional type can, you just have to specify X, the amount of parameters. There are only 45 because kotlin 1.3's functional arity is 45.
- These are better used than {_, _, ... _ ->} throughout your code, as these each only make 1 anonymous function and are much easier to check equality for default values while keeping your code non-nullable. {_, _ ->} is not equal (according to hashCode) to DO_NOTHING_2, despite doing the exact same thing, nothing.
- Added default onAnnounce and default enableAnnounce from DT3
- You can now define onAnnounce and enableAnnounce at the top level of a DropTable and all children created brackets will inherit these.
- This is pure QOL syntactic sugar change. This is meant to minimize effort (assigning a bunch of onAnnounce and enableAnnounce with 1 definition) while keeping the same level of customizability (allowing you to override the suggested values inside the bracket).
- These default values are only "suggested" to built brackets, and will not be used if the bracket has its own explicit onAnnounce or enableAnnounce.
- If the "selected" enableAnnounce is false, neither the suggested nor defined onAnnounce will be used. DO_NOTHING_3 will be used.
- Useful if you want to minimize typing in a case where say, one drop table you want all tables to announce with the same message. Except you don't want to announce the least rare one (-enableAnnounce). You also want the most rare one to have a unique message (onAnnounce { ... }).
Inheritance\Suggestion example
2019/01/03
DT2 updates
- Inlined a lot of stuff so less separate binary garbage files are produced and performance over extremely large unrealistic tests of hundreds of millions of item draws is increased around 5%
Development on DT3 has started! Current version is 3.04b
- Completely rewritten everything (RandomUtil and Components are the most notable)
- New RandomUtil class and a few new extensions! (2 randTo 10) creates RandomIntRange(2, 10, inclusive=true), (RandomIntRange step 2) creates RandomIntProgression(range.start, range.stop, 2). RandomIntProgression has all the same values as the equivalent IntProgression, but you can get a random Int from it rather than having to map it to a list\array and get the random result from that.
- Much higher level of abstraction compared to the quite rigid structure of DT2. You will be able to add BaseRandom<Int> as ItemProducer (previously ItemGenerator) ItemId AND ItemAmount, so if you really want to you can get really deep with this. You can also put multiple brackets in the same bracket.
- Improved DSL Syntax, while still being very similar to (but not copypaste compatible with) DT2. Most notable change is no more un-wrapped ranges (ex: with amounts 2 to 10 step 2 -> with amounts (2 to 10 step 2))
2019/01/04
DT3.3 - Haven't found any bugs yet, here's to hoping lmao
- Finished rewriting all components (ItemProducer, Bracket, DropTable) to DT3 spec (Flexible, Powerful, Customizable) and their builders. Very similar usage.
- ItemProducer in DT3 is equivalent to ItemGenerator in DT2
- Bracket in DT3 can now either be a SingleBracket (which can only produce anything that extends ProducesItem), or a MultiBracket (which can produce SingleBracket or anything that extends ProducesItem). This is good because it allows you to have multiple brackets for the same weight without fucking up the MemoWeightedTable's formula, as well as let you diversify what those brackets do onAnnounce! Multiple Brackets per weight with separate onAnnounce functions is why I created DT3. It was extremely beneficial to rewrite nearly everything from the ground up rather than rewrite everything from the inside out.
- Nothing super notable about DropTable, its basically just a holder of Brackets.
- Fixed bug in BaseRandom, not sure how I DIDNT have any compilation or runtime problems (BaseRandom was still extending ProducesWhenPicked<T> which didn't exist rather than Produces<T>)... fuck it
- Removed a lot of vestigial reused DT2 code
- Rewrote MorUlRek Gem Stall in DT3!
This is rewritten to increment the weight in a Map every time the bracket is called
Spoiler for Rewritten + Cherry picked results:
Bitbucket: https://bitbucket.org/Nbness2/droptable/src/DT3/
2019/01/06
DT3.4
- Fixed bug where Bracket would not inherit from DropTable using Builder syntax
- MultiBracket now more truthful to its name, can hold multiple Brackets rather than only multiple SingleBrackets
- Renamed and visually upgraded (better to look at) a bit of code
2019/01/07
DT3.5
- You can now specify a custom weight calculation formula if you so wish. This way, you don't have to calculate it everywhere else in your code, just one place!
- Removed pickItemList and pickItemMap from MemoWeightedTable and DropTable. I didn't see any real use for them.
- Added DslMarker annotations to builders, this makes sure you can't do something weird like build an ItemProducer inside of an ItemProducer or DropTable unless explicitly stated using this@xxx
Spoiler for custom calc:
2019/01/10
DT3.6
- Added onSelect
- onSelect is a function you can define to trigger every time a bracket is picked regardless of whether or not announceDrop is enabled
- onSelect can be defined in both DropTable and Bracket
- onSelect will be suggested to any children. Reminder that children will refuse the suggestion if the child already has an one already explicitly defined.
- onSelect can be useful if you want to do something when, say, you get a pick from a specific table. An example would be firework graphics or maybe incrementing progress towards an achievement.
- Reduced keystrokes required to create a DropTable
- Added 'add producer {...}' as a shorter alternative to 'add itemProducer {...}'
- You now don't have to type "add bracket {...}" or "add producer {...}", you can now remove the "add " part and just type "bracket {...}" or "producer {...}"
- As a byproduct of basically calling a function now rather than using a variable and infix function, less stress is put on the IDE when using reduced keystroke builders.
- This change is back-compat, i didnt remove the "add bracket" and "add producer" functions.
- Added sub-bracket name inheritance using a String class similar to my StateBoolean
- All sub brackets will inherit the name from their parent bracket and add on to it
- The idea behind this is to have the parent bracket's name an adjective and the child bracket's name be the subject and the child's children any extra descriptor.
- For example a parent bracket named "Glowing" that has has a child named "Swords" will result in the childs actual name being "Glowing Swords", and the child's child bracket being named "of Might" will result in the child's child's name being "Glowing Swords of Might"
- Misc
- Changed calculateWeights signature from ((Int) -> Double)? to (Int) -> Double and now the default is defaultWeightCalculation
- Reorganized code
- Removed BuilderCommon.Set objects. With things that should only be used once in the builder, you use With.
DT 2.8
- Added onSelect from DT3 (read above)
- added reduced keystroke builders ("add producer {...}" -> "producer {...}") from DT3
- Removed 2 empty lines from DropTable class file
- added a space before +enableAnnounce in the test bracket in the builders file
Spoiler for images:
2019/07/02
DT3.8
- Put in a jar
- Now in
rspsUtil
namespace- Made generic
- Generic using the same thing I used for Container, the
ItemAccessWrapper<T>
whereT
is your item class.- If you are using the DSL, all you have to do is put
(accessWrapperName)
afterDropTable
(soDropTable(accessWrapperName)
) and it should work the same as before
Source not pushed yet, as I need to clean up this ugly poop.
I will be adding support for my most recentRandomUtil
sooner or later. This feels as though it is a more important release, as it previously locked people in to using my source code andItem
class but now it does not, as it lets you use whatever you want for the item class.
A new improvedItemAccessWrapper
is coming as well, supports item attributes.
JAR DOWNLOAD
Spoiler for pic:
2019/07/03
DT3.9
- You can now put an extra type which will be used as the new first parameter in
onSelect
andonAnnounce
. I use it for player, personally.- Added a tutorial on main post
2021/06/18
DropTable 4.0
There is NO 3 to 4 changelist as DropTable has been re-written from the ground up! However, here's a list of features
- Separated in to 2 modules, one being the more generic
ProducerUtil
(of which is a dependency to the latter), andDropTable
which is an elaborateProducer
wrapper.
ProducerUtil
essentially boils down to a single function,Producer<T>.produce(Arguments) -> T
with some helpers to help you along the way in your journey.- No more named parameters and parameter clutter, I am now welcoming
ArgumentKey<T>
andArguments
in to the fold.
- This means you can just... call the damn producer! While making sure you are setting the target, of course...
- Modify arguments as they pass through the pipes
- Check out your arguments when
onSelect
is called- Lighter weight! DropTable used to come with the full
RandomUtil
with it but now it only comes with what it needs (the random tables) and a few useful helpers (Like the random integral ranges and progressions)- Much much more flexible and powerful than DropTable 3 ever could even dream about approaching the level of.
- Make whatever you want in to a
Producer
simply by calling.toProducer()
- NO WRAPPERS REQUIRED, JUST SHAKE AND BAKE BABY!!
- A brand new type of table:
MultiRollTable
- Every producer you put in has whatever chance you get it to be picked no matter what else is rolled on
- You can have anywhere from 0 to
size
drops depending on how lucky you are!- This is generally a good spot to put exclusive tables, it's useful for stuff like dropping bones and a drop and maybe even something else all within 1 thing
very quick and insufficient but FUNKY demonstration
Spoiler for Exclusive Table Sample:
Spoiler for Multi Roll Sample:
Spoiler for How to call (including argument usage):
Spoiler for links:
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |
Tags for this Thread |