Author Topic: Source Code?  (Read 24708 times)

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Source Code?
« Reply #25 on: July 16, 2010, 12:33:51 AM »
I'd say at least someone on the OP2 coding team knew what they were doing, and probably more. There's no way something like OP2 would have been completed without someone experienced on the project. And if little parts of it seem like they could have been done better, keep in mind that real world projects have time and budget constraints. Plus, some of the tools from back then, and available libraries, were not as good as what we have now. Remember that C# didn't exist, and I doubt that Spring engine did either (whatever it is). The programmers for OP2 probably would have had to code a lot of stuff themselves, and any libraries available for them to use may have been lacking. It's hard to judge quality of code from a disassembly, especially if you're only looking at a small part of it. You could very well be looking at library code they had nothing to do with writing. You also don't know what programmer on their team wrote it, plus some aspects of the original code may be hidden by what the compiler or optimizer has done to it.
 

Offline ImpulziveMyztikalGuru

  • Newbie
  • *
  • Posts: 29
Source Code?
« Reply #26 on: July 16, 2010, 01:54:03 AM »
That is true. I never said they didnt know what they were doing, but if memory serves me, and it screws up every now and then  :P , then they didnt use what they could have to their fullest. Yes, not everything we can use now was available to them, and there were areas in programming that were lacking. But, with what they did use, they made an amazing game  :)  Now its time for a long overdue, major update, build on what they had.

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Source Code?
« Reply #27 on: July 16, 2010, 03:08:01 PM »
A couple things I guess that kinda stick out at me. (I'm hoping this post isn't going to be interpreted as flaming, as it's not my intention)

1. You admit that you're not completely certain where you stand, level-of-expertise wise (i.e. not knowing what programming language to use), but you apparently seem to know enough about assembly language (and what high level constructs in C++ translate to in assembly) to be able to make the conclusion that it's terrible code, and that "monkeys could have written this"? (I guess no offense meant but you did not make it sound like you were in such a position to make sweeping statements about OP2's design).

2.
Quote
I'd say at least someone on the OP2 coding team knew what they were doing, and probably more. There's no way something like OP2 would have been completed without someone experienced on the project. And if little parts of it seem like they could have been done better, keep in mind that real world projects have time and budget constraints.
This. Generally speaking, you don't write a program of this scale without proper formal knowledge of how to "correctly" write software (considering that the developer, Dynamix, probably isn't going to hire people without at least a university education in Comp Sci or something similar).
Similarly time/budget constraints might cause them to lazily "hack" in required enhancements/features if they need to release by a certain date.

In response to the rest of the posts:

Keep in mind that this was a game released in 1997 (so written before that even). In addition to not having modern/current libraries, etc. you have to keep in mind the limitations of the hardware they were developing for (OP2 was designed to run on a pentium, there is even code to check to see whether the CPU supports MMX instructions or not and two different versions of certain functions for MMX/non-MMX CPUs) so what seems really strange to us now was necessary optimization back then to make the program run at decent speeds.

As far as choice of language is concerned, C probably isn't the best language to use (it's the non object oriented predecessor to C++). It's still useful in systems programming and whatnot (for example the Linux kernel and most of the system software are written in C) but probably is not the best choice for a game.
I've used C# and it was pretty decent; the .net runtime is a lot lighter than Java and the standard library is very good. (Given that it'd be a reimplementation of a 2d game that is over 13 years old, running on modern computers, performance of the chosen language/runtime/framework is probably not a major concern).
« Last Edit: July 16, 2010, 03:12:19 PM by BlackBox »

Offline ImpulziveMyztikalGuru

  • Newbie
  • *
  • Posts: 29
Source Code?
« Reply #28 on: July 18, 2010, 04:49:21 AM »
In response to you first statement, I know quite a bit about programing. Yes, I know assembly language, because it is some of what I work with. The reason I asked which language would be best to use is because of the wide range, and depending on which one I use, depends on how much of that language I know. If I wrote the game in Binary, it would take forever, but I could do it. What language I use for the final implementation depends on input from outside sources (Outpost Universe). I could write it in my native computer language, but then that would be it, nobody else would be able to use it, let alone modify it.

It probably didnt come across the right way, and I apologize for saying some things about the original programming team, and the original program itself, Im not sober very often, and in fact do my best work, well, not sober. But when writing for forums, that doesnt work so well, haha. I give them great credit, for they did produce an amazing game with what they had.

