LegionDark with Fiber Connection, Puppetmaster, 3 years up!

tarumancer
Posts: 5
Joined: Thu Nov 12, 2015 10:30 am

Re: Ding dong...

Post by tarumancer » Tue Jan 30, 2018 11:02 am

TeoTwawki wrote:I've helped out LegionDark for a long, long time here and done the bulk of the fixing broken stuff on a server that isn't even mine

[...]

When I first started helping LegionDark's codebase was a totally unusable crapheap. It could not do 'git pull' from Darkstar|master at all. I had to show everyone why they way they were doings was unmaintainable and could not survive long term. There was a lot of resistance at first. Within a week I had gutted 80% of it, but it could finally pull updates. A condition of my help was "if its fully retail, don't put it directly in LegionDark, send it to Darkstar and then pull it back to LegionDark after its merged". Everyone agreed. And then right away someone tried to ignore that and then rage quit LegionDark when I called him out on it.

It was like this with most subjects. I wasn't trying to control LegionDark - far from it, I don't even LIKE item level post lv99 gameplay. Nothing in terms of what drops where or what the endgame was like, was ever my decision. And I insisted it be that way because this ain't my server. I had my own server I ran, and I was just helping here. "Just helping" steadily grew to be more and more "cleaning up all the broken things" and then I got so sick of it when I couldn't even play the game anymore I wanted to just create new stuff out of sheer boredom, but I digress..

[...]

I wanted to get the last batch of new content out and bug fixes, which would have added multiple new zones and 3 new endgame activities while allowing a lot of older boring crap to go back to stock so we'd ..I mean so I'd no longer have to keep repairing it to keep it custom instead of stock Darkstar, and the server would finally be able to "just pull". I'd no longer be needed for the most part.
Teo/LegionDark Team,

Thanks for your (and everyone else who contributed) work in helping align LegionDark. Seems a shame that this all came to a head, but here we are. Thanks to everyone at the LegionDark team for having provided to the community everything that you did for as long as you did. Time, effort, hosting, hardware, and expertise don't come out of thin air. Thanks!

The shutdown of LegionDark has prompted me to start looking into the work involved in creating a similar custom environment. As someone with no coding experience and only-slightly-better-than-copy-paste scripting ability, it's a daunting task to say the least. I've been able to clone, build, configure, and launch a Vanilla DarkStar Server. The wiki has great basic tutorials, so kudos to the DarkStar team for that.

Teo (et al.), I have a few general questions now that the lights are out, if you have a few moments and are able to answer:
  1. As someone starting out down the road to building out a Custom Server, are there any simple (or big) pitfalls that I should be thinking about trying to avoid? Are there good practices I should be thinking about when modifying the lua script base (or other locations) to make the process clean for future updates?
  2. Referencing back to the Wiki, the basic detail to stand up the server was very helpful. In the short time that I've spent looking for information, I've been able to grep out some variables and actions to generate scripts but I haven't found a good central documentation to list, for example, variables and other items. Is there a good place to cull this information from other than grepping through scripts?
  3. In regards to the customized work that was done by the LegionDark Team, do you know if that will be released to the public in some form? I realize this question may be premature since you haven't spoke with Loki yet, but asking anyway. I'd be interested in seeing how the customized Voidwatch, ZNM, Legion, and Abyssea pieces were designed and implemented. Having it available as a reference/building block would go a long way for myself and anyone else in the community looking to generate custom content.
  4. Related to #3, are there any good tutorials or examples that you (or anyone else reading along) can point out that would help?
  5. Also related to #4, do you plan on releasing your own custom work to the community in any form?
  6. As far as feature parity between Legion and Vanilla DSP, do you know if things are close from the perspective of Missions and Quests? The What Works and Missions pages on the Wiki seem to be out of sync or a few months outside of being updated. For reference, I was able to complete Sandy Rank 10 in Legion, COP to completion (or thereabouts), Zilart to just before Divine Might (walked away in early 2016 right after getting my pentasphere), and ToAU seemed to stop just after Mission 5 or 6 (though this may have been an issue with my client being a revision ahead of the ecv on Legion).
  7. Regarding feeding back to DarkStar, if there are things that I can directly contribute (Missing Recipes, for example), any pointers on helping prepare data for submission? I am 100% a neophyte when it comes to working with git, so I probably need to educate myself there first...
Thanks in advance for any response, and again Thanks to the LegionDark Team for having provided a great server to the community.

