Add early-game survival mechanism to prevent instant player death#33
Merged
dmccoystephenson merged 4 commits intomasterfrom Sep 29, 2025
Merged
Conversation
…ack avoidance Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
…idance Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add early-game survival mechanism for player
Add early-game survival mechanism to prevent instant player death
Sep 29, 2025
dmccoystephenson
requested changes
Sep 29, 2025
Member
dmccoystephenson
left a comment
There was a problem hiding this comment.
@copilot Expand unit tests
Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Contributor
Author
Expanded unit tests from 3 to 18 comprehensive tests covering all aspects of the survival mechanism: Test Suites Added:
Key Features Tested:
All 18 tests pass and provide comprehensive coverage of the early-game survival mechanism. Fixed module execution issue in Commit: 3d3dffa |
dmccoystephenson
approved these changes
Sep 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes issue where players would die instantly when the simulation begins, making the game frustrating and unplayable.
Problem
The player creature often died within 1-2 ticks of starting the simulation due to:
This resulted in players barely experiencing any gameplay mechanics before dying.
Solution
Implemented a comprehensive early-game protection system with three layers of defense:
1. Grace Period (50 ticks)
Players receive temporary protection during their first 50 game ticks, giving them time to learn the mechanics and establish themselves in the world.
2. Damage Reduction (40%)
During the grace period, players take 40% less damage from all attacks while maintaining a minimum of 1 damage to preserve game balance.
3. Attack Avoidance (85%)
Other creatures have an 85% chance to avoid initiating attacks against the player during the grace period, significantly reducing early-game pressure.
Implementation Details
Configuration (
src/config/config.py):Fight Mechanics (
src/entity/livingEntity.py):fight()method to check for and apply damage reductionGame Logic (
src/kreatures.py):Testing
Comprehensive Unit Test Suite: Expanded from 3 basic tests to 18 comprehensive tests covering:
Testing Results:
Game Balance
The protection is temporary and carefully tuned to:
Players can now experience the full range of game mechanics (combat, friendship, reproduction) before the protection expires, making the game significantly more engaging while maintaining its core difficulty.
Fixes #32
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.