Back to my programming skills. They are well developed in most languages, but not used very often. I work best with one you probably havent heard of, DeNAos, and basic operating systems. Programming games is different, again, with such a large community, most of whom are adding to and modifying the game, I want to use a language that is compatible with whatever other people are using.

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Source Code?
« Reply #29 on: July 18, 2010, 10:19:11 AM »
Quote
It probably didnt come across the right way, and I apologize for saying some things about the original programming team, and the original program itself, Im not sober very often, and in fact do my best work, well, not sober. But when writing for forums, that doesnt work so well, haha. I give them great credit, for they did produce an amazing game with what they had.
We're not upset that you made fun of them, so much as when you say stuff like "a monkey could code this" it makes you look like you don't know what you're doing.
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline ImpulziveMyztikalGuru

  • Newbie
  • *
  • Posts: 29
Source Code?
« Reply #30 on: July 18, 2010, 10:45:59 AM »
And I apologize for that, again, I was in the middle of coding, not necessarily for OP2, and like I said, Im not exactly sober when I program, so things get put out that I dont mean to say. I actually feel bad for having said that  :(  
« Last Edit: July 18, 2010, 10:46:27 AM by ImpulziveMyztikalGuru »

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Source Code?
« Reply #31 on: July 18, 2010, 01:42:51 PM »
Quote
Im not exactly sober when I program
Once again, not inspiring any confidence in your abilities at all.
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline ImpulziveMyztikalGuru

  • Newbie
  • *
  • Posts: 29
Source Code?
« Reply #32 on: July 18, 2010, 02:26:19 PM »
Haha, thats what the military said before they offered me a contract. Im good, very, very good.  (thumbsup)

Also, cracked seventeen DLLs so far
« Last Edit: July 18, 2010, 09:36:04 PM by ImpulziveMyztikalGuru »

Offline CK9

  • Administrator
  • Hero Member
  • *****
  • Posts: 6226
    • http://www.outpost2.net/~ck9
Source Code?
« Reply #33 on: July 20, 2010, 10:42:44 AM »
Did you offer to do the job for less money than anyone else?  That's how the military picks all their weapons anyway...
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 ImpulziveMyztikalGuru

  • Newbie
  • *
  • Posts: 29
Source Code?
« Reply #34 on: July 21, 2010, 07:03:56 AM »
Haha, not quite. I offered and proved I could do what they wanted better than anyone else, and they weren't worried about payment.

Offline ImpulziveMyztikalGuru

  • Newbie
  • *
  • Posts: 29
Source Code?
« Reply #35 on: July 22, 2010, 11:38:59 PM »
Another update. I've stopped opening DLLs, because Im pretty sure there are only six that are actually responsible for running the game, seeing as how all the others are mission and tutorials.

I've actually been thinking on that, but haven't decided what to do. The fact that the missions are nicely packed into DLLs, I don't see any reason to rework them, if they are still compatible with the new program. Correct me if I'm wrong, but most of the mods done haven't been to the missions themselves, but to the actual program, most notably the EXE.

New mission are made, but then those, again correct me if I'm wrong, are packed into DLLs, and the game is told that they are there. If my assumptions are correct, then again, I see no reason to have to rewrite every single DLL, only those six that are responsible for the game.

That being said, I have opened all six of the DLLs. They are as follows:
odasl.dll
op2ext.dll
op2extra.dll
OP2Shell.dll
op2shres.dll
op2res.dll

Those are the only DLLs that I've seen that have anything at all to do with the running of the game, everything else is, again, missions and tutorials. If anyone knows anything more, please let me know. As of now, those DLLs have been cracked, and I am working on cleaning up the code, so its at least semi-legible, and from there I will use the old code as a blueprint for writing the new. I will be writing the new code in a few different languages, to see which I like best, and which I think works best. The languages are as follows:
C#
D
Java
Python
DeNAos


At a certain point, I will dump four of the five, and continue with one only, but that's a ways off yet Sometime in the next few weeks, I hope to be able to post the six DLLs in their cracked entirety, so that others may see exactly how the game ticks. No guarantees, as the files are large, and I cannot host them for public use.

I also hope to be posting, within a month or two, a rough shell of the new game. Still looking for someone who can do the graphical design, but that's for later, if the consensus is for new graphics, unless they want to stay with the old original stuff.

Offline CK9

  • Administrator
  • Hero Member
  • *****
  • Posts: 6226
    • http://www.outpost2.net/~ck9
Source Code?
« Reply #36 on: July 23, 2010, 12:42:21 AM »
All the game needs to run new maps is for the .map and the .dll files to be in the OP2 folder.  There's probably a line of code that tells the game to search the folder for the .dll (which in turn tells the game what map to use).
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 ImpulziveMyztikalGuru

  • Newbie
  • *
  • Posts: 29
Source Code?
« Reply #37 on: July 23, 2010, 04:17:02 AM »
Okay, cool, thank for that. I haven't gotten that far into the code, but that definitely makes things easier, means I don't have to rewrite everything  :P Just need to update the graphics  :(  

Offline Hidiot

  • Hero Member
  • *****
  • Posts: 1018
Source Code?
« Reply #38 on: July 23, 2010, 10:52:44 AM »
Any .dll that is e/p/t and a number is a mission or tutorial. Any .dll that starts with c is a colony game and any .dll that starts with m is a multi player map.

There's also the demos, ademo1 to 3.

So yeah, you got the 6 game .dlls.
"Nothing from nowhere, I'm no one at all"

Offline ImpulziveMyztikalGuru

  • Newbie
  • *
  • Posts: 29
Source Code?
« Reply #39 on: July 23, 2010, 11:02:00 AM »
Okay, thanks again. Making things so much easier :)  Well, those 6 DLLs are open, just working on cleaning them up a bit. I've been playing around with Spring, and think I'm going to continue using it for the engine, unless there are any better suggestions?

Offline Sirbomber

  • Hero Member
  • *****
  • Posts: 3238
Source Code?
« Reply #40 on: July 23, 2010, 11:15:21 PM »
We wrote op2extra.dll; there's no need to disassemble it.
"As usual, colonist opinion is split between those who think the plague is a good idea, and those who are dying from it." - Outpost Evening Star

Outpost 2 Coding 101 Tutorials

Offline Hooman

  • Administrator
  • Hero Member
  • *****
  • Posts: 4955
Source Code?
« Reply #41 on: July 24, 2010, 12:18:07 AM »
Both of these were written by people at OPU:
op2ext.dll
op2extra.dll

Btw, what do you mean by:
Quote
As of now, those DLLs have been cracked, and I am working on cleaning up the code
I find that a little vague and ambiguous. If you mean you've opened them in a disassembler/debugger, be aware the result might not be editable and recompilable. If you just plan to use a disassembly to rewrite stuff... well, how many lines is it?
 

Offline ImpulziveMyztikalGuru

  • Newbie
  • *
  • Posts: 29
Source Code?
« Reply #42 on: July 24, 2010, 01:07:55 AM »
I'm using the old DLLs as guidelines for the new code. Don't know how many lines there are exactly, the code is not, and probably never will be completely disassembled, but I am getting enough to have a rough starting point. I am not planning on using the original code, everything is being rewritten, at least as far as the basic operation of the game is concerned.

Don't know if that makes any sense, I've been awake for three days now, and I really really need sleep.  :yawn:  
« Last Edit: July 24, 2010, 01:08:17 AM by ImpulziveMyztikalGuru »

Offline ImpulziveMyztikalGuru

  • Newbie
  • *
  • Posts: 29
Source Code?
« Reply #43 on: April 24, 2011, 09:56:43 PM »
Whoa, so, just got a personal email from jcj94 about the status of this little project, which has become not so little, haha  :blink: As far as its come, its still along ways from done, and I actually have used to computers at work for some raw power to get some stuff done, very interesting actually, completely different subject. So, if anyone is interested, hers what has happened since my last post:

All the DLLs have been cracked and open and rewritten. Yes, thats right, I have cracked the DLLs open like a book, and rewritten the code, updating some surprisingly massive bugs  :blink: The new program is underway, and the current plan is actually quite ambitious

I am working on compressing everything into one file. Again, yes, thats right, ONE file, thats actually smaller, more streamlined, and much more powerful than the original game. It will be one massive EXE file, and all mods can be done within this one file, you will just have to know where to look. I would post a snippet of the code, but right now, my coding computer is undergoing a massive overhaul, and the data on the drives is currently inaccessible.

Right now, the program is actually in a state of standby as the overhaul is ongoing, but the project should be rolling again soon, hopefully within the next two or three weeks, hopefully not that long. If anyone has any concerns about anything in this post, feel free to let me know, Id be more than happy to answer questions. Until then, live life to the fullest (thumbsup)



Failure Is Not An Option.

Offline jcj94

  • Sr. Member
  • ****
  • Posts: 407
    • http://techfusion-279.com
Source Code?
« Reply #44 on: April 24, 2011, 10:42:03 PM »
1: I am super happy that this project is underway again!
2: See, sometimes PM's work out for getting certain members back (no, I won't spam the member base)
3: Wow, .dll's all rewritten?  Is this as far as any project has gone?

 (thumbsup) :D (thumbsup)

