{"id":68,"date":"2013-07-28T21:13:00","date_gmt":"2013-07-28T21:13:00","guid":{"rendered":"http:\/\/oneiricworlds.com\/en\/index.php\/2013\/07\/28\/speed-dev-week\/"},"modified":"2025-11-07T10:00:43","modified_gmt":"2025-11-07T10:00:43","slug":"speed-dev-week","status":"publish","type":"post","link":"https:\/\/oneiricworlds.com\/en\/2013\/07\/speed-dev-week\/","title":{"rendered":"Speed Dev Week"},"content":{"rendered":"\n<p>Hello everybody,<\/p>\n\n\n\n<p>This week, it was logistically complicated, because I was away from home&#8230; Some kind of holidays in a sense&#8230;. So I chose to work on a little side-project: a 2D top-down view stealth game with the possibility for the player to easily create levels. Graphics are of course very simple, but the goal was mainly to create a tool to quickly test 2D level design. So if you want to create levels yourself, watch out for the next demo of&#8230; World of Ninjas (yes, I&#8217;m really inspired when it comes to names).<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/1.bp.blogspot.com\/-k27NXJpVmck\/UfWB_t-z3bI\/AAAAAAAAGoA\/ijrYefP_Ruk\/s1600\/20130728_224020.png\"><img decoding=\"async\" src=\"http:\/\/1.bp.blogspot.com\/-k27NXJpVmck\/UfWB_t-z3bI\/AAAAAAAAGoA\/ijrYefP_Ruk\/s1600\/20130728_224020.png\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p>Hence, this (long) post will explain more or less in detail the creation process done in&#8230; 1 week. The next post will link to the demo!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Day 1<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Basic character and camera control: the player can move, the camera follows him.<\/li>\n\n\n\n<li>Dynamic level loading from image file: I simply choose to use paint (or gimp) to create a logical map of the level. The map is loaded and each pixel is interpreted as a game object:<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>blue = player<\/li>\n\n\n\n<li>grey = wall<\/li>\n\n\n\n<li>red = enemy<\/li>\n\n\n\n<li>yellow = path of the enemy<\/li>\n\n\n\n<li>&#8230; and additional colors for other elements can be added<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>&#8220;basic enemy&#8221;: I created a simple enemy game object that follows a path<\/li>\n<\/ul>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/3.bp.blogspot.com\/-3mFhcF2MnK0\/UfVqG4JcRtI\/AAAAAAAAGnU\/qiU_PouNoi4\/s1600\/level2.png\"><img decoding=\"async\" src=\"http:\/\/3.bp.blogspot.com\/-3mFhcF2MnK0\/UfVqG4JcRtI\/AAAAAAAAGnU\/qiU_PouNoi4\/s1600\/level2.png\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p>A basic map made in GIMP<\/p>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Day 2<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Field of view of the enemies: they can detect the player if he is visible within a given distance<\/li>\n\n\n\n<li>Checking out of an old path planning algorithm (A*) and adapt it: now enemies can avoid walls and find paths on their own (not only follow a designed path). They can also search around when the player was visible but escaped.<\/li>\n\n\n\n<li>Optimizing A* to have real-time compatibility: path planning computation are really cpu intensive and can make the game lag\/slow down. I had to limit the computation time available on each frame. Thus, complex calculation takes more frames to get done, but does not slow down the game.<\/li>\n<\/ul>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Day 3<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Main menu and level listing: adding a title screen with level selection (levels are read from image files on the hard drive)<\/li>\n\n\n\n<li>Enemies can shoot the player if he is visible<\/li>\n\n\n\n<li>Player can shoot to respond to enemies: use the mouse to aim<\/li>\n\n\n\n<li>Player can slash (short range attack that won&#8217;t consume ammo). You can move the mouse to control the blade direction while slashing. It&#8217;s quite fun to do \ud83d\ude42<\/li>\n\n\n\n<li>Refine field of view display: I want the player to understand quickly what enemies can see and what they can&#8217;t. So I used the old &#8220;Commando&#8221; game style:<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/4.bp.blogspot.com\/-cWrVqurKjCk\/UfV7mPEymoI\/AAAAAAAAGnk\/ReVgCsa5VL8\/s1600\/20130728_221145.png\"><img decoding=\"async\" src=\"http:\/\/4.bp.blogspot.com\/-cWrVqurKjCk\/UfV7mPEymoI\/AAAAAAAAGnk\/ReVgCsa5VL8\/s1600\/20130728_221145.png\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p>\u00a0Enemy field of view. Quite harsh to implement, and far from optimized. But\u2026 quite functional at the moment.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Day 4<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Add &#8220;Goal&#8221; object (white pixel on the map): a particular object the player has to get to before exiting the level to succeed<\/li>\n\n\n\n<li>Level success\/failure: check when the player finishes a level or when he dies<\/li>\n\n\n\n<li>Statistics on kills and time: once the player finishes the level, display a few information<\/li>\n\n\n\n<li>Add a level validity check: verify that the image file exists, is not corrupted, and has minimum information (a blue pixel for the player)<\/li>\n\n\n\n<li>Keep last score: once a level is finished, the last statistics are saved and displayed on the main menu<\/li>\n\n\n\n<li>Add command list: start to create a head-up display (HUD) to explain commands and show the player inventory<\/li>\n\n\n\n<li>Enemy react to killed enemies: when an enemy sees a killed enemy, he goes towards him.<\/li>\n<\/ul>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Day 5<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Shockwave : to simulate sound, I add &#8220;shockwaves&#8221; when a bullet hits a wall for example. If an enemy is hit by the shockwave, he will go to the sound origin to check what happens.<\/li>\n\n\n\n<li>HUD improvement<\/li>\n\n\n\n<li>Add impact when enemies are killed<\/li>\n\n\n\n<li>Player can carry objects or killed enemies<\/li>\n\n\n\n<li>Player can throw objects or killed enemies<\/li>\n\n\n\n<li>Player can drop bombs: bombs create a large shockwave that kills enemies and destroy nearby walls.<\/li>\n\n\n\n<li>Add wall debris after an explosion<\/li>\n\n\n\n<li>Add proximity mines: some special kind of bomb that explodes when something moves around. This was quite tricky to implement, because this mine must take some kind of &#8220;snapshot&#8221; of what&#8217;s around when it&#8217;s armed and constantly check what changes nearby.<\/li>\n\n\n\n<li>Add a weapon selection menu<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"http:\/\/1.bp.blogspot.com\/-gVgVI2cuitA\/UfV86DrMaoI\/AAAAAAAAGnw\/p4HDsmaAfNs\/s1600\/20130728_221214.png\"><img decoding=\"async\" src=\"http:\/\/1.bp.blogspot.com\/-gVgVI2cuitA\/UfV86DrMaoI\/AAAAAAAAGnw\/p4HDsmaAfNs\/s1600\/20130728_221214.png\" alt=\"\"\/><\/a><\/figure>\n\n\n\n<p>Shockwave during a bomb explosion<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">&nbsp;Day 6<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Additional HUD modification to take into account all the new available moves<\/li>\n\n\n\n<li>Various bug fixes (I don&#8217;t talk about it, but I do this everyday of course)<\/li>\n\n\n\n<li>Display the proximity mine danger area<\/li>\n\n\n\n<li>Add a few items to pick up: life, ammo, bombs, mines<\/li>\n<\/ul>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Day 7<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Write this article (don&#8217;t laugh&#8230; it takes some time!)<\/li>\n\n\n\n<li>Write a readme explaining how to create levels<\/li>\n\n\n\n<li>Put a download on this website<\/li>\n<\/ul>\n\n\n\n<p>And at this point, that&#8217;s all I have. I already noticed a few additional bugs that I&#8217;ll have to fix, but the goal was to set up a playable prototype within a week. If it works well and is quite fun, maybe I&#8217;ll improve it later, I already have a very long list of possible enhancements\/corrections.<\/p>\n\n\n\n<p>About the bugs: adding new items\/functionnalities always raises new questions. For example: &#8220;what happens if a &#8220;life bonus&#8221; is hit by a bomb shockwave?&#8221; The more elements there are, the more complex interactions can be. I surely missed some. By the way, professional developpers often say they only create 5 bug free lines of code per day. I coded ~2250 lines, with hopefully 50 free bug lines&#8230; That means there are still loooooooots of bugs to find, I count on you \ud83d\ude42<\/p>\n\n\n\n<p>That&#8217;s all for this week. See you next time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello everybody, This week, it was logistically complicated, because I was away from home&#8230; Some kind of holidays in a sense&#8230;. So I chose to work on a little side-project: a 2D top-down view stealth game with the possibility for the player to easily create levels. Graphics are of course very simple, but the goal [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":202,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[24],"class_list":["post-68","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dev","tag-world-of-ninjas"],"_links":{"self":[{"href":"https:\/\/oneiricworlds.com\/en\/wp-json\/wp\/v2\/posts\/68","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oneiricworlds.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oneiricworlds.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oneiricworlds.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oneiricworlds.com\/en\/wp-json\/wp\/v2\/comments?post=68"}],"version-history":[{"count":3,"href":"https:\/\/oneiricworlds.com\/en\/wp-json\/wp\/v2\/posts\/68\/revisions"}],"predecessor-version":[{"id":1845,"href":"https:\/\/oneiricworlds.com\/en\/wp-json\/wp\/v2\/posts\/68\/revisions\/1845"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/oneiricworlds.com\/en\/wp-json\/wp\/v2\/media\/202"}],"wp:attachment":[{"href":"https:\/\/oneiricworlds.com\/en\/wp-json\/wp\/v2\/media?parent=68"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oneiricworlds.com\/en\/wp-json\/wp\/v2\/categories?post=68"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oneiricworlds.com\/en\/wp-json\/wp\/v2\/tags?post=68"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}