User avatar
TeoTwawki
Developer
Posts: 527
Joined: Mon Jul 15, 2013 9:50 pm

Re: Ding dong...

Post by TeoTwawki » Wed Jan 31, 2018 3:52 pm

tarumancer wrote: Teo (et al.), I have a few general questions now that the lights are out, if you have a few moments and are able to answer:
  1. As someone starting out down the road to building out a Custom Server, are there any simple (or big) pitfalls that I should be thinking about trying to avoid? Are there good practices I should be thinking about when modifying the lua script base (or other locations) to make the process clean for future updates?
  2. Referencing back to the Wiki, the basic detail to stand up the server was very helpful. In the short time that I've spent looking for information, I've been able to grep out some variables and actions to generate scripts but I haven't found a good central documentation to list, for example, variables and other items. Is there a good place to cull this information from other than grepping through scripts?
  3. In regards to the customized work that was done by the LegionDark Team, do you know if that will be released to the public in some form? I realize this question may be premature since you haven't spoke with Loki yet, but asking anyway. I'd be interested in seeing how the customized Voidwatch, ZNM, Legion, and Abyssea pieces were designed and implemented. Having it available as a reference/building block would go a long way for myself and anyone else in the community looking to generate custom content.
  4. Related to #3, are there any good tutorials or examples that you (or anyone else reading along) can point out that would help?
  5. Also related to #4, do you plan on releasing your own custom work to the community in any form?
  6. As far as feature parity between Legion and Vanilla DSP, do you know if things are close from the perspective of Missions and Quests? The What Works and Missions pages on the Wiki seem to be out of sync or a few months outside of being updated. For reference, I was able to complete Sandy Rank 10 in Legion, COP to completion (or thereabouts), Zilart to just before Divine Might (walked away in early 2016 right after getting my pentasphere), and ToAU seemed to stop just after Mission 5 or 6 (though this may have been an issue with my client being a revision ahead of the ecv on Legion).
  7. Regarding feeding back to DarkStar, if there are things that I can directly contribute (Missing Recipes, for example), any pointers on helping prepare data for submission? I am 100% a neophyte when it comes to working with git, so I probably need to educate myself there first...
