Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 09-20-2010, 08:48 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Haha, to be honest, I didn't do any of the work on Destructible items yet. I just asked Derision about the work he had done, as I was planning to see if I could help to get them working. I don't think there is too much left to do after seeing the work Derision has done. We just need to add in a few new DB fields and make some stuff to handle them properly.

I don't know much about destructible objects, but here are some points on what I have learned so far from messing with them:

1. Destructible objects have 5 states of appearances which can be seen by doing #appearance 44 0 to 4. Appearance 0 is the non-damaged version, and 4 is fully destroyed. Do not use appearance 5 or higher, as that will crash the client!

2. The new opcode named OP_DestructibleRelated changes the object from being targetable to being untargetable. This can be made into a Perl command, but we will also need some way for new players who zone in to see the object as untargetable as well. I think we will need to play with the struct a bit to see how to set the spawn to be untargetable from the start so we can set that field for new players zoning in after the object has been set this way. One cool thing about this new opcode is that it also works on normal NPCs. If it is used on a normal NPC, it removes them from your target and makes them untargetable. It is almost like they are toggled to bodytype 11 in real-time. If there is a way to change them back to being targetable again, I think this opcode could have some other potentially nice uses (maybe anti-hack stuff and possibly other uses).

3. The destruction animations can be done in any order, and also can be done in reverse.

4. These objects all have collision, which I think makes them more useful than some other types of zone objects.

5. Since the objects are essentially NPCs, they can be moved with a #summon. This is pretty cool. It makes me wonder what would happen if you set one on a pathing grid lol!

6. Each destructable object has 4 variable length string fields. I assume we can use the name and lastname field of normal NPCs for 2 of those strings, but we will probably need at least 1 or 2 new fields to be able to handle these properly. There are still at least a few fields we don't undertand yet, so there will probably need to be some other fields as well. I noticed a couple of fields that were set to 100, and I assume one of them may be object size.

At this point, I think the plan is to add destructible objects to the npc_types table. This makes sense, because they are essentially NPCs and even use the same opcode as NPCs do for spawning them. It is also the easiest way to manage them, since they need to be loaded like an NPC anyway.

Here are some notes on what I think we still need:

1. We need a way to set the damage states automatically based on HP percentages like maybe having them changes appearances every 25% (100% = 0, 75% = 1, 50% = 2, 25% = 3, 0% = 4). I believe that the appearance fields I added to NPCs a while back should be able to work for destructible objects as well, but will need to review that later to be sure. This should allow them to show the correct appearance state when new players zone in.

2. We need a way to set them non-targetable for new players zoning in after the OP_DestructibleRelated opcode is sent.

3. Optional would be to add a perl command to send the new OP_DestructibleRelated opcode (I can add this in like 2 seconds).

4. It may not be required, but we should try to identify some more of the unknown fields if possible.

I don't have a ton of time to work on this atm, but if no one else commits some stuff for destructible objects like what was submitted here, I will try to get to it when I have more time. I really appreciate Derision sharing the work he has done on them to this point. With his work, I think destructible objects should be functional and on the SVN pretty soon one way or another

EDIT: Wanted to note that the patch Secrets posted will probably break any existing corpses. So, for any servers that leave corpses with items on them, be warned that patching this will basically poof any existing corpses on your server (or make them inaccessible anyway).
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 09-20-2010 at 12:00 PM..
Reply With Quote
  #2  
Old 09-27-2010, 08:27 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Seems like adding the code to replace existing objects in a zone with a destructible object should be easy enough to get going as it doesn't matter much what is set, it just takes over the object initially and everything looks ok. The only thing keeping this from being submitted is figuring out what is required to get new destructible objects that don't already exist to be able to spawn properly. So far, I haven't had too much luck in figuring those out completely. I was able to confirm that DestructableUnk1 is the setting for how damaged the object is. Unfortunately, for the example I was using (from oceangreenvillage), I wasn't able to get it to show up at all unless it was set to a value of 1 or higher (up to 4). That is one of the issues left to figure out.

The next issue is to figure out why they appear to be spawning about 5 units lower than they should, which puts them partially underground. I don't have any reference to how they should look on Live, but I am pretty sure they shouldn't be partially underground like that.

The final issue is to figure out why the collector may be collecting a size that is not the same size they should appear in-game. It is hard to be sure if this is really an issue or not though. I am using tents in mesa to compare as I spawned them to not replace the existing tents and they were all set to size 6 as they were collected, but the tents they are supposed to replace are actually size 5. This may just be due to SOE being lazy and using a generic setting since the size issue does not happen when they are actually replacing the existing objects as it takes on that object's attributes.

