swfans / swars-re-helpers

0 stars 1 forks source link

Syndicate Wars Playstation Debug Symbols #1

Open Moburma opened 2 years ago

Moburma commented 2 years ago

Hi, Not sure if you are aware of this, but last year a prototype of the PlayStation version of Syndicate Wars was posted on archive.org (https://archive.org/details/SyndicateWarsJun21997prototype). What's relevant about this is that unlike the final game it appears to have the debug symbols file MAIN.SYM in its root. While this is of course for the substantially different PS1 version, it also has a LOT of entries for things that were cut out of that version, so possibly this may have been adapted from and be useful to the original DOS version. Maybe this would be helpful to the project.

Moburma commented 2 years ago

I finally had time to play with the editor build.. again amazing! The red pathing lines are almost what you see if you get in the cut mech in the final game, so I assume that must survive in the code there, somewhere. Looks like you can rotate some parts of the scenery too? I don't know if it was me but one of the bridges was rotating on its access.

mefistotelis commented 2 years ago

This is harder than I expected. But doable.

obraz

Moburma commented 2 years ago

Awesome! Do the routines for the menu options actually exist/work?

mefistotelis commented 2 years ago

They exist. Only a few are properly linked to the menu though.

mefistotelis commented 2 years ago

I wonder what's the story behind this:

void __fastcall unkn_add_fungus_unused(__int16 x, __int16 y)
{
  __int16 idx; // ST10_2
  struct SimpleThing *v3; // ST08_4
  struct MyMapElement *a1; // [esp+4h] [ebp-10h]
  __int16 xa; // [esp+10h] [ebp-4h]

  xa = x;
  a1 = &my_big_map[(x >> 8) + (y >> 8 << 7)];
  if ( !a1->field_E && !a1->field_10 )
  {
    idx = unkn_add_new_sthing();
    printf(" adding new fungus thing %d \n", idx);
    v3 = &sthings[idx];
    v3->X = xa << 8;
    v3->Z = y << 8;
    add_node_sthing(idx);
    v3->Y = 0;
    v3->State = 1;
    v3->Timer1 = 0;
    v3->Type = TT_FUNGUS;
    v3->Radius = 200;
  }
}
Moburma commented 2 years ago

That is weird! One thing I wonder is that the Psycho Gas has the following in its description: "Research into the narcotic properties of the Creation planet fungus have yielded the active ingredient of this dangerous hallucinogenic. The hand-held canister contains a mixture of fungal spores and an oxidising agent which is released in a cloud, causing psychotic behaviour in anyone within it." Maybe there'd be mushrooms that acted like Psycho Gas when you went near them?

mefistotelis commented 2 years ago

That could be it. There was a similar thing in Dungeon Keeper - fungus trap, which also was supposed to release a gas. And it was cut from there as well.

mefistotelis commented 2 years ago

I browsed through the whole alpha code now, identified interesting functions which come from the editor:

# grep UNUSED main-alpha1-demo.map
 0001:00020BC0       load_level_files_UNUSED
 0001:00022800       save_map_file_UNUSED
 0001:00022E20       save_map_file_psx_UNUSED
 0001:0002FFF0       brush_save_or_load_UNUSED
 0001:00031F00       mapedit_frame_unkn3_input_UNUSED
 0001:00034BD0       mapedit_unkn4_input_UNUSED
 0001:00035270       mapedit_draw_lights_options_UNUSED
 0001:00035890       mapedit_unkn07_light_test_input_UNUSED
 0001:00036360       unkn4_place_thing_input_UNUSED
 0001:00038C10       unkn_mouse_over_5_process_UNUSED
 0001:00039D50       unkn_mouse_over_1_process_UNUSED
 0001:0003BFB0       setup_screen_redo_UNUSED
 0001:0003C210       draw_mapedit_top_menu_UNUSED
 0001:0003C380       mapedit_topmnu_actions_UNUSED
 0001:0003CD40       unkn_lights_related_UNUSED
 0001:0003CEB0       mapedit_unkn6_input_UNUSED
 0001:0003DAF0       mapedit_apply_ambient_inputs_UNUSED
 0001:0003E720       unkn5_input_UNUSED
 0001:0003F010       unkn12_texture_UNUSED
 0001:0003FDC0       editor_input_UNUSED
 0001:0005EFD0       ql_swap_map_UNUSED
 0001:00060B90       mapedit_unkn2_inputs_UNUSED
 0001:0006A500       mapedit_thing_2_actions_UNUSED
 0001:0006BB50       mapedit_thing_create_delete_actions_UNUSED
 0001:000862C0       unkn_game_exit_input_UNUSED
 0001:00086B00       unkn_triangulation2_input_UNUSED
 0001:00086E40       unkn_triangulation_input_UNUSED

For calling these - I focused on the top menu, which turned out to be not that interesting (besides saving and loading map, there are only lighting-related commands). But I did made it functional.

Maybe the second menu will be more rewarding. If I can enable it.

Moburma commented 2 years ago

It's interesting that it looks like it can save PlayStation version maps as well. There's the early progress report video that claims to be from the Playstation version that is clearly from the pre-alpha build, but has some minor differences, with the buildings blowing up in a really odd simplistic way and with what looks like coloured lighting. I guess the two versions were pretty similar at this point (it's claimed the PS1 version was even the lead for a while!) until the feature set for the PC one must have gotten too complex and they diverged.

mefistotelis commented 2 years ago

Ok I think it's time to move to a different project.

I enabled both the top menu and the other (half-transparent) menu. There are probably other things to enable, but I already spent too much time on this. I was hoping for a simple map editing menu, ie. putting roads and changing ground shape; it's probably still there somewhere, I've seen functions which seem to do such things, but the menus I enabled doesn't seem to have that.

So here is my updated binary: https://mega.nz/file/MZEjVICA#T6y9hIiwolI64XAdXb7o48nImAvWsHy5dcemYsYj5GE

Some control keys (after you enter the editor mode with G):

Interaction in lights edit mode:
'NEW MAP' / Backspace   - no action
'LOAD MAP               - load map file
'SAVE MAP'              - save map file
'LOAD LEVEL'            - load level file
'SAVE LEVEL'            - save level file
'SWITCH MAP' / J        - no action - probably should call ql_swap_map_UNUSED
'COMPRESS MAP'          - compresses current map in memory
'QUIT' / Shift+Esc      - exit program
'DELETE PEOPLE'         - remove all people from map
'LOADSA TEXTURE'        - place all kinds of textures on non-textured ground
'SHOW MEMORY'           - shows mem usage screen
'COMPRESS TEXTURES'     - prepares texture set
'SYNC TEXTURES'         - clears some fields in textures
'RESET ROAD LIGHTS'     - resets light params within objects
'PLACE AMBIENT LIGHT'   - should work
'DEL AMBIENT LIGHT'     - should work
'RECALC LIGHTS NS'      - should work
'RECALC LIGHTS WS'      - should work
'DELETE ALL LIGHTS'     - remove all lights from the map
'LIGHTS'                - no action (whole menu)
6                       - Ifreq/damp/gravity edit mode
Ctrl+V                  - Clear things and add a vehicle (?)
Shift+F7                - ?
F3                      - Switch to edit mode 18 (shows a menu)

For the menu triggered by F3 - I didn't checked that in detail.

Moburma commented 2 years ago

Awesome, thanks! It's amazing to see all this working again. I've briefly been messing about with the F3 menu - that seems the most interesting part and also seems to work pretty well. You can place NPCs and get them to do stuff from here. I think there will be some clues in there as to how the mission file data is setup/used. I was also surprised to see the list of levels already in the final game format (c00x00 etc) as well. One thing I found - highlighted objects (buildings etc) can be deleted by pressing D on the keyboard, that already worked in your last version. Oh, do you know how to show the mouse pointer? It seems to default to not visible, but I managed to accidentally get it working a minute ago, it's obviously much easier to use with it! The vehicles appear in-game if you save the map and then start on that map: https://ibb.co/6Z1TFWp https://ibb.co/HCW89Ht https://ibb.co/gwVDGMG One thing I noticed a while ago is there are odd levels included with the final game that don;t work and seem to be in the wrong format. I will try loading them into the editor... Also, are the editor buttons actually used at all in the code?

mefistotelis commented 2 years ago

Mouse pointer - I made it so pressing g in gameplay mode switches to editor, switches to high res and enables the cursor. So run with -m1, then hit the g and cursor will be there. You can't get the cursor is low res mode.

Vehicles - ha, interesting. I though there's only one vehicle, didn't tried looking around for the others. (btw, not sure if you've noticed, but you can move around the map faster with shift pressed).

are the editor buttons actually used at all in the code?

Don't understand the question. Most buttons do lead to some function being executed. The 'lights' menu is an exception - it does nothing, and I found no functions in the code which would resemble these actions.

Moburma commented 2 years ago

Sorry, what I meant was these: https://ibb.co/vXWjzw2 There's the file DATA/EDITICON.DAT/TAB that contains these icons that were obviously from the control panel of one of the editors, I just wondered if they actually seem to be used by the code or just left in with the files.

mefistotelis commented 2 years ago

They do seem to be used, in 4 places:

obraz

.. but if you use -m1, they are not even loaded. So if you want the mouse cursor, you won't have the sprites.

Moburma commented 2 years ago

Hmm, I think they are supposed to be down the left hand side of the screen, like in say Deluxe Paint on the Amiga (well that has the icons on the right, you know what I mean!). I was running it deliberately with just the executable called and no arguments so it goes straight to the editor. There is no mouse cursor, but if you click around the lefthand side the screen it acts like buttons are being pressed, so I think that is where the buttons are meant to be. Also it eventually goes a bit crazy and the mouse cursor does appear, even running low res! Ahh, I see what you mean now. I think I am right, Basically there would be a column of buttons down the left edge of the screen. Some of them you click and hold on, and it expands to show more buttons for that option - this works if you load using -m1 and press G, although the icons are offset compared to where the mouse is. At least one halfway down zooms the screen in, and if you right click on it, it zooms out.

mefistotelis commented 2 years ago

Yeah, you're right - there is a menu. And there are even more light menus.

Here I called every of the functions listed before, minus those which crash when called outside of specific state.

https://mega.nz/file/AA9mhKZZ#6aZ26XxQAmv9vw-XR3dB7lFCsYj4nIKT2Y0hj_pgyJs

Moburma commented 2 years ago

From experimentation, I believe the menu looked like this: https://ibb.co/3hGxfHK The icons in the .DAT are in the order they are shown on screen based on the ones that are visible due to submenus, so this allowed me to work out the ones that are not visible. That said there are still another 6 icons (including the high res/low res toggle and the weird bubble thing that I guess was the scanner), and I don't know where they would go as not only there's nowhere that responds, but also no room on the left of the screen!

EDIT: Wow, holey moley, you did it! Also looks like I was 100% correct on the icon placement too, but I never would have guessed the second lot were offset.

mefistotelis commented 2 years ago

Calling all functions in one state has some bad side effects, but that's the way to show everything. Ie. mouse buttons are used for various things in different functions, so here you never know what will happen. Usually you will place a light, but sometimes the mouse state may switch in different function (it is switched via interrupt), and ie. place a lamp post.

I'd put the functions into proper states, but I don't know which one should be called under which conditions. The light placing, maybe it should be after selecting "place ambient light" (this command sets unkn1_editor_state to 0x1A). Though the lights you place look like normal lights, not ambient lights. So I don't know.

And I can't see a state for placing lamp posts as well.

Moburma commented 2 years ago

Yeah, I imagine it would be a lot more work for not much gain (there's not much more you can actually do with it, even if it was all working!). One thing I tried was loading final game maps into the editor. This seems to crash if you start using that map using the -m argument, but they load if you start using the demo map and then choose them from the menu. Of course the map format is totally different so it's just spikey gibberish shown. The most interesting result was with map074 - the simplest one in the final game (it's just a building on an empty plain). That generates errors about the lights: https://ibb.co/X7YGXqk It also shows the debug mode from the later demo was present already at this point. I think you can skip the error using escape, but it just has too much wrong so keeps coming back up. Not really very helpful, I just thought it was unusual behaviour.

mefistotelis commented 2 years ago

I mostly took the time to enable these things to check whether that could be added to SW port. And it looks like general structure of the maps is the same, there are the same arrays, only some have shorter rows (ie. dwords switched to single bytes), or longer rows (one or two fields added), or the array has different total length (most arrays were either shortened or expanded in final).

So if Syndicate Wars Port reversing was more advanced, it would be possible to add these functions to it. With the symbols from PSX, this became doable. But that would be still months of work.

Moburma commented 2 years ago

Ahh I see. I've never paid much attention to the map file structure, I thought it would be beyond me. Maybe I'll have a play and see if some hacking about of the structures gets one working in either the editor or in the final game.

mefistotelis commented 2 years ago

The Alpha version loads all arrays directly in code:

swars_load_map_file_alpha.c.log

And final version defines a list of elements, and then iterates through that list:

struct QuickLoad quick_load_console[19] =
{
  { NULL, &my_big_map, 18, 16384 },
  { &next_floor_texture, &textures, 18, 800 },
  { &next_face_texture, &face_textures, 16, 800 },
  { &next_object_point, &object_points, 10, 2000 },
  { &next_object_face, &object_faces, 32, 2000 },
  { &next_object, &objects, 36, 120 },
  { &next_quick_light, &quick_lights, 6, 4000 },
  { &next_full_light, &full_lights, 32, 10 },
  { &next_normal, &normals, 16, 3500 },
  { &next_object_face4, &object_faces4, 40, 2000 },
  { &next_anim_tmap, &anim_tmaps, 54, 50 },
  { &next_traffic, &traffic_nodes, 36, 50 },
  { &next_light_command, &light_commands, 36, 50 },
  { &next_vects_list, &col_vects_list, 6, 1000 },
  { &next_col_vect, &col_vects, 14, 600 },
  { &next_walk_header, &walk_headers, 4, 0 },
  { &next_walk_item, &walk_items, 2, 0 },
  { &next_col_column, &col_columns, 16, 0 },
  { NULL, NULL, 0, 0 }
};

But it ends up filling the same arrays. Well, the final version also reads some pathfinding triangulation arrays separately after everything from the list is loaded.

Moburma commented 2 years ago

A bit off topic, but in case you're interested someone has taken your lead and managed to get the level editor for the pre alpha demo of Theme Hospital working as well: https://tcrf.net/Proto:Theme_Hospital Looks like all the early demos on that CD had editors built in (looks like Creation does too).

mefistotelis commented 2 years ago

Ha, this seem to be the case for every Bullfrog game.

Genewars beta also had an editor; I used it to make the maps of levels: http://genewars.lubiki.pl/html/desc_levels_conq.php

It looks like that was the development style at Bullforg - they had no clear view on what the game will be, they were just developing tools until that gave the game a direction.

For Creation demo - it was quite early in development, but there are some objects which were not used for the demo. The executable has debug symbols, so is easy to analyze. Dolphin, killer whale, fungus, mines, some lasers, torpedoes - there are several interesting types of objects implemented. Editor functions are never used, similarly to SW - so would require binary hacks. For example, there's a function generate_world() which seem to create ground with hills, caves, and something called abyssal.

You can extract the debug symbols to text form using the tool I created: https://github.com/mefistotelis/watcom-wdump (Genewars beta has full symbols as well, extractable by the tools)

Moburma commented 2 years ago

Yeah, I actually did quite a bit of delving into Creation at the start of the month and found all of those: https://tcrf.net/Creation It also has unused models for things like divers and various drones/submarines, and some kind of file for generating cave terrains. The commandline options also mostly actually work already which is unusual. Very interesting game, I hope someday one of the final builds of it get leaked, but that looks extremely unlikely... It also has some of the exact same dummy files as the SW pre-alpha like text.dat

I was looking through the syndicate wars pre-alpha and that has some interesting looking models too, it appears to have early models for the trains in the files.

mefistotelis commented 2 years ago

Nice.

For Creation demo command line options, here's the full set:

    if ( strcmpi("network", &arg) )
    {
      if ( strcmpi("players", &arg) )
      {
        if ( strcmpi("session", &arg) )
        {
          if ( strcmpi("record", &arg) )
          {
            if ( strcmpi("playback", &arg) )
            {
              if ( strcmpi("movie", &arg) )
              {
                if ( arg != 'e' && strcmpi("editor", &arg) )
                {
                  if ( strcmpi("debug", &arg) )
                  {
                    if ( arg != 'h' && arg != 'H' )
                    {
                      if ( arg != 's' && arg != 'S' )
                      {
                        if ( arg != 't' && arg != 'T' )
                        {
                          printf("ERROR : Incorrect command - %s\n", &arg);
                          v67 = -1;
                          break;
                        }
                        tabgen = 1;
                      }
                    }
                    else
                    {
                      v6 = 1;
                    }
                  }
                  else
                  {
                    debug = 1;
                  }

"players" takes an integer after it. "session" takes a string "record"/"playback"/"movie" takes file name, but there's a default of "RECORD.PKT" if not provided the rest have no additional arguments.

mefistotelis commented 2 years ago

A bit different subject, but you might be interested - While Dungeon Keeper was being developed, there was an early version where player hired creatures directly (by selecting from a list), and collected souls of enemies. Is is vaguely described here: https://tcrf.net/Prerelease:Dungeon_Keeper

What is missing there - is info about speeches from that version. The recording session was published as goodies somewhere. I divided them into single lines, and you can check them out here: https://github.com/dkfans/FXsounds/tree/main/speech_eng2_marsha

Moburma commented 2 years ago

Ahh that's interesting. One problem is I've never actually played either of the Dungeon Keeper games! I've had copies for over 20 years but never got round to playing it. I already have stuff like the early pictures in the Bullfrog Upcoming Games demo for it, but I just don't know the game to say what is unused or not! I definitely need to check it out and look into it.

The speech files are interesting, a similar situation occured with Theme Hospital. The PC version broadly only has files that are used/categories they intended to use with the rest clearly cut out, but the PlayStation version has the complete recording sessions for the PA announcements on disc including all kinds of early recordings that don't fit in the game at all.

mefistotelis commented 2 years ago

Look at that, the game is capable of quite high resolutions. There are only issues with HUD and zoom. This is SW Port, hacked to enter video mode 25: swars-hires

Moburma commented 2 years ago

Wow, that looks fantastic! Something I always hoped would be possible with the port. As we now know, the game was always intended to be zoomed out and with more visible on-screen anyway. The funny thing as well is a lot of the alpha build screenshots have similar issues with the HUD and map etc being wrongly placed/sized, so this is not the first time the game has had this problem!

Oh, and off topic once more, I put up some very old pictures of Genewars in its earliest form, not sure if you had seen them before: https://tcrf.net/Prerelease:Genewars#CU_Amiga_magazine_February_1994

Moburma commented 2 years ago

Something interesting I discovered today: The original release of the Syndicate Wars Beta demo was actually on an issue of PC Format magazine. What's significant about this is it actually came with one of the CD audio tracks as a .wav file! I'm not sure this is any different to the final game's music, but I will check and see. Even more interestingly the CD has loads of video files of interview with Peter Molyneux talking about the game and other Bullfrog titles, including one video about Genewars and how it originally began development in 1989!

mefistotelis commented 2 years ago

Will take a look.

Btw, the "Unused text" chapter: https://tcrf.net/Syndicate_Wars_(DOS)#Unused_Text

All these texts come from one place - reason of your scientists dying after a mission. I usually get more scientists deaths when I invest a lot of money in research. But I'm not sure what the algorithm is. I mean, not sure what affects the random factors.

Anyway, in mission debrief, you can be informed about some (1-2) of your scientists dying, with an indication of the cause.

So, these are "rare texts", but not unused.

Moburma commented 2 years ago

Ahh, ok, I've never seen that! I haven't played the campaign properly for like a decade at this point, I should probably play through it again.

Moburma commented 2 years ago

I started trying to work on your old SWLevelEd application, but I'm too dumb to do proper C code and got stuck trying to do more complicated operations. Therefore unfortunately I had to dumb it down and make my own script using Powershell (don't laugh!). Anyway, it does a few things your reader couldn't do yet, like listing the weapons people have, and naming their group memberships. If you're interested, it's here: https://github.com/Moburma/SWLevelReader

Moburma commented 2 years ago

I've written a level convertor script to convert pre version 15 levels to work with the final game. It's quite simple functionality at the moment, it just strips the extra 48 bytes from each character, moves the group membership data from what is the BumpMode data in the final structure and also the ComHead data is moved to the right place. The end result is the level loads and NPCs are visible and (I think) mostly behave correctly. Vehicles are still bugged with that invisible/corrupt glitch, but that's because they are missing their initial orientation data from the extra 36 bytes of vehicle data. I've fixed this by hand before, but need to figure out where that data is/a more robust fix. All characters are also missing weapons currently, not figured out where that is yet. Also characters are slightly corrupt and have bits of their animations not showing, but I have previously fixed that by hand, at least for the NPCs, player characters remained not working yet.

I will release it on Github once it's more mature and does more things.

Here are some example screenshots of the cut Unguided level Talks Ambush (mission 67):

https://ibb.co/LJzxRG5 https://ibb.co/zH3508F https://ibb.co/kqzj9jh

I think it's safe to say no one has seen this level in action for 25+ years...

mefistotelis commented 2 years ago

That's nice!

Later we can modify swars-port to allow adding additional campaigns. I was thinking about replacing the ALL*.MIS files with text-based format, INI-like. Not any time soon though.

Moburma commented 2 years ago

I've finally got my level convertor mostly finished now. I was stuck for a while with a weird bug where all characters on a level were invincible, but that turned out to be because their UMOD variable was over a certain number (was bad data obviously for another field). As a preview, here are three Unguided levels that are working well: https://easyupload.io/oiwxga This includes mission 68 (which was clearly going to be the first level of the Unguided campaign as it apes the start of the other campaigns), 66, and 70. The only real problem is I haven't started on reverse engineering the vehicle stats yet, which means the visual glitch is there (although it only affects stationary vehicles and flying ones) but more importantly vehicles only have 1hp and die if anyone looks at them funny! Otherwise I think most things are working and missing fields have been found. The missions can all be completed and NPCs seemingly behave correctly (although the weak cars make things a bit difficult).

The other big thing to do is work out the UMOD values. These seem to setup all kinds of states for NPCs. Currently the level Talks Ambush is unplayable, as a load of NPCs who are clearly meant to rush you at the end of the level appear at the start and just steamroller you, and it must be this stat that controls them. It's a really interesting level that's maybe the most advanced one I've found, you start with four Unguided with no weapons and have to go and meet with Eurocorp in an alleyway, presumably for some kind of peace deal. They also have no weapons, but once you enter they grab some nearby miniguns laying on the floor and open fire, and then more (what must be hidden) armed agents pour out of a nearby building. You have to run away to the south where there are lots of weapons stashed and use them to take out the agents. Then there seem to be a load of super high end agents AND punks with plasma lances who appear as reinforcements for a final huge battle. At the moment the plasma lance agents start almost next to you and just vaporise your guys while they are unarmed...

Moburma commented 2 years ago

I uploaded my level convertor: https://github.com/Moburma/SWLevelConvertor Still has issues with flying vehicles, but otherwise works very well. Edit: That made me realise what the problem was, fixed!

mefistotelis commented 2 years ago

Good stuff. Do we need a new all000.mis to play these, or just use one of the older files?

Moburma commented 2 years ago

Well, it depends if they are defined in there or not. If you check on https://tcrf.net/Syndicate_Wars_(DOS)#Unused_Levels I've started listing levels that are defined but need conversion, there are about 10 or so like this you can convert and play right now (mostly unguided levels, I've updated that page too with new screenshots and info on converted levels). Other ones you would of course need to edit ALL000.MIS, or what I tend to do is find another mission on the same map and overwrite its file and use that mission entry to play. The mission objectives will be screwed up, but that will be the case no matter how you do it unless you sat down and re-wrote them. The very oldest levels tend to be simplistic test levels rather than proper missions, predictably enough. I've started writing some of these up, but it's a mammoth task and actually a lot of the working but non-allmiss defined levels are more interesting anyway (there are a LOT of unused Lucy De Saxo levels in there). I have a complete list of level files vs file version I will stick up on the Notes page as a table which shows which levels can be convered. It's fairly interesting as you can clearly see often down to the day when Bullfrog started and stopped using each new file version when charted vs datestamps.

I guess my next step would be to write an allmiss editing tool, I've already created tools to dump out allmiss and the individual mission objectives using the helper data structures, just not released them. They also show that there was at one point support for losing missions and getting a different path through the game as a result, but that isn't used in the final game at all.

Moburma commented 2 years ago

Something interesting I found - early pre-alpha footage that shows some basic editing of lights: https://www.youtube.com/watch?v=CdXeVnncnts Oh, also a Dungeon Keeper Alpha video from the same CD: https://www.youtube.com/watch?v=LjyPn_8nMSQ

mefistotelis commented 2 years ago

Yep, interesting. Thanks for sharing.

Would be funny to have a bonus level where you control the car directly, like in the video.

mefistotelis commented 2 years ago

For the levels you've checked and converted, maybe you'd like to improve the level descriptions I have on the site: http://syndicate.lubiki.pl/swars/walkthrough/swars_levellist_pc.php

Here's how these descriptions look in source form: walkthrough.zip

Moburma commented 2 years ago

Yeah ok, will do! There're already some of them filled in here for the unguided levels: https://tcrf.net/Syndicate_Wars_(DOS)/Unguided_Campaign Not sure if they allow people to reuse content from there, I wrote it all, but I suppose by using their site they own the copyright. Anyway, I will write up the remaining levels defined in the .MIS file for you. I'll work through non-defined levels, but probably just do a brief summary, the really early ones are just crude test levels with no real point to them.

Also literally only a few hours ago I worked out how the version 12 vehicle health works - it's to do with the file version. If the file is version 17, it uses the armour field. If lower than that it seems to work another way, I think either all vehicles just have the same health or it has some kind of hard coded table for each type (need to test that). So setting my converted files to version 16 and not filling in the armour field seems to work correctly. I will update my convertor once I have cleared up some more of the junk data still left in some fields.

Oh, also one more thing, does your version of the Windows port actually run on Windows at the moment? If I compile my own version I get an error, so I assumed it was me being dumb, but the Github artifact has the same problem. If this is a known issue then nevermind, but if not I will log an issue. I get the error "the proceedure entry point _ZSt28_throw_bad_array_new_lengthv could be be located in the dynamic link library [executable name]" on startup. It works fine with the last official release of the project.

mefistotelis commented 2 years ago

The Syndicate site - I could put the *.php files into git repo, so that it is easier to modify and track changes. Let me know if you prefer that over the .zip I attached.

SW Port builds - the error is due to different version of libstdc++. If you will compile it on your machine, it will work. Or you can update your MSYS - the build system probably uses latest version.

Hm, maybe I should include the DLL files within the package. Otherwise, only small chunk of people is able to use these built artifacts.

Moburma commented 2 years ago

Ahh you were right, I used the copy of libstdc++-6.dll from my mingw32/bin directory and that got it working.

Moburma commented 2 years ago

FYI, I discovered a small part of the original Syndicate source code and Bullfrog libraries were released on an old PC Format coverdisk, here (they're in the archives FROGLIBS.zip and PCFBULL.arj): https://beigebox.co.uk/retro/CoverdiskArchive/PCFormat/PCF_Issue023_Disk01.zip Not sure if this is in any way useful, but might as well let you know if you weren't aware.

mefistotelis commented 2 years ago

Wow, so that was released back in 1993.. if I knew it 15 years ago I would likely start remaking that game instead of Dungeon Keeper.

Today, communities around various Bullfrog games contacted many of the old employees, and got some old disks. We have parts of the newer bullfrog libraries (they were versioned - ie. in 1994 there was Library 5, in 1995 - Library 6, then Syndicate Wars and Dungeon Keeper were released using Library 7. One of DK developers even released his diary, where the moment of switching to Library 7 is clearly marked. Populous TB used Library 8.

For some versions we have more sources, for others there are only object files and headers - so there are still many holes in what is available. Also several disks had bad sectors.

When making KeeperFX I didn't had any source of any library, so this is a completely new implementation. And I'm keeping that approach with current work on SWars Port - everything there is a new code.

Moburma commented 2 years ago

I spent some time looking at the Playstation version of the game. Not that interesting, but a few revealing things. This guy has a full playthrough of the Playstation version on Youtube, which is useful for checking some things. He also includes a link to a cheat engine file for the NTSC version of the game that has useful stuff that I played with, including setting mission via CALL000.MISS number and giving all weapons etc. Trying to load the cut levels is a bit of a dead end, as I think you discovered before - it looks suspiciously like they use a different level format, as I can't believe they can all just be empty maps. Messing with the weapons is more interesting. As in the DOS version there are the two cut weapons that use the cut video for the equip screen. What is funny is that if you equip these in the DOS game it shows a piece of corrupt UI instead of the weapon icon. If you do this in the PS1 version it does the same - and shows a piece of the old console UI visible in magazine coverage! https://ibb.co/R6gdWtB The disc also includes .TIM files that have all the UI and textures etc, but they seem to be non-standard for the format. They are just about visible through various viewers online, and they show that the old UI is in fact included with the game. https://ibb.co/kST3rf3 Interestingly it includes new versions of the PC menu icons, and even includes the PAN icons still. It also has odd stuff like the letters "SS", AND it still has the weird objective icons that are not used in the PC version. I was going to suggest a new option for the port to use the Playstation version's soundtrack cues (as it doesn't just play track 1 all the time like the PC original), but actually I worked out it uses a weird and fixed format of its own anyway - it just plays the same pattern of tracks for every level through the game. It just plays track 1, 1, 2, 3 for each subsequent mission and then starts the pattern again (so mission 1 is track 1, mission 2 is track 1, mission 3 is track 2, mission 4 is track 3, then back to 1, etc). I'd hoped they had matched the feel of each level to a certain track on the disc, but it's not that well thought out. Kind of a shame as a I love the soundtrack but rarely remember to advance past track 1.

I also wrote up all of the cut missions for you, but got bogged down trying to make mission objective maps. I found it hard to work out the positioning using the overlay method, so was just going to paste the markers on the maps as you did in the older ones on the site, but it's not finished yet.

mefistotelis commented 2 years ago

I see you've got "Level File Naming Convention" chapter in notes. You may want to improve the extension explanation.

Within 'Mission' struct, there is ReLevelNo and LevelNo. One of these has the sign changed (lvno = -LevelNo) and then is provided to a function which formats file name and loads the level:

  if (lvno < 0)
  {
    lvno = -lvno;
    word_1C8446 = 1;
    if (lvno <= 15)
      sprintf(lev_fname, "%s/c%03dl%03d.dat", levels_dir[0], current_map_no, lvno);
    else
      sprintf(lev_fname, "%s/c%03dl%03d.d%d", levels_dir[0], current_map_no, (lvno - 1) % 15 + 1, (lvno - 1) / 15);
    if (lvno > 0)
      current_level = lvno;
  }

So simplifying, file name is: C<MapNo>L<LevelNo%15>.D<LevelNo/15> And if LevelNo/15 is zero, then the extension is just .DAT. Getting back the complete level number is easy:

LevelNo = NumberFromExt * 15 + NumberTwoFromName