Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neworigins v6 merger with master branch #142

Merged
merged 228 commits into from
Oct 11, 2023
Merged

Neworigins v6 merger with master branch #142

merged 228 commits into from
Oct 11, 2023

Conversation

artyomtrityak
Copy link
Member

@artyomtrityak artyomtrityak commented Oct 10, 2023

WIP, reviewing the code

valdisz and others added 15 commits September 12, 2022 21:33
Better World Events. Now with assassinations :)
* Updated description for FORGET to reflect the defined ruleset.

* Rephrased after commit review.
* fixed event order, now more significant events will be on top

* cossmetic update of the text art

* added missing space after number of looses

* even more missing spaces added back
Update the workflow runner to run on the current neworigins-v6 branch.
Also have it run on any jt-* branches which I use for local feature testing
(I don't necessarily like pushing that last bit into master but I figure
I am likely the only one who cares)
We have a number of compiler warnings in the current code.   Let's
get rid of them all.

Add -Werror to prevent new compile warnings from creeping in
This code is mostly dead and hasn't been updated/built/looked at in a long time.
It will still exist in git history, and I believe that Artyom is going to create
'last state/arcadia' branch which preserves it before merging all the neworigin
and neworigins-v6 changes to master to bring things back to sanity.
Snapshot tests kind of suck in general and are more fragile, but
they are all we really have right now for testing before the unit
test changes and they can still serve some purpose for doing
end-to-end testing.

This moves the directory to be better named, updates the github
workflow to use the new directory/driver script and enhances that
script to compare the output to 'expected' output each step of
the way.
I'd forgotten to remove it from the Makefile when I killed the
directory.
Begin process of wiring up creating and running unit test.
@valdisz valdisz mentioned this pull request Oct 10, 2023
In order to make sure that some of the work I am doing around file
output works correctly, I wanted to make sure I had some neworigins
snapshots including the quest system which the standard snapshots
don't have.  This checkin includes those snapshots to the point that
quests have been created on turn 13.

This also updates the scripts to run them so that both sets of
snapshots will be run to validate the tests.
The intent of the code was that weighter landmarks (settlments) would
take preference over fortifications, etc.   This test was backwards.
However, it was also possible that if there were two equally close
and equally weighty landmarks, the order would fluctate based solely on
how the in-memory layout of the unordered_map being used to construct
the data got laid out.   This changes this to be a stable ordering based
on distance (shorter distance), weight (higher weight), x coordinate
(westernmost preferred) and finally y coordinate (northernmost
preferred).   Exposed the comparison function to allow unit tests and
added unit tests.
@@ -129,6 +129,19 @@ void ARegionList::CreateNexusLevel(int level, int xSize, int ySize, char const *
}
}

// void ARegionList::CreateConstrainedSurfaceLevel(int level, int xSize, int ySize, char const *name, int contients,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure why this is commended here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks (from looking at the code and the history) that this was added by Valdis about 2 years ago for neworigins as an attempt to improve the map generation, and was added as a dummy/empty function to the other rulesets, then later removed from the game.h header and commented out everywhere. This is (to me) prime example of code that should be just tossed since it's pretty obvious that an even better system has already replaced it.


void WriteSides(ARegion *,Unit *,Unit *,AList *,AList *,int,
ARegionList *pRegs );

// void WriteBattleStats(ArmyStats *);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to investigate why it was commended

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similarly, it looks like that was your initial attempt from 3 years ago to create some battle statistics and has been replaced with newer/better code (the BattleLogLevel::Detailed stuff in the normal battle output generation).

@artyomtrityak artyomtrityak merged commit c38361d into master Oct 11, 2023
10 checks passed
@valdisz
Copy link
Contributor

valdisz commented Oct 12, 2023

This was merged as a squash merge that kills the history. It is fine when we merge changes from the one author like that. But when there are many it is not correct. @artyomtrityak @jt-traub

@valdisz
Copy link
Contributor

valdisz commented Oct 12, 2023

Also, deletion of the Arcadia was intentional?

@valdisz
Copy link
Contributor

valdisz commented Oct 12, 2023

I propose to revert this PR and merge no_v6 directly into the master. This will be more correct.

@jt-traub
Copy link
Contributor

Also, deletion of the Arcadia was intentional?

Yes.. I got annoyed when searching for functions that it kept going to the arcadia version rather than the real version, and since arcadia wasn't regularly being built and was quite diverged from the changes that had been made in the mainline files on neworgins, it seemed better to leave it in-state on the v5_stable branch, and get rid of it from the 'main' branch. I am the one who authored the pr to remove it. :)

@jt-traub
Copy link
Contributor

This was merged as a squash merge that kills the history. It is fine when we merge changes from the one author like that. But when there are many it is not correct. @artyomtrityak @jt-traub

In general I agree with you.. I would probably have retained the branch commit history. But I don't feel strongly enough that it needs to be reverted and remerged. That branch history still exists in github, it just takes a bit of work to get to.

@valdisz
Copy link
Contributor

valdisz commented Oct 25, 2023

As I'm the one who is most annoyed with that. Then I will unwind history myself or do nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants