Arctic Edge devlog #3: enemy AI (part I)

This is the third post on a series about the development of Arctic Edge, a stealth-action game I’m working on. If you missed the previous post click here or here for the whole series.

Listening to the player

When I started thinking about how could the enemies “listen” to the player while running I went for the quickest, simpler solution: Detect the collision with the player inside a circle of r radius around the enemy. If the player is running alert the enemy.

That definitely works, but only allows me to detect the player moving, nothing else. If I want to detect the player shooting I will have to add some other conditional. And the same for other noise producing actions. Besides being a messy and limited solution, it’s also kinda lazy.

To fix this I came up with something that seems to be working quite well. I’ve created a new object: the noise object. The enemies detect instances of this object and act accordingly changing the estate of the enemy.

The noise object is very simple. It has two important variables: a radius and a duration. Every time the object is instantiated (in position xy, for example wherever the player took his last step), the object grows linearly until it gets to the desired radius and it does so in the defined time (duration). After reaching the full size, the object destroys itself.

The noise object in action. It’s a bit difficult to see due to the speed and quality of the video but each noise object appears as a white circle, grows to it’s maximum size and disappears.
The circle won’t be shown in game, it’s only for debugging purposes.

This approach is very flexible and helps me in many ways. For example, when the player is running I can create the noise object only when I’m actually playing the step sound (not implemented yet, but still). It also allows me to create different intensity (radius and duration) steps depending on the material the players steps on. This can also be applied to the gunshots. Not to mention that I’m not limited by the user position to create this noises. I could make an explosion that alerts everyone around or throw a rock away from me to distract an enemy that is approaching.

I’m aware that I’m not discovering anything new but it’s been fun to come up with this solution and prototype it into the game.

Arctic Edge devlog #2: entity

This is the second post on a series about the development of Arctic Edge, a stealth-action game I’m working on. If you missed the previous post click here or here for the whole series.

The entity or parent entity is the base I’m using for each of the game actors like the player, enemies or bullets. It has a series of properties and mechanisms that are common to all of this actors. For example all entities have a speed in the X axis and one in the Y axis. All entities also have a max speed and an acceleration.

Besides common variables I also have common behaviour that is shared between entities. I’m placing this common behaviour in the step event of the parent entity and I leave the begin step and end step events empty to be used on the child entities. The way it works is as it follows:

  • Begin step event: in each of the child entities it is used to define input. That means that in the player entity I take care of user input while in the enemies a estate machine define which action will be performed on that frame.
  • Step event: All entities have a speed, direction, etc. and this event makes use of them to move the entity around, detect collisions, etc. This event is defined in the parent entity object.
  • End step event: As of now this event is also used exclusively on the child entities. It’s reserved mainly for managing animation and sfx but it can be also used for other tasks.

The step event is equally divided into three sections or blocks of code that are executed in the following order:

  • Pre-movement: uses the forces defined in the begin step event to determine the speed of the object in both axis.
  • Move Y: Moves and handles collisions in the Y axis
  • Move X: Moves and handles collisions in the X axis

This is how it works as of now. Maybe I will have to add some more stuff in the future but right now I’m keeping it as simple as I can.

As you see it’s a pretty simple system but it allows me to have my code organized easily and delegate common actions into a parent entity. Is this the best approach? I honestly don’t know but so far seems to be doing what I need. In the next post I will dive deep into the enemy estate machine and how I’m implemented its behaviour.

Arctic Edge devlog #1: prototyping

I’ve started working on my next game. A top down action stealth game that I’m calling Arctic Edge. I was playing around with Pico-8 – the fun but somewhat complicated virtual console – and I came up with a little concept for the game.

I soon saw that things where getting a little complicated and I moved the project to Game Maker Studio 2. Even with the change I’m going to try really hard to keep the scope as small as it was in its original Pico-8 version.

The game puts you in the place of a black ops agent that has to infiltrate a pharmaceutical complex in the north of Sweden. The lab has been taken by a terrorist group for unknown reasons. Special ops, snowy environment and terrorists, all very Metal Gear Solid.

