{"author_link":"\/users\/ursigames","author_name":"UrsiGames","author_uid":"ursigames","comments":[],"epoch":1493679526,"event":"LD38","format":"md","ldjam_node_id":29360,"likes":6,"metadata":{"p_key":"92185","p_author":"UrsiGames","p_authorkey":"1010126","p_urlkey":"305103","p_title":"Backyard Warriors - player and AI controller","p_cat":"LDJam ","p_event":"LD38","p_time":"1493679526","p_likes":"6","p_comments":"0","p_status":"WAYBACK","us_key":"1010126","us_name":"UrsiGames","us_username":"ursigames","event_start":"1492732800","event_key":"69","event_name":"LD 38"},"node":{"_collation":{"body_sanitizer":"TextUtils::SanitizeHTML via existing importer","event":"LD38","removed_author":false},"_superparent":9405,"_trust":3,"author":10126,"body":"![splash ldjam 1.png](\/\/\/raw\/e87\/2\/z\/32a3.png)\n# Backyard Warriors\nBackyard Warriors is a game about the kids fighting to take control over their neighborhood. As a player, you play as one of the children. Your mission is to defeat all the enemies.\n\n# How did we start?\nOur first idea was to make a game where you play as a survivor on a round planet where you must collect some resources to create or repair your space rocket. After a while, we decided to make something else, because there were so many games with sphere planets. We figured that _a small world_ isn't necessary about planets. It could be also an ant world, room or whatever what is small or closed area. Next, we decided to do a gladiator arena which is the _small world_ for gladiators. I (@panmadzior), as a programmer, started working on a player controller and @moono, as a graphic designer, started prototyping some arts. Then we get the final idea - let's add young boy memories to the gladiator game concept. In our opinion, it fits the theme very well - everybody in their childhood had a unique, individual _small world_.\n\n# Early player controller\nFor the character, I decided to make a 2D sprite facing the camera. For movement, we chose a classic WSAD steering with mouse aiming. With some camera adjustments, it felt quite nice.\n\n![prototype 1.gif](\/\/\/raw\/e87\/2\/z\/32a7.gif)\n\nNext, I started working on some simple AI system. It was my first time with that kind of bots. Below you can see some dumb NPCs following each other. It was a good start point.\n\n![prototype 2.gif](\/\/\/raw\/e87\/2\/z\/32c0.gif)\n\n# Animations\nAfter core controller modules and first arts were done I started developing some animations. The game is made using Unity, so for 2D animations, I chose Anima2D asset. I've never used it before, but - whatever - I gave it a try. It was easy to start with. I learned to use basic modules quickly and I made a simple character skeleton.\n\n![animations 1.gif](\/\/\/raw\/e87\/2\/z\/32e1.gif)\n\nI made two death, three attack, running and idle animations. I was quite happy with them.\n\n![poor kid.gif](\/\/\/raw\/e87\/2\/z\/32ed.gif)\n\nWith help of the Unity Animator component, I managed to do a running animation.\n\n![animations 3.gif](\/\/\/raw\/e87\/2\/z\/3309.gif)\n\nUnfortunately, Anima2D animations don't really work in 3D space. After rotating character to face the camera animations were not working. A x-rotation needs to be exactly 0f. After a while, I found an idea to solve this problem. Do we really need to rotate the characters? Why don't we rotate the whole world! Yeah... Now, inside the Unity editor, it looks like this. Anyway, it works!\n\n![Unity_2017-05-01_16-15-40.png](\/\/\/raw\/e87\/2\/z\/3398.png)\n\n# Weapons and attacking\nWe wanted to do three weapons - sword, pick and slingshot. Unfortunately, there wasn't enough time to do the last one. Melee weapons basically work the same way. When the player or a bot start attack action, an animation starts and after some time system checks collision - if weapon collider hit some target it gets damage. Because there is more than one weapon, I decided to do a system for dropping and pick-upping them.\n\n![sword.gif](\/\/\/raw\/e87\/2\/z\/3310.gif)\n\n# AI improvements and first gameplay\nFor AI, I made some mind map first. The main goal was to make any kind of playable enemies. I ended up doing this:\n\n![chrome_2017-05-01_15-24-48.png](\/\/\/raw\/e87\/2\/z\/332d.png)\n\nI added some more small mechanics like dodging incoming attacks. For this, I made some simple statistics: _care_, _greed_, _fury_ and _skill_. Those stats are randomly generated at the start of the battle. And they work! You can see that some NPCs get points in every round and some not.\n\nAlso, I added simple spawning system to test out my creation. Here is how it looked:\n\n![ai 1.gif](\/\/\/raw\/e87\/2\/z\/333c.gif)\n\n# Result\nAt the end of the third day, I finished all systems. For comparison, how it looks now:\n\n![end 1-2.gif](\/\/\/raw\/e87\/2\/z\/3366.gif)\n\n# Summary\nIf you want to play our game you can do it here: https:\/\/ldjam.com\/events\/ludum-dare\/38\/backyard-warriors\n\nWe'll appreciate any feedback, so leave comment how do you like our creation :)\n\nIf you are interested in Backyard Warriors even more, you can follow me https:\/\/twitter.com\/panmadzior. Maybe in the future, we will start developing a full game out of this prototype, so you'll get informed about this!","comments":0,"created":"2017-05-01T11:43:37Z","files":[],"files-timestamp":0,"id":29360,"love":6,"love-timestamp":"2017-05-15T20:53:00Z","meta":[],"modified":"2017-05-15T20:53:00Z","name":"Backyard Warriors - player and AI controller","node-timestamp":"2017-05-01T22:58:46Z","parent":16043,"parents":[1,5,9,9405,16043],"path":"\/events\/ludum-dare\/38\/backyard-warriors\/backyard-warriors-player-and-ai-controller","published":"2017-05-01T22:58:46Z","scope":"public","slug":"backyard-warriors-player-and-ai-controller","subsubtype":"","subtype":"","type":"post","version":75594},"node_metadata":{"n_key":"29360","n_urlkey":"305103","n_parent":"16043","n_path":"\/events\/ludum-dare\/38\/backyard-warriors\/backyard-warriors-player-and-ai-controller","n_slug":"backyard-warriors-player-and-ai-","n_type":"post","n_subtype":"","n_subsubtype":"","n_author":"10126","n_created":"1493639017","n_modified":"1494881580","n_version":"75594","n_status":"WAYBACK"},"source_url":"https:\/\/ldjam.com\/events\/ludum-dare\/38\/backyard-warriors\/backyard-warriors-player-and-ai-controller","text":"![splash ldjam 1.png](\/\/\/raw\/e87\/2\/z\/32a3.png)\n# Backyard Warriors\nBackyard Warriors is a game about the kids fighting to take control over their neighborhood. As a player, you play as one of the children. Your mission is to defeat all the enemies.\n\n# How did we start?\nOur first idea was to make a game where you play as a survivor on a round planet where you must collect some resources to create or repair your space rocket. After a while, we decided to make something else, because there were so many games with sphere planets. We figured that _a small world_ isn't necessary about planets. It could be also an ant world, room or whatever what is small or closed area. Next, we decided to do a gladiator arena which is the _small world_ for gladiators. I (@panmadzior), as a programmer, started working on a player controller and @moono, as a graphic designer, started prototyping some arts. Then we get the final idea - let's add young boy memories to the gladiator game concept. In our opinion, it fits the theme very well - everybody in their childhood had a unique, individual _small world_.\n\n# Early player controller\nFor the character, I decided to make a 2D sprite facing the camera. For movement, we chose a classic WSAD steering with mouse aiming. With some camera adjustments, it felt quite nice.\n\n![prototype 1.gif](\/\/\/raw\/e87\/2\/z\/32a7.gif)\n\nNext, I started working on some simple AI system. It was my first time with that kind of bots. Below you can see some dumb NPCs following each other. It was a good start point.\n\n![prototype 2.gif](\/\/\/raw\/e87\/2\/z\/32c0.gif)\n\n# Animations\nAfter core controller modules and first arts were done I started developing some animations. The game is made using Unity, so for 2D animations, I chose Anima2D asset. I've never used it before, but - whatever - I gave it a try. It was easy to start with. I learned to use basic modules quickly and I made a simple character skeleton.\n\n![animations 1.gif](\/\/\/raw\/e87\/2\/z\/32e1.gif)\n\nI made two death, three attack, running and idle animations. I was quite happy with them.\n\n![poor kid.gif](\/\/\/raw\/e87\/2\/z\/32ed.gif)\n\nWith help of the Unity Animator component, I managed to do a running animation.\n\n![animations 3.gif](\/\/\/raw\/e87\/2\/z\/3309.gif)\n\nUnfortunately, Anima2D animations don't really work in 3D space. After rotating character to face the camera animations were not working. A x-rotation needs to be exactly 0f. After a while, I found an idea to solve this problem. Do we really need to rotate the characters? Why don't we rotate the whole world! Yeah... Now, inside the Unity editor, it looks like this. Anyway, it works!\n\n![Unity_2017-05-01_16-15-40.png](\/\/\/raw\/e87\/2\/z\/3398.png)\n\n# Weapons and attacking\nWe wanted to do three weapons - sword, pick and slingshot. Unfortunately, there wasn't enough time to do the last one. Melee weapons basically work the same way. When the player or a bot start attack action, an animation starts and after some time system checks collision - if weapon collider hit some target it gets damage. Because there is more than one weapon, I decided to do a system for dropping and pick-upping them.\n\n![sword.gif](\/\/\/raw\/e87\/2\/z\/3310.gif)\n\n# AI improvements and first gameplay\nFor AI, I made some mind map first. The main goal was to make any kind of playable enemies. I ended up doing this:\n\n![chrome_2017-05-01_15-24-48.png](\/\/\/raw\/e87\/2\/z\/332d.png)\n\nI added some more small mechanics like dodging incoming attacks. For this, I made some simple statistics: _care_, _greed_, _fury_ and _skill_. Those stats are randomly generated at the start of the battle. And they work! You can see that some NPCs get points in every round and some not.\n\nAlso, I added simple spawning system to test out my creation. Here is how it looked:\n\n![ai 1.gif](\/\/\/raw\/e87\/2\/z\/333c.gif)\n\n# Result\nAt the end of the third day, I finished all systems. For comparison, how it looks now:\n\n![end 1-2.gif](\/\/\/raw\/e87\/2\/z\/3366.gif)\n\n# Summary\nIf you want to play our game you can do it here: https:\/\/ldjam.com\/events\/ludum-dare\/38\/backyard-warriors\n\nWe'll appreciate any feedback, so leave comment how do you like our creation :)\n\nIf you are interested in Backyard Warriors even more, you can follow me https:\/\/twitter.com\/panmadzior. Maybe in the future, we will start developing a full game out of this prototype, so you'll get informed about this!","title":"Backyard Warriors - player and AI controller","wayback_source":[]}