scottschiller / ArmorAlley

A browser-based interpretation of Armor Alley, a combat strategy game originally released in 1990 for the Macintosh and MS-DOS PCs.
https://armor-alley.net/
Other
91 stars 25 forks source link

game is slow on Win10 and game not working on Win11 #8

Closed starwindz closed 9 months ago

starwindz commented 9 months ago

Thank you for making a remake of Armor Alley. But there are some problems with running the file received from github locally, so I would like to ask for your help. (The http server used python. python -m http.server)

  1. It works on Windows 10, but the response to mouse movement is slow, and the SHIFT and Z keys cannot fire one shot at a time, but multiple shots are fired even when pressed briefly.

  2. on Windows 11, the browser background turns black and no further progress of game is made.

Thank you in advance.

(P.S.)

scottschiller commented 9 months ago

Thanks for the report and details. python -m http.server should be OK for serving locally, presuming HTTPS is not needed. (I don't believe it is here, for any reason at present.)

There is a bit of a delay on mouse movement, by design. The helicopter does not immediately move to the mouse location, but takes a sort of "chase" approach. Particularly on modern systems, it would be trivial to move very quickly and effectively be a target that is impossible for the CPU to hit. If this doesn't sound like a description of what you're seeing, let me know.

Z and/or SHIFT should fire multiple shots by design following the original game, provided the key is held down. It may be that the firing rate is too fast, where it's difficult if not impossible to fire only one shot - I'll review.

Wild guess, here: There might be a JS or other runtime error on Windows 11, somehow. If you see JS console errors, details may help with troubleshooting. Thanks.

starwindz commented 9 months ago

The problem of index.html not opening on win11 localhost has been solved by using npx http-server. And the input delay problem did not occur when I connected the power to my laptop PC. This may be related to the performance mode of the PC, which may limit the performance of the graphic card.

I have several new questions.

  1. Even if the "Z" key is pressed briefly, multiple bombs tend to come out. Can you tell me the relevant code to control this? Could you add an option to control this?
  2. Is it possible to add the game stat feature that records high scores after the game ends?
  3. Is there some kind of randomness at each level? If so, can an option to adjust this be added? If not, can randomness be added?
  4. The URL of the link below in README.md is broken. Can this link be restored? "Original article about building "V1.0"" https://www.schillmania.com/content/entries/2013/armor-alley-web-prototype/

Thank you very much again for making such a great remake game! 👍

scottschiller commented 9 months ago

The game must be served via http given the use of ES6 script modules, and not via file:// etc.

It sounds like your laptop is throttling the GPU when on battery power, or similar.

Regarding questions: I'll review the rate of gunfire and bombs. Both are likely fast relative to the original game.

I used to have a "stats" screen showing some basic numbers of gunfire and units for both sides, but it broke at some point. The original game had some sort of "points" system, but I don't know how the scoring worked - and I don't believe it was documented anywhere.

Thanks for the note on the broken link, my web host recently migrated some things and I suspect that 500 error is related. 😅

starwindz commented 9 months ago

I have several ideas for improvements of features.

  1. rate of bombs I have changed bombModulus in Helicoper.js from 4 to 12 (or 16) for test, the rate seems to be similar to the original DOS and Mac version. https://github.com/scottschiller/ArmorAlley/blob/c6bac5b3a4c86aea3d811ffb210436c03cc2f517/script/units/Helicopter.js#L3048

  2. high score list The high score list seems to be an essential feature for motivating the game. As you mentioned, it's not clearly documented how the score is calculated. But, wouldn't it be possible to reverse engineer it using the information below in the manual? ``Armor Alley scores loosely on a moral system. You lose points for: long battles, each soldier and piece of equipment you order, the destruction of buildings, and the destruction of your forces. You gain points for winning, each surviving hero, and destroying enemy forces.```

  3. random level generator How about adding a feature that automatically generates some kind of random levels? I think Armor Alley's replayability would really improve if the difficulty and enemy placement can be set in detail to create creative and challenging random levels.

  4. description of each scenario How about embedding the description of each scenario in the manual into the game?

I would be happy if the above ideas serve as the reference for the development of future versions.

scottschiller commented 9 months ago

Thanks for the added thoughts.

I was looking at helicopter bomb and gunfire rates yesterday, and considering something like "modern" vs. "classic" timings in options. In quick testing, slowing the gunfire had an impact on strafing enemy tank convoys at full speed. 😅

I had set bombModulus: 5 as a possible new default, but I could see doubling it appearing closer to the original game. It's worth noting the MS-DOS version also had a game speed option, so the Mac might be the most "reliable" speed reference. The frame rate of the original game is also notably lower, so I am trying to strike a balance between smooth gameplay and accuracy. One approach could be to record the audio and measure the delay between gunfire sound effects etc., to establish timing.

If the scoring system were clearly documented, it could be interesting to re-implement it. Presently, I don't see a clear way to do it. There's also a "bonus" bit of text in the game that I've never understood. In my experience, I've found scoring / points systems to be of limited value. When online (e.g., a high scores leaderboard) as I've done in past, people will of course cheat and game the system to take the top spot. I'd rather invest time and effort in gameplay UX/UI, vs. the "metadata" around the game.

I don't seem to have a good screenshot on hand, but I had some stats that would show at the end of a battle in past. I've been meaning to revisit those. Time spent and other numbers could be interesting. AA prototype - stats

I had recently been thinking about randomly-generated levels. I just started working in logic to have the number of "turrets" (anti-air guns) vary depending on difficulty level and updating the live preview from the game menu, and random generation could build on top of that. The main thing would be grouping and distributing buildings and units "reasonably," avoiding overlap, to keep it fun and still beatable.

Level descriptions have also been on my to-do list; I was going to write up my own summaries, but will review the manual. It had more of a story line, and I feel like a brief description and strategy tips would be more relevant. A copy of the manual might be handy for folks to see, with the understanding that it's been 30+ years since this game was released.

starwindz commented 9 months ago

I think it's a really good idea to provide classic and modern options for rates of bomb and gunfire. Another idea would be providing an option to adjust these rates in the form of a slide bar just like the game speed option in the original DOS version.

Since for now the scoring system is not clearly defined, it may be a good idea to display the game result stats after a battle is over. This would be a nice feature.

I was not aware that an online leaderboard has been implemented in the past. And the javascript source code is on the server, so I'm not sure how cheating is possible. Regarding the scoring system, I will check it separately later through a playtest of the original version to see if the scoring system can be clearly documented. (I don't know if this is really possible :) )

Personally, I think random level generation is a very interesting and fun feature. I have participated in developing the random level generation feature in the OpenFodder project. Players are showing considerable interest in playing at unpredictable levels. https://github.com/OpenFodder/scripts

I think the scenario description is a good feature that motivates game play. It can be thought of as giving each battle a kind of story.

scottschiller commented 9 months ago

I've added an option for "classic helicopter controls," which affect the rates of gunfire, bombs, and paratroopers and should bring them closer to the feel of the original game.

To clarify on leaderboards / highscores, there was never one for my version of AA. I've made a few in games over the last 20+ years, and people ultimately are tempted to cheat regardless of logic or where it lives.

starwindz commented 9 months ago

"classic helicopter controls" option is really cool. Thanks you so much!

I understand what you mean about leaderboards/highscores. People seem to have a tendency to cheat.

But, what I'm trying to say is that leaderboards/highscores are not the goal in themselves. What I'm talking about is motivation to play the game. If all levels have been cleared after all the failures and retries and then there is nothing left, it seems really meaningless. If leaderboards/highscores are exploited for cheating, I think other forms of history recording would possible.

It would be good to leave it as logs or journals in roguelike games such as nethack. Or, I think things like trophies, achievements, or badges from PlayStation games would be good. Soldier diary on Openxcom is also a good example. https://openxcom.org/forum/index.php/topic,1718.0.html

scottschiller commented 9 months ago

If I were to do some sort of leaderboard, I'd implement it locally and avoid the whole cheating incentive.

Another thing on my TODO list has been the "battle over" sequence, and options to continue e.g., on the next level as in the original game's "campaign mode." With the fireworks, you'd also get a growing set of badges and then some text like, "you caught the enemy by surprise this time, but they will be more prepared on the next battle" etc. This also goes back to the storyline and so on.

In the original campaign, the battles become more difficult as the enemy becomes more strategic - eventually the "turrets" start firing at your tanks, and so on. The approach I've taken differs slightly in that you choose your difficulty right away, and then any battle you want as opposed to having to play all the way through to get to "Midnight Oasis" (a fun and very challenging one in "extreme" mode.)

I've played through the entire original game on the "Boot Camp" difficulty (other options: Wargames, Conflict, Armorgeddon) and I may try the others at some point, but going through all of them may be quite a slog. 😅 Just finishing "Boot Camp" was quite a challenge!

I had also been thinking of a save-game state, so if you accidentally reload or close a browser tab it'd be nice to have the option to resume.

scottschiller commented 9 months ago

This issue began as a conversion around performance, evolved to a discussion around bombing and gunfire rates (and creation of a "classic" controls option), and is closing on leaderboards / battle over sequences. I'm going to close this issue, but note the discussion that followed. I hope to have updates on the "battle won/lost" screens next.