Outpost Universe Forums

Projects & Development => Outpost 2 Programming & Development => Topic started by: BlackBox on December 24, 2003, 08:41:55 AM

Title: This forum's Christmas Present
Post by: BlackBox on December 24, 2003, 08:41:55 AM
To everyone at this Forum,

This is your Christmas present from me... (well, sort of).
It's good news.

The news is:
The DLL Editor is coming!

Well, this isn't a good name, since you can't edit compiled programs, but you will be able to create brand new mission DLL's.

I'm currently working on it... The real name for the project is "Outpost 2 Mission Compiler", because in a sense, it is a crude "compiler". (It takes data fed in by the map editor about units, etc. and converts them to the machine code the computer can understand)

With the release of this program will come an upgraded version of the map editor.
(Actually this will be part of the map editor, more of like an "extension" or "add-on" to the map editor's architecture)


Anyway, enough of my ramblings about how it works and so on. The first release of it will be very limited.... creating tutorial missions, and about the few things it will be limited to is creating players, units, and beacons.

But, anyway, expect it in a while....

-- op2hacker
Title: This forum's Christmas Present
Post by: OP2Patriot on December 24, 2003, 09:15:40 PM
WOO HOO! This is good news.

Merry Christmas to all!

 
Title: This forum's Christmas Present
Post by: CK9 on December 24, 2003, 09:22:07 PM
Wow!  This is great news!  Every little thing like this is what keeps this group of forumites strong.  well done hacker.


*forumites stare at CK strangley*

What?
Title: This forum's Christmas Present
Post by: Drakmar on December 25, 2003, 01:41:12 PM
Forumites? Where did that come from? Anyway: I can't wait to try that! That is the first step to the Expansion Pack to OP2, Outpost 2: First Wave. Btw: Will the expansion pack be based on the novella First Wave?
Title: This forum's Christmas Present
Post by: CK9 on December 25, 2003, 05:06:27 PM
lol, just a little terminology I picked up at the Myst forums
Title: This forum's Christmas Present
Post by: OP2Patriot on December 25, 2003, 05:23:16 PM
It is based on First Wave. It will contain missions from First Wave and Allies and Enemies.
Title: This forum's Christmas Present
Post by: BlackBox on December 26, 2003, 02:54:41 PM
Update...

It can now produce code for unit creation....
I'm currently working on how to get it to "link" the produced code with a DLL file (so it can actually be run/played in OP2). (What it does right now is write out the code into a .TMP file (similar to the .OBJ files any C/C++ compiler will output ... you get OBJ files when you run CL from the command line in MSVC++.) Usually after this stage of the "build" process for any program, the OBJ files are "linked" to produce the final output EXE, DLL, or VXD file.

Anyway that "linking" stage is going to be the hardest part of it.....
Adding code for commands in OP2 (ie. Create a unit, blow it up, create a trigger, etc.) is easy.... all I do is look at the DLL's that use the commands and basically copy the machine code into my program.


<End of lengthy technical description>

It will have a few downfalls though... (Not major ones, hopefully -- Being able to create new OP2 missions is a major cool thing)

First of all, it doesn't look the greatest... (It will be a dos box window inside the OP2 Mapper window (did I mention that it will be part of the mapper?)
I did add colors to 'jazz it up' a little, like, red for errors, green for "Compiled successfully", red for "Compile failed", that sort of thing.

Second of all, the code that it produces will be unoptimized... like certain "unnecessary" commands may be repeated, etc. however they shouldn't be noticeable to the human eye. (Not a big deal because we're not running old 286's or anything.)

Third of all (this also isn't much...) it will produce slightly larger DLL's than I'm sure sierra/dynamix could produce (the reason for this is because it has a 1.5 KB section added onto the end of the DLL file... it should only be about 2 kb bigger than t01.dll.... (~25 KB))

And that brings me to the last one, there will be a maximum number of instructions that you can use, due to the size of the new section... (The page size is 1,536 bytes... that is the size of the new code section it uses, so if you exceed 1,536 bytes it will screw up.)

Tell me if I might need to increase this. Currently the code that creates one unit/building is 55 bytes big... so with that amount of space you could create 27 units in code... probably too small.)

But anyway, it's a first...

--op2hacker
Title: This forum's Christmas Present
Post by: OP2Patriot on December 27, 2003, 08:16:32 PM
Here's a belated one from me. I am on vacation now, but I had this picture up for some time. Also, when I get back I will upload a two page story on how things were at Killer's forum, focusing mainly on the Killer Crisis.

(http://op2.xfir.net/times/train.jpg)
Title: This forum's Christmas Present
Post by: plymoth45 on December 27, 2003, 09:22:58 PM
while we r on the programing subject, how do u make maps?
Title: This forum's Christmas Present
Post by: CK9 on December 27, 2003, 10:44:44 PM
Quote
Also, when I get back I will upload a two page story on how things were at Killer's forum, focusing mainly on the Killer Crisis.
 
Mind if I link to it from my site when you do?
Title: This forum's Christmas Present
Post by: Drakmar on December 28, 2003, 07:36:33 AM
Where can you download the Ultimate Outpost 2 Trainer? I saw it on the site with the ESH Trainer, but I couldn't download it. Plus on the ESH Trainer, The "ConVec Cheats" don't work. Why?
Title: This forum's Christmas Present
Post by: BlackBox on December 28, 2003, 11:57:42 AM
Quote
while we r on the programing subject, how do u make maps?
You can download the map editor from here:

http://312productions.xfir.net/etc/op2mapper_alpha.exe (http://312productions.xfir.net/etc/op2mapper_alpha.exe) (1,042 KB)

After downloading that and installing it, upgrade it to version 1.6 with this patch:

http://312productions.xfir.net/etc/map_upd16.exe (http://312productions.xfir.net/etc/map_upd16.exe) (169 KB)

I will put up a web site for the mapper and other op2 projects like the DLL compiler soon.
 
Title: This forum's Christmas Present
Post by: plymoth45 on December 28, 2003, 02:00:12 PM
i got the editor, but how do i play a map once it is made? i have a map partially made, and i wanted to see how it played before i finished it, but i can't figure out how to play it.
Title: This forum's Christmas Present
Post by: OP2Patriot on December 28, 2003, 04:16:11 PM
There was too much concern over the ultimate trainer then ruining the multiplayer environment, so it was deleted hours after being released.  The ConVec cheats should only work if
Windows 95 is what you have installed and using on your machine.
Title: This forum's Christmas Present
Post by: CK9 on December 28, 2003, 04:29:22 PM
I only have windows 98
Title: This forum's Christmas Present
Post by: plymoth45 on December 28, 2003, 04:31:08 PM
i have xp pro, so i wont even try.
Title: This forum's Christmas Present
Post by: BlackBox on December 29, 2003, 03:41:17 PM
Quote
i got the editor, but how do i play a map once it is made? i have a map partially made, and i wanted to see how it played before i finished it, but i can't figure out how to play it.
Ok. You gotta get a DLL that you want to use that contains the setup of the units you want, and copy it. (easiest way to test is to just copy a tutorial, like t01.dll)

Now, (armed with a hex editor) open the copy of the DLL, search for the text .map and you will find the map name that the DLL is using.. You can change it if you want... It's easiest to keep it the same length, but if it's less, then add null's (00) past the end of the .map part until it is the same length as the old name in the hex view.

Whatever you do, don't make the name longer, and make sure you are OVERWRITING the text, not inserting text! (If you change the length of the file, you will screw up the DLL and it won't work... Well, actually there is a way to fix it if you make it shorter, but I'm not going to go into about how Windows works to load programs and about alignments... Too complicated.)

Nearby the map name there should be the name of the level. (change this if you want, but remember: don't exceed the length! and add nulls (00) or spaces (20) to make it the same length as the old name, if it's shorter.

Finally, save it, and rename it to the kind of mission it previously was, using the OP2 naming conventions.

The file name must start with:

t - for Tutorial
e - for Eden Campaign
p - for Plymouth Campaign
ml - multiplayer lastone/landrush (I think)
c - colony game.

(Note, that you CANNOT switch the type of DLL it is by changing the 1st letter! There is also a number in the DLL that controls the mission type. If you do, it won't show up in the list.)

Now you can go into OP2 and your new mission should be in the list, according to what kind of mission you originally copied from.

If you have any questions about this, I'll be glad to provide answers.
Title: This forum's Christmas Present
Post by: plymoth45 on December 29, 2003, 06:11:30 PM
ok, where do i get a hex editor?
Title: This forum's Christmas Present
Post by: gpgarrettboast on December 29, 2003, 06:13:05 PM
Help! My maps won't save!!! When I click save, it asks for the name. IO give it one, it "saves". But when I go back, There is no file! Maybe my dl corrupted, but maybe not
Title: This forum's Christmas Present
Post by: gpgarrettboast on December 29, 2003, 06:21:55 PM
C++ has a hex editor, but there may be some free (OR CHEAP) ones...  Try searching binary editor at google.
Title: This forum's Christmas Present
Post by: BlackBox on December 30, 2003, 08:10:29 AM
The hex editor I use is Hex Workshop 3.1

You can get it off download.com, I think....

There are also other good ones like HIEW and UltraEdit-32.
Title: This forum's Christmas Present
Post by: Drakmar on December 30, 2003, 09:55:56 AM
Quote
The ConVec cheats should only work if
Windows 95 is what you have installed and using on your machine.
I have Windows 2003, why does it work only for Win95?
Title: This forum's Christmas Present
Post by: BlackBox on December 30, 2003, 10:03:17 AM
I think his trainer engine only works on old versions of windows, or something, I dunno, maybe the addresses are different under XP...
Title: This forum's Christmas Present
Post by: gpgarrettboast on December 30, 2003, 11:38:50 AM
Oh, it works.  :)
Title: This forum's Christmas Present
Post by: plymoth45 on December 30, 2003, 04:10:30 PM
Ok, i have the hex editor XVI32, hope it is a good one, now wht?
Title: This forum's Christmas Present
Post by: BlackBox on December 30, 2003, 04:53:12 PM
Hmm, never heard of that one.

What to do? Follow the instructions I gave up above.  :)  
Title: This forum's Christmas Present
Post by: Leviathan on December 30, 2003, 07:54:16 PM
op2hacker when ur editor loads map it counts the 1st square on the map (top left) as 0,0, this is not infact the case in op2, op2 starts with 1,1.
when tryin 2 place markers for the mines i found this out, i placed a marker at 15,9 in the editor and it came out as 16,10 on the map in game.
Title: This forum's Christmas Present
Post by: plymoth45 on December 30, 2003, 10:20:56 PM
um, which editor were u using?
Title: This forum's Christmas Present
Post by: BlackBox on December 31, 2003, 06:58:36 AM
Hmm? marker?

Are you editing DLL's? or were you just using a weird tile like the blue tile to mark mines and other stuff?

Yeah, I could change it to say 1,1

That was sort of laziness on my part because the array that holds the tiles is 0 based, and the accessor functions for it (GetTile, SetTile) expect 0,0 if you're really getting 1,1 (the first tile on the map)

But I could change that tooltip and the status bar to read: 1,1 and so on.
Title: This forum's Christmas Present
Post by: Leviathan on December 31, 2003, 07:09:15 AM
Quote
op2hacker when ur editor
plymoth45, op2hacker's editor, hence 'ur'.

yea plz change it 2 1,1 so its same as op2.

the markers i was placing were just cirten tiles so i can tell where mines r.
Title: This forum's Christmas Present
Post by: BlackBox on December 31, 2003, 07:34:20 AM
Oh ok... (about the tiles)

I will be releasing patch 1.7.1 today.... I'll make a topic on the forums, and I'll post it at the site that's linked in my sig (the Hacking HQ)

 
Title: This forum's Christmas Present
Post by: Leviathan on December 31, 2003, 07:39:14 AM
about the Tileset Compiler, it exports in jpg and ur editors a gif..
also do u no how 2 get the compiled tiles in2 op2?
or is it just 2 edit tiles for the editor?
if so that has no point at all if the edited tiles cant b used in op2.
or are you working on this?
Title: This forum's Christmas Present
Post by: BlackBox on December 31, 2003, 07:56:21 AM
Um, the tileset compiler is for the editor's tiles... I don't know why it exports as a .jpg, actually, yes I do

I think it's supposed to output either a tiles.bin or a tileset.set file, see the reason I have it is when I was first making the editor I had Phil mark all the tiles as passable/impassible/superhiway, but then I took a separate program, and created the .gif from the tile images... it's sorta weird... the tileset compiler has no real use

As far as adding tiles to OP2.... I know it can be done, but the images have to be flipped a certain way or something for them to look right in OP2.