Jump to content

TiberianSharp (formerly Luftballon) research thread


ShadowDog

Recommended Posts

I know the language thing isn't remotely like what TD uses; my idea is to make it so you can switch languages mid-mission, and also to let a half-implemented language fallback to another language. In my library, the language order is English, Spanish, French (due to being similar to Spanish), and German, though in TibSharp, it's English, German, French, Spanish. I'm planning on implementing the same thing for textures, too. Also, I'm planning on de-hardcoding it so that it uses the 2 list system I outlined previously.

 

I'm heard that C# doesn't do palettes, only shaders, and that I'd need to either have multiple textures that I manipulate on initialization to replace their colors with whatever they should be, or write a shader that does that, which I hear would be a performance hit. Since I'm going to be creating the

Image

from scratch anyway, I'll probably just use fastpixel (which I have a program I can reference, thankfully) and create a

CNCFakePaletteSHP

class that holds all the sides' paletting of a SHP. Considering that even if I could get it to do palettes, it'd still have to be broken into multiple

Image

s, that'll be a PITA.

 

Unless, of course, fastpixel is faster than the speed of freaking light and I could have it convert hundreds of SHP-data-thingys into an image per-frame. Argh. I'll probably ask godly-cheese to make a giant mission (bigger than SS/RA's maximum map size) with a stupid amount of units to stress test the thing once I've made a map editor.

 

Edit: Opps, fastpixel isn't a library, it's a random class in ClassicMap, which is a Pokemon map editor. Argh. Anyway, research time, I suppose.

 

Edit2: Changed some hacky stuff into a flexible function, and it hit the fan. I finally tracked it down to an XOR statement. The main problem was what the fuck is an XOR statement and why shouldn't ^ be the exponent symbol. I haven't even gotten to anything involving bit-shifting or whatever yet and I'm already finding it to be a PITA.

Link to comment
Share on other sites

and also to let a half-implemented language fallback to another language.

Mine does that... simply by first reading the default language's settings, and then using these values as defaults for reading the actual one. I'm also working on an ini-based strings system to do both partial and complete replacements of the strings files.

 

I don't really get the storage system associated with your languages code though... but it reminds me of InnoSetup, where you can set custom strings for any number of supported languages, like this: (taken from the C&C95 v1.06 patch installer)

 

eng.langchoice=Set the game language:

ger.langchoice=Wählen Sie die Sprache für das Spiel:

fre.langchoice=Configurez la langue du jeu:

 

eng.reschoice=Screen Resolution:

ger.reschoice=Bildschirmauflösung:

fre.reschoice=Résolution graphique:

 

Though I'm not sure how you'd implement that for the entire game... it uses numerical IDs, not strings.

Link to comment
Share on other sites

I'll parse the conquer.eng/.etc files, making a new MultiString for each that has it's values set accordingly. After that, I'll read whatever files those were that patch the conquer.* files. The MultiStrings are going to be in a list, BTW, so I can just call them up by index.

 

I'm not going to be handling absolutely everything the way TD does. For example, while TD has it's pre-briefing briefing (the part that shows up after you select a territory, but before you actually load the mission) call up string number x, I'll first check to see if the mission's .ini has anything on it, then check some .ini file for that info. You already wrote down that info, and I made it into an .ini file and shoved it somewhere in Luftballon. Once I finish up .mix loading, find a good way to store the canonical versions of the files in memory, parse the .tmp and .shp files, and figure out how to use palettes in a shader environment, I'll get around to getting the fancier things like actually loading text. For now, I've just finished getting back on a normal sleep schedule, so I'll be around 7PM before I'm ready to screw with TibDawn some more.

 

P.S. Played some more Black Ops. today. Kicks GoldenEye Wii's butt.

Link to comment
Share on other sites

Level editor? Pfff, the Renegade Red Hat 8 FDS contains most of the code from the win32 version of the game, including parts of the singleplayer and it has all the symbols!

 

CCHyper: APOC gave them parts of the source code and stuff. One guy got close to one of the devs and accidently found that source code on an open directory owned by the dev. He ragequit and leaked it out. He''s been acting like a total retard for years so it's kinda amazing how he got so close to the dev. :/

 

ShadowDog: Did you take a look at OpenRA, it also implements C&C1/RA1 somewhat with C#. Although you'll probably only want to use small parts of what they have, they use an OpenGL wrapper for C# and they support Mono.

 

What kind of university allows projects with dutch code comments to pass? lol

Link to comment
Share on other sites

What kind of university allows projects with dutch code comments to pass? lol

Um, a Dutch-language university, duh. I live in Belgium. IIRC they specifically asked to make the code Dutch... most informatics teachers here are unfortunately people whose only knowledge of English comes from the programming. Their English pronunciation is usually pretty atrocious, too :P

Link to comment
Share on other sites

Wasn't the DOS version (or was that just the installer)? Or am I confusing what 16-bit actually means?

Just a quick note on that... the C&C95 CD installer is a 16-bit windows program. The DOS installer is 32-bit though. Yes, it's silly.

Link to comment
Share on other sites

Wait, so would I be able to run the DOS installer on Windows 7 without DOSBox or similar?

 

Also, lets say that I made a program that looked at all the jumps, noted them, and automatically went through and output an ASM file where the jumps pointed to labels. What would the problems be with that? The only one I can think of off the top of my head is the possibility that the "JMP" is actually just something with the same byte as the JMP opcode, but not actually a JMP (Data, or an argument to another opcode). Shoot, I'd have to go through the whole file, jot down (in a List<WhateverProject_Opcode>) what all the opcodes are along with their arguments, and figure out what's data and what's not.

 

Nyer, if you're programatically going through all the opcodes, etc., is there any way to tell if you're in data vs. an opcode?

Link to comment
Share on other sites

Wait, so would I be able to run the DOS installer on Windows 7 without DOSBox or similar?

No, DOS programs are tricky that way... REAL 32-bit DOS programs don't exist, since DOS isn't 32-bit. They always have to start from 16-bit code and then do some ugly tricks to switch to 32-bit.

 

Also, lets say that I made a program that looked at all the jumps, noted them, and automatically went through and output an ASM file where the jumps pointed to labels. What would the problems be with that? The only one I can think of off the top of my head is the possibility that the "JMP" is actually just something with the same byte as the JMP opcode, but not actually a JMP (Data, or an argument to another opcode). Shoot, I'd have to go through the whole file, jot down (in a List<WhateverProject_Opcode>) what all the opcodes are along with their arguments, and figure out what's data and what's not.

That's exactly what a disassembler does... basically, once it knows where to start it can simply follow all possible paths the game can follow, and identify all code correctly that way. Though for that to work correctly, it needs to know absolutely every CPU instruction, of course. Also note that functions that exist in the exe, but are never called or referenced anywhere, won't be identified, unless you go to their start point and tell the program to start scanning from that point again. The fact most compilers align their function starts to 16 bytes makes this quite easy though. That way I found out C&C contains unused ini write functions for the unit/structure/etc sections; another leftover of its inbuilt map editor.

 

Nyer, if you're programatically going through all the opcodes, etc., is there any way to tell if you're in data vs. an opcode?

Once you follow a path, and correctly follow the rules of expanding opcodes, your scanner should be emulating what the actual X86 CPU does, and you should never end up in data. But you'll see a lot of code appear that LINKS to data without jumping or calling to it, and that way you can identify what is data.

Link to comment
Share on other sites

  • 1 year later...
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...