Contributing to OpenDeadlock development

See what Deadlock fans are creating, whether it be fan games, art or scenarios.
Post Reply
uber_nick
Hatchling
Hatchling
Posts: 5
Joined: Sun Jun 13, 2021 2:04 am
Favourite Race: Cyth

Contributing to OpenDeadlock development

Post by uber_nick »

Hi all,

I'm a long time player who recently discovered these forums. One exciting surprise was finding an active OpenDeadlock project. I have a software background and would like to contribute.

I'll start with this post, which will be a quick how-to guide for running the latest code. I hope it will save time for others who follow.

Summary

The OpenDeadlock codebase currently contains a set of development tools to read and convert data from the original game. The main project lives on SourceTree under the name 'Decoder'. It contains code for five command-line executables:

1) Binloader
  • a command-line tool used to extract byte data from files at specific offsets
2) Camtools
3) Decoder
  • a command-line tool that reads sprite data from Deadlock and outputs as images
4) Dehdx
5) Palettetool

The first four projects are C++, while the last is Java. Here, I'll describe how to build the third project "Decoder" in Windows using Visual Studio.

Step 1) Install Tools

Download and install the following:

Mercurial, for source control
  • Click download next to a Windows installer
    e.g. "Mercurial 5.8 Inno Setup installer - x64 Windows
  • Check that "Add the installation path to the search path" is selected
Visual Studio 2019 Commuity with C++
  • Check that "Desktop development with C++" is selected
  • Install
ImageMagick 6, used by the code for its image processing libraries
  • Note this is the legacy page specifically for version 6
  • Check that "Install development headers and libraries for C and C++" is selected
Step 2) Get Source Code

a) Open a cmd console with Start -> Run -> cmd
b) Go to your development directory, for example:
  • `cd\`
    `mkdir dev`
    `cd dev`
c) Enter `hg clone http://hg.code.sf.net/p/opendeadlock/decode opendeadlock-decode`

Mercurial (hg) will then fetch our code from SourceForge and create the directory `opendeadlock-decode`

Step 3) Compile Decoder

We'll use Visual Studio as our IDE and compiler

a) Open Visual Studio 2019
b) Click "Not now, maybe later." to skip the registration screen
c) Click Start Visual Studio
d) Click "Open a local folder"
e) Navigate to .\opendeadlock-decode\decoder
f) Click "Select folder"

After a few seconds, the console should display some build logs, eventually ending with:
"1> CMake generation finished."

g) Locate Visual Studio's "Solution Explorer" pane (top right)
h) Right-click on CMakeLists.txt -> Select "Build"

The console should again fill with build logs ending in "Build Succeeded"

i) Right-click on CMakeLists.txt -> Select "Debug"

The exe will be created with the help menu displayed.

Step 4) Run Decoder

a) Open the cmd console and navigate to your build directory from Step 2b).

b) Enter `cd opendeadlock-decode\decoder\out\build\x64-Debug\decoder`

c) Enter `decoder` to see the help menu

d) Copy the necessary files to the output directory, and enter the following format:

Code: Select all

decoder.exe <palette file> <sprite table file> <sprite table start position> <sprite table length> <sprite file> <output directory> <output format> [bigendian] [matte index]
Next steps

Figure out what counts as a palatte file, sprite table file, etc and where those files live in the Deadlock CD or GOG directories.
User avatar
Tggtt
Mighty Colony Leader
Mighty Colony Leader
Posts: 244
Joined: Sun Oct 06, 2013 8:08 pm

Re: Contributing to OpenDeadlock development

Post by Tggtt »

Thank you very much for joining GalliusIV uber_nick!

I really appreciate voluntary contributions, as GalliusIV is a community and OpenDeadlock is its supported community project. Feel free to clone and submit changes.

I need to remind two details:
  1. OpenDeadlock is much beyond the decode tools repository; It includes a complete reimplementation of the game itself as well;
  2. Some Mercurial repositories (not all) are planned to be converted to GIT because Bitbucket has killed many of its tools and we are facing trouble using Mercurial. I have already tested converting and it works.
If you like writing wikis, please visit https://deadlock.fandom.com and https://sourceforge.net/p/opendeadlock/decode-wiki/ I could give you further access for editing.

Some of the next steps you have mentioned can be found in the latter, such as https://sourceforge.net/p/opendeadlock/ ... e%20Table/ and https://sourceforge.net/p/opendeadlock/ ... /Palettes/ . I can provide further help if necessary.

Enjoy your stay!
uber_nick
Hatchling
Hatchling
Posts: 5
Joined: Sun Jun 13, 2021 2:04 am
Favourite Race: Cyth

Re: Contributing to OpenDeadlock development

Post by uber_nick »

Wonderful, let's get the ball rolling!

Please grant me repo access so that I can move the above notes to their appropriate wiki pages.

If the project plan is to move to GitHub, I'll volunteer to create the project and port over the code. Apart from the code, SourceForge is also hosting the wiki and ticket system. If you're open to moving those as well, I'll be happy to recommend and set up alternatives.

I'm most excited to hear about a complete re-implementation in your reply. While I did see a post here /viewtopic.php?f=7&t=399 referencing such, I was not able to find any code, release binaries, screenshots, or feedback about it. Is this a private project that is eventually planned to be open-source?

I would enjoy compiling and running the private project if you're willing to share, but can only contribute once it's open. If I'm not mistaken, Decoder is the only currently-open-source piece of code available, so I'll focus my efforts there for now.

In addition to code contributions, I'd like to get started on the following:

* Creating a Project Roadmap

Defining and prioritizing goals and wish-list items. For instance, do we just want to be able to run multiplayer in the the GoG version? Or should we consider new ideas like adding bots and more sophisticated AI to opponents? Would community mods, missions, and maps be worth prioritizing over simply replicating current game modes?

