Integrated Static Tool

Archive of the older Feature Request Forum Posts

Moderator: POL Developer

Yukiko
Distro Developer
Posts: 2728
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Post by Yukiko » Fri Sep 01, 2006 12:35 pm

I do admit that the one thing that I like about RunUO, and it's the only thing, is that you don't need to run a conversion on the files. Atleast you didn't the last time I used it anyway.

For the record I use Punts Worldmaker Map Editor for editing statics but like you said Lagoon ya still have to UOConvert it afterwards.

Nightson
Neophyte Poster
Posts: 33
Joined: Mon Apr 02, 2007 1:13 pm

Re: Integrated Static Tool

Post by Nightson » Fri Sep 26, 2008 2:18 am

would be sweet to see commands like that

User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Re: Integrated Static Tool

Post by OldnGrey » Fri Sep 26, 2008 5:47 am

The first time I saw the RunUO .admin command and the ability to unfreeze and freeze map statics together with UO Architect to make templates of items and move them around smoothly, I was totally convinced it was the way to decorate and edit the world. I am guessing that those two things - rewriting statics on the fly and the OSI housing system (like dynamic multis) are THE two features that RunUO has that we will always miss in POL. From what I read, a lot of POL shard developers are using RunUO to work on their world. Even if the features were available in POL we would still have to write the utilities to make use of them.

Pandora's box has me intruiged too, so I am even contemplating writing some pol scripts to emulate runuo commands - like incx etc. I know I can edit the xml files to change the commands in a lot of cases, but it interests me that I could distribute some scripts that would allow pandora's box to work unmodified. Of course RunTest could finish his utility first!

Madman
POL Developer
Posts: 62
Joined: Sun Feb 05, 2006 7:20 pm

Re: Integrated Static Tool

Post by Madman » Mon Sep 29, 2008 10:38 pm

I would love to see a way to do map modification in POL, personally.

Someone above said they didn't like the fact that we have to run UOConvert before a map is usable- the goal with that was to divorce ourselves from explicitly using UO's maps and map formats. POL can use pretty much any map format... so long as the format had an associated MapConvert program that turned its data into what POL can read. The problem with this is it has never been taken advantage of, as far as I know. The problem there is that there's insufficient advantage to bothering to take advantage of it. But that's why it's there- so if someone someday wanted to use POL to create a game totally unaffiliated with UO, they would not have to use UO's data formats to make it work.

My apologies for the boring history lesson for those who were aware of all of the above.

Yukiko
Distro Developer
Posts: 2728
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Integrated Static Tool

Post by Yukiko » Mon Sep 29, 2008 11:11 pm

Madman,

Are the POL map data file formats documented anywhere?

Would it be possible to create a module (*.em) with functions that allow manipulation of the POL map datafiles and possibly a conversion function to convert those newly modified data files back into *.mul files for the UO client? This seems like something that might be feasible at least. I was thinking someone could script an InGame editor calling these new functions and when the editing is done call the 'convert' function and have the mul files generated. The only issue I can see with 'real-time' editing is the terrain. Does the client dynamically update an area once it is in its display window? In other words if I was InGame and raised a mountain a few Zs would the client update that on screen? Can POL send map info to the client dynamically and have it "see" it? Since I have only glanced at the packet docs I am ignorant on that issue.

Statics editing would not face this issue ofcourse as static items are handled differently and get "frozen" from dynamically placed art tiles. But it would be nice to have this ability internalized with some EM functions if possible. As long as I am on the subject, the scripts for static editing could easily be made to only freeze items with a custom property that indicated they are to be frozen. In this way existing maps on active shards could be edited right on the working shard without having placed dynamic items frozen as statics.

Pierce
Forum Regular
Posts: 420
Joined: Thu Feb 02, 2006 8:33 am

Re: Integrated Static Tool

Post by Pierce » Tue Sep 30, 2008 5:36 am

