Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Graf Zahl

UDMF common namespace, first draft

Recommended Posts

Let's do this here, the other thread has already become a bit unwieldy.

Here's the first draft for a common namespace, I went through ZDoom's and removed everything that was marked 'not supported' by EE.

Once I've gotten some feedback I'll create a repo at Github for it and will give all EE devs commit access so that you can add new features as they become available.

http://pastebin.com/DQay4iiy

The ACS section needs some input. While I was able to check the function list, I couldn't get much else out the ACS VM's code, so you'll have to fill in the missing pieces.

Share this post


Link to post

Neat-o. I should also take some time to write the UDMF Eternity text file, if not for anything else but for visibility, so that users trust that it exists in the current form.

EDIT: there's no WRAPMIDTEX in Eternity yet. Only CLIPMIDTEX.

Share this post


Link to post

Thanks for getting this spec done so quickly, it's really appreciated.

Graf Zahl said:

While I was able to check the function list, I couldn't get much else out the ACS VM's code, so you'll have to fill in the missing pieces.


What pieces to do need to be filled in for the purposes of this spec? I feel I'm missing part of the big-picture here.

Share this post


Link to post

The spec needs to document which ACS features are supported and which are not. I couldn't do that because I was unable to find out which PCodes map to some other operation than a function. All I could do was to list the functions that get handled but some codes are for more complex things where several codes work in conjunction. To check these parts I need a few pointers where to look.

Share this post


Link to post
Graf Zahl said:

The spec needs to document which ACS features are supported and which are not.

Problem is that those common "features" (do you mean functions?) may keep growing, on both sides.

Share this post


Link to post

Surely. But for now we need a baseline so that modders can work with it. You don't want as much as me that mappers use stuff that doesn't work because they don't know, do you?

I think best would be two lists: One with supported features and one with planned features so they can be ticked off when done and integrated into the spec.

Like I said, my main issue is simply that from the implementation I haven't found out yet which PCodes work and which don't. For functions it's easy but for 'internal features' I need something to check.

Share this post


Link to post

All of the PCodes with a translation work. All of the not-commented translations and all of the ranges noted as "ACSVM internal codes" here are translated.

As for ACS functions which result in multiple instructions: Eternity does not implement CreateTranslation or HudMessage, but should have all of the other printing functions (Print, Log, StrParam, etc.). It does not implement the k: print specifier and the l: specifier just prints the input string. All other print specifiers should be implemented.

And since you were asking earlier where the translation actually happens, that would be in Tracer.cpp.

Share this post


Link to post

Doing a translator on the code allows for the interpreter to be structured to be more maintainable. The core interpreter loop itself can contain only the generic computational instructions, making it smaller. Which aside from making it a less daunting function, also potentially helps with cache coherence (not sure, though, as it does still have to call out for array accesses, so it may be a wash in that respect). Doing callfuncs as function pointers is half because ACSVM is a separately developed library and half because being able to distribute those function definitions across multiple files is a useful organizational tool. (Eternity's acs_func.cpp needs to be so split at some point. I really hate massive source files.)

It also allows for some performance improvements in the interpreter. The check for the compressed bytecode is handled entirely in the loader, rather than during execution. There are no gaps in the internal code indexes for a switch to have to work around (or a jump table and computed goto can be used). I also use the opportunity to turn jump table instructions into small hash maps. And the guards for executing past the end of bytecode are handled by simply inserting additional instructions into the output.

There are also some code analysis opportunities, though I do very little with that at present. I have at least considered the possibility of autodetecting if additional global/world/map variables are needed, since the translator is able to see what indexes for those are used.

Share this post


Link to post

Been almost a week since last post. Has anything been going on? Is there any more planning to do?

Share this post


Link to post

From my side, no. I was actually waiting for one of you commenting on the listed features and say if I missed something or not.

Share this post


Link to post

I've been putting higher priority on fixing bugs in Eternity (and experimenting with some "cool stuff" such as the overlay automap, which I didn't yet push to master) and I still have a lot of challenging bugs to fix. I've just added a Github issue for this (link), but I'll address it after I fix all known remaining bugs.

Share this post


Link to post