* Creating a Technical Roadmap and contribution pipeline

What languages and tools should build in? Would a Windows recreation built in MSVS and mirroring original logic be enough? Or would a clean-room re-implementation in a modern language make more sense? With the latter, we could easily port the game to browser and mobile.

I'd like to choose and build these tools in a way that makes it easy for others to contribute. That means dev setup guides, examples, and functional, discoverable documentation. We'd also want to set up a review, build, and distribution pipeline around it.

* Make a plan for assets and IP

Decoder did a great job extracting original assets from the game, but we shouldn't limit ourselves. A tool that allows us to swap in/out assets would be quite valuable. For instance, we don't need to use the original soundtrack if Chip provided us with a higher quality version. And modifying the images to increase resolution or animations could effectively produce something like a "Remastered Edition" of the game that looks great on modern hardware. Lastly, if the IP holders ever do push back (*fingers crossed they don't*), we'll be able to remove the original artwork and add our own.

I noticed an earlier forum poll asking about interface preference, be it Deadlock I, II, or something custom. I'd prefer being able to swap between all those interfaces in a customizable way. And I'd be even more exited about UX enhancements on top. For instance, the ability to change production from food to wood on multiple farms, or move multiple units/colonists at once, would make large games much quicker and easier to handle. To make that possible, we'll have to start planning and ensure our architecture can support them. Soliciting community UI/UX expertise and releasing non-dev tools would go a long way, especially if combined with other incentives like a bounty system.
MildewMan1
Colonist
Colonist
Posts: 35
Joined: Sat Jun 27, 2020 3:02 pm
Favourite Race: Tarth
Location: St. Louis, Missouri, USA

Re: Contributing to OpenDeadlock development

Post by MildewMan1 »

uber_nick wrote: Tue Jul 06, 2021 12:03 am move multiple units/colonists at once,
I think this is already a feature in the game if you hold down the Alt key while dragging the units unless you are referring to some other kind of move.

As for setting multiple building tasks at the same time, I could see that being useful. Maybe have a setting that allows you to select default task values for each building type when they are created or something.

I think it would be pretty cool to have other kinds of technologies that you research at various buildings which would offer specialized improvements, kind of like in Age of Empires. You could have techs available at a factory that gives units created in that factory increased attack, defense, range, speed, etc. Maybe have the ability to choose 3 "merits" per building or something like that.
User avatar
Ubergeneral Grunt
Site Admin
Site Admin
Posts: 186
Joined: Fri Nov 19, 2010 10:20 am
Favourite Race: Tarth
Location: Perth, Western Australia
Contact:

Re: Contributing to OpenDeadlock development

Post by Ubergeneral Grunt »

uber_nick wrote: Tue Jul 06, 2021 12:03 am For instance, we don't need to use the original soundtrack if Chip provided us with a higher quality version.
I've met with Chip, he only has the six tracks he sent me in 2011. The others exist in mono only, 16-bit 22050Hz, from the Power Mac version.
Tarth cooks make best strudel, barbecue, bean dip, fish, cat food, smelt, piston rings, tofu and cam shafts...
uber_nick
Hatchling
Hatchling
Posts: 5
Joined: Sun Jun 13, 2021 2:04 am
Favourite Race: Cyth

Re: Contributing to OpenDeadlock development

Post by uber_nick »

MildewMan1 wrote: Wed Jul 07, 2021 1:49 am I think this is already a feature in the game if you hold down the Alt key while dragging the units
Wow, you're right! You've just reduced my missile bombardments clicks by 75%.

Your other ideas are fantastic. I added them to a brainstorming board:
https://trello.com/b/fS0sagJ2

The board is 100% open. Please add anything you think would be useful. All forums members are welcome to contribute.

The more fleshed-out ideas we get, the easier to build a project roadmap.

@Ubergeneral Grunt: Good info, neat! The sound files were just an example but those specifics are pretty useful. I'd love to get all of those into an accessible repository as we start building a CMS.
User avatar
Tggtt
Mighty Colony Leader
Mighty Colony Leader
Posts: 244
Joined: Sun Oct 06, 2013 8:08 pm

Re: Contributing to OpenDeadlock development

Post by Tggtt »

Hello uber_nick!
uber_nick wrote: Tue Jul 06, 2021 12:03 am I noticed an earlier forum poll
These polls ran since 2014-02-01. But since October 2018 there are hosting issues that make it impossible to complete the survey.
Therefore, I have decided to disable it (temporarily); all the data is saved.

I noticed you like brainstorming, so I wish you could take a look on the statistics from earlier polls to compile them into a single comprehensive view on the suggestions.

Are you interested?
If you accept, I need to remind you that all responses were anonymous and are considered to be "authored by the community members" as a whole.

Thanks in advance!

By the way, you can already contribute to https://deadlock.fandom.com/wiki/ about general Deadlock information (not limited to OpenDeadlock).
uber_nick
Hatchling
Hatchling
Posts: 5
Joined: Sun Jun 13, 2021 2:04 am
Favourite Race: Cyth

Re: Contributing to OpenDeadlock development

Post by uber_nick »

Hi Tggtt,

I have a few updates from earlier.

You mentioned planning to convert the source repositories from Hg to Git. I have created the repo page and started the process:

https://github.com/UberNick/opendeadlock

The GitHub project's README contains an initial project roadmap. I also have "Tasks" and "Brainstorming" boards on Trello to manage more specific and detailed items:

https://trello.com/b/80qauJyq/tasks

https://trello.com/b/fS0sagJ2/enhanceme ... instorming

I'd love to get additional ideas and contributions. You asked in your previous post if I want the survey data. Yes! Of course! Please share it with me and I will be happy to anonymize and post it to a public location.
Post Reply