PDA

View Full Version : New NPC models


sirreality
05-17-2005, 02:36 AM
Is it possible to introduce new [npc] models to the world? Not animated models, but static models that have a race assigned. For example, trees are race 143, row-boats are race 141, etc...

I'm kind of a newb at this stuff, but here's what i found out so far:

I was messing around with ships and found that the only one that behaves like a normal NPC model is the original boat, which can be force-loaded using pre,oot_chr in a *_chr.txt file. However, this boat does not have any collision detection. I thought perhaps collisions were handled by the model itself, so i loaded up my original EQ CD and replaced the oot s3d files with the ones from the original CD. When i loaded the boat, Stormbreaker, it was taking on the old model and the old textures, but still has no collisions, so unless i missed something, that isn't going to work.

I cannot seem to find the right ***,***** combination(s) for any of the other boats to force-load them in zones where they do not already exist. From S3dSpy and ZoneConverter, it looks like those models are SHIP, which doesn't obey the 3-character standard for the force-loading method and will crash some zones when used in a _chr.txt file. For instance, ship,timorous_chr will crash the client when used in east commons, but doesn't seem to crash butcherblock.

So, since i cannot seem to get boats to work, which are race 72, i thought i would try the launches (small boats and rafts), race 73. However, these all appear to be static models and i cannot find any kind of ***,******* combination for them to force-load.

If anyone has some insight on this subject, i would really appreciate it. I have been beating on this for a while and not making any progress, so i thought i would appeal to the experts.

Thanks in advance for your help :)
-sirreality

KhaN
05-17-2005, 04:41 AM
Is it possible to introduce new [npc] models to the world? Not animated models, but static models that have a race assigned. For example, trees are race 143, row-boats are race 141, etc...
Only if you replace old NPC by new models, and, im not really sure it would work because WLD structure of NPC and static models (like trees) is REALLY different.

this boat does not have any collision detection
i dont know how it work now, but when i was playing EQ, you couldnt have a collison between a NPC & a PC.

Personally, im able to forceload all npc but boats and PoP gods (and i tried a lot to forceload them).