More than anything else, I’m excited about doing some work on the enemy AI. I hope I can do a decent job and create situations that are interesting for the player. I’m not going to anything to complicate though. As I said, I want to keep the scope small.

I’m going to be releasing more of this devlogs as I make progress on development. I think it can be very useful for me to be aware of what I right and wrong. Let’s see how it goes 🙂

Inktober 2019

My first participation on Inktober is done! It’s been quite a challenge but nonetheless a very rewarding experience. Sadly I missed 5 days of the challenge – well, you know, life – but for most of October I’ve been doing my drawings/sketches and having lots of fun with it. Furthermore, today I feel I have a better understanding of how to draw – and more importantly how not to – certain things . Anyway, below you can see a gallery with all the sketches I did for Inktober 2019.

Q2 of 2019 in review

Hello there! It is already July, what means is time to review the second quarter of – this lightning fast and very busy – 2019. The second quarter has been one of change. After coming back from Japan Aneesha moved in and we had to adjust to our new life (easy adaptation tbh).

Even though normal people usually has enough with one wedding – even more if it’s an Indian 3-day wedding – we had another wedding to prepare, celebrate, etc. We did all that without dying, what is an accomplishment.

My parents booked a 65′ Mustang (my all-time favorite car) and the owner drove us back from the venue until home. It was awesome.

When it comes to the goals that I have set for myself for those 3 months there is a little bit of everything: success, failure and epic failure. On one side we have Chai&Churro. I’m doing quite well with our comic strip and people seem to be liking it. On the other side of the spectrum we can find my attempts at studying that didn’t go as I would’ve liked. Anyway, let’s have a look at the list:

  • Write but different: I wrote a short story (wiii) and I’ve been working on something else. Would’ve liked to write more though.
    Partial success
  • Chai & Churro: We’ve published on the Instagram account (and here at the blog) every two weeks without fault. It’s been good, people seem to be liking the comic strip and I’m relatively happy with my work.
    Success.
  • Improve my drawing skills: I have improved my drawing skills during this time but I have failed miserably at being consistent with my practice and work on repetitive tasks like drawing hands, feet, etc multiple times to understand shapes better.
    Failure
  • Study: I learned some ReactJS but haven’t done enough. A week or two of studying over a period of three months it’s nothing.
    Epic fail
  • Be there for my people: I think I’ve done pretty well in this regard. I’ve managed to do most of the things I wanted to without compromising in the time I spend with my family.
    Success

As I said before I have done quite well. But I can’t avoid to feel that I lose track of my goals easily and I tend to always forget something that ends up being an absolute failure. Maybe by setting shorter term goals I can make it work. But that’s a story for another post. Peace

Eden of the sands + Night Driving Avenger

This is an artsy mini project I embarked myself a couple of weeks ago. I made a digital painting and wrote a short story. They are independent of each other but share the same seed, the title of music album: Night Driving Avenger. Hope you like it.

Night Driving Avenger

Night Driving Avenger

I painted this on my iPad Pro with the app Autodesk Sketchbook. With all its flaws I’m pretty happy with how it turned out 🙂

Eden of the sands

The car lights were on, projecting her shadow over the sand. She walked back circling around the opened door and sat at the driver’s seat. She opened the glove compartment and took out an old and battered notebook. With a sigh, the woman leaned back on her seat and opened the journal. “It’s finally over.” Her words came out in a murmur that expressed sadness more than anything else. She closed the door and started driving back home. She was crying. The window was open and her tears were flying to the sides of her face due to the wind that was coming through. She had spent the last couple of months on a personal mission that was supposed to bring her relief. Instead she felt nothing but sadness.

She drove through the wasteland. Home wasn’t far from there. Nothing really was. The last vestiges of her species had gotten confined to a small piece of land where growing vegetables was still possible. Scavengers roamed the sands of the desert that surrounded their Eden, but none of them was going too far. That would be a death sentence.

