there's another post containing diffs (including one for cmake) to build what has been released to the public thus far.
http://www.eqemulator.org/forums/showthread.php?t=36401 |
I'm in the process of re-writing everything to be cleaner, better organized, more compatible (the itemdb in particular I need to redo so that it'll be easier to convert directly to and from SQL) and have better error checking. I still need to learn the basics of Git too. But I do hope to get a test branch up somewhere while I work on it, hopefully not too long from now.
|
Lua vs Perl / MySql
Pros of Lua vs Perl:
Cons of Lua vs Perl:
Pro's of Lua vs MySQL:
Con's of Lua vs MySQL:
What else am I missing? I'll edit as I people add. |
Quote:
|
I know nothing at all about Lua but it sounds pretty cool.
|
Lua and MySQL aren't even in the same problem domain.
|
Quote:
|
I think it's somewhat impractical is all.
Also a few of the developers do have plans to somewhere down the road change up the quest system and the database system but we're not close enough to be ready to talk about it yet. |
I like Lua for content databasing for a few reasons:
1) Content data is essentially static -- it only changes when new stuff is put in there, and doesn't really change at runtime. The only thing you really get out of having it be SQL is searchability and the ability to invalidate a whole table in a single brainfart. (Oh, and making sweeping changes, which I guess is nice for this project; I hope to make at least items and spells convertible back and forth from SQL, which would still allow that.) 2) For some things (like the spawnpoint and path grid stuff I put up) open-ended scriptability is a lot simpler than having to add new fields (sometimes new tables) and new code for every little new abstract functionality or feature you want to add. 3) Having everything organized into the folder of the zone it belongs to is nice. Not that e.g. the NPC database could not be changed to include zone and reduce the need for global NPCID numbers, but that's probably one of those "too late to consider changing" things. Definitely would not want to force anyone to switch. But there are reasons both for and against. |
Quote:
Whats worse - lua is stack based - thats a whole new level of understanding for most people. For perl, you were unable to expose complex objects (func args) to the quest system - now with direct lua calls you have the same issue - every complex object has to be manually coded - where in bindings its done in one line. Look how WoW emus, EQ2, Ryzoom and other implemented their event system - and compare all the bad things and improve upon this - (BTW - they all use bindings). A quick example how a binding could look like for getters or setters Code:
.def("GetName", &NPC::GetName) Code:
static int Lua_GetName(lua_State* L) { More things you need to take care of : script scoping - want to make sure that nobody can overwrite a var of another npc ? or do you want that ? How can entities interact with each other directly? |
Quote:
Quote:
For the two or three who might care, currently have a work-in-progress repo here; trying to keep the repo wiki up-to-date with all the EVENTs and object functions and eventually some script examples, as well as how-to's on module writing and adding new object types etc. |
Another positive to the Lua system, the more we move into it the more we can 'live update' while the system is running. not sure how much of an advantage it is, but hey there you go.
|
Added scriptability for the SoF+ respawn window by way of an EVENT_RESPAWN_WINDOW. This allows respawn options to be customized: options can be added or removed based on the Client's level, the current zone, qglobals; options to respawn in guild hall, server hub zone, options to return to a questgiver if you were in the middle of a quest event, etc.
Full description and some example usage can be found at https://github.com/Zaela/LuaEQEmu/wi...respawn_window Someone may want to make a Perl version of this if nothing else. I think it's a pretty neat thing. Also, there is a bug with the respawn window and aggro; when the Client is hovering for respawn, they will continually aggro whatever killed them (aggro, lose aggro because the client is not a valid attack target, then aggro again, rinse and repeat) and mess up the Client's x-targets. This can spam trigger EVENT_AGGRO and possibly EVENT_COMBAT. To fix, replace this in aggro.cpp: Code:
bool Mob::CheckWillAggro(Mob *mob) { Code:
bool Mob::CheckWillAggro(Mob *mob) { |
Quote:
|
Awesome, great to hear that Lua is of interest in the community and among the devs. Out of all the languages I know, I use lua for my personal projects 90% of the time and for work whenever I can get away with it.
However, I would highly recommend using LuaJIT over basic Lua. As noted in the pros/cons list, Lua GC does have some iffy scenarios that LuaJIT fixes. LuaJIT also makes the c/c++ binding far easier once you grasp the ffi library. It's also very hard for other scripting languages to beat it's performance. |
All times are GMT -4. The time now is 07:41 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.