It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
https://klei1984.github.io/max/

And the list of vanilla bugs that it has already fixed:

https://klei1984.github.io/max/defects/
avatar
Malasquor: https://klei1984.github.io/max/

And the list of vanilla bugs that it has already fixed:

https://klei1984.github.io/max/defects/
I love this so much!
Hello Sal, if by any chance you know about any M.A.X. v1.04 defects that are not on the list yet, I would be more than happy to add them.
avatar
klei.604: Hello Sal, if by any chance you know about any M.A.X. v1.04 defects that are not on the list yet, I would be more than happy to add them.
Hello klei! Sorry for the late reply! Top from my head, if I recall correctly, there is a way to move the enemy units by holding shift and select a unit of the enemy BUT also yours at last. Clicking to move your unit, the enemy units mimics the movement. Though this is rather an exploit, I believe the Russian community found out about it.

I will have to go through old files with defects I can see. I believe, you mostly have them listed already on your page.
The A.I. usually broke the single player games by building weirdly. I remember one spot with two different constructor, overlapping in build space.

I have a bigger save file that has some issues. Might be related to other defects, that get saved and break the game after
eventually. Moving an engineer after he is finished, breaks the game with a stack overflow issue.

Might be more to find out there. Here is the file. Its from 2012 :O
www.sal4.de/new/max/SAVE100.zip

Thanks for all the hard work.
sal
Attachments:
I could not reproduce the multi select tool exploit to move non team member units. Maybe this was a thing in pre v1.04 M.A.X. versions. I tried in hot seat, single player turns and simultaneous turns modes.

Most weird defects are caused by running out of extended memory. In those cases heap or free store memory allocations silently fail. The compiler does not call constructors and simply assigns null to applicable variables. Usually null pointer dereferences do not crash the game as under DOS this usually points to something found in DOS 1k memory which is not being used by the game and the DOS extender itself extensively or at all.

In the Watcom C/C++ compiler the heap allocator and the stack are actually using the same XMS memory space without much protection. For non library functions the compiler emits a stack overflow test into each function prologue. If that test fails you get the stack overflow runtime error on your screenshot and the game exits.

There are a couple of cases where the game uses recursion and in those cases the call depth could go as deep as many units are in the game. In many cases huge local buffers are created on the stack too that makes things even worse.

The game also uses two hash maps that potentially use hashing algorithms that do not work properly when there are huge amounts of units present. I always wanted to prove this but I did not find the time yet. This would explain misplaced units like cones, slabs or tapes remaining after construction sites are left.

Even though save files them selves are robust, due to the above memory allocation and management short comings it could easily happen that anomalies are generated that are then saved and loaded into games.

I also observed once that two computer units entered close proximity and then one of them started to build a building that overlapped with the other unit. I could not capture this on a video unfortunately. This is defect #17 in the list and is very similar to what you described. In this case the paths manager uses an optimized path finding algorithm and when the path is walked the builders switch tasks and maybe this special use case does not check whether there is something in the way. In case of human players it is nearly impossible to instruct a unit to start building something at a location and parallel instruct another to move there as well. But the simulation in which the computer players live there are just three main steps to plan actions. Beginning of the turn, middle of the turn and end of the turn. Due to this the planning phase could easily instruct several units to move to somewhere and start to build there synchronously in which case four tile units could cause issues.

I loaded your save file and with my current setup, DOS/32A extender, 64 MB RAM for dosbox and enhanced graphics disabled the stack overflow issue does not happen and end turns progress fast.
Woah woah woah! I want MAX Port! This is better than the Sid Meier's Alpha Centauri unofficial patch!
avatar
klei.604: I could not reproduce the multi select tool exploit to move non team member units. Maybe this was a thing in pre v1.04 M.A.X. versions. I tried in hot seat, single player turns and simultaneous turns modes.

Most weird defects are caused by running out of extended memory. In those cases heap or free store memory allocations silently fail. The compiler does not call constructors and simply assigns null to applicable variables. Usually null pointer dereferences do not crash the game as under DOS this usually points to something found in DOS 1k memory which is not being used by the game and the DOS extender itself extensively or at all.

In the Watcom C/C++ compiler the heap allocator and the stack are actually using the same XMS memory space without much protection. For non library functions the compiler emits a stack overflow test into each function prologue. If that test fails you get the stack overflow runtime error on your screenshot and the game exits.

There are a couple of cases where the game uses recursion and in those cases the call depth could go as deep as many units are in the game. In many cases huge local buffers are created on the stack too that makes things even worse.

The game also uses two hash maps that potentially use hashing algorithms that do not work properly when there are huge amounts of units present. I always wanted to prove this but I did not find the time yet. This would explain misplaced units like cones, slabs or tapes remaining after construction sites are left.

Even though save files them selves are robust, due to the above memory allocation and management short comings it could easily happen that anomalies are generated that are then saved and loaded into games.