Thanks in advance for any response, and again Thanks to the LegionDark Team for having provided a great server to the community.
  1. Depends how comfortable you are handling the results - as an example in LegionDark there would be hundreds, sometimes thousands of edit conflicts as a result of adding things that didn't exist in Darkstar and then those things coming into existence after. If those implementations differed even slightly then resolving that conflict using a specific version of the file (tortoisegit used to call it "use mine" and "use theirs" but now specifies which trunk its from) could either risk breaking your customization's or risk breaking some scripts from your customization's. Manually reviewing files sucks, even if most of them have no problems and git just wants to to confirm it merged it correctly looking can take all day. edits in the C++ source code can risk your dump files being outright useless or pointing Darkstar devs to the wrong line number when they try to look at wtf went wrong along with visual studio yelling "this dump came form custom code!" and you having to try and recreate the bug on an unaltered copy of Darkstar-master (and for many they have to do that anyway because they don't know enough to know if their customization's were involved.. Always look at what you've changed FIRST before reporting).

    I've done things like wrapping my source changes in their own functions and calling them as a one-line change in already existing blank lines to make it easier to spot when my custom changes caused a problem, and to make it easier on git so it doesn't have to ask me to review a conflict. In lua scripts, when I have to comment something out I use a block comment so the original line isn't changed - instead 2 new lines were added, "--[[" and "]]". Then if that single line gets changed by someone in Darkstar, it is still commented out without my having to review a conflict. SQl changes..create a subdirectory in your sql folder. Store just your modifications in their own files there. Don't edit the Darkstar SQL files. Use ALTER, REPLACE, UPDATE (and if need be, DELETE) statements instead of commenting out Darkstar's INSERT statements. Learn your SQL syntax. Seriously don't change or write SQL unless you are willing to use a search engine ("google it").
  2. We have sucked at documenting. A lot of it can't really be documented to that level as well unless we start automating it. Sometimes running a search on github is enough to avoid searching the local copy (file size limits and such on github tho..)
  3. A few of the NPC's I couldn't get their CS event parameters right, so I faked it using commands to alter the NPC's actions (facing player, gesturing) and printing the same lines their cs event would have in /say chat. Say is nearly the same color as regular NPC text by default so unless the player modifies chat color sin their client they rarely notice. Recently the PintToPlayer() binding was altered to support chat types, but my other features aren't in Darkstar at this time. They aren't hard to do though and I'll get that shared when I have time (I dunno if they can go in the main project being custom, but I can still share on the forum here if not). The packets to tell the client to update the NPC with its new facing and animation states already exist.

    The NMs Loki built were fully custom. Only the mobId and model matched retail for 99% of them, the move names sometimes matched but usually did different things. I wanted to get retail versions into Darkstar first but Loki was in a hurry because of his new job starting soon. The rifts weren't exactly perfect (I left out atmacite void dust and other things) and here is a basic script for that, please note that it is way wrong because of Legions Custom restrictions (which I was in the process of phasing out to be more retail but never finished):

    Code: Select all

    -----------------------------------
    -- Area: North Gustaberg
    --  NPC: Planar Rift
    -----------------------------------
    require("scripts/globals/keyitems")
    -----------------------------------
    
    function onTrade(player,npc,trade)
    end;
    
    function onTrigger(player,npc)
        local STRATUM = player:hasKeyItem(INDIGO_STRATUM_ABYSSITE);
        local mobID = 17211882;
        local mobNotUp = false
        local correctNPC = false
    
        if (GetMobAction(mobID) == ACTION_NONE or GetMobAction(mobID) == ACTION_SPAWN) then
            mobNotUp = true;
        end
    
        if (npc:getXPos(798) and npc:getYPos(0) and npc:getZPos(440)) then
            correctNPC = true;
        end
    
        if (STRATUM == true and mobNotUp == true and correctNPC == true) then
            -- NOTE: I'm only requiring 1 person (the popper) to have the voidstone+abyssite, per pop.
            -- I know this isn't what retail does. Retail also lets them gain more than 1 per day too.
            -- In the mobs onMobDeath script, we can easily make the popper 100% upgrade rate and everyone else less, if desired.
            if (player:getCurrency("voidstones") > 0) then
                player:startEvent(6000, 7);
            else
                player:startEvent(6000, 2);
            end
        else
            player:startEvent(6000);
        end
    end;
    
    function onEventUpdate(player,csid,option)
        -- printf("CSID2: %u",csid);
        -- printf("RESULT2: %u",option);
    end;
    
    function onEventFinish(player,csid,option)
        -- printf("CSID: %u",csid);
        -- printf("RESULT: %u",option);
        -- NOTE: I'm only requiring 1 person (the popper) to have the voidstone, per pop.
        -- I know this isn't what retail does. Retail also lets them gain more than 1 per day too.
        if (csid == 6000 and option == 1) then
            player:delCurrency("voidstones", 1);
            SpawnMob(17211882):updateClaim(player);
        end
    end;
    
    Retail requires all members to have a void stone. You can use a loops to check stones and deduct them from the party/alliance members. The parameters used above disables the menu options LegionDark wasn't using. The GetMobAction commands were deprecate din Darkstar ages ago, and should likely be replaced with checks for !isDead(GetMobByID(123456)..Also Legion only used 1 rift and one of the multiple copies of each NM per area. Retail has multiple rifts and multiple copies of each NM. Another thing I never got around to fixing on LD.. Some stuff is written funky to make clear to ppl I was teaching. Like You don't have to say "== true" at all when checking true/false in lua.
  4. For specific things in Darkstar (like how to script the parts of an NM that need scripting) I have some WIP ones in my gists but they aren't ready yet. For more generic learning of lua/c++/sql there are a lot of good ones online. (Note that Darkstar uses LuaJIT which is most like Lua 5.1 and has some 5.2 (and possibly 5.3) mixed into it. Aim for 5.1 compatibility and everything should work)
    https://www.lua.org/pil/1.html
    https://www.tutorialspoint.com/lua/index.htm
    http://www.cplusplus.com/doc/tutorial/
    https://www.tutorialspoint.com/cplusplus/index.htm
    https://dev.mysql.com/doc/mysql-tutoria ... pt/5.7/en/
    https://www.mysqltutorial.co/
    With mysql I really recommend just search for the specific thing you are trying to do, even after you read tutorial stuff..
    "Google, how do I do X with this Y? And please filter out all those useless PHP examples, Darkstar doesn't use PHP.."
    Translated to google speak wrote:"how to" edit column mysql -php
    https://encrypted.google.com/search?hl= ... l%20%2Dphp

    BAM we learn how to ALTER TABLE
  5. Yes, I do. Always have. Offline "irl" permitting I'll forum post some of my stuff that isn't fit for pull requests stuff.
  6. LegionDark had disabled some server-crashy things, other than that missions should have been identical. Quests there may have been some half baked copy pasta attempts to add a few, I can't really say. And I had made a few easier just to get rid of often repeated attempt to bug report things that were not bugs. Example: before the weather requirement was remove din Darkstar (because retail removed it) I had killed it in Legion because I was sick of ppl reporting it..It was never broken! People were blind to the fact thunder weather was going on. Even after that people still kept reporting it"Oh I missed teh CS in sky" Yeah I know, I just wasted my time checking your quest status and variable. :sob: Lots of people were reporting bugs induced by mismatched client/server version as well which towards the end here was making R3P0 foam-at-the-mouth ranty about it.
  7. Learn the syntax before even starting. Practice with git before opening your first pull request. Make sure you know how to fork, branch, pull, push, and rebase. Deliberately giving yourself some edit conflicts to practice resolving would be good experience as well (pull one branch into another where both branches made different changes to the same files, watch the result). Once you feel confident to do your first pull request, be aware that often there can be a lot of back-and-forth in the review process and that this is normal and "can you do X here?" does NOT mean "your code is bad and you should feel bad". Don't be afraid to ask for help when you don't know how to do what is asked, and don't be afraid to lay out a case for why you feel method A would be better than method B if you think you have a good reason - just try to be concise and polite in the explaining. Also realize its probably not that important - I have trouble with rambling myself, usually give up after not being able to 'splain. It 99% the time works out fine anyway.