Back home she had a little house. One that not too long ago had been shared with a person that filled her life with joy and happiness. A person that made the difficulties of her life bearable. But that person was gone and it would never be back.

Her car emerged from behind a dune finally reaching the border of the liveable land. As she advanced the terrain changed. The sand became more compact. Darker. Fertile. She quickly reached one of the outposts. The community had increased security after what had happened. No one from the exterior was welcomed anymore. Everyone had to go through exhaustive screenings and security checks. No guns, knives or weapons of any kind where allowed inside the community. She got out of the car. Her light hair shone under the powerful lights of the outer rim. One of the guards came to her and took her to the side. She had to go through a full check up. She would be check for weapons and later would be examined by a doctor. Any sign of infection and she would be sent back to the wasteland. Her car would go through an exhaustive inspection too. Seats and any other detachable parts would be removed. Every single inch of the car would be scanned in search of explosives and hidden weapons.

She walked with the guard into the security cabin. Inside another guard was seating behind a desk. He quickly got up. “If you are wearing any weapons, please leave them over that table.” said the guard. “And you need to remove all your clothes, I will call a female guard for your examination if you want.” She looked at him. He was a young boy, maybe 20 or 22. She noticed that he looked nervous. Maybe the first time he had to examine a woman? “No need, let’s get over with this, alright? Just do your job.” The guard nodded but still looking a bit uncomfortable. She removed a knife from the interior side of her left boot. She was also carrying a gun on a holster below her right arm. An old twenty two that had been in her family for long and that she hadn’t used once. She checked the safety and left the hardware over the table. Only then she proceeded to remove her clothes. She folded everything carefully and left it over the table next to the weaponry. There was a small podium at the center of the room, the guard told her to step on it. The security check went on without incidents. She had nothing to hide. “I will call the doctor ok? Your weapons will be deposited at the vault and you can collect them whenever you leave town.” He disappeared through a door carrying her knife and the twenty two.

The doctor came in an instant later. She was a woman in her sixties, blonde hair and a little overweight. A smile crossed the doctor’s face as soon as she saw the woman over the podium. “I’m so glad to see you again Alice, Bruce and I were very worried after you left… you said nothing and after losing Alex… we thought, I mean, we want you to be safe and help you get your life going again.” The concerned felt real. She knew it was. Having someone that cares for you is comforting but that could not change the last two months of her life. It couldn’t change Alex’s death. Neither it could erase what had come after. She tried to be nice to the doctor during the examination and she promise to go visit soon, maybe stay for dinner. But the truth is that she didn’t want to do any of that. Since she had lost Alex she had focused on her mission. It was her escape. Her way of not confronting a harsh reality. But now that the mission was over she felt dead inside.

She went back to pick up her car. The guy at the security post gave her clearance to go inside Eden but not before recommending her to be careful with her car. “Don’t know what you run over with that thing and honestly, I don’t wanna know, but you should clean and repair that car before it falls apart… you’ve got lots of bumps in the front…” She said nothing, got inside the car and start driving home.

Eden was nice. Nicer than the desert at least. Alice was glad to see greenery again. Some more weeks in the desert and she could have lost her mind completely. The town was composed of wooden houses, all of them with plenty of land around them. The houses were simple and functional. They’ve managed to have running water and electricity. The survivors of Eden couldn’t ask for much more than that. The new generations had grown in that environment, they had never known the old days of prosperity and richness before everything went to hell. The inhabitants of Eden tried to keep everything as integrated with nature as possible. There was no place for asphalt or concrete in there. After all it looked like some lessons had been learnt.

It was late and the streets were mostly deserted. That worked for her, she didn’t want to speak to anyone. She opened the window and let the wind blew his hair. It was humid and there was a hint of soil and grass in the air. It was so different in there. She’d missed it. Alice parked the car at the drive-in of her house. Everything looked exactly as she left it, surely her neighbors had kept an eye while she was away. She entered the house and walked to the kitchen. She filled a bottle with tap water and walked up the stairs. It was well past midnight and she didn’t have any energy left on her.