I also observed once that two computer units entered close proximity and then one of them started to build a building that overlapped with the other unit. I could not capture this on a video unfortunately. This is defect #17 in the list and is very similar to what you described. In this case the paths manager uses an optimized path finding algorithm and when the path is walked the builders switch tasks and maybe this special use case does not check whether there is something in the way. In case of human players it is nearly impossible to instruct a unit to start building something at a location and parallel instruct another to move there as well. But the simulation in which the computer players live there are just three main steps to plan actions. Beginning of the turn, middle of the turn and end of the turn. Due to this the planning phase could easily instruct several units to move to somewhere and start to build there synchronously in which case four tile units could cause issues.

I loaded your save file and with my current setup, DOS/32A extender, 64 MB RAM for dosbox and enhanced graphics disabled the stack overflow issue does not happen and end turns progress fast.
Ahh! Sorry for the extremely late reply. At the same time - thank you for your detailed reply. Defect#17 seems like something I have seen and mean. Very interesting to see inside the A.I. soul like this.

I just checked again with the multiselect and made 2 small videos showing it. The key to make it actually work is to hold the shift key and select the enemy unit first, then yours, click again on yours and leave the shift button unpressed.
Its a weird scheme, and you will see, in the first video I had to find out how to do it again. The second video shows it more clearly.
I downloaded the latest GOG version I had, setup_m.a.x._1.04_(21516).exe, and its on MAX 1.04, just to be sure its still there. You can't move an unit that is on an active construction job or similar. Also the unit you want to move needs to have speed left, otherwise it won't work.

Here are the Youtube links showing it.

https://youtu.be/Bd9c5pk_wrQ?t=23

https://youtu.be/Bd9c5pk_wrQ

How is the progress coming along? I am usually checking the roadmap and love every piece of new progress.
Thanks for the hard work!

Best,
sal4

Edit:

Ahahah, of course it had to crash in the first video :D
Post edited November 26, 2022 by Sal4
Hello Sal4,

thanks a lot for the videos! The crash is also very interesting as the game exits with an assertion test failing that I never saw trigger in the retail. I will try to reproduce them too and will document them soon in the related article.

With respect to progress, only 256 functions are left to reimplement out of the 5704. The current focus is the AiPlayer class and its 93 functions. This is the last remaining AI related class. This is also the core of the computer players' AI. It decides about strategies to use, actions to take, upgrades to research and such. After this is finished, only three major components will remain to be done. Majority of the UnitInfo class, half of the Units Manager module and most of the Remote module which is only relevant for multiplayer.

After finishing the single player relevant modules, the game will be in a workable state again in theory. It will surely have many reimplementation issues as it was not possible to test any newly implemented functions for like half a year, but I have some plans on how I could approach testing in a systematic way. The game uses pseudo random numbers to make a lot of decisions and the random number generator’s seed is changing with the date and time. I will hardcode the seed so that each run will play exactly the same way in two independent game instances. One will run the original implementation, the other will run the reimplementation. As soon as major game or player state variables start to differ I will know where to look for defects. Of course if I happened to fix some major defects that were present in the original and that leads to different game and player state, the approach will not work.

If the current work capacity and work complexity remains stable we are a few months away to complete all the above and in theory to be able to play M.A.X. Port.

After that there are three major topics to resolve. First is that the sound manager uses SDL_mixer which does not support loop points in digital sound effect samples. This is a huge problem as M.A.X. uses such loop points all around. The second one is that the MVE player needs to be finished which uses self modifying code and streaming digital audio. The self modifying code must be removed to become cross platform, the streaming audio needs to be synchronized to the render loop to achieve seamless playback even on low end machines. The third one is the most difficult. I need to reimplement the in-game netcode below the Remote module’s abstraction layer using UDP/IP for Internet play. This third one is required even for LAN play as I ditched the IPX network backend. Currently the network lobby is working, the in-game protocol does not.

It will take another year or more to do all of these parallel to fixing the identified game breaking defects.
I watched the graphics expansion you worked on:

https://klei1984.github.io/max/2023/02/19/Renderer-progress.html


Wow! Very interesting to see the main screen in such large proportions! And with so many objects existing in the space at once!

And a side note: I forgot how great the game music is! I usually have shut it off while playing the game over the past many years, but the menace, the foreboding, the warlike soundtrack sounded so good in the video.
avatar
Sarxis: I watched the graphics expansion you worked on.
I made a new blog post showcasing the current status and how to configure the latest public builds to use the new graphics settings.
avatar
Sarxis: I forgot how great the game music is!
I also like the ambient music a lot. Brian Luzietti made an excellent job. The music in M.A.X. 2 is also very similar even though it was made by another composer. In M.A.X. 2 the music was adaptive which means that the mood or feel of the music changed depending on what happened in game.
avatar
Sarxis: I watched the graphics expansion you worked on.
avatar
klei1984: I made a new blog post showcasing the current status and how to configure the latest public builds to use the new graphics settings.
avatar
Sarxis: I forgot how great the game music is!
avatar
klei1984: I also like the ambient music a lot. Brian Luzietti made an excellent job. The music in M.A.X. 2 is also very similar even though it was made by another composer. In M.A.X. 2 the music was adaptive which means that the mood or feel of the music changed depending on what happened in game.
Wow! Looks great. It'll be fresh being able to stretch out the visuals to 16:9! The UI re-scales nicely now.