As printz said, we have no wrapmidtex (but it is something I've personally wanted to see in, so hopefully we can add it later). We have no decal support (and by extension, no nodecals). We have no floor_reflect or ceiling_reflect.

Specials look fine, it's worth nothing that anything here is run at map start, and cannot be called by ACS, except for those defined here.

Share this post


Link to post
Altazimuth said:

As printz said, we have no wrapmidtex (but it is something I've personally wanted to see in, so hopefully we can add it later). We have no decal support (and by extension, no nodecals). We have no floor_reflect or ceiling_reflect.



I intentionally left a few things in that can safely be ignored if the feature it is associated with does not exist.

Nodecals is such a thing, it does no harm in an engine that does not support decals (as there are no to begin with) but is of use if the map is being played with them on.

The reflect fields can possibly be removed.

Share this post


Link to post

Concerning the health key, this was incorrectly implemented in ZDoom and didn't match the spec. Of course it cannot be changed now because it may break actual maps out there so I split up the key in two to repair the damage:

   thing
   {
	  health = <int>;			// Set per-actor health as an absolute value. Default = actor default.
	  healthfactor = <float>;	// Set per-actor health as a factor to the original. Default = 1.
   }

Share this post


Link to post

Wait what? What happened? Did you just change the specification (documentation) to match GZDoom, or did you also change the GZDoom internal behaviour?

What is the formula if you have both fields? Does HealthFactor multiply the overriding Health value? Or does Health fully replace monster's health, no matter if you apply HealthFactor or not?

EDIT: I just looked in your git commits, so I see the answers. But looks like I need to make another late change to the EE behaviour... Sorry WIP authors.

Also GZDoom Builder Bug-Fix UI needs to be updated with these new fields.

Share this post


Link to post

I matched the spec to what was actually implemented.

The relevant commit describing the 'health' property was made by Gez and missed the existing implementation by a wide margin (which in other words means, it was utter horseshit) and I only noticed yesterday when I was looking at a feature suggestion about this matter.

So what can I do? I can't change the implementation, it has been out for 3 years by now and actually been used in real maps. So the only option is to match the spec to what is actually in the code and then use another property to what the spec said.

Share this post


Link to post

That's why I posted it here. But in the end both are trivial to implement, but that's up to the Eternity devs to decide.

Share this post


Link to post

Yeah, guess I'll fix that.

Still, I feel this is a moving thing. Unless I take a break from Eternity, the boundary is blurry.

Graf Zahl said:

The relevant commit describing the 'health' property was made by Gez and missed the existing implementation by a wide margin (which in other words means, it was utter horseshit) and I only noticed yesterday when I was looking at a feature suggestion about this matter.


Then what's up with this part of the code (GZDoom p_mobj.cpp bottom of P_SpawnMapThing)? Apologies if I didn't get to run ZDoom first, but it looks a bit suspicious.

	if (mthing->health > 0)
		mobj->health *= mthing->health;
	else
		mobj->health = -mthing->health;
	if (mthing->health == 0)
		mobj->CallDie(NULL, NULL);
	else if (mthing->health != 1)
		mobj->StartHealth = mobj->health;
Apparently if the mapthing health (as set in UDMF) is greater than 0, the thing health is multiplied by that amount. And the negation trick (previously described in the UDMF spec) still applies. It seems pretty much compliant to the UDMF spec before your recent change.

Share this post


Link to post

Damnit, I thought I looked everywhere. Thanks for finding. I should have gone to bed earlier instead of working late...
Of course that stuff will get reverted ASAP and the property just turned into a float.

Share this post


Link to post

How goes progress on this? Having a common modern mapping format I think is really important and I would hate to see the idea die.

Share this post


Link to post

Don't worry, it won't die. Of course it depends on our time we spend to develop it. As soon as I'm free of the current Eternity bugs/issues, I'll slowly work towards this.

 

A main prerequisite: document UDMF in a definitive file for EE. Right now I've been too lazy to even write it on the wiki, but I will go through it...

Share this post


Link to post

I've been unable to pay much attention to this as I've been busy with university work. As I catch up I should be able to dedicate some time to Eternity.

Share this post


Link to post

OK, it's the summer (almost), the latest Eternity release has happened, should have some time to focus on this now. What do we need to do before going forward?

Share this post


Link to post

I'll need to take a closer look later, but this looks like it covers almost everything I XLAT/ExtraData-hacked together for Hacx 2.0. Take that with a grain of salt until I comb through the wad and confirm, though.

 

The one thing offhand I know is missing is slopes, but that's an unusual case considering that EE slopes are physics-less, so reconciling that may go a bit beyond this proposal.

Share this post


Link to post
On jeudi 18 mai 2017 at 0:41 PM, Altazimuth said:

What do we need to do before going forward?

First order of business: establish order of business.

Share this post


Link to post

Well derp, slopes are indeed there in the proposal. My brain-tired Ctrl+F spree earlier failed to remember that the special is named "Plane_Align". :P

 

tl;dr: this covers all of Hacx 2.0's use cases, FWIW -- and, of course, opens the door for a ton more. Flat alignment by itself is a gorram godsend.

Share this post


Link to post

@XaserYou think with there being a commonspace for UDMF now you might see if other source ports that'll adopt it could be supported? Only one I know of offhand is 3DGE.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×