EDIT: Just noticed the "Failure is not an option" at the bottom of his post.  Way to keep up morale! (both personal and otherwise)
« Last Edit: April 24, 2011, 10:45:10 PM by jcj94 »

Offline CK9

  • Administrator
  • Hero Member
  • *****
  • Posts: 6226
    • http://www.outpost2.net/~ck9
Source Code?
« Reply #45 on: April 25, 2011, 01:32:40 AM »
and that's what you get when you have one person coding instead of a team: a better-working file that is actually smaller.  Game bugs seem to revolve around areas that multiple people and/or teams were working.
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 TH300

  • Hero Member
  • *****
  • Posts: 1404
    • http://op3game.net
Source Code?
« Reply #46 on: April 25, 2011, 05:08:14 AM »
Quote
All the DLLs have been cracked and open and rewritten. Yes, thats right, I have cracked the DLLs open like a book, and rewritten the code, updating some surprisingly massive bugs
Care to tell us what these bugs are? And are you even 100% sure that those are bugs and not features that the game depends on? I would feel better if you rewrote the code as close to the original as possible and fixed "bugs" in collaboration with opu members.

Quote
I am working on compressing everything into one file. Again, yes, thats right, ONE file, thats actually smaller, more streamlined, and much more powerful than the original game. It will be one massive EXE file, and all mods can be done within this one file, you will just have to know where to look.
If you care about modding you should keep it several files, so that one can be altered separately. Also, how are you compressing it? How will it be more powerful than the original game? You don't have the original source code. At best you have source code that does the same as the original source code.

