Jump to content

Design: Interaction between MaNGOS core, database and scripting


Schmoozerd

Recommended Posts

Hi all

this thread is about interaction between the different projects, to solve a few "open" problems, and perhaps improve already doable stuff.

Basicly it is about getting a "good" way of doing things (because all things can be done "somehow")

First, a few examples, where interaction would be cool:

1) Emissary of Hate: http://www.wowhead.com/npc=25003#comments

This mob should spawn, after 6 of the mobs around are killed (_continent_ map)

- store & count information of killed mobs around

- check on each kill if 6 is exceeded, if it is, spawn emissary

- reset counter on corpse-despawn

Problem:

- Where to store counter, and check if should be summoned?

2) Stitches Event: http://www.wowhead.com/npc=412

Mob should be summoned on Quest-Complete, with a few additions: (_continent_ map)

- do not summon a new stitches, while there is already one summoned alive

- let a mob (town crier) shout on summoning/ death of stitches

Problem:

- Where to store counter, and check if should be summoned?

- How to "check" the map-status in the DB-script (checking always means to "agree" on some sort of IDs - and as these would be custom that is a problem)

3) Dire Maul - Pusilin Chase http://www.wowhead.com/npc=14354

This NPC should have gossip options, to start a "chase"

- There are three parts of the chase, each one has to be activated by gossip-interaction, so the problem is, to only display the item, that corresponds the next part.

Problem:

- Possible to only move a part of a way, and then pause?

- Interaction between progress in chase and gossip. (If done by Creature-Variable, then how to check it in gossip/ set it in DB-scripts, if done by Instance-script, how to check, how to set?)

4) ICC: Forge of Souls - Intro Dialogue

This Dialogue should only be started once per Instance, so it needs some kind of storage of already started dialogue

Problem:

- Where to store?

- How to check/ set?

A few ideas and their problems:

i) Add SD2-"instance-like" support for continent maps

Would clearly help a lot in scripting 1) or 2)

- 1) could be directly handled with this

- 2) would need additional interaction between the map-script and the DB-scripts

- - This interaction opens (again) the problem of agreeing on custom IDs :(

ii) Add (custom) world-states in Mangos, which can be used (TODO) by conditions, DB-scripts and SD2

Does solve quite a lot of problems, but would need to somewhere agree on a bunch of custom world-state IDs (which ofc wouldn't be sent to client)

- 2) supporting the town-crier on death of Stitches wouldn't be supported.

iii) Add an event-based framework, with maps, creatures can "hook" into the event-IDs, events could be thrown on various occasions.

This would be extremely powerfull to handle any dynamic aspects in the game, but has the problems, that we would have to agree on _many_ custom event-ids

Another problem is, that "checking" events is a bit difficult, as they usally are dynamic, and don't provide static information, but this should be doable.

Infact such an event-based framework (especially with scripted maps) would most likely solve nearly any problems of current (335) game design.

But, we would need to "somewhere" agree (define) an quite many different event-IDs!

A few remarks:

- there is no reason at all, that i) is not already supported! - this might infact be quite helpfull to add support for battlegrounds or outdoor pvp

- ii) is perhaps the easiest way to interact between the different aspects of a server, and also rather easy to implement

- iii) With some sort of clever storing passed events, it would be possible to move most work from SD2 instance-scripts to DB-event-scripts, example opening doors on aggro would only mean adding an action for the On-Aggro-Event ID of the boss to close a corresponding door

Conclusion:

I think we need someway to store data, that possibly interacts with different parts, and can easily be checked and set.

The main problem is in all solutions I can think of, that we would need to agree "somewhere" some IDs that are used for these purposes

Any Ideas are welcome, I hope put the problems I see in a clear way

Link to comment
Share on other sites

  • 4 weeks later...

Well

4) ICC: Forge of Souls - Intro Dialogue

This Dialogue should only be started once per Instance, so it needs some kind of storage of already started dialogue

Problem:

- Where to store?

- How to check/ set?

- Instance Data boolean value ?

1) Emissary of Hate: http://www.wowhead.com/npc=25003#comments

This mob should spawn, after 6 of the mobs around are killed (_continent_ map)

- store & count information of killed mobs around

- check on each kill if 6 is exceeded, if it is, spawn emissary

- reset counter on corpse-despawn

Problem:

- Where to store counter, and check if should be summoned?

- Blizz uses invisible triggers for such

then for mobs add OnDied -> Set trigger variable -> if variable = 6 -> spawn mob

everything but second (I dont actually understand second fully), is doable big problems

Link to comment
Share on other sites

In fact if Ambal map's patch will completed will not many diffs in continent/instance maps.

No any reasons not allow any map have instance data. Ofc, for continent main problem that state common for all players.

And ofc expected size of this data.

continents can always be broke down into subzones (each map - zone) to reduce the "size of this data"

bout the second one, you can spawn an "Event controller" with eventAI script to make both NPCs spawn, always check for possible existance of this "controller"

kill controller when stitches dies... most quest events and stuff is handled by triggers as well... its all about knowing where to do what (if EventAI cant handle this, then the event controller should have its own, independant script

Link to comment
Share on other sites

IMHO - we need messaging subsystem in Mangos Core (aka based on current Callback mechanism implemented in event system) in any way - this will solve open problems with thread-unsafe method calls like:

1) Far teleports

2) Player/object removal from map

3) Apply damage/calculate rewards for mobs affected by spell on different map etc

Also, "signal-slot" idiom implemented by different GridVisitors might help with some spell scripting :rolleyes:

Link to comment
Share on other sites

continents can always be broke down into subzones (each map - zone) to reduce the "size of this data"

What different 10K one data block form 10 of 1K data blocks? I not see any imporovment. All zones data unique and exist possible cross-zone used data.

my idea was just to reduce the amount of code per zone to make it more "readable", indeed it wouldnt have that much of an impact considering it would be (in size) almost the same

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use