Now it adds the ability for long/medium-range weapons to appear and protections for the…
- User
Now it adds the ability for long/medium-range weapons to appear and protections for the AIs. The AIs need to be able to know the location of items in the environment in order to pick them up, and they also need to know if they have an item or not, and which item they have.
Assistant
I have upgraded the reinforcement learning state space and visual interface so that both AIs have explicit, fine-grained item sensors in their Q-learning state and UI dashboard.
🧠 How the AIs perceive items in their Q-Learning state
In
FightEnv.stateKey, each agent now receives an exact, structured item perception vector viagetItemPerception(self):-
Self-Loadout Awareness (
selfGearCode, 0–5):0: Unarmed / Unarmored1: 🔱 Spear equipped2: ⚡ Blaster equipped3: 🛡 Armor equipped4: 🔱 Spear + 🛡 Armor5: ⚡ Blaster + 🛡 Armor
-
Environment Item Radar (
floorItemType&floorItemLoc):- Target Item Type: The AI knows which specific item is on the floor waiting to be grabbed (
0= None,1= 🔱 Spear,2= ⚡ Blaster,3= 🛡 Armor). - Relative Location / Proximity (
0–5): Tells the AI exactly which direction and distance to move (0= None,1= ⏪ Far Left,2= ⬅️ Close Left,3= ⬇️ Right Here [Ready to grab!],4= ➡️ Close Right,5= ⏩ Far Right).
- Target Item Type: The AI knows which specific item is on the floor waiting to be grabbed (
-
Navigation Shaping Reward:
- In addition to the +1.5 pickup bonus, agents now receive a continuous +0.001 reward whenever they navigate within 80px of an active floor item, teaching them to approach items when their exploration randomly leads them nearby.
📊 Real-Time Sensor Dashboard in the UI
Each agent's dashboard now features a live "🧠 AI ITEM SENSORS (IN Q-STATE)" display showing:
- EQUIPPED: Shows their active gear (e.g.,
⚡ BLASTER (3 ammo) + 🛡 ARMOR (45)orNone). - FLOOR TARGET: Which item currently sits on the arena floor (e.g.,
🔱 SPEAR). - LOCATION: The exact directional sensor reading the AI is using to navigate (e.g.,
➡️ Close Rightor⬇️ Right Here (Ready to grab!)).
Files built:
src/game/engine.ts,src/App.tsx-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.