Did you even compile the whole thing once? If not, how do you know that you're not breaking it by "compressing" it? How do you know that you'll ever be able to compile it into the working game?

Quote
I would post a snippet of the code, but right now, my coding computer is undergoing a massive overhaul, and the data on the drives is currently inaccessible.
I would really like to see such snippet. Right now I don't even believe that you are doing this, because it sounds so improbable and impossible. If you cannot post source, you should at least be able to explain how you're editing it (e.g. refactoring classes), to show us that you know what you're doing.

Also: Which language are you using now? Still C#?
« Last Edit: April 25, 2011, 05:52:11 AM by TH300 »

Offline Zardox Xheonov

  • Sr. Member
  • ****
  • Posts: 274
Source Code?
« Reply #47 on: April 25, 2011, 08:05:12 AM »
If your rewriting the game, you may want to keep these in mind:

-Ability to add/modify new/existing units/structures with an easy to use program.

-Ability to edit/change player colors by simple use.

-Make some sort of translator, where as .map and .dll are compatible with the new rewrite (or) be able to read and translate older files into compatible files (if older files don't work with new rewrite).

-Ability to store more tilesets at a time.

-Ability to allow two human players to control the same colony (could be useful for helping newbies). And share the same interface.










----------------------
I know most of these ideas have been suggested before and would be nice to have... Probably after you finish you could place some of these features in... Though some are pretty hard to implement.
« Last Edit: April 25, 2011, 08:05:45 AM by Lord Of Pain »
Hit me up on discord, if I am online, you know I'll be gaming.

(Lord Of Pain is no more, I am currently now "Zardox" and have been for awhile on other platforms.)

Offline BlackBox

  • Administrator
  • Hero Member
  • *****
  • Posts: 3093
Source Code?
« Reply #48 on: April 25, 2011, 06:00:39 PM »
I am quite skeptical considering comments such as "All the DLLs have been cracked and open and rewritten. Yes, thats right, I have cracked the DLLs open like a book, and rewritten the code, updating some surprisingly massive bugs" is not how I would expect a software engineer to describe such a project.

"The data on the drives is inaccessible" and complete lack of source code (certainly it would be in some kind of version control system, probably offsite?) or even any specific details about the project or how it is organized also reeks of "vaporware."

Finally, "compressing everything into one massive EXE file" implies that it is a giant monolithic mess and not something that is at all maintainable or modifiable (and is also not how proper software engineers/companies write software).

If this project is real and does exist I will be pleasantly surprised but as a real life software engineer myself I do not see enough solid evidence to prove that it actually exists, much less that one person would be able to accomplish a perfect rewrite from reverse-engineered game code in the amount of time that has been given.

Offline ImpulziveMyztikalGuru

  • Newbie
  • *
  • Posts: 29
Source Code?
« Reply #49 on: April 25, 2011, 10:58:58 PM »
Understandable. I do apologize for not posting anything besides, well, posts, no files, but this project is not uberly important in light of work, and therefore does not get the attention I would like to give it. I do realize some of what I have said sounds sketchy, but if you meet me in person, youd see why  :P not that Im a sketchy person, im just not a very people person, and horrible at explaining things Ive done.

But, first things first: inaccessibility of game data... The storage unit that all my hardrives are normally kept in is in, uhm, lots and lots and lots of teeny tiny little pieces right now. One of the blades crashed and burned(literally), so trying to rebuild what I have, and upgrade in the process, thus the major overhaul. I hope the sheds some light there.

As far as not posting any code or anything, refer to above  ;)