One other thing that I was able to confirm is that the last 2 fields are actually in the wrong order. It is an int8 then an int32, not int32 then int8. They are generally set like 0x01 and 0x00000002.

Either way, I am holding off on working on these more for a while. If anyone else wants to, feel free. My main concern with adding these is that we get all of the required fields added to the npc_types table so collects for them only need to be done once in order to have all of the info we will need for any destructible object. I know we will definitely need a new string field for the 3rd destructible string. I think we will need at least 1 or 2 other fields for the DestructableUnk1 and maybe the one noted as "// eye height?" in the normal part of the struct.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 09-27-2010, 11:17 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

Couldn't you just offset them 5 units above where they should be and figure it out later? =p
Reply With Quote
  #4  
Old 09-22-2011, 11:42 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Late response, but no, it doesn't work that way. It works more like an NPC where the client will try to put them at the level it thinks they should be unless they have flymode on.

Anyway, I started work on this again and committed the work in this thread. It is mostly the stuff that Derision had done already, but with a few modifications. It definitely needs more work, but it is a start. I figured I would bump this thread and will start posting more details of what needs to be worked out still as well as looking for feedback. Since I never played Live when destructible objects existed, I don't know any more about them than what I have read.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #5  
Old 09-23-2011, 06:41 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

It has been so long since I messed with these destructible objects that I am having to redo a lot of the testing I originally did to figure everything out. There are still quite a few things that need to be worked on before the system can be considered fully functional. Until everything is worked out, I would recommend not investing too much time into setting up destructible objects, as there is likely to be changes to a field or 2.

Here is my current list of what needs to be done (many things are the same from my last list in this same thread):

1. Destructible Objects still need to be added to SoF and UF clients.

2. The OP_Untargetable opcode needs to be found for SoF and UF clients and added to the appropriate files.

3. The damaged level appearance needs to be set for new clients that enter the zone. I think we can just use _appearance to hold the damage level appearance. We probably set it by doing something like this:
Code:
ns->spawn.DestructibleAppearance = static_cast<EmuAppearance>(_appearance);
It would also need to be changed every time the appearance is changed while the object is damaged.

4. We need to set the damage states automatically based on HP percentages. Maybe having them changes appearances every 25% (100% = 0, 75% = 1, 50% = 2, 25% = 3, 0% = 4). We can probably handle this in the SetHP() or SendHPUpdate() functions easy enough. - DONE

5. Replacing an existing object with a destructible object currently isn't working with how I have it implemented so far. I forget offhand what actually sets that, but I think it is the 3rd string (ie. "ZoneActor_01186"). If so, then we will need 1 more string field added to the npc_types table, which I was trying to avoid.

6. If new field (or more) is needed to be added to the npc_types table, it would be good to find a better way of adding fields so it doesn't break player corpses every time due to adding more fields to mob.

7. The new OP_Untargetable opcode needs code to support it. It will be easy enough to add a function that can send it. It will also be easy to add a Perl function for sending it. This packet is cool, because it works on normal NPCs as well. If we can figure out how to make it return the NPC to targetable again, it could be very useful. We could then send it anytime bodytype is changed to type 11 or any other untargetable type, and send it again when they change to a targetable type again so targetable could be toggled on an NPC without repopping it, which is currently not possible. - PARTIALLY DONE

8. Since the bodytype is not sent for destructible objects, we would need some way for new clients zoning in to also see the object as untargetable after OP_Untargetable has been sent. We could just check when the entity list is sent if the NPC is a destructible object and then if it is set to untargetable, and send that packet if so. - DONE

Extra Notes:

Even once destructible objects are fully functional, we will still need the packet collector tool to be updated to parse the information into the right fields. This shouldn't be worked on until it is more final, though (mainly a note for Derision if he sees this).

Currently, I have the luclinface field in npc_types set to handle the damage level of the object when it spawns. Ideally, we would have a new field for this, but again, I was trying to avoid having to add any new fields.

Good zones to test and work on or play with destructible objects are devastation or mesa, but there are definitely others too.

I definitely plan to do more work on this, but if anyone else wants to help out, please feel free, as there is a lot left to do
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 09-23-2011 at 02:27 PM..
Reply With Quote
  #6  
Old 09-23-2011, 02:14 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

Trev, if you have to use hacks to avoid new fields. Add the new fields.
Reply With Quote
  #7  
Old 11-22-2011, 10:33 AM
provocating's Avatar
provocating
Demi-God
 
Join Date: Nov 2007
Posts: 2,175
Default

Since I have not played live in 8+ years, what are destructible object in the game ?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:13 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3