I would like to reduce my wish for that feature a little bit, because it was over
2 years ago i had it.
Meanwhile i scripted a lot of tools like a multi.mul builder, a statics mul builder and
a custom map/statics to UOKR facet converter etc. These tools are always a combination
of a pol and a perl script.
There is only one simple thing that Pol is missing and i could rescript the Perl part into
a 100% pure pol script. And that is the lack of a binary reader/writer, cause i use the
perl script mainly for that reason.

These are the perl commands i can't simulate with a pol script cause they use
binary mode not text mode.

Code: Select all

open (idxout ,">$idxfile") or die "cant open $idxfile\n";
open (mulout ,">$mulfile") or die "cant open $mulfile\n";
open (staticin ,"<$staticfile") or die "cant open $staticfile\n";
binmode idxout;
binmode mulout;
print mulout $mul1.$mul2.$mul3.$mul4.$mul5;
print idxout $mul6.$mul7.$NO.$NN.$NN.$NN;
close (idxout);
close (mulout);
close (staticin);
I don't know if the cfgfile.em and datafile.em commands use the StreamReader/Writer object from the .NET framework, but i think so.
If that's the case it could perhaps be simple to add the binary Reader/Writer object.

http://www.genprogrammers.com/forum_posts.asp?TID=306

I think 4 commands/methods would be needed (an example):

var binaryfile := OpenBinaryFile(filename);
Opens the binary file if exists or creates a new one.

CloseBinaryFile(filename);
This one is perhaps not really needed.

binaryfile.ReadBytes(position, number of bytes);
Read the number of bytes from the given position.

binaryfile.WriteBytes(bytes);
Append the bytes to the binary file.

Therefor i always write a completly new e.g. static file from the start i think
the append function would be enough. In this case you don't have any
garbage in your new mul files, like with most mul editors around atm.

I think these 3-4 commands could make life a lot easier, at least for people
like me who don't like to work with several different tools when there could
be one that does all :D

User avatar
OldnGrey
POL Expert
Posts: 657
Joined: Sat Feb 04, 2006 6:26 pm

Re: Integrated Static Tool

Post by OldnGrey » Tue Sep 30, 2008 6:17 am

This thread is leaping about and quite intruiging!
I'd like to pick up on the uoconvert utility and the realms directory.

Two things:
1. there is a file that is always open in each of the realms directories. Makes it tough to copy and work with it when pol is running.
2. you still need to write out maps and statics files in mul format somehow otherwise your players can't get the maps. So we need a uo-unconvert.exe utility I guess.

Luth
Former Developer
Posts: 200
Joined: Mon Jan 30, 2006 8:10 am

Re: Integrated Static Tool

Post by Luth » Tue Sep 30, 2008 12:03 pm

Pierce wrote: There is only one simple thing that Pol is missing and i could rescript the Perl part into a 100% pure pol script. And that is the lack of a binary reader/writer, cause i use the perl script mainly for that reason.
Coincidentally enough, I added a BinaryWriteFile to my working copy of POL098beta this last weekend. It mimics the format format of the normal WriteFile, and its slightly hokey due to the lack of a BYTE and WORD datatypes. However, by packing information into DWORD (Integer), double (Real), and strings, it works perfectly well.

After reading your suggestions, and talking to Madman, it seems that a better step would be to work on editing POL files directly, and writing a re-converter to turn them back into MUL format for redistribution to players.

Hm... no promises, but I'm going to put a little thought into this. Its certainly not impossible. Might take another weekend of work...

Yukiko
Distro Developer
Posts: 2728
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Integrated Static Tool

Post by Yukiko » Tue Sep 30, 2008 11:21 pm

Luth,

I would still advocate for it to be done as functions in a new EM, maybe mul.em that would provide conversion, static freeze and melt (for those who wish to remove statics) and terrain modification functions. This way a tool could be scripted to take advantage of the functions and allow customization by each shard owner to their liking.

Oh and no fair you getting to play with POL 0.98 beta!
*sulks and sticks out tongue at you*

Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: Integrated Static Tool

Post by Turley » Wed Oct 01, 2008 12:40 am

