Skip to content

Addtional Map with New Content #424

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

Draft
wants to merge 68 commits into
base: main
Choose a base branch
from
Draft

Conversation

Zenoctate
Copy link

@Zenoctate Zenoctate commented Feb 6, 2025

As discussed in #423, this is a pull request for discussion of content which should be added. Any suggestion is appreciated. Below is a list of suggestion I think should be added. This may expand or change.

A new map is created for this - assets/maps/level2.tmx. Original map will remain same and additional content will be created in level2.tmx.

Current Roadmap

  • A new game start level (just played once) - Before reaching the main map, player should feel welcomed
    • Give player ability to stand on platforms
  • Starting hub with:
    • Cool logo for AAAAXY 2
    • 4 pathways to other levels (Yet to be decided)
    • A hidden secret
  • Maze/Escape level - Find a way out of confusing space
  • Add more Gravity Switching Level (This part seems short)

How to Test

Copy this fork repo and follow build instructions:

git clone https://github.com/TrinketKite/aaaaxy.git
cd aaaaxy
git submodule update --init --remote
make

Now before running the ./aaaaxy you need to run make assets-update-all mainly to generate the checkpoints map of all *.tmx maps as it is required by the game.

make assets-update-all

Tip: This is a long process so if you want, you can execute sh scripts/generate-checkpoints-only.sh (created only for this fork repo) to only generate the checkpoints map if its changed. But it is recommended to run make assets-update-all atleast once. This will be script will be removed once this repo becomes available for merging.

sh scripts/generate-checkpoints-only.sh

