Haru 290 Posted January 15, 2016 Rationale: This is part of the NPC scripts standardization project. In the past, NPCs were defined with numeric View IDs, while now we've replaced most of them with more human-readable (and as such easier to maintain) constants - the same constants that AEGIS scripts use, making the numeric IDs obsolete (and deprecated). Contents: When the NPC View IDs were converted to constants, the only leftover was the special ID '-1' we use for invisible / floating NPCs, that didn't have an equivalent constant defined at the time. This changeset defines a constant 'FAKE_NPC' for it, and replaces all the '-1' view IDs with the new constant. The exception for the -1 case is removed from the code (making it effectively deprecated, just like the other numeric IDs). Impact: The impact of this changeset on custom scripts is low. All old code will still work (but it'll throw a deprecation warning). It's recommended to update all the affected code as soon as possible - the support for the old style IDs may be removed from the code at any time in the future (after at least a month from the commit). Details: The use of the sprite ID '-1' in NPC headers to specify an invisible NPC is now deprecated. 'FAKE_NPC' should be used instead. This affects all NPC types (script, shop, trader, duplicate, etc) /* Before: */ - script TurboTrap#tt_main -1,{ // ... } in_moc_16,65,162,0 duplicate(SinTrap) 02_2 -1,0,0 /* Now: */ - script TurboTrap#tt_main FAKE_NPC,{ // ... } in_moc_16,65,162,0 duplicate(SinTrap) 02_2 FAKE_NPC,0,0 Merge Date:Thu, 31 Dec 2015 23:40:48 +0100 Related Pull Requests: - #1000 - https://github.com/HerculesWS/Hercules/pull/1000 - define FAKE_NPC as -1 in const.txt [AnnieRuru] Related Commits: - ef171a8 - https://github.com/HerculesWS/Hercules/commit/ef171a8 - Mon, 21 Dec 2015 19:59:38 +0800 define FAKE_NPC as -1 in const.txt [AnnieRuru] - efaaf84 - https://github.com/HerculesWS/Hercules/commit/efaaf84 - Mon, 21 Dec 2015 20:12:45 +0800 Replace -1,{ with FAKE_NPC,{ replace using Notepad++ [AnnieRuru] - b4c99db - https://github.com/HerculesWS/Hercules/commit/b4c99db - Tue, 29 Dec 2015 02:16:49 +0100 Replaced leftover -1 view IDs with FAKE_NPC [Haru] - 32a42ee - https://github.com/HerculesWS/Hercules/commit/32a42ee - Tue, 29 Dec 2015 02:17:26 +0100 Extended the numeric view ID deprecation to '-1' (FAKE_NPC) [Haru] - 0e99004 - https://github.com/HerculesWS/Hercules/commit/0e99004 - Thu, 31 Dec 2015 23:40:48 +0100 Merge branch 'AnnieRuru-request_29' into hercules [Haru] Trivia: Commit efaaf84 was done with a find and replace in Notepad++, to globally replace '-1' view IDs with 'FAKE_NPC' (as described in the commit notes). Commit b4c99db caught the leftovers (less common cases where the -1 is not followed by ',{'), and was powered by vim macros and grep (and vimgrep). It also features manual clean up of trailing whitespace or extra tabs in a small subset of the affected lines. 6 jaBote, JulioCF, Legend and 3 others reacted to this Quote Share this post Link to post Share on other sites
Neo-Mind 264 Posted January 15, 2016 Oh good. Human Readability FTW. 1 evilpuncker reacted to this Quote Share this post Link to post Share on other sites
evilpuncker 504 Posted January 15, 2016 @@Haru is that intentional that the old format shops can still have -1 as viewid and give no warning or whatsoever? Quote Share this post Link to post Share on other sites
Haru 290 Posted January 15, 2016 Not intentional, I'll look into it Okay, checked. The reason is that we don't parse the view ID, if the shop NPC is floating. I'll probably change that (I believe it's a good idea to enforce the syntax more strictly, to avoid unexpected issues later) 1 evilpuncker reacted to this Quote Share this post Link to post Share on other sites
Oxxy 24 Posted January 16, 2016 I'm not sure if It's good idea to delete server's ability to read NPC sprites as numbers, because, personally, for me, it has more readability than those names. im not sure how to explain it properly, but I like old variant. Quote Share this post Link to post Share on other sites
vykimo 68 Posted January 16, 2016 Useless. 'Kay, Thx, Bye. Prepare some usefull shit for player rather than disturbing script developpers... 1 vBrenth reacted to this Quote Share this post Link to post Share on other sites
Haru 290 Posted January 16, 2016 @@Oxxy 49 66 20 79 6F 75 20 70 72 65 66 65 72 20 72 65 61 64 69 6E 67 20 6E 75 6D 62 65 72 73 20 74 68 61 6E 20 77 6F 72 64 73 2C 20 6E 6F 74 68 69 6E 67 20 70 72 65 76 65 6E 74 73 20 79 6F 75 20 66 72 6F 6D 20 64 65 66 69 6E 69 6E 67 20 74 68 6F 73 65 20 6E 75 6D 62 65 72 73 20 61 73 20 63 6F 6E 73 74 61 6E 74 73 2C 20 62 79 20 65 64 69 74 69 6E 67 20 63 6F 6E 73 74 61 6E 74 73 2E 63 6F 6E 66 2E. Sarcasm aside, it's just ASCII codes. If you decode it, it contains a solution that should work for you. @@vykimo If you're not pleased, you can use any other emulator. We provide both content updates and architecture modernization, and we will keep doing so as long as the project lives. If you want to stick to the early 2000's coding practices *and* use Hercules at the same time, then feel free to make your own fork, and undo the changes you don't like. As you can see in my post, I specified the related commits, so they're easy to revert. 3 Skyline, jaBote and evilpuncker reacted to this Quote Share this post Link to post Share on other sites
AnnieRuru 957 Posted January 16, 2016 (edited) @@Oxxy use this tool to convert what Haru just said XD http://www.asciitohex.com/ EDIT: the reason why we can't fix some bugs is because we have a very crappy and messy coding format in the source code when we directly fix the bugs, most of the time, is just a temporary measurement to permanently get rid of the bugs, the 1st step is of course make the source code have higher readability only a good structure code and a readable coding style that understood by many users, can help make our emulator less bug Edited January 16, 2016 by AnnieRuru 2 fourxhackd and jTynne reacted to this Quote Share this post Link to post Share on other sites
Oxxy 24 Posted January 16, 2016 @@Oxxy 49 66 20 79 6F 75 20 70 72 65 66 65 72 20 72 65 61 64 69 6E 67 20 6E 75 6D 62 65 72 73 20 74 68 61 6E 20 77 6F 72 64 73 2C 20 6E 6F 74 68 69 6E 67 20 70 72 65 76 65 6E 74 73 20 79 6F 75 20 66 72 6F 6D 20 64 65 66 69 6E 69 6E 67 20 74 68 6F 73 65 20 6E 75 6D 62 65 72 73 20 61 73 20 63 6F 6E 73 74 61 6E 74 73 2C 20 62 79 20 65 64 69 74 69 6E 67 20 63 6F 6E 73 74 61 6E 74 73 2E 63 6F 6E 66 2E. Sarcasm aside, it's just ASCII codes. If you decode it, it contains a solution that should work for you. @@vykimo If you're not pleased, you can use any other emulator. We provide both content updates and architecture modernization, and we will keep doing so as long as the project lives. If you want to stick to the early 2000's coding practices *and* use Hercules at the same time, then feel free to make your own fork, and undo the changes you don't like. As you can see in my post, I specified the related commits, so they're easy to revert. Then could you define them together with release, because I don't think they will be so useless, not only me is using them instead of constants, because you gotta look up for those constants every time, and numbers were used since forever Quote Share this post Link to post Share on other sites
Haru 290 Posted January 16, 2016 The constants don't need to be looked up, since they have somewhat of a meaning (they already tell you if a NPC is a man, a woman, an animal, a monster or a thing for example, and they describe in a way or another what it looks like). Numbers on the other hand, are just numbers, and don't have any descriptive meaning. It's discouraged to use numbers, since they're too easy to mistake (and several errors in the past, both in scripts and in source, were caused by misplaced numbers, very hard to detect while reviewing code) 2 hemagx and evilpuncker reacted to this Quote Share this post Link to post Share on other sites
kisuka 178 Posted January 17, 2016 Honestly not really in favor of the idea of deprecating the use of IDs :/ I was the one that was pushing for script standardization originally. I released the first const use in place of sprite IDs. But that change was not meant to become a mandatory thing. Users should not be forced to use constants in place of IDs if they don't want to. Consts reference the IDs anyways, so eliminating the ability to use direct IDs just really doesn't make sense. It's in the same sense of script commands like getitem, delitem, specialeffect, skill, etc. We encourage the use of constants but in no way should it be mandatory. A better solution instead of straight up deprecating it would be to create an official scripting style guide and encourage the user of constants over the IDs, but don't require users to have to use them. If users will be contributing to the repository they should follow the style guide / use constants, but if they're making their own scripts they should be allowed to use either. Constants should be optional always for these situations. 2 jTynne and vykimo reacted to this Quote Share this post Link to post Share on other sites
Haru 290 Posted January 17, 2016 Oh come on everyone, where have you all been during the past 7 months? I mean, there's been a warning since June, when a NPC was using a number instead of a constant (the only thing that changed now is that it's extended to the '-1', everything else was already changed last June) Quote Share this post Link to post Share on other sites
Mystery 594 Posted January 17, 2016 When NPCs were using IDs, we all had to learn the IDs of the NPCs and I bet not everyone, still to this day, knows ALL the NPC IDs by heart. Now that the NPCs are constants, it'd be the same way like it was back in the day; learning. Yeah I know it'll take some time to learn new things, but what's the point staying back in the olden days? 1 hemagx reacted to this Quote Share this post Link to post Share on other sites
vykimo 68 Posted January 18, 2016 (edited) @@Oxxy 49 66 20 79 6F 75 20 70 72 65 66 65 72 20 72 65 61 64 69 6E 67 20 6E 75 6D 62 65 72 73 20 74 68 61 6E 20 77 6F 72 64 73 2C 20 6E 6F 74 68 69 6E 67 20 70 72 65 76 65 6E 74 73 20 79 6F 75 20 66 72 6F 6D 20 64 65 66 69 6E 69 6E 67 20 74 68 6F 73 65 20 6E 75 6D 62 65 72 73 20 61 73 20 63 6F 6E 73 74 61 6E 74 73 2C 20 62 79 20 65 64 69 74 69 6E 67 20 63 6F 6E 73 74 61 6E 74 73 2E 63 6F 6E 66 2E. Sarcasm aside, it's just ASCII codes. If you decode it, it contains a solution that should work for you. @@vykimo If you're not pleased, you can use any other emulator. We provide both content updates and architecture modernization, and we will keep doing so as long as the project lives. If you want to stick to the early 2000's coding practices *and* use Hercules at the same time, then feel free to make your own fork, and undo the changes you don't like. As you can see in my post, I specified the related commits, so they're easy to revert. I was in bad mood and sorry if I was a bit aggresive But what I meant is that changes like this are totally invisible for players and you have to understand that players' community of Ragnarok Online is decreasing years by years. Today it reached its worse point ever. Hercules is actually the best emulator for stability and exactness with official content : I work on hercules everyday and I thank dev every single day for the cleanliness of source code. NOW, official content takes very long time to come and you probably will understand that Ragnarok is nothing without players, thus hercules too. And I care most about Ragnarok pServ/Hercules' community than using constants instead of integers. That's all I wanted to say just before. Edited January 18, 2016 by vykimo Quote Share this post Link to post Share on other sites
Haru 290 Posted January 18, 2016 That's certainly true, the RO population is declining and all, but please understand that Hercules has very little to do with the number of players playing the game. I'm not here to implement the latest NPCs or to obtain information from official servers (I don't even have an account on official servers, nor I have access to any inside information or leaks), but you can't deny that other developers in the Hercules team are constantly adding new features or adapting to game mechanics changes. My role here is to oversee the development, review code, and bring architectural improvements when they're necessary. Please also keep in mind that, while Hercules is mostly a Ragnarok Online emulator, it provides a foundation that can be used with other games (see The Mana World / evol online for an example). 1 jTynne reacted to this Quote Share this post Link to post Share on other sites
Jguy 215 Posted January 18, 2016 One of the goals of *Athena (Hercules was forked from rAthena which was forced from eAthena which is forked from jAthena...etc) is to closely emulate the official server(s) as possible. This includes databases, NPC's and yes, source and NPC code structure (with obvious modernization such as not using 96GB of RAM and Windows only to run). This change most closely follows that original goal. 1 jTynne reacted to this Quote Share this post Link to post Share on other sites
Tepoo 23 Posted January 18, 2016 @@Oxxy 49 66 20 79 6F 75 20 70 72 65 66 65 72 20 72 65 61 64 69 6E 67 20 6E 75 6D 62 65 72 73 20 74 68 61 6E 20 77 6F 72 64 73 2C 20 6E 6F 74 68 69 6E 67 20 70 72 65 76 65 6E 74 73 20 79 6F 75 20 66 72 6F 6D 20 64 65 66 69 6E 69 6E 67 20 74 68 6F 73 65 20 6E 75 6D 62 65 72 73 20 61 73 20 63 6F 6E 73 74 61 6E 74 73 2C 20 62 79 20 65 64 69 74 69 6E 67 20 63 6F 6E 73 74 61 6E 74 73 2E 63 6F 6E 66 2E. Sarcasm aside, it's just ASCII codes. If you decode it, it contains a solution that should work for you. @@vykimo If you're not pleased, you can use any other emulator. We provide both content updates and architecture modernization, and we will keep doing so as long as the project lives. If you want to stick to the early 2000's coding practices *and* use Hercules at the same time, then feel free to make your own fork, and undo the changes you don't like. As you can see in my post, I specified the related commits, so they're easy to revert. I was in bad mood and sorry if I was a bit aggresive But what I meant is that changes like this are totally invisible for players and you have to understand that players' community of Ragnarok Online is decreasing years by years. Today it reached its worse point ever. Hercules is actually the best emulator for stability and exactness with official content : I work on hercules everyday and I thank dev every single day for the cleanliness of source code. NOW, official content takes very long time to come and you probably will understand that Ragnarok is nothing without players, thus hercules too. And I care most about Ragnarok pServ/Hercules' community than using constants instead of integers. That's all I wanted to say just before. sorry but the population is not decreasing because people improve a opensource project or not. the population is decreasing because the whole scene became toxic. every kid wants money for their work today, they want to get payed for every small shit bit. the community does not care for quality. they prefer to go to a 1.1k populated server who crashs everyday and which is money making oriented with a damn bad quality, instead of joining a server where they offer nearly everything for free and where the admins knows how to fix bugs to keep a full server alive without crashes. this community don't die because of the devs of Hercules or RAthena, it dies because of the stupid greedy admins who open one server after the other to make money and milk the people. flame them, not Haru and the others. Topic related: Nice changes, took me quiet some while to merge to the newest level, but was worth it. 1 askafreedom reacted to this Quote Share this post Link to post Share on other sites
mrlongshen 22 Posted January 23, 2016 NPC using constants, for me this is good ! Nothing different compare with the number. HAHA Always keep up to date haru ! Quote Share this post Link to post Share on other sites
Kuya Jeo 120 Posted January 25, 2016 Yeah its hard to know or memories those NPC names but once you learned it, it like eating pizza Quote Share this post Link to post Share on other sites
mleo1 36 Posted January 25, 2016 Does not matter when you got a listDon't need to remember the ids, don't need to remember the names, you gonna look and copy paste anyway, kek Quote Share this post Link to post Share on other sites
4144 366 Posted January 25, 2016 if you do typo in id, it will works if you do typo in name, it will show error. Quote Share this post Link to post Share on other sites
Legend 43 Posted January 27, 2016 Scripters need also to adopt the new scripting styles and I like the update, for better reading. Quote Share this post Link to post Share on other sites
REKT 10 Posted January 28, 2016 When WILL Hercules will be support 2015 client i mean fully support* @@Haru sorry for posting out of topic. I just need the fully function of client 2015-10-29a Quote Share this post Link to post Share on other sites
Mystery 594 Posted January 28, 2016 When WILL Hercules will be support 2015 client i mean fully support* @@Haru sorry for posting out of topic. I just need the fully function of client 2015-10-29a Please don't use this topic as a means of inquiry outside topic's trajectory (scope). Meaning, don't ask questions regarding clients in a topic like this that talks about a NPC structure change. Nor is it advised to ask support questions in this topic as it is just used as an announcement. Thanks. Quote Share this post Link to post Share on other sites