Hope that helps.


edit:
also always make your code human readable with good indentation and as easy to maintain as possible. Not like this abomination:
wtf did I just look at.png
Hi, I run The Demiurge server.


Image
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
PLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

tarumancer
Posts: 5
Joined: Thu Nov 12, 2015 10:30 am

Re: LegionDark with Fiber Connection, Puppetmaster, 3 years

Post by tarumancer » Thu Feb 01, 2018 9:42 am

(question to mods: since this conversation is rapidly becoming off-topic, can we copy/split it out to a separate thread in a more appropriate forum?)

Thanks for taking the time to reply. This is indeed very helpful!

The super boiled down take away (as it relates to me, at least) is spend the time and learn "the right way to do it"™. Learn how to use git correctly and effectively, then pick up MYSQL syntax, LUA and ultimately start kludging my through C++.

My thinking was (and essentially still is) to use existing examples of trigger based mobs, time based mobs, and special condition mobs as guides on how it's done the DarkStar way.

My own living hit list of things I need to get under my belt:
  1. Plan for documentation using practical examples.
  2. Locate / Create a reference table for PC Variables (HP, Level, Rank, Mission, Quest status, etc).
  3. Locate where different "currencies" (Conquest Points, IS, TABS, Cruor, Bayald, etc) reside in the DB and engine, how to increment and decrement them through scripting or otherwise.
  4. Learn how to query for mobs and digest the results.
  5. Look at an existing mob, find its stats, drop table, abilities, pop conditions, and the like, and then use those as a reference to either modify it or create custom mobs.
  6. Understand how Abyssea/Dynamis/ZNM/etc work in DarkStar, find their systems, rules, and parameters, and edit them.
Again, thanks for taking the time to respond and provide not only guidance, but reference material. Much appreciated.

User avatar
TeoTwawki
Developer
Posts: 527
Joined: Mon Jul 15, 2013 9:50 pm

Re: LegionDark with Fiber Connection, Puppetmaster, 3 years

Post by TeoTwawki » Thu Feb 01, 2018 5:31 pm

Another important thing: its easy to overwhelm yourself. Sometimes it can be good to get out of ones comfort zone, but on the flipside I've seen many ppl bite off more than they could chew and not be able to handle the frustration. Sometimes there's no shortcut and you gotta accept the mistakes you'll make.
(question to mods: since this conversation is rapidly becoming off-topic, can we copy/split it out to a separate thread in a more appropriate forum?)
Can just make a new thread if you have more questions, or ask for help on Darkstars discord https://discord.gg/Xuu5YX7 (for legion stuff, legion's discord is till up atm)

currencies are just values in a db table btw. char_points. some teleport things are in same table, I'd like to separate those but haven't had the spare time and keep hoping someone else will.
Hi, I run The Demiurge server.


Image
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
PLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

Post Reply