Cisyouc
05-17-2005, 05:55 AM
Actually to my knowledge, ships DO have collision detection (KhaN: They have to, otherwise, you'd fall though boats) however, it must be #spawn'd as that race. #race will treat it like a normal npc with that particular model.

Windcatcher
05-17-2005, 06:07 AM
Let me see if I can help.

To the best of my knowledge, the three-character race designation for the ships is "PRE" (race 72). Hell if I know why they chose that prefix, but I think that's what you're looking for.

Models don't have any collision-checking information, though some have bounding boxes as well as bounding sphere information. This is something that's common to all models, though. It's part of the 0x36 fragment specification.

Clients (not just EQ or MMORPG clients, but in general) handle collision avoidance with the world and everything in it. They way it's done is to define an ellipsoid around every player and mob, and check the ellipsoid against any objects that are in its BSP node or any nodes it intersects. This would include other mobs such as ships, but there's a catch: for most mob models (actual monsters), it's very expensive to check the player's ellipsoid against every polygon in the model, so it's better to check against something more simple, like a box around the mob model instead. Ships, since they are also mob models, would be an exception to this, and I wouldn't be surprised if there was a flag in the data somewhere that instructed the client to perform proper collision avoidance against it (on the other hand, though, from what I've learned about WLD files, I also wouldn't be surprised if the client simply had a hardcoded flag for any model wth race "PRE" -- the WLD format isn't all that great).

If you wanted to replace a non-animated model (like a ship), I'm not sure how you would do it with the live client. I suppose you could add the necessary fragments to a zone's <zone>_chr.s3d file and force-load it. It wouldn't be a trivial exercise, though. I've been wanting to add support to OZ to allow adding mob models to zones you create, but the problem has been a lack of source material. Adding non-animated models would probably be pretty easy. If we wanted to do animated models we would need to have a thorough discussion on available source material, especially formats, since WLD animated models require certain characteristics. Khan and I have been looking closely at the Quake 3 format but they don't have everything that WLD models require.

sirreality
05-18-2005, 03:45 AM
Great info, thanks for the prompt replies. I have one workaround that is probably well-known and i would like to discuss the idea of static models in custom zones.

First, I figured out that all zones seem to accept up to two <zonename>_chr.s3d files. So, you can take, for instance, timorous_chr.s3d, rename the .wld file inside to ecommons_chr2.wld, then rename timorous_chr.s3d to ecommons_chr2.s3d. Now you should find that all the models from the timorous file are available in east commons, including both kunark boats and launches. There may be unintended side-effects to this, but it does allow you to add models that can't seem to be force-loaded.

Second, you mentioned that adding static mob models to OZ for custom zones might not be too difficult, but animated ones are. I have read some threads where some work was being done on the skeletons and so on (this is over my head right now, so i won't pretend to comment). I would really like to see this capability added and would offer any assistance that i can in this effort.

Another nice idea, just thinking out loud here, would be to extract various models from existing zone files to make custom files that contained any mix of models desired. However, i suppose this could allow you to replace existing zone models and could lead to cheating, which i read about in a previous thread, Windcatcher, and i do not want to advocate that at all.

Again, thanks for the information!

Windcatcher
05-18-2005, 06:39 AM
I did some thinking, and even ship models are animated (billowing sails). Rowboat models, though, (like the ones in Lake Rathe) aren't animated and would be easier to add.

If I had source material that met the requirements of WLD animated models, I could probably find a way to add the ability to use them (that is, convert to WLD on exporting a zone) pretty easily. WLD animated models have the following characteristics:

- bounding box
- bounding sphere
- hierarchical bone structure (skeleton) where each bone has one and only one parent bone (except the root bone, of course)
- each and every polygon is assigned to one and one and only bone (e.g if the left forearm bone was bone 7, then all of the polygons for that part of the body would have a 7 assigned to them)
- only one root bone for the skeleton
- each bone supports orientation and length
- models can be split into heads and bodies, with alternates for each

I can calculate the bounding box and sphere, but it's always better to get those from a source model. KhaN and I were looking at the Quake III file format as a possible source, but there are issues with alternate meshes: Quake III models are split into upper- and lower-torso parts, where EQ models are split into "head" and "rest of body" (though this splitting isn't required -- you can have a single mesh for an entire monster, for instance).

Animations are another issue, but they can be handled separately for the most part. EQ has a core set of animations that apply to all models of a certain type and then has a few animations that are specific to certain models to handle special cases. For instance, simple actions like walking, running, emotes, and most attacks are the same for many models. Some example model classes are:

- bipedal, normal limb length-to-girth ratio (elf, human, erudian, etc.)
- bipedal, alternate limb length-to-girth ratio (dwarf, ogre, troll, etc.)
- feline
- canine
- ursine (in other words, bears or anything similar)
- snakes
- arthropod (spiders, beetles, etc.)
- reptile (alligator, basilisk)
- birds
- dragons

In this sense, once an animation is created for a model class, it can be copied to all models of that class, and that is exactly what EQ does (according to KhaN, this is a common practice). A good example of a special-case animation would be swinging a 2-handed weapon: different models have different arm lengths, and so the animation parameters will have to be tailored to each model to keep the hands in the correct position. In general this is an issue where two limbs (specifically, bones that don't have a direct parent-to-child relationship) have to be synchronized.

If we can acquire some free models that meet these requirements, I think we can get to the point where we are exporting our own models in OpenZone in relatively short order. It's a lot of work making a model (mesh, animations, textures) and is something I'm not capable of doing, but I understand enough of how WLD handles animated models that I'm pretty sure I can have OZ do the conversion given the right source material. Since the client wouldn't copy its existing animations to ours we would have to create the full set of animations, but would only have to do so once -- we could then apply them to any models we make that are of the same class (similar geometry).

One thing I should point out is that there is an alternate animated model type that WLD supports that isn't used for mobs. If you've ever seen the hanging flags in old-world zones that slightly billow in the wind, you've seen this type. Those models are stored as a series of frames -- for example, there might be ten animated frames, and for each frame a complete mesh is stored in the WLD file (with a fragment that tells the client where the frames are and how many there are). It's a horribly inefficient way to store an animated model, which is why it isn't used for mob models, but if we want to create such things as animated flags it's another possibility.

I should also mention that I've created an elf male model in Anim8or and several animation sequences for it (standing 1, standing 2, looking around, walking 1, walking 2, taking damage). The model isn't stellar (and it's not textured or uv-mapped), but the animations are valid for that skeleton (and it should be possible to put that skeleton on any similar model). I also have a partial Anim8or file parser written, so if people want to make models and animations in Anim8or it shouldn't be hard for me to convert them to WLD. Unfortunately Anim8or doesn't support inverse kinematics or telescoping bones so getting the animations right can be difficult, but it's free and pretty easy to learn.

GeorgeS
05-19-2005, 08:55 AM
WC - I'm very experienced in 3D model creation, and can create anything static for eqemu. If you would like, I can give some custom ones (using my textures) I sure would love to help out


Animated modeling (I use truespace 6.6) and am very good using that tool. I can texture pretty well and even make monsters. I even made a very eq similar froglok last month! If you can animate them, I can make some and submit them.

Just let me know. I will upload some examples for everyone to check out


George

Innerfire963
05-19-2005, 09:13 AM
I wanna see!

Windcatcher
05-19-2005, 11:26 AM
Any help is appreciated. I'm a coder, not a modeler, but with some examples I can see what I can do, or at least determine what the issues are. I have enough of the WLD format licked that I think it will be more of an issue of parsing the source material than storing it as WLD. Ultimately, though, it comes down to how well the source material matches what WLD files require. I definitely think converting animated models to WLD is doable, as long as we have good source material.

GeorgeS
05-19-2005, 12:01 PM
ok then, what I will do is begin by creating eq static models (I am excellent in low poly models).

Now just a few questions -

What format would these need to be in (3DS, X, etc..) and is mesh hierarchy fine or export as single mesh?

Triangulated or not?


Next, if my models are acceptable, then I can start making static monster mesh's (I usually keep those to under 3000 tris). These would take a bit longer to make ~1 textured mob per week and 1 untextured per day.

I also find eq mob textures come in many separate textures in files. So in essence, 1 mob would have about 12 textures. The advantage of this is to re-use textures for similar themed mobs. I texture this way as well.

I will give it a go. Let you know of the progess as it happens...always glad to help!

Later
George

some links to my low poly work
ultimaIV rewrite
http://www.wizardportal.com/optimaiv/

tutorials for low poly http://www.wizardportal.com/optimaiv/orion2/tutorials.html

main page for 3D objects - see left panel
http://www.wizardportal.com/optimaiv/orion2/orion.html

some guns
http://www.wizardportal.com/optimaiv/orion2/guns1.html

Windcatcher
05-19-2005, 01:40 PM
Bleh. I should have mentioned that about the texturing. There should be a separate texture for each body part (that is, skeleton bone), but only one mesh for the entire model (or at most, one mesh for the head and one mesh for the rest of the body). Separate meshes isn't important unless you want to have alternates -- for example, *all* player models all have four alternate heads: bare, wearing leather, wearing chain, and wearing plate. A few also have alternate body meshes, such as armored or robed high elves. By contrast, monster models have alternate mesh heads for different types (e.g. cyclops or hill giant) but always only one body mesh.

A textured model per week is fantastic. I wouldn't even be able to keep up. I already have a .3DS file parser, but as far as I know it doesn't support bones. Maybe the thing to do is export the same model in a bunch of different formats and I can see what I can read. I have a parser for Quake III and I might have one for half-life (not sure, though). I can always scour the net for readers for different formats and convert to Delphi if I have to.

Another thng I forgot: there are some "special" bones in WLD models that don't have any polys. These are for item attachments such as weapons and shields. There should be one for each hand and a shield bone on the left arm. There should also be one for the helmet and one for what they call the guild (sits above the head). Old-world player models have helmets in the head mesh and have non-zero alpha values assigned to the helmet polys so the client can assign tints to them, so the helmet bone is unused for them, but it's used for helmet items that have their own meshes. We can tweak the lengths and orientations of these bones at a later time, but they should exist. Basically the held object bones point along the direction of a prospective held weapon, the shield bone points out through the shield, and the helmet and guild bones point straight up.

Edit: actually I think there are two bones per hand: one for a weapon and one that points to the side somehow for held books and such. I'm not 100% sure about this, but it should be easy do deal with these polygon-less bones anyway since they shouldn't ever move with any animations.

KhaN
05-19-2005, 04:35 PM
Back from holidays, so.

If we can acquire some free models that meet these requirements
Post a schema of those requirement, ala davinci draw with named bones, bounding box, entities ....

Also, as OZ already import Ogre Meshes, it would be maybe easier to export NPC as ogre format, i already have bunnies, horses and such ready and animated, but nothing humanoid ready yet, and also, i think my bone format wont match what you need (i mainly bone ala Muybridge's way).

Thanks :)