Luth wrote: Coincidentally enough, I added a BinaryWriteFile to my working copy of POL098beta this last weekend. It mimics the format format of the normal WriteFile, and its slightly hokey due to the lack of a BYTE and WORD datatypes. However, by packing information into DWORD (Integer), double (Real), and strings, it works perfectly well.
Why not make the same functionality like packets (.set/getint8/16/32/....)?
Also i see no need to limit it to mul files, maybe someone wants to write/read bmp files :)

Luth
Former Developer
Posts: 200
Joined: Mon Jan 30, 2006 8:10 am

Re: Integrated Static Tool

Post by Luth » Wed Oct 01, 2008 10:28 am

Turley: Because I needed a multi exporter to write MLT files from in-game, and copy/paste functionality was the quickest way possible. :D I've already decided that my additions will not be committed. Its too... unwieldy. No average scripter would be comfortable using it. If I were to commit a Binary Writer, it would be in lines with what you're expecting.

Yuki: I think a polfile.em to read/write POL's data files sounds like a good idea. Of course, I'm going to have to talk to everyone else and learn a bit more about the core's data system before I even begin to promise such a thing. Just because it sounds like a good idea doesn't mean it is one. ;)

Pierce
Forum Regular
Posts: 420
Joined: Thu Feb 02, 2006 8:33 am

Re: Integrated Static Tool

Post by Pierce » Wed Oct 01, 2008 1:07 pm

I've already decided that my additions will not be committed.
Damn, i started to convert the Perl scripts to Pol after your post yesterday,
at least the parts that not handle the binary part. It seems i cheered too
soon ;)
Does this mean Pol will not have the possibility to read/write binary files or
only that Luth does not want his functionality to be in, because it is
a bit uncomfortable?

Luth
Former Developer
Posts: 200
Joined: Mon Jan 30, 2006 8:10 am

Re: Integrated Static Tool

Post by Luth » Wed Oct 01, 2008 4:06 pm

Pierce wrote:
I've already decided that my additions will not be committed.
Damn, i started to convert the Perl scripts to Pol after your post yesterday,
at least the parts that not handle the binary part. It seems i cheered too
soon ;)
Does this mean Pol will not have the possibility to read/write binary files or
only that Luth does not want his functionality to be in, because it is
a bit uncomfortable?
I mean that my implementation will not be added. I see no reason why a binary file writer should not be included, but the way I had done it originally was just terribly ugly. Here's a section of my multi exporter:

Code: Select all

foreach item in items
	if (item.isa(POLCLASS_ITEM))
		var graphic := CInt(item.graphic) & 0xFFFF;
		var x := CInt(item.x - midx) & 0xFFFF;
		var y := CInt(item.y - midy) & 0xFFFF;
		var z := CInt(item.z - midz) & 0xFFFF;
			
		data.append(CInt((x << 16) | graphic));
		data.append(CInt((z << 16) | y));
		data.append(1);

		itemCount += 1;
	endif
endforeach
	
var res := BinaryWriteFile(filename, data);
No normal user would want to do all that. :) Instead, I think a function-set including the likes of { Write8, Write16, Write32, Write64, and WriteString } would be much more beneficial. I would be perfectly happy to commit that.

I'm still merging my changes from the end of 097 (the ones that didn't get committed) to 098. I'll try to write a good Binary File Writer as well. :)

Madman
POL Developer
Posts: 62
Joined: Sun Feb 05, 2006 7:20 pm

Re: Integrated Static Tool

Post by Madman » Wed Oct 01, 2008 10:50 pm

Yukiko wrote:Madman,

Are the POL map data file formats documented anywhere?
I honestly don't know, and I've promised Luth I'll try to find out. I mean, they can be reverse engineered from the uoconvert source code, but that's no fun.

Yukiko
Distro Developer
Posts: 2728
Joined: Thu Feb 02, 2006 1:41 pm
Location: San Antonio, Texas
Contact:

Re: Integrated Static Tool

Post by Yukiko » Thu Oct 02, 2008 1:46 am

Luth said:
Just because it sounds like a good idea doesn't mean it is one.
Ofcourse it's a good idea, it was mine wasn't it? ; )

Locked