Have you made the SDL executable public? I'm not actually sure where it is uploaded to.
Post edited March 13, 2023 by Sarxis
avatar
Sarxis: Have you made the SDL executable public? I'm not actually sure where it is uploaded to.
All latest GitHub Actions builds are publicly available here: https://github.com/klei1984/max/actions . After some time older builds are removed by GitHub automatically though.

E.g. the last commit to the so called master branch was made yesterday. The commit message was "Fixed defect 156.". Clicking that entry in the build list opens up a new page. At the bottom of that page there is a section called Artifacts which contains a link to an archive which contains the Linux deb and Windows nsys installers. The archive is always called build artifacts. Direct link to the aforementioned build: https://github.com/klei1984/max/suites/11507240672/artifacts/594810943 (roughly 22 MiB).

A proper release is not created yet as even the latest build contains various game play issues. E.g. currently I am investigating a reimplementation issue that prevents computer players from using air transport support. There is a related issue that gives wrong path finding results to land units which forces them to rethink what should they do next.

As long as I can identify reimplementation issues on a daily basis and the backlog of known issues is not empty I do not attempt to make a release as it would become outdated too fast.

The game is already playable though. In the last couple of weeks I was able to complete all training and campaign missions from first to last on Expert difficulty. In general the computer players are dumber than they should be due to the remaining reimplementation issues lurking around in the AI code, but none veteran players will not notice this. The game does not crash that often anymore either. Actually the only crash that I experience nowadays is also related to air transport usage of computer players in certain hard to reproduce corner cases.

It is possible to start custom games without configuring any human players. This allows two or more computer players to play automatically against each other without the need for any human input. I just fire up the game, watch the computer players, and inspect their thought processes via various built-in debug menus. Due to original game defect 154 the computer players do not attack each other in most cases, but I can incite them against each other by changing their arch enemy team definitions. The game can easily run up to 100+ turns this way without any crashes or glitches and after I can finally figure out the transporter and path finding issues I hope that there will no further crashes at all.

I play test on Windows only, the Linux version might be much more unstable due to posix and *nix quirks of GCC, SDL2 or whatever.
avatar
klei1984: The game is already playable though.
Thanks for the update and links! I will take a look. And I am also looking forward to your continued work.
avatar
Sarxis: Have you made the SDL executable public? I'm not actually sure where it is uploaded to.
avatar
klei1984: All latest GitHub Actions builds are publicly available here: https://github.com/klei1984/max/actions . After some time older builds are removed by GitHub automatically though.
The game is already playable though.
Hey Klei! I decided to try the 0.3.0 release, just to see how the widescreen resolutions would get along on my system. Seems to be working ok! Except, I have an instant crash in the beginning of training mission 2 when the AI wants to make a move (will crash instantly with simultaneous moves activated, or crashes after I end my turn when turn based moves are activated).

Didn't know if it matters or if you are looking for crash reports at all. These are the MAX.INI settings I messed with:

display_index=0
screen_mode=2
disable_ar_correction=0
scale_quality=1
window_width=853
window_height=480
dialog_center_mode=1
Hi

So I just tried out Max Port v0.3.0 and I’m having issues.

First of all the installer is reported as a virus and get quarantined now obviously this is a false positive most likely cause by the way the installer is being packaged so might want to look in to that.

Second after white listing and running the installer I notice that it didn’t ask me for either the CD or the GOG installer so that it can copy the game files, now this isn’t a problem on Windows XP as I’m still able to run the old DOS Installer but newer versions of windows can’t so to make life a bit easier for people you might want to update the installer so that it can extract the game files from either the CD or the GOG installer.

Third after doing a fresh install of MAX from the CD and then copying the MAX Port files from the Windows 7-Zip 32 bit archive I get the following error when I try to run it.

The procedure entry point GetTiclCount64 could not be located in the dynamic link library KERNEL32.dll

So obviously something isn’t right there considering that MAX Port is supposed to be built for 32bit systems not 64bit systems so might want to look into this as well.

Now from what I can tell you are using the same library that was used for Syndicate Wars Port which works just fine for me on XP SP3 so what gives how come MAX Port won’t run? Because according to

https://wiki.libsdl.org/SDL2/FAQWindows

Windows XP is supported so it should work ??

Also might be an idea to set-up some sort of a contact from on the MAX Port website so that people can report issues or provide feedback because at the moment there doesn’t appear to be anyway to report issues or provide feedback other than making a github account which is fine if you already have one but it’s annoying if you don’t.

Especially in my case since my XP computer doesn’t have an up-to-date browser and therefore I can’t even make an account at github because the page wont load and I just get a blank screen which is why I posting this here on the GOG Forum so you might want to take some time to look in to possible options.
Post edited April 03, 2023 by Cursed-Ghost