Secondly: Technically, I am not doing this alone, but that is a whole nother can of worms that I really really dont feel the need to go into anytime soon, and Id prefer to not be asked why.

As far as bugs go, yes, they are actual bugs. Well, maybe not 'Bugs'. but dead code, extra 'poop' that literally has never done anything, and some code that, when you try and mod the EXE file and it doesnt work? Sometimes its because you have to code for those pieces that dont even really need to be there.

Moving on to compressing the file: It works kind of like a JAR file, but not really. Its something Ive tried to explain to friends through text, and not surprisingly, a LOT gets lost in translation. However, they way the file is currently designed, any program that allows coding in any of the Cs, or Java, will be able to open the file and modify it. However, not everything will be accessible unless you program in the original language, which yes, is still C#, but thats just because the compression is kinda stupid  <_<

BTW, on a quick beak, I didnt realize soo much would happen in this post in the space of a day, haha.

Moving on...
There is still much to be done. The games is nowhere near completion, and the menu barely boots as it is, just because, as you all who have worked on code have probably noticed, a lot of things have to work together, and not everything is there yet. Not going to mention the lines of code already written, Ive gone through 9 keyboards so far from typing so long, breaking keys off when I get frustrated  :find:

As far as Lord of Pains suggestions, those ideas are actually blocked out, and will be implemented when the time comes, as they are very, very good ideas. As far as storing more tile sets, how many would you like, ideally? I can make the program recognize, i believe, something around 3000 different tile sets. Not that youd use that many(at least I hope not), but it is, theoretically, possible.

Now, the idea of two people controlling one colony.......
Yea, about that......
The basic idea is blocked out, but Ive played with some hardcode for it, and its going to be massively difficult to implement. Something like that WILL actually be in a separate file, and both players of the colony must have the same version of the file for it to work. In the end, I dunno if anyone has used this, is going to be like an advanced version of Synergy, or a dumbed down version of Remote Desktop. This will be one of the few things that will be in a separate file from the get go.

Something that I think will make people happy:
I have set the initialization to look for certain file types when it starts, within the OP2 folder, like usual. This will allow less advanced programmers to make their own files, and the game will substitute their files for the hardcode in the EXE. Not very hard, just kinda drawn out to actually get it to work.

Some qucik parting comments:
BlackBox, good sir. Software engineer, second major in college. I am first and foremost a quantum physicist and mathematician. Thusly why I am very socially awkward, I usually dont like people  :P they seem kinda slow now  :( However, that was not meant to insult anyone, its just when you think in the time scales I do, a day seems like eternity, everything in the world seems to be slow now. But I do my best  :D

Also, at first glance, yes, it is a giant monolithic mess. HOWEVER, :) it is not. If you look at the notes, it is actually very, very organized, so much so it hurts MY head :P . It is not the most advanced or involved piece of software I have written, but it is a piece of art, I do believe. Also, that is why I am able to write everything on my own, because this is relatively easy compared to what I have to code on a near daily basis.

Now Im pretty sure Ive answered all the replies, but not positive :P So, if I missed you, I apologize, just let me know and I will tomorrow night. For now, bed calls my name :D