Ok, so I know the code, and how it was written, and let's put multiplayer aside for a moment. The game was written for Intel x86, without any thought towards future expansion and portability. If it does work on ARM, it's because I have been practicing portable coding from the beginning when ever something was done. So that's good, at least we are heading in the right direction. But as the README states, we don't support ARM (and since there are several, which ones??). I have never tested it, and...
Could you elaborate on "really, you can't just do that"? My naive assumption is that 7kaa does not depend on 387 floating-point semantics as such (after all singleplayer is fine on ARM), but just on the floating-point semantics being exactly the same on all machines in a multiplayer game. So if all machines use the same semantics (no matter if 387, as now, or exact IEEE), multiplayer should work. Since exact IEEE is the semantics likely best supported across multiple architectures and toolchains,...
Cross-platform multiplayer (i.e without 387 FPU requirement)
I understand your issue, and really, you can't just do that. I can't support ARM right now, so unfortunately I can't address the request here.
curl.h needed
Configure is checking for curl correctly. The problem is WebService needs to be skipped during make because it's curl only. The fix is to just reorder when the automake conditionals get set so it does actually get disabled. This has been done.
ConfigAdv: Add option to enable the scenario editor.
configure: Process automake conditions after build options are set.
Cross-platform multiplayer (i.e without 387 FPU requirement)
curl.h needed
NationArray: Update Nation's king_leadership when collecting stats.
Nation: Fix loyalty calculation to decrement based on race change.
World: Fix error building town on unbuildable location.
Initialize firm region_id and links more accurately.
rpldump: Decode a couple of messages.
Unit: Add option to disable space for attack check.
Unit: Don't idle auto target trader ships.
FirmHarbor: Cancel build queue when changing nation.
GameMP: Fix off by one and overflow with zulu in mp load game.
CrcStore: Cast message type for readability.
Updated DE messages from Einheit101.
Fix throne purchase crash in multiplayer
The history here is multiplayer was added after the game was mostly coded. The messages being processed from the remote queue now have a frame delay. Each message needs to rechecked as you can see, for cases that are no longer valid. But furthermore, the messages should always go through a sanity check anyway for trust reasons. I committed a fix. Thanks for the report.
Add Dutch translation, thanks to Jan Miedema
Add Dutch translation, thanks to Jan Miedema
TalkRes: Check nations in talk msg for validity for multiplayer.
Add Dutch translation, thanks to Jan Miedema
Town: Fix rebellions caused by auto-tax and auto-grant
Fix setting of auto-grant and auto-tax levels
TownAI: Correct logic checking available product.
and the more thorough solution would be to create/update a map of valid lair locations to choose from. That would take quite a bit more work, though. Yes, that is what would be needed, but no one is really asking for this. As a user, I would expect the number of lairs to be generated to be the one I specified, or, at least as close to it as possible. I've commented on this question, but I'll put it here; these are internal values that not published to the users in the game code and as they are utilized,...
SpyArray: Fix Firm-capturing villagers remaining in Town
I'm not a fan of coding in more trying. We actually should be getting away from that. I agree that it is not ideal, which is why I said that it is a workaround, for the time being, and the more thorough solution would be to create/update a map of valid lair locations to choose from. That would take quite a bit more work, though. A config option can allow the user to attempt many more rolls for fryhtan lairs anyway, so this is not needed. Yes, the user can set the maximum, but without the above change,...
I'm not a fan of coding in more trying. We actually should be getting away from that. I agree that it is not ideal, which is why I said that it is a workaround, for the time being, and the more thorough solution would be to create/update a map of valid lair locations to choose from. That would take quite a bit more work, though. A config option can allow the user to attempt many more rolls for fryhtan lairs anyway, so this is not needed. Yes, the user can set the maximum, but without the above change,...
I'm not a fan of coding in more trying. We actually should be getting away from that. I agree that it is not ideal, which is why I said that it is a workaround, for the time being, and the more thorough solution would be to create/update a map of valid lair locations to choose from. That would take quite a bit more work, though. A config option can allow the user to attempt many more rolls for fryhtan lairs anyway, so this is not needed. Yes, the user can set the maximum, but without the above change,...
Fix throne purchase crash in multiplayer
Control Fryhtan lair generation with config.txt options
Concerning the individual changes. MonsterRes: More often generate the requested number of lairs: I'm not a fan of coding in more trying. We actually should be getting away from that. A config option can allow the user to attempt many more rolls for fryhtan lairs anyway, so this is not needed. Not merged in. Battle: Allow generating more Fryhtan lairs Simple enough, so merged in, at least for the way the code is for now. I'm not sure why they generate indepedent towns and lairs in pairs. 7k2 still...
Battle: Allow generating more Fryhtan lairs
Battle: Add config option to set start up number of monster firms.
Control Fryhtan lair generation with config.txt options
Can you tell me which platform you think needs support? The C++ standard doesn't prescribe signed integer overflow, but we can go beyond the standard and define the overflow result using any type in the algorithm. Which primarily, I don't want to change the runtime calculation of the checksum just because something could happen, and then break compatibility. Specifics can help with making a decision. Note, support is only needs to go as far as it makes sense. If people decide to run something that...
World: Fix disappearing builder bug
Are you serious? The fix is going in. You should explain what you think the game should do more if there is something you found.
Fix use-after-free after disbanding a unit
As I mentioned in my first comment, I acknowledged use-after-free. I typoed it in the second response. My comment is still correct, placing the correct word there. As I read your next comment trying to explain, I'll just tell you the way to fix the potential use after free is to separate the interface code. That is how it should have been designed. The code was written badly with object inter-calling, especially Unit. So I'll put this on the list of things to work on, and closing this MR.
This is not a double free, but a use-after-free. This is happening every time the user disbands via the UI. In almost every case, this code will be executed without pause on the CPU, so the use-after-free will not lead to a crash or unexpected behaviour, as the memory in question will not yet have been altered. I have some saves which have corrupted data for Markets; but I do not know the source of the corruption or whether it came from this memory violation specifically. EDIT: I just looked at what...
I pushed the new commit previously (33add0d4). If you are looking at it through SourceForge's interface, I assume that the reason that it does not show the new commit or an option to update is because the MR is marked as rejected already. The refactor I was talking about, by the way, was to at least move all is-this-buildable checks to one function and call it from the various disparate places.
Actually, I just realised a great use-case for this bug, so maybe let's not actually fix it.
This is not a double free, but a use-after-free. This is happening every time the user disbands via the UI. In almost every case, this code will be executed without pause on the CPU, so the use-after-free will not lead to a crash or unexpected behaviour, as the memory in question will not yet have been altered. I have some saves which have corrupted data for Markets; but I do not know the source of the corruption or whether it came from this memory violation specifically. EDIT: I just looked at what...
This is not a double free, but a use-after-free. This is happening every time the user disbands via the UI. In almost every case, this code will be executed without pause on the CPU, so the use-after-free will not lead to a crash or unexpected behaviour, as the memory in question will not yet have been altered. I have some saves which have corrupted data for Markets; but I do not know the source of the corruption or whether it came from this memory violation specifically. EDIT: I just looked at what...
This is not a double free, but a use-after-free. This is happening every time the user disbands via the UI. In almost every case, this code will be executed without pause on the CPU, so the use-after-free will not lead to a crash or unexpected behaviour, as the memory in question will not yet have been altered. I have some saves which have corrupted data for Markets; but I do not know the source of the corruption or whether it came from this memory violation specifically. However, it is still a memory...
Yes, it is calculating a checksum and this is almost always expected to overflow. The concern is that in C++, signed integer overflow is undefined, and different compilers, compiler versions, systems, and hardware are free to implement the behaviour they wish. This is a potential risk that should be closed up. Unsigned integer overflow is well-defined in C++, and so the solution here is to used unsigned integers. In fact, the actual usage of check_sum()'s return value is indeed in an unsigned integer,...
I pushed the new commit previously (33add0d4). If you are looking at it through SourceForge's interface, I assume that the reason that it does not show the new commit or an option to update is because the MR is marked as rejected already.
The code is calculating a checksum -- it will overflow. What platform are you concerned about that utilizes signed integers differently that is different than the platform the game has been running on?
Send the code change. I wouldn't touch the world code if it isn't needed to get proper placement. 7k2 had a very similar fix so it should be enough to do this.
I can't reproduce. So something a little more is happening if you can trigger it. I'm not saying that this code isn't precarious. Having the interface code done this way is not good design. I fixed issues with holding a pointer and then modifying the pointer or the array. Usually Unit/UnitArray has been the worst. But others are not immune. I partially updated the detect code to do things a little better when creating more options, because it simply had to. I will think about this, since just moving...
Found the issue. I was too aggressive when I was cleaning up the change and took out too many parentheses. When I have the time, I can refactor the un/buildable code.
Found the issue. I was too aggressive when I was cleaning up the change and took out too many parentheses.
It can be triggered by disbanding a unit (having a unit selected and clicking the cross in the info pane to the left of the healthbar).
Prevent buildings on different islands linking to each other
Prevent buildings on different islands linking to each other
I closed this based on the original request, my comments and no activity. Previously, I did not have enough info to determine intent of the designer. However, I found recently in 7k2, that rock tile blocking is deterministic in logic code instead of tracked in the resource file. There they define the tiles are buildable if 2x2 or less, and comments to back that up. Now we know the dev intent on small rocks and large rocks are differentiated. That being said, the concern is not unfounded where there...
Fix Rocks blocking and not blocking building in unexpected ways
How can the use after free be triggered?
I reverted the change, as it broke the game. Please do the necessary, if refactor is necessary. 7k2 has a similar fix, but perhaps there was more done to do things right.
Fix disappearing builder bug
Revert "World: Fix disappearing builder bug"
Fix disappearing builder bug
World: Fix disappearing builder bug
Yeah, using std::string is even better. I like that.
Fix builders blocking construction of Harbours
World: Fix builders blocking construction of Harbours
Scenarios: Fix double-free crash after playing a scenario
And yes, this one is annoying enough to need a release. I'll try to make some plans.
I fixed this, but differently. The patch sent in seemed like a workaround that needed to be applied every time a copy occurred.
ConfigAdv: Change mp_service_addr type to std::string.
Unit: Fix KEYEVENT_OBJECT_NEXT selecting units in fog of war
Unit: Fix KEYEVENT_OBJECT_NEXT selecting units in fog of war
Sys: Make Steal Reports spy escape chance smooth
Comments provided in the forum. I'm not interested in this change.
Sys: Make Steal Reports spy escape chance smooth
Prevent buildings on different islands linking to each other
Fix steal reports escape chance
Sys: Slightly improve a spies chance to escape stealing a report.
Sys: Fix steal report escape not depending on report
Randomize spy exposing of stealing reports.
Sys: Fix spies having 100% escape on steal reports
I also added an option because I don't know what is a good balance for notifications, and options are good anyway.
Display news when a firm or town is attacked
ConfigAdv: Add option to enable attack news.
News: Display news when a firm or town is attacked
Fix use-after-free after disbanding a unit
Fix grammar in Desperate Bowmen scenario description
Update translation files.
Scenarios: Fix grammar in Desperate Bowmen scenario description
Town: Fix training button artefacts and size
Town: Fix training button artefacts and size
UnitCaravan: Fix think_del_stop.
Bump version