Nightmares woke her up not longer after she went to bed. Her heart was pounding and she couldn’t catch her breath. She tried to go back to sleep but the images of the victims kept coming when she closed her eyes. And Alex, she could not stop seeing Alex’s face beaten up, covered in blood. She hadn’t been able to save her partner and had reacted with rage and anger, becoming someone she had never been. She felt the need to ask for forgiveness. If someone could understand her it would be Alex. She put on a t-shirt and shorts and went down the stairs. Left the house through the main door and came around to the backyard. The first morning light started to shine in the horizon. She walked fast, holding herself. She knew if she didn’t do that she would just fall apart. The pain was too much for her to bear. The feeling that her life was over didn’t let her breath. She looked up trying to locate Alex’s tomb. She fell to her knees in front of it and tears started to run down her cheeks. Grass and flowers had started grown while she was away. Alex’s body had given birth to new life, being the fertilizer that the soil needed. The pain and sorrow that she felt started to vanish as the sun came out of the horizon.

Goals for Q2 2019 & review of Q1

Yo! So here we are again. I had a very intense and busy start of the year but still – kinda – managed to accomplish my goals for the first quarter of the year. Let’s review them:

  • Write: I wanted to write 2 posts a month and I – almost – did it. I’ve been working on other stuff but I’m happy with what I’ve done. I wrote about my thoughts on this blog, my goals, creative design, god or whatever and Inktober/Wordtober.
  • Get married: Yuuuuuuup!! And not once but twice (and one more coming xD). Aneesha and I got married on 3rd January at the Indian Consulate in Dubai and between February 14 and 16 we had our hindu wedding in Mumbai. It all went really well and it was an amazing experience for various reasons (like getting together people from all over the world).
  • Make and publish 3 Chai & Churro: done. Here, here and here. I’m really happy with how C&C is going. Still struggling with consistency in the art but I have a pretty streamlined process now with my iPad. I will talk more about this on the goals for the next 3 months.
  • Lose some weight: I somehow managed to lose 3 kg (91 to 88). And last week I even got down to 86.9, TEN KILOS less than when I started making changes in my diet (September 2018). Food happened over the weekend and I’m back to 88 but I’m happy with the progress.

Very happy with how things have gone. I’m also very happy that I got the chance to visit Japan, something that I thought I would never do and now I feel in the position to confirm it: yes, it’s paradise.

For the next quarter I don’t have much in my mind. It’s an extension of what I’ve done in the first quarter with some tweaks. Let’s check the list:

  • Write but different: I might write something for the blog (I have a couple of ideas) but I would like to work on creative writing. I have a little something prepared that I will post soon and I want to keep exploring this path. We’ll see.
  • Chai & Churro: Well, C&C is now a bi-weekly comic strip and it has a Facebook page and an Instagram account. I have found the workflow that makes it work for me. I could be more ambitious and do it weekly but it wouldn’t leave me with enough time for things like the next point.
  • Improve my drawing skills: This is a work in progress and it will never end but I want to take it seriously. I want to improve in key areas for creating expressive characters (hands, eyes, faces…) and improve the art as a whole. The consistency of my drawings it’s a problem (each Chai & Churro looks fricking different) but I hope to improve on that too.
  • Study: I hate studying. I’m lazy and I get easily distracted buy in my line of work is indispensable. I will focus on front-end web coding and UX as that is what appeals to me the most and where I think my – immediate professional – future lays.
  • Be there for my people: All these goals are very cool but they don’t matter if I’m not a good husband, brother, son and brother. I want to improve as a person as much as I want to improve on the things I like to do. This is always priority number one but is good to remind it to oneself from time to time.

Well, that’s it… not much more to say. I guess we’ll talk in July, until then peace, love & Periphery IV.

A month for creativity