To test the map, type ./aaaaxy -cheat_level <tmx> where <tmx> is replaced with the name of level file you want without the .tmx extension. Level file must be located in assets/maps/*.tmx to be used.

This new map is written in level2, so run ./aaaaxy -cheat_level level2 to test. Remember! There is no save game when testing, you need to manually move your Player object in the Tiled application, save and then run to test different areas.

./aaaaxy -cheat_level level2

Bugs

  1. When compiling with make you may get an error claiming that git commit version doesn't match. To fix this simply run it fetch --tags https://github.com/divVerent/aaaaxy/. This happens because for some reason, my fork repo did not copy all the tags, which are necessary to accurately determine version number with respect to git commit history.

  2. When running the map, you may get a level hash error. Simply copy the first level hash (like this got <hash to copy>, want <hash don't copy>) in the error log message and go to Tiled application and open the .tmx which is giving this error when running. Go to (Upper ribbon) Map -> Map Properties -> Look at custom properties -> Paste copied hash to checkpoint_locations_hash property -> Save. Then run the game again. Level hash is needed to properly save the game in the save file.

@divVerent
Copy link
Owner

To be clear, making changes to the existing map will likely break existing runs (which is checked by automated tests) and probably requires a new major version. The gravity flipping section is kinda fair game though, as changes to secrets are "allowed' without considered breaking (see https://github.com/divVerent/aaaaxy/blob/main/RELEASING.md#versioning).

Some changes will need the checkpoint map to be recomputed, which technically breaks runs, but I assume time spent in the UI is minimal, so I would think that is OK in a minor version update as well.

However, once the changes are significant enough, I will do the work to allow this to be an additional, "experimental" map to choose from in the game.

@Zenoctate
Copy link
Author

Zenoctate commented Feb 7, 2025

From my understanding, if I change the existing map, I will need a major version as it may break speedruns.

So should I really be changing the existing map? My goal simply was to add more to the existing map without changing the already created map. But this may have an impact on 100% speedruns.

Therefore, I think that creating another map in the same level.tmx as an addon content would be a better idea, meaning the existing map will remain same but players can select this optional map (through some UI maybe).

Any suggestion in my approach?

Edit: My english :p

@divVerent
Copy link
Owner

From my understanding, if I change the existing map, I will need a major version as it may break speedruns.

So should I really be changing the existing map? My goal simply was to add more to the existing map without changing the already created map. But this may have an impact on 100% speedruns.

Therefore, I think that creating another map in the same level.tmx which will be as an addon content would be a better idea, meaning the existing map will remain same but players can select this optional map (through some UI maybe).

Any suggestion in my approach?

I'd prefer it being a separate level.tmx file, so these can later also be packed independently. I will add a selector UI for that.

Thank you!

@Zenoctate
Copy link
Author

Alright I will change the "Extend gravity flipping section" as "Add more gravity flipping section as a secret level".

I will name the new file as level2.tmx (very creative :p) and try to see how to test it in the game.

I will be committing to the repo whenever I think that good, small but well defined progress has been made. I will definitely clarify any doubts and take any advice.

It may take a long time for me to make a commit as Github is my hobby and not my full time. Thanks!

@Zenoctate
Copy link
Author

Zenoctate commented Feb 8, 2025

QUERY 1

Instead of going to the new map through UI, should we try to integrate it directly into the existing map as a secret? Like the screenshot below (sorry, should have written "To New Map", instead of "Addon Content"). Checkpoint - In The Beginning

AAAAXY

Of course this will no way affect the original map runs and players can switch between maps after this map has been discovered. But we need a way to find how to combine level.tmx and level2.tmx together which may prove hard.

A consequence of this will be that any activated power ups from original map will remain in the new map and players will treat it like a optional extension of the original map. Not much of a concern but if you might want a completely different map with completely different progression then doing like this may not be the idea.

So what should be the decision, start new map through UI or a secret path in original map? I am asking to help me make the starting section of the new map accordingly.

divVerent added a commit that referenced this pull request Feb 9, 2025
Helps with #424 by allowing an alternate level tmx file by `-cheat_level=foo`.
@divVerent
Copy link
Owner

I find this interesting, however I definitely don't think they can be connected seamlessly in the current design of the game logic.

For now I'd suggest you consider them separate files, and I think I should find time later to add a command line flag to load a different .tmx file as a start for this.

In the end, though, I can totally imagine using e.g. a "teleporter" added to the main map to jump to addon content, instead of a menu. There are definitely a few places where this could be safely added.

@Zenoctate
Copy link
Author

Zenoctate commented Feb 9, 2025

Alright thanks! For now I will continue making the level2.tmx as a separate with completely different progression, meaning the power ups need to be re-activated after entering this new map. Save file also needs to be created separately.

@Zenoctate Zenoctate changed the title Addtional Content to Existing Map Addtional Map with New Content Feb 9, 2025
@Zenoctate
Copy link
Author

Zenoctate commented Feb 10, 2025

Problem 1

When running ./aaaaxy -cheat_level level2, the game throws an error stating it couldn't load the checkpoints map level2.cp.json. I am not able test it because of it. README.md says to run make assets-update to update checkpoint map if changed but it hasn't worked and no level2.cp.json is created. I believe it only does for level.tmx.

Log:

[FATAL] could not initialize game: precaching engine: loading level: loading checkpoints: could not load checkpoint locations for "level2": could not open /generated/level2.cp.json: open generated/level2.cp.json: no such file or directory

I will anyway look for a solution for this. But it is recommended that you make a commit in your repo to fix this permanently.

@Zenoctate
Copy link
Author

Zenoctate commented Feb 10, 2025

Side-note - Ignore this, unrelated

I have accidentally hidden my comments without knowing that these cannot be viewed without being signed in to Github. If the maintainer can unhide my comments then I request to do so as I cannot do it myself. I will no longer hide comments in future.

Well now I am able to unhide for some reason

@divVerent
Copy link
Owner

Problem 1

When running ./aaaaxy -cheat_level level2, the game throws an error stating it couldn't load the checkpoints map level2.cp.json. I am not able test it because of it. README.md says to run make assets-update to update checkpoint map if changed but it hasn't worked and no level2.cp.json is created. I believe it only does for level.tmx.

Log:

[FATAL] could not initialize game: precaching engine: loading level: loading checkpoints: could not load checkpoint locations for "level2": could not open /generated/level2.cp.json: open generated/level2.cp.json: no such file or directory

I will anyway look for a solution for this. But it is recommended that you make a commit in your repo to fix this permanently.

I figured this out: you need to compile the game using:

env AAAAXY_GENERATE_ASSETS=true AAAAXY_GENERATE_CHECKPOINT_LOCATIONS=true make

This is seldomly needed, and disabled by default as the checkpoint locations depend on the exact version of the graphviz package and even platform it runs on (damn floating point), so I couldn't get reproducible builds with that enabled.

@Zenoctate
Copy link
Author

Zenoctate commented Feb 11, 2025

After inspecting the build scripts and Makefile, make assets-update-all already does include the AAAAXY_GENERATE_CHECKPOINT_LOCATIONS environment variable. So I ran both, first make and then your command you provided. None of them worked.

I can not believe that I was wasting time troubleshooting when the real problem was that in scripts/build-generated-assets.sh in line 28, there is a typo in the name of the variable as LOCAITONS. So changed it back.

line 28
- if [ x"$AAAAXY_GENERATE_CHECKPOINT_LOCAITONS" = x'true' ]; then
+ if [ x"$AAAAXY_GENERATE_CHECKPOINT_LOCATIONS" = x'true' ]; then

Further I had to change line 37 to take lname variable

line 37
- neato -Tjson assets/generated/level.cp.dot > assets/generated/level.cp.json
+ neato -Tjson assets/generated/$lname.cp.dot > assets/generated/$lname.cp.json

So level2.cp.json now gets generated. But now a checkpoint locations hash error comes claiming it doesn't match. I copied the hash in the error to level2.tmx map custom properties in Tiled application as it was done in level.tmx and now the error doesn't show anymore. save_game_version is also required in map custom properties which I gave as 1.

Now I am able to play whatever I create in level2. I suggest making a commit in your repo to fix this.

@divVerent
Copy link
Owner

Sounds good so far! As you are working on a new map, I am considering implementing a new engine feature: slopes.

Interested?

@Zenoctate
Copy link
Author

Yep! I think it would be a cool feature. I will mention #428 here.

Sorry for late response, been busy.

Copy link
Author

Choose a reason for hiding this comment

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

To be removed when open for merging

@divVerent
Copy link
Owner

I am sorry to ask this now, but - can you name it something more "inventive" than level2? Could name it after your nickname, or whatever - basically, can we change the filename to something not numbered, and can you also give me a "human readable name" to show in the menu?

Thanks!

(Unless "Level 2" is actually the intended visible name, which is fine too if you want that)

@Zenoctate
Copy link
Author

Of course, let me think of a name which may suit the theme of level 2.

@Zenoctate
Copy link
Author

Hey just wanted to let you know that build process broke after merging to my fork repo.

make assets-update-all now breaks when generating checkpoint. It's because the file cmd/dumpcps/main.go had outdated package import name at line 25. I checked your commits and math should be renamed as m in here

cmd/dumpcps/main.go - line 25
++	m "github.com/divVerent/aaaaxy/internal/m"
--	m "github.com/divVerent/aaaaxy/internal/math"

Also the application binary broke as it gives the error that assets/generated/picture_load_order.txt is not found when running. Recompiling didn't work. File internal/picture/load.go was changed at line 106 in your commit. I understand your reasons for renaming but currently, assets-update-all creates file named image_load_order.txt rather than named picture_load_order.txt.

scripts/build-generated-assets.sh should be updated to fix this

scripts/build-generated-assets.sh - line 52
++	sh scripts/image-load-order.sh assets/generated/picture_load_order.txt assets/tiles assets/sprites third_party/grafxkid_classic_hero_and_baddies_pack/assets/sprites
--	sh scripts/image-load-order.sh assets/generated/image_load_order.txt assets/tiles assets/sprites third_party/grafxkid_classic_hero_and_baddies_pack/assets/sprites
	if [ x"$AAAAXY_DIFF_ASSETS" != x'false' ]; then
++		diff -u assets/_saved/image_load_order.txt assets/generated/picture_load_order.txt
--		diff -u assets/_saved/image_load_order.txt assets/generated/image_load_order.txt
	fi

I suggest renaming scripts/image-load-order.sh as scripts/picture-load-order.sh if you want to have consistent names, although this seems fine for now.

@Zenoctate
Copy link
Author

Build process is fixed

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.

2 participants