Author Topic: Blackbox's Megathread Of Goodies  (Read 5591 times)

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Blackbox's Megathread Of Goodies
« on: March 19, 2010, 06:26:07 AM »
Greetings all,

Since as you have seen I have been MIA for quite some time from OPU and as you may have guessed I really have no time to devote to OP2 related development anymore. I have had quite a few requests for source code during this time.

As of today I am deciding to release the majority of my larger projects as open source (I've decided on a creative commons license to prevent people from taking the projects and running off with them without giving credit; http://creativecommons.org/licenses/by-nc-sa/3.0/us/). I will be posting to this thread as I am able to take the time to clean up the projects and upload them.

Most of the code is C++ code written in MSVC6.0. The express edition of MS visual studio should be able to open these (potentially with some difficulties). I am making no guarantee whatsoever that these projects will compile, run, or do at all what they are supposed to (in other words if you build and run one of my projects and it somehow turns your computer into a great big steaming pile of fail, don't come whining to me).

I also am not making any guarantee that I can help you with getting them to compile. Some of the timestamps on the files are over 4 years old; I don't have a clue how the builds work for some of the projects. If you are having major issues getting them to build or work properly please post here (I do think a couple use some modified versions of dependencies; I've tried to include the deps with the project but again, no guarantee that it will work at all). If you are missing deps I will try to help you the best I can but I cannot devote any time to helping you understand how the code works or anything of that sort cause my RL schedule is just too busy.

Now with that out of the way, here are the projects I have released. All the files can be downloaded from http://blackbox.outpost2.net/op2goodies/ -- I will now list off the names of each .rar file and what the project inside is supposed to be:

OP2App -- this one is just a bunch of header files containing the exported functions, data, etc. from Outpost2.exe that are not used for anything level related. These include stuff to deal with files, windows, other UI elements, etc. It's probably not useful to anyone except those who might be interested in trying to hack these pieces of OP2.

OP2Editor -- this is the editor backend for OP2Mapper v2. It handles all the tileset, map, and vol file management and exposes a COM interface for these things. (The GUI frontend is written in VB6 and references the COM objects to perform the actual task of modifying and writing the map files). It may be useful if you are trying to write programs that work with maps, tilesets, VOLs, or CLMs. Most of the credit goes to Hooman on this one; I've only made minor changes for the most part as far as I can remember.
It's required if you are going to try to compile OP2Mapper v2.

op2ext -- this is an extension library that we include with the OPU distribution of OP2 that has been hacked in so that it gets loaded by the game when it starts up. It implements features such as the mod loader, loading of extra/addon VOLs, the IP dropdown list for multiplayer, language.ini support, among other things.
This is probably out-of-date: I know Hooman has made some major changes to the way the mod loader works as he asked for this code a while ago. Useless to most unless you are going to try to extend Outpost2.exe through some means.

OP2LangReader -- this goes hand in hand with op2ext, it was a tool written to extract localized strings from different language versions of OP2 and generate language.ini for you. There are some example language files cooked up already; it's pretty useless unless you know the virtual address and size of the localized strings table in Outpost2.exe, so mainly put here for reference purposes. (On the other hand, if someone wants to have a shot at making multilanguage versions of OP2; I know there is a spanish version floating somewhere that will have to have its strings extracted).

virmasktools -- tools to manipulate virmask.raw (a file in maps.vol that holds some 1bpp bitmaps that are used to generate the edges on lighting from the buildings, as well as the blight edges). There are two tools: vmunpack, which extracts a 32x32 1bpp bitmap from virmask and saves it as a windows DIB .bmp; and vminject which takes a DIB bmp and inserts it into virmask.raw. If you have any desire at all to modify virmask.raw these tools should allow you to do it with some elbow grease.

VOLExplorer -- VOL extractor/editor, was supposed to be a WinRAR-esque program for manipulating VOL files but it looks pretty unfinished. (The extract functionality might work, again try at your own risk).

There are some more projects that I plan to release full source to once I clean them up, I will list them here and post again when I clean them up and upload the rar:

OP2Mapper v2 -- The mapper frontend; written in VB6 (probably going to be impossible to compile in VB.net cause I recall it using a bunch of nasty hacks and external libraries. We'll see).

OP2Mapper 3 -- An unfinished project that was meant to be a full reimplementation of the mapper in 100% C++. Last time I poked around with this and tried it on Windows 7, my computer froze and I had to reboot. It may or may not work.

op2remake -- An attempt at creating a crossplatform replacement for Outpost 2 itself (the project is a C++ codeblocks project and it uses SDL and a menagerie of other libraries for font rendering, script processing, GUI, etc). IIRC, it could render a map file (I had a converter that would convert the OP2 .map into a lua script which it could process) and let you scroll around it inside of the OP2 greyish frame.... not too useful but it's a possible start.

If there is any project of mine that you would like to see but that I have completely missed, let me know and I will try to dredge it up from the bowels of my hard drive. In addition if you have any questions about anything let me know and I will try to answer them time permitting.

I will post as I am able to clean up the mappers and the op2 remake project and upload them.

Thanks and good luck,
BlackBox

Offline TH300

  • Hero Member
  • *****
  • Posts: 1404
    • http://op3game.net
Blackbox's Megathread Of Goodies
« Reply #1 on: March 19, 2010, 08:20:00 AM »
First, thank you very much. This will allow others to continue what you have started.

Most of your code will probably only be useful to Hooman, because he is the one who makes new releases of op2. Some of it may be interesting for modders. Some may be of help when making a remake.

I am particularly interested in the mapper stuff. But the code that I looked at, so far, depends so heavily on windows, that it hurts my eyes. I was hoping for a Linux port of the mapper. Now, I understand why you never made that.
 

Offline CK9

  • Administrator
  • Hero Member
  • *****
  • Posts: 6226
    • http://www.outpost2.net/~ck9
Blackbox's Megathread Of Goodies
« Reply #2 on: March 19, 2010, 11:51:27 AM »
I know a certain group that can benefit from this...(I am not allowed to divulge too much information, but I can reassure you it only consists of people who are currently active posters here)
CK9 in outpost
Iamck in runescape (yes, I still play...sometimes...)
srentiln in minecraft (I like legos, and I like computer games...it was only a matter of time...) and youtube...
xdarkinsidex on deviantart

yup, I have too many screen names

Offline Spikerocks101

  • Hero Member
  • *****
  • Posts: 711
Blackbox's Megathread Of Goodies
« Reply #3 on: March 19, 2010, 12:18:15 PM »
Spikerocks101 is suspicious towards this "certain group". Oh, and great thanks Black Box :D
I AM YOUR PET ROCK!!!!!!

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Blackbox's Megathread Of Goodies
« Reply #4 on: March 19, 2010, 02:16:26 PM »
Alright, I cleaned up the source of the mappers and op2remake and uploaded them. Some notes:

OP2Mapper2 -- You will probably need VB6 to compile this, it uses a huge number of sick hacks and a very large number of VB custom controls (.ocx files). The source code to these controls is in the controls/ directory.
You will most certainly have to download and compile OP2Editor and make sure it's registered (regsvr32 OP2Editor.dll), you may need to regsvr32 the ocx and dll files as well.
The source is probably not easy to read or make any sense of, you have been warned!
If you can get it to compile under VB.net, more power to you. (But I doubt the automatic importer is going to be able to convert it properly).

OP2Mapper3 -- C++ app, it should be self contained. An MSVC6 project like most of the others. It's not complete so don't complain if it crashes when you try to use it (also the tilesets probably have to be in the same directory as the exe, there may be some hardcoded paths and things).

op2remake -- A codeblocks project. You need to have mingw32 gcc/g++ installed to compile this on windows. (I have not attempted a build under linux, in theory it should work but I have no idea).
You will probably need to have SDL, SDL_image, SDL_ttf, and libfreetype development headers installed (included for windows I think, for other platforms install them using yum or apt). You will need Swig to compile the project (it generates foreign language bindings for the scripting language), this is not included for windows (go download it, it's opensource).
It looks like the project was in the middle of a transition from lua to some other scripting language (I believe GameMonkey), so I have no idea if it will work at all. (The GUI was generated by lua scripts, as I recall, and map files were lua scripts).
tools/ - contains a program to convert a .map to a lua script and a program to create the .pkg files that hold tileset data.
op2remake/ - contains the actual project. All windows dependencies should be in deps/, swig interface definitions in op2remake/swig/. I don't think there were swig bindings for gamemonkey, I believe I was trying to create a module for swig to do this but I cannot remember where that code is.
In any case it could not do much beyond displaying the grey frames that OP2 uses and scrolling a map around inside it.

Good luck, again if you have any questions let me know.

Thanks,
BlackBox

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Blackbox's Megathread Of Goodies
« Reply #5 on: March 20, 2010, 05:03:33 AM »
Thank you for this. :)
 

Offline AmIMeYet

  • Full Member
  • ***
  • Posts: 128
Blackbox's Megathread Of Goodies
« Reply #6 on: March 20, 2010, 05:53:53 AM »
Thanks for releasing this. May something good come out of it :)

Offline alice

  • Administrator
  • Hero Member
  • *****
  • Posts: 553
Blackbox's Megathread Of Goodies
« Reply #7 on: March 30, 2010, 04:24:00 PM »
I've really wanted the Mapper code for a very, very long time.. Thank you for releasing all of this ^^

Offline evecolonycamander

  • Hero Member
  • *****
  • Posts: 602
Blackbox's Megathread Of Goodies
« Reply #8 on: April 03, 2010, 03:43:12 PM »
Yes onward and forward i say. in other words this helps a lot
''The blight cant get us up here!''
-famous last words
--------------o0o--------------
Outpost 2: EoM project status: Re-planning

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Blackbox's Megathread Of Goodies
« Reply #9 on: April 03, 2010, 06:57:35 PM »
"We must go forward, not backward. Upward, not forward. And always twirling, twirling, twirling towards freedom."

:P
 

Offline Eddy-B

  • Hero Member
  • *****
  • Posts: 1186
    • http://www.eddy-b.com
Blackbox's Megathread Of Goodies
« Reply #10 on: June 01, 2010, 02:19:18 PM »
I think i'll be joining Blackbox as i have also been MIA for several months.
I have decided to make Renegades available to a select few since some of it goes pretty deep into the op2 program itself.
Also, my coding is far from clean and badly commented (another reason why it is so hard for ME to pick it up again, after being away from renegades for a few years).

I hope some good will come from my source, and i will be popping in from time to time, perhaps even downloading an extra mission for Renegades... depends if someone's up for the challenge!


Be seeing you guys!!!
Rule #1:  Eddy is always right
Rule #2: If you think he's wrong, see rule #1
--------------------

Outpost : Renegades - Eddy-B.com - Electronics Pit[/siz

Offline Arklon

  • Administrator
  • Hero Member
  • *****
  • Posts: 1269
Blackbox's Megathread Of Goodies
« Reply #11 on: July 11, 2010, 06:19:00 PM »
Quote
I think i'll be joining Blackbox as i have also been MIA for several months.
I have decided to make Renegades available to a select few since some of it goes pretty deep into the op2 program itself.
Also, my coding is far from clean and badly commented (another reason why it is so hard for ME to pick it up again, after being away from renegades for a few years).

I hope some good will come from my source, and i will be popping in from time to time, perhaps even downloading an extra mission for Renegades... depends if someone's up for the challenge!


Be seeing you guys!!!
It's now been another month and 10 days :P