Have you ever heard of Inktober? No? Well, Inktober is a challenge that has gained some traction over the years. It was started in 2009 by illustrator Jake Parker and it consists in making an ink drawing every day of the month of October. Participants share their work with the community – Twitter, Instagram, etc. – and interact with each other. Not only you can see amazing art, you can also see people encouraging their peers in what seems to be a pretty healthy environment.

The official Inktober account gives a daily prompt to keep the challenge interesting. It’s up to the artist to interpret the word and translate it into art.

The event has grown over time and it is now quite popular. And that has given birth to parallel challenges like Wordtober, in which I participated last year. In Wordtober the objective is to write a tweet-long story using the daily prompt as a starting point. It was a really fun and positive experience. The time, topic and length limitations boost your creativity. There’s no time for second guessing, you have to use your instincts. No place for unnecessary words either, you have to get to the point. Aneesha – who also participated – defined the process as word vomit. Writing without thinking it twice once. Maybe it is like that but I surely was doing a lot of thinking before everything “clicked”.

Based on my experience last year, I think anyone with some interest in any art form should find the Xtober that fits their interest. It’s not only a great training tool, it’s also a ton of fun.

Goals for Q1 2019

Hi there! As I explained on my previous post I’ve decided to set quarterly goals for myself. If you’ve been following my you’ll know that I did it in 2017 and even though I failed to accomplish all I wanted I found it to be a good practice. I have a very active mind, always thinking about new project. And that can be quite distracting. Having public goals helps me focus and keep working on what I want to accomplish instead of jumping constantly between new things without finishing anything.

I have a couple of things I want to accomplish this year. This first quarter I’m going to be quite busy so my goals are not too ambitious:

  • Write: I’m not going to be ambitious here. Publish 2 posts a month for the next three months. I prefer to post less and things that matter to me the most than just randomly write about anything. Let’s see how it goes next month because…
  • Get married: Aneesha and I are legally married already but we still have two more weddings to go. The first one will be in India in around 20 days. I have to survive to 3 days of events. Wish me luck 😂
  • Make and publish 3 Chai&Churro: recently I bought and iPad pro and I’m starting to get used to it. It’s an amazing tool and I hope it will help me be more productive. My goal is for Chai&Churro to become a bi-weekly thing but that is not going to happen now. I aim for 1 comic strip a month.
  • Lose some weight: I’ve changed my eating habits quite a bit over the last 4 or 5 months. It has worked out well and I’ve lost 6-7 kilos but my weight has been going up and down around the same number for the last couple of months. I want to make some progress, even if it is only a couple of kilos (down).

I’m going to be between India and Japan for a full month. I’m not sure of how much free time I will have. I’ll do my best to be on track and fulfil my goals. I’ll be doing the quarterly review at the beginning of April. Until then, peace, love & death metal ✌

Reflecting on the past and future of this space

I’m back. Last year was a complicated one. I had a crazy busy second half of the year, with lots of grown up things happening (remember? I’m a child with a grey-ish beard), and this had kept me from writing as I would liked to.

And yes, I also went through some kind of crisis regarding my blog. I had to “look myself in the mirror” and ask why am I doing this. What’s the purpose of my blog? Does it make sense? I was writing about a bunch of stuff, things that I like: games, movies, music… But in the end I realized I wasn’t getting anything back from it on any level and my time was better spent somewhere else.

As a result of this I’ve decided 2 things:

  • I won’t write anything for weeks (or months) if I don’t have anything to say. It doesn’t mean I don’t have a goal for this blog. It just means I won’t write about whatever just because I made myself a promise to write.
  • I don’t want to write anything review-like. There are professionals that do that and they do it way better than I do. If I write I want it to be related to what I do in my life, things that matter to me the most, like Chai&Churro, my drawings, coding or writing.

To start this new stage I’ll be looking at something I did in the past: set quarterly goals for myself. I did it throughout 2017 and I found it useful to keep an agenda and remind myself of what are my short term priorities.

I’ll be writing a post for my Q1 goals soon. Stay tuned 🙂