taco_empire [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=61771 Red Vs Blue <p> <table><tr><td> <a href="/bbs/?pid=129206#p"> <img src="/bbs/thumbs/pico8_rvbfps-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=129206#p"> rvbfps</a><br><br> by <a href="/bbs/?uid=61771"> taco_empire</a> <br><br><br> <a href="/bbs/?pid=129206#p"> [Click to Play]</a> </td></tr></table> </p> <p>Hello!</p> <p>I present to you Red Vs Blue, a strategy first person shooter game. Red Vs Blue is heavily inspired by the Precinct Assault mode of the PlayStation 1 game, Future Cop: LAPD.</p> <p>Controls:</p> <ul> <li>Arrow Up: Move Forward</li> <li>Arrow Down: Move Backward</li> <li>Arrow Left: Turn Left</li> <li>Arrow Right: Turn Right</li> <li>Z (in-game as O): Shoot</li> <li>X (in-game as X): Next/Accept/Purchase</li> </ul> <p>Features:</p> <ul> <li>FPS gameplay by way of Wolfenstein 3D raycasting.</li> <li>Team select- Choose from 2 completely identical teams!</li> <li>AI enemy powered by a neural network.</li> <li>More than 1 map!</li> <li>Visuals that could be described as almost adequate.</li> <li>Beeps and, on occasion, boops.</li> </ul> <p>How To Play:<br /> The goal of the game is to have one of your drones reach the enemy heart. However, there are capture-able turrets scattered across each map. Capturing a turret is simple: Walk up to it and stand there until it changes colors. Capturing a turret not only causes it to fight for you, but each owned turret provides $1 every 10 seconds. Money can be used to purchase drones at a cost of $5 per drone. Once a drone is spawned in, it will happily march toward the enemy heart firing at anything it comes across. That could be an enemy drone, turret, or your rival, 99. Watch out for 99- it spent over 3 weeks in virt training to kill you.</p> <p>Neural Network:<br /> 99 is controlled by a real neural network. I trained the neural network using a process called Neuro Evolution. This process involves creating a population of neural networks (100 in this case) and having them play the game. We score each &quot;brain&quot; based on how well it played the game. Once all 100 brains have had a chance to play, we crossbreed and mutate them and start the whole process over again. This simulates evolution and over time the brains get better and better at the game. Honestly, this took about two weeks of constantly running to get a viable brain, which is about twice as long as it took to make the game in the first place.</p> <p>99 is pretty good at playing the game, but honestly I would like to try again to see if I can get something better. 99 is great at capturing turrets and putting up a decent fight, but I feel it needed more time in the oven, so to speak. Maybe one day in the future.</p> <p>99 &quot;sees&quot; the game world in much the same way as the player. For walls, we cast out rays in front of 99 to tell it the distance. Object vision is a little different in that we use vision cones. I did try raycasting for objects, but it leaves such large gaps in 99's vision at far distances so it didn't work out as well. 99 cannot see through walls, but does make twice as much money from turrets as the player does, just for a little difficulty boost.</p> <p>Postmortem:<br /> I had a lot of fun making this project, but my biggest regret is that I tried to cram way too many things into this game. For the first time, I ran out of tokens! As of this writing, my token use is 8119 out of 8192, so yikes. I had to cut some things out, which was a big bummer. Originally I was using Flow Field Generation for automatic pathfinding for the drones. It worked great! But was also 700 tokens, so that had to go. Training the neural network took so many tokens that I had to move it into its own .p8 file and manually copy the neural network &quot;brain&quot; over to rvb.p8. So that was a fun mess, but hey it worked. And my second biggest regret is that I left all audio until the very end. I have the least experience in the audio department, so I procrastinated on it and that kind of bit me.</p> https://www.lexaloffle.com/bbs/?tid=52575 https://www.lexaloffle.com/bbs/?tid=52575 Sun, 30 Apr 2023 23:27:11 UTC Flap Evolved 1.3 <p> <table><tr><td> <a href="/bbs/?pid=104518#p"> <img src="/bbs/thumbs/pico8_yabadopuwo-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=104518#p"> Flap Evolved 1.3</a><br><br> by <a href="/bbs/?uid=61771"> taco_empire</a> <br><br><br> <a href="/bbs/?pid=104518#p"> [Click to Play]</a> </td></tr></table> </p> <p>Hello there!</p> <p>Here's my first PICO-8 project, Flap Evolved. It's a really terrible Flappy Bird clone, but it is playable. It was a great project to start my PICO-8 journey out on.</p> <p>Player Mode (X):<br /> Take control of a really ugly bird and try not to fly into pipes. That's about it. Every 4 pipes passed increases the speed.</p> <p>Neural Network Mode (Z):<br /> Tired of playing already? Yeah, ditto. Why not watch a population of neural networks evolve over time to learn how to play, instead?<br /> The neural network is pretty basic, but it does support multiple hidden layers and has a basic genetic algorithm included, for all your evolutionary needs.</p> <p>I'm still learning Lua &amp; PICO-8, but having a blast so far. Thanks for taking the time to read and have a good one!</p> <p>Cheers,<br /> Taco</p> <p>v1.1:<br /> -Improved graphics<br /> -Removed jump delay<br /> v1.2:<br /> -Increased jump amount for added difficulty, adjusted &quot;physics&quot;<br /> -Improved game instructions<br /> -NNs now see the_pipe.x<br /> -NNs now see pipe_speed<br /> v1.3:<br /> -2 pipes will now appear on screen at a time, refactored pipe &quot;system&quot;<br /> -Increased starting pipe stats to make it easier at the start<br /> -Every 4 pipes cleared, pip gap becomes smaller, distance between pipes becomes shorter, and the y position jump becomes larger<br /> -Fixed a couple of crash bugs from OOB arrays<br /> -Agents now get additional points from clearing a pipe, instead of just points per frame<br /> -Agents see the closest 2 pipes to them. Pipe x, topY, and bottomY are visible for both pipes<br /> -Increased mutation chance<br /> -Added a fitness graph that shows the average fitness over the last 20 generations</p> https://www.lexaloffle.com/bbs/?tid=46055 https://www.lexaloffle.com/bbs/?tid=46055 Sat, 08 Jan 